@primer/react-brand 0.75.0-rc.a3f7dbd6 → 0.75.0
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/SubdomainNavBar/index.md +215 -86
- package/docs/index.md +2 -2
- package/esm/Accordion/Accordion.d.ts +2 -2
- package/esm/Accordion/Accordion.d.ts.map +1 -1
- package/esm/Accordion/Accordion.js +2 -2
- package/esm/Accordion/Accordion.js.map +1 -1
- package/esm/Accordion/Accordion.module.js +6 -5
- package/esm/ActionMenu/ActionMenu.d.ts +2 -2
- package/esm/ActionMenu/ActionMenu.js +3 -2
- package/esm/ActionMenu/ActionMenu.js.map +1 -1
- package/esm/ActionMenu/ActionMenu.module.js +7 -6
- package/esm/AnchorNav/AnchorNav.d.ts +4 -4
- package/esm/AnchorNav/AnchorNav.d.ts.map +1 -1
- package/esm/AnchorNav/AnchorNav.js +9 -4
- package/esm/AnchorNav/AnchorNav.js.map +1 -1
- package/esm/AnchorNav/AnchorNav.module.js +5 -4
- package/esm/AnchorNav/useExpandedMenu.js.map +1 -1
- package/esm/Avatar/Avatar.js +1 -1
- package/esm/Avatar/Avatar.js.map +1 -1
- package/esm/Avatar/Avatar.module.js +5 -4
- package/esm/Bento/Bento.d.ts +4 -4
- package/esm/Bento/Bento.js +1 -1
- package/esm/Bento/Bento.js.map +1 -1
- package/esm/Bento/Bento.module.js +7 -6
- package/esm/Box/Box.d.ts +1 -1
- package/esm/Box/Box.d.ts.map +1 -1
- package/esm/Box/Box.js +1 -1
- package/esm/Box/Box.js.map +1 -1
- package/esm/Breadcrumbs/Breadcrumbs.js +1 -1
- package/esm/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/esm/Breadcrumbs/Breadcrumbs.module.js +7 -6
- package/esm/BreakoutBanner/BreakoutBanner.js +1 -1
- package/esm/BreakoutBanner/BreakoutBanner.js.map +1 -1
- package/esm/BreakoutBanner/BreakoutBanner.module.js +5 -4
- package/esm/Button/Button.js +1 -1
- package/esm/Button/Button.js.map +1 -1
- package/esm/Button/Button.module.js +5 -4
- package/esm/ButtonGroup/ButtonGroup.js +1 -1
- package/esm/ButtonGroup/ButtonGroup.js.map +1 -1
- package/esm/ButtonGroup/ButtonGroup.module.js +3 -2
- package/esm/CTABanner/CTABanner.d.ts +1 -1
- package/esm/CTABanner/CTABanner.js +2 -2
- package/esm/CTABanner/CTABanner.js.map +1 -1
- package/esm/CTABanner/CTABanner.module.js +4 -3
- package/esm/CTAForm/CTAForm.js +1 -1
- package/esm/CTAForm/CTAForm.js.map +1 -1
- package/esm/CTAForm/CTAForm.module.js +4 -3
- package/esm/Card/Card.d.ts +2 -2
- package/esm/Card/Card.d.ts.map +1 -1
- package/esm/Card/Card.js +3 -3
- package/esm/Card/Card.js.map +1 -1
- package/esm/Card/Card.module.js +18 -17
- package/esm/ComparisonTable/ComparisonTable.d.ts +3 -3
- package/esm/ComparisonTable/ComparisonTable.js +1 -1
- package/esm/ComparisonTable/ComparisonTable.js.map +1 -1
- package/esm/ComparisonTable/ComparisonTable.module.js +4 -3
- package/esm/ExpandableArrow/ExpandableArrow.d.ts +2 -1
- package/esm/ExpandableArrow/ExpandableArrow.d.ts.map +1 -1
- package/esm/ExpandableArrow/ExpandableArrow.js +1 -1
- package/esm/ExpandableArrow/ExpandableArrow.js.map +1 -1
- package/esm/ExpandableArrow/ExpandableArrow.module.js +4 -3
- package/esm/EyebrowBanner/EyebrowBanner.js +2 -2
- package/esm/EyebrowBanner/EyebrowBanner.js.map +1 -1
- package/esm/EyebrowBanner/EyebrowBanner.module.js +12 -11
- package/esm/EyebrowText/EyebrowText.js +1 -1
- package/esm/EyebrowText/EyebrowText.js.map +1 -1
- package/esm/EyebrowText/EyebrowText.module.js +4 -3
- package/esm/FAQ/FAQ.d.ts +2 -2
- package/esm/FAQ/FAQ.d.ts.map +1 -1
- package/esm/FAQ/FAQ.js +1 -1
- package/esm/FAQ/FAQ.js.map +1 -1
- package/esm/FAQ/FAQ.module.js +7 -6
- package/esm/FAQ/FAQGroup.d.ts +2 -2
- package/esm/FAQ/FAQGroup.d.ts.map +1 -1
- package/esm/FAQ/FAQGroup.js +7 -3
- package/esm/FAQ/FAQGroup.js.map +1 -1
- package/esm/FAQ/FAQGroup.module.js +8 -7
- package/esm/Footnotes/Footnotes.d.ts +2 -2
- package/esm/Footnotes/Footnotes.d.ts.map +1 -1
- package/esm/Footnotes/Footnotes.js +2 -2
- package/esm/Footnotes/Footnotes.js.map +1 -1
- package/esm/Footnotes/Footnotes.module.js +7 -6
- package/esm/FrostedGlassVFX/FrostedGlassVFX.d.ts +1 -1
- package/esm/FrostedGlassVFX/FrostedGlassVFX.d.ts.map +1 -1
- package/esm/FrostedGlassVFX/FrostedGlassVFX.js +1 -1
- package/esm/FrostedGlassVFX/FrostedGlassVFX.js.map +1 -1
- package/esm/FrostedGlassVFX/FrostedGlassVFX.module.js +4 -3
- package/esm/Grid/Grid.d.ts +2 -2
- package/esm/Grid/Grid.js +2 -2
- package/esm/Grid/Grid.js.map +1 -1
- package/esm/Grid/Grid.module.js +5 -4
- package/esm/Heading/Heading.js +1 -1
- package/esm/Heading/Heading.js.map +1 -1
- package/esm/Heading/Heading.module.js +4 -3
- package/esm/Hero/Hero.js +1 -1
- package/esm/Hero/Hero.js.map +1 -1
- package/esm/Hero/Hero.module.js +4 -3
- package/esm/Hero/HeroContext.js.map +1 -1
- package/esm/Hero/sub-components/HeroButtonGroup.js +1 -1
- package/esm/Hero/sub-components/HeroButtonGroup.js.map +1 -1
- package/esm/Hero/sub-components/HeroDescription.js +1 -1
- package/esm/Hero/sub-components/HeroDescription.js.map +1 -1
- package/esm/Hero/sub-components/HeroEyebrow.js +1 -1
- package/esm/Hero/sub-components/HeroEyebrow.js.map +1 -1
- package/esm/Hero/sub-components/HeroHeading.js +1 -1
- package/esm/Hero/sub-components/HeroHeading.js.map +1 -1
- package/esm/Hero/sub-components/HeroImage.js +1 -1
- package/esm/Hero/sub-components/HeroImage.js.map +1 -1
- package/esm/Hero/sub-components/HeroLabel.js +1 -1
- package/esm/Hero/sub-components/HeroLabel.js.map +1 -1
- package/esm/Hero/sub-components/HeroPrimaryAction.js.map +1 -1
- package/esm/Hero/sub-components/HeroSecondaryAction.js.map +1 -1
- package/esm/Hero/sub-components/HeroVideo.js +2 -2
- package/esm/Hero/sub-components/HeroVideo.js.map +1 -1
- package/esm/IDE/IDE.d.ts +1 -1
- package/esm/IDE/IDE.js +3 -2
- package/esm/IDE/IDE.js.map +1 -1
- package/esm/IDE/IDE.module.js +8 -7
- package/esm/Icon/Icon.d.ts +2 -2
- package/esm/Icon/Icon.d.ts.map +1 -1
- package/esm/Icon/Icon.js +2 -2
- package/esm/Icon/Icon.js.map +1 -1
- package/esm/Icon/Icon.module.js +4 -3
- package/esm/Image/Image.d.ts +1 -1
- package/esm/Image/Image.d.ts.map +1 -1
- package/esm/Image/Image.js +1 -1
- package/esm/Image/Image.js.map +1 -1
- package/esm/Image/Image.module.js +5 -4
- package/esm/InlineCode/InlineCode.js +1 -1
- package/esm/InlineCode/InlineCode.js.map +1 -1
- package/esm/InlineCode/InlineCode.module.js +5 -4
- package/esm/InlineLink/InlineLink.js +2 -2
- package/esm/InlineLink/InlineLink.js.map +1 -1
- package/esm/InlineLink/InlineLink.module.js +3 -2
- package/esm/Label/Label.js +1 -1
- package/esm/Label/Label.js.map +1 -1
- package/esm/Label/Label.module.js +6 -5
- package/esm/Link/Link.d.ts +1 -1
- package/esm/Link/Link.d.ts.map +1 -1
- package/esm/Link/Link.js +2 -2
- package/esm/Link/Link.js.map +1 -1
- package/esm/Link/Link.module.js +4 -3
- package/esm/LogoSuite/LogoSuite.d.ts +1 -1
- package/esm/LogoSuite/LogoSuite.js +4 -3
- package/esm/LogoSuite/LogoSuite.js.map +1 -1
- package/esm/LogoSuite/LogoSuite.module.js +11 -10
- package/esm/MediaPlaylist/MediaPlaylist.d.ts +4 -4
- package/esm/MediaPlaylist/MediaPlaylist.d.ts.map +1 -1
- package/esm/MediaPlaylist/MediaPlaylist.js +1 -1
- package/esm/MediaPlaylist/MediaPlaylist.js.map +1 -1
- package/esm/MediaPlaylist/MediaPlaylist.module.js +25 -24
- package/esm/MediaPlaylist/useMediaPlaylist.js.map +1 -1
- package/esm/MinimalFooter/MinimalFooter.d.ts +3 -3
- package/esm/MinimalFooter/MinimalFooter.d.ts.map +1 -1
- package/esm/MinimalFooter/MinimalFooter.js +4 -3
- package/esm/MinimalFooter/MinimalFooter.js.map +1 -1
- package/esm/MinimalFooter/MinimalFooter.module.js +15 -14
- package/esm/MinimalVideoPlayer/MinimalVideoPlayer.js +2 -2
- package/esm/MinimalVideoPlayer/MinimalVideoPlayer.js.map +1 -1
- package/esm/MinimalVideoPlayer/MinimalVideoPlayer.module.js +6 -5
- package/esm/MinimalVideoPlayer/useMinimalVideoPlayback.js.map +1 -1
- package/esm/NavList/NavList.js +2 -2
- package/esm/NavList/NavList.js.map +1 -1
- package/esm/NavList/NavList.module.js +18 -17
- package/esm/Pagination/Pagination.d.ts +1 -1
- package/esm/Pagination/Pagination.d.ts.map +1 -1
- package/esm/Pagination/Pagination.js +1 -1
- package/esm/Pagination/Pagination.js.map +1 -1
- package/esm/Pagination/Pagination.module.js +11 -10
- package/esm/Pagination/model.js.map +1 -1
- package/esm/Pillar/Pillar.d.ts +2 -2
- package/esm/Pillar/Pillar.d.ts.map +1 -1
- package/esm/Pillar/Pillar.js +1 -1
- package/esm/Pillar/Pillar.js.map +1 -1
- package/esm/Pillar/Pillar.module.js +9 -8
- package/esm/PricingOptions/PricingOptions.d.ts +1 -1
- package/esm/PricingOptions/PricingOptions.js +5 -3
- package/esm/PricingOptions/PricingOptions.js.map +1 -1
- package/esm/PricingOptions/PricingOptions.module.js +13 -12
- package/esm/Prose/Prose.js +1 -1
- package/esm/Prose/Prose.js.map +1 -1
- package/esm/Prose/Prose.module.js +4 -3
- package/esm/Section/Section.js +1 -1
- package/esm/Section/Section.js.map +1 -1
- package/esm/Section/Section.module.js +5 -4
- package/esm/SectionIntro/SectionIntro.js +1 -1
- package/esm/SectionIntro/SectionIntro.js.map +1 -1
- package/esm/SectionIntro/SectionIntro.module.js +4 -3
- package/esm/SectionIntroStacked/SectionIntroStacked.d.ts +3 -3
- package/esm/SectionIntroStacked/SectionIntroStacked.js +1 -1
- package/esm/SectionIntroStacked/SectionIntroStacked.js.map +1 -1
- package/esm/SectionIntroStacked/SectionIntroStacked.module.js +6 -5
- package/esm/Stack/Stack.js +1 -1
- package/esm/Stack/Stack.js.map +1 -1
- package/esm/Stack/Stack.module.js +4 -3
- package/esm/Statistic/Statistic.js +1 -1
- package/esm/Statistic/Statistic.js.map +1 -1
- package/esm/Statistic/Statistic.module.js +6 -5
- package/esm/SubNav/SubNav.d.ts +4 -4
- package/esm/SubNav/SubNav.d.ts.map +1 -1
- package/esm/SubNav/SubNav.js +6 -4
- package/esm/SubNav/SubNav.js.map +1 -1
- package/esm/SubNav/SubNav.module.js +9 -8
- package/esm/SubNav/useContainsFocus.js.map +1 -1
- package/esm/SubdomainNavBar/NavigationVisbilityObserver.d.ts +3 -1
- package/esm/SubdomainNavBar/NavigationVisbilityObserver.d.ts.map +1 -1
- package/esm/SubdomainNavBar/NavigationVisbilityObserver.js +117 -64
- package/esm/SubdomainNavBar/NavigationVisbilityObserver.js.map +1 -1
- package/esm/SubdomainNavBar/SubdomainNavBar.d.ts +157 -20
- package/esm/SubdomainNavBar/SubdomainNavBar.d.ts.map +1 -1
- package/esm/SubdomainNavBar/SubdomainNavBar.js +479 -299
- package/esm/SubdomainNavBar/SubdomainNavBar.js.map +1 -1
- package/esm/SubdomainNavBar/SubdomainNavBar.module-WIrpYyjV.css +1 -0
- package/esm/SubdomainNavBar/SubdomainNavBar.module.js +36 -11
- package/esm/SubdomainNavBar/SubdomainNavBar.module.js.map +1 -1
- package/esm/SubdomainNavBar/SubdomainNavBarLinkContext.d.ts +9 -0
- package/esm/SubdomainNavBar/SubdomainNavBarLinkContext.d.ts.map +1 -0
- package/esm/SubdomainNavBar/SubdomainNavBarLinkContext.js +10 -0
- package/esm/SubdomainNavBar/SubdomainNavBarLinkContext.js.map +1 -0
- package/esm/SubdomainNavBar/useSearchKeyboardShortcut.d.ts +8 -0
- package/esm/SubdomainNavBar/useSearchKeyboardShortcut.d.ts.map +1 -0
- package/esm/SubdomainNavBar/useSearchKeyboardShortcut.js +52 -0
- package/esm/SubdomainNavBar/useSearchKeyboardShortcut.js.map +1 -0
- package/esm/SubdomainNavBar/useSearchResults.d.ts +24 -0
- package/esm/SubdomainNavBar/useSearchResults.d.ts.map +1 -0
- package/esm/SubdomainNavBar/useSearchResults.js +57 -0
- package/esm/SubdomainNavBar/useSearchResults.js.map +1 -0
- package/esm/SubdomainNavBar/useVisibilityObserver.d.ts +1 -1
- package/esm/SubdomainNavBar/useVisibilityObserver.d.ts.map +1 -1
- package/esm/SubdomainNavBar/useVisibilityObserver.js +60 -23
- package/esm/SubdomainNavBar/useVisibilityObserver.js.map +1 -1
- package/esm/Tabs/Tabs.js +3 -2
- package/esm/Tabs/Tabs.js.map +1 -1
- package/esm/Tabs/Tabs.module.js +12 -11
- package/esm/Testimonial/Testimonial.d.ts +1 -1
- package/esm/Testimonial/Testimonial.d.ts.map +1 -1
- package/esm/Testimonial/Testimonial.js +1 -1
- package/esm/Testimonial/Testimonial.js.map +1 -1
- package/esm/Testimonial/Testimonial.module.js +8 -7
- package/esm/Text/Text.d.ts +1 -1
- package/esm/Text/Text.d.ts.map +1 -1
- package/esm/Text/Text.js +1 -1
- package/esm/Text/Text.js.map +1 -1
- package/esm/Text/Text.module.js +4 -3
- package/esm/TextCursorAnimation/TextCursorAnimation.d.ts +1 -1
- package/esm/TextCursorAnimation/TextCursorAnimation.d.ts.map +1 -1
- package/esm/TextCursorAnimation/TextCursorAnimation.js +1 -1
- package/esm/TextCursorAnimation/TextCursorAnimation.js.map +1 -1
- package/esm/TextCursorAnimation/TextCursorAnimation.module.js +10 -9
- package/esm/ThemeProvider/ThemeProvider.d.ts +1 -1
- package/esm/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/esm/ThemeProvider/ThemeProvider.js +4 -4
- package/esm/ThemeProvider/ThemeProvider.js.map +1 -1
- package/esm/ThemeProvider/useTheme.js.map +1 -1
- package/esm/Tiles/Tiles.js +2 -2
- package/esm/Tiles/Tiles.js.map +1 -1
- package/esm/Tiles/Tiles.module.js +4 -3
- package/esm/Timeline/Timeline.d.ts +3 -3
- package/esm/Timeline/Timeline.d.ts.map +1 -1
- package/esm/Timeline/Timeline.js +2 -2
- package/esm/Timeline/Timeline.js.map +1 -1
- package/esm/Timeline/Timeline.module.js +5 -4
- package/esm/Token/Token.js +1 -1
- package/esm/Token/Token.js.map +1 -1
- package/esm/Token/Token.module.js +6 -5
- package/esm/Tooltip/Tooltip.js +2 -2
- package/esm/Tooltip/Tooltip.js.map +1 -1
- package/esm/Tooltip/Tooltip.module.js +4 -3
- package/esm/VideoPlayer/VideoPlayer.d.ts +2 -2
- package/esm/VideoPlayer/VideoPlayer.js +2 -2
- package/esm/VideoPlayer/VideoPlayer.js.map +1 -1
- package/esm/VideoPlayer/VideoPlayer.module.js +29 -28
- package/esm/VideoPlayer/components/CCButton/CCButton.d.ts +2 -2
- package/esm/VideoPlayer/components/CCButton/CCButton.d.ts.map +1 -1
- package/esm/VideoPlayer/components/CCButton/CCButton.js +1 -1
- package/esm/VideoPlayer/components/CCButton/CCButton.js.map +1 -1
- package/esm/VideoPlayer/components/Captions/Captions.d.ts +2 -2
- package/esm/VideoPlayer/components/Captions/Captions.d.ts.map +1 -1
- package/esm/VideoPlayer/components/Captions/Captions.js +1 -1
- package/esm/VideoPlayer/components/Captions/Captions.js.map +1 -1
- package/esm/VideoPlayer/components/Captions/Captions.module.js +5 -4
- package/esm/VideoPlayer/components/ControlsBar/ControlsBar.d.ts +2 -2
- package/esm/VideoPlayer/components/ControlsBar/ControlsBar.d.ts.map +1 -1
- package/esm/VideoPlayer/components/ControlsBar/ControlsBar.js +1 -1
- package/esm/VideoPlayer/components/ControlsBar/ControlsBar.js.map +1 -1
- package/esm/VideoPlayer/components/FullScreenButton/FullScreenButton.d.ts +2 -2
- package/esm/VideoPlayer/components/FullScreenButton/FullScreenButton.d.ts.map +1 -1
- package/esm/VideoPlayer/components/FullScreenButton/FullScreenButton.js +2 -1
- package/esm/VideoPlayer/components/FullScreenButton/FullScreenButton.js.map +1 -1
- package/esm/VideoPlayer/components/IconControl/IconControl.d.ts +2 -2
- package/esm/VideoPlayer/components/IconControl/IconControl.d.ts.map +1 -1
- package/esm/VideoPlayer/components/IconControl/IconControl.js +1 -1
- package/esm/VideoPlayer/components/IconControl/IconControl.js.map +1 -1
- package/esm/VideoPlayer/components/MuteButton/MuteButton.d.ts +2 -2
- package/esm/VideoPlayer/components/MuteButton/MuteButton.d.ts.map +1 -1
- package/esm/VideoPlayer/components/MuteButton/MuteButton.js +2 -1
- package/esm/VideoPlayer/components/MuteButton/MuteButton.js.map +1 -1
- package/esm/VideoPlayer/components/PauseIcon/PauseIcon.d.ts +2 -2
- package/esm/VideoPlayer/components/PauseIcon/PauseIcon.d.ts.map +1 -1
- package/esm/VideoPlayer/components/PauseIcon/PauseIcon.js.map +1 -1
- package/esm/VideoPlayer/components/PlayIcon/PlayIcon.d.ts +2 -2
- package/esm/VideoPlayer/components/PlayIcon/PlayIcon.d.ts.map +1 -1
- package/esm/VideoPlayer/components/PlayIcon/PlayIcon.js.map +1 -1
- package/esm/VideoPlayer/components/PlayPauseButton/PlayPauseButton.d.ts +2 -2
- package/esm/VideoPlayer/components/PlayPauseButton/PlayPauseButton.d.ts.map +1 -1
- package/esm/VideoPlayer/components/PlayPauseButton/PlayPauseButton.js.map +1 -1
- package/esm/VideoPlayer/components/Range/Range.d.ts +1 -1
- package/esm/VideoPlayer/components/Range/Range.d.ts.map +1 -1
- package/esm/VideoPlayer/components/Range/Range.js +1 -1
- package/esm/VideoPlayer/components/Range/Range.js.map +1 -1
- package/esm/VideoPlayer/components/SeekControl/SeekControl.d.ts +2 -2
- package/esm/VideoPlayer/components/SeekControl/SeekControl.d.ts.map +1 -1
- package/esm/VideoPlayer/components/SeekControl/SeekControl.js +1 -1
- package/esm/VideoPlayer/components/SeekControl/SeekControl.js.map +1 -1
- package/esm/VideoPlayer/components/VideoTooltip/VideoTooltip.d.ts +2 -2
- package/esm/VideoPlayer/components/VideoTooltip/VideoTooltip.d.ts.map +1 -1
- package/esm/VideoPlayer/components/VideoTooltip/VideoTooltip.js +3 -2
- package/esm/VideoPlayer/components/VideoTooltip/VideoTooltip.js.map +1 -1
- package/esm/VideoPlayer/components/VolumeControl/VolumeControl.d.ts +2 -1
- package/esm/VideoPlayer/components/VolumeControl/VolumeControl.d.ts.map +1 -1
- package/esm/VideoPlayer/components/VolumeControl/VolumeControl.js.map +1 -1
- package/esm/VideoPlayer/components/VolumeControl/VolumeControl.module.js +3 -2
- package/esm/VideoPlayer/hooks/useIsElementFullScreen.js.map +1 -1
- package/esm/VideoPlayer/hooks/useVideo.js.map +1 -1
- package/esm/VideoPlayer/hooks/useVideoResizeObserver.js.map +1 -1
- package/esm/animation/Animate/Animate.d.ts +1 -1
- package/esm/animation/Animate/Animate.d.ts.map +1 -1
- package/esm/animation/Animate/Animate.js +1 -1
- package/esm/animation/Animate/Animate.js.map +1 -1
- package/esm/animation/Animation.module.js +4 -3
- package/esm/animation/AnimationProvider/AnimationProvider.d.ts +1 -1
- package/esm/animation/AnimationProvider/AnimationProvider.d.ts.map +1 -1
- package/esm/animation/AnimationProvider/AnimationProvider.js.map +1 -1
- package/esm/animation/TextRevealAnimation/TextRevealAnimation.js +1 -1
- package/esm/animation/TextRevealAnimation/TextRevealAnimation.js.map +1 -1
- package/esm/animation/TextRevealAnimation/TextRevealAnimation.module.js +5 -4
- package/esm/animation/TextRevealAnimation/useTextRevealAnimationLines.js.map +1 -1
- package/esm/animation/useAnimation.js.map +1 -1
- package/esm/component-helpers/shared.module.js +3 -2
- package/esm/component-helpers.d.ts +2 -2
- package/esm/component-helpers.d.ts.map +1 -1
- package/esm/constants.js.map +1 -1
- package/esm/css/stylesheets.js +1 -1
- package/esm/findElementInChildren.js.map +1 -1
- package/esm/forms/Checkbox/Checkbox.js +2 -2
- package/esm/forms/Checkbox/Checkbox.js.map +1 -1
- package/esm/forms/Checkbox/Checkbox.module.js +4 -3
- package/esm/forms/ControlGroup/ControlGroup.js +3 -2
- package/esm/forms/ControlGroup/ControlGroup.js.map +1 -1
- package/esm/forms/ControlGroup/ControlGroup.module.js +7 -6
- package/esm/forms/FormControl/FormControl.d.ts +5 -5
- package/esm/forms/FormControl/FormControl.d.ts.map +1 -1
- package/esm/forms/FormControl/FormControl.js +4 -3
- package/esm/forms/FormControl/FormControl.js.map +1 -1
- package/esm/forms/FormControl/FormControl.module.js +5 -4
- package/esm/forms/Radio/Radio.js +1 -1
- package/esm/forms/Radio/Radio.js.map +1 -1
- package/esm/forms/Radio/Radio.module.js +4 -3
- package/esm/forms/Select/Select.d.ts +2 -2
- package/esm/forms/Select/Select.js +1 -1
- package/esm/forms/Select/Select.js.map +1 -1
- package/esm/forms/Select/Select.module.js +4 -3
- package/esm/forms/TextInput/TextInput.js +1 -1
- package/esm/forms/TextInput/TextInput.js.map +1 -1
- package/esm/forms/TextInput/TextInput.module.js +5 -4
- package/esm/forms/Textarea/Textarea.js +1 -1
- package/esm/forms/Textarea/Textarea.js.map +1 -1
- package/esm/forms/Textarea/Textarea.module.js +4 -3
- package/esm/hooks/useAnchoredPosition.js +7 -4
- package/esm/hooks/useAnchoredPosition.js.map +1 -1
- package/esm/hooks/useCursorAnimation.js +4 -2
- package/esm/hooks/useCursorAnimation.js.map +1 -1
- package/esm/hooks/useFocusTrap.js.map +1 -1
- package/esm/hooks/useId.js.map +1 -1
- package/esm/hooks/useKeyboardEscape.js.map +1 -1
- package/esm/hooks/useOnClickOutside.js.map +1 -1
- package/esm/hooks/useReducedMotion.js +1 -1
- package/esm/hooks/useReducedMotion.js.map +1 -1
- package/esm/hooks/useRef.js.map +1 -1
- package/esm/hooks/useResizeObserver.js.map +1 -1
- package/esm/hooks/useTabs.js +1 -1
- package/esm/hooks/useTabs.js.map +1 -1
- package/esm/hooks/useWindowSize.js +7 -7
- package/esm/hooks/useWindowSize.js.map +1 -1
- package/esm/list/ListItem/ListItem.js +4 -2
- package/esm/list/ListItem/ListItem.js.map +1 -1
- package/esm/list/ListItem/ListItem.module.js +5 -4
- package/esm/list/OrderedList/OrderedList.d.ts +2 -2
- package/esm/list/OrderedList/OrderedList.d.ts.map +1 -1
- package/esm/list/OrderedList/OrderedList.js +1 -1
- package/esm/list/OrderedList/OrderedList.js.map +1 -1
- package/esm/list/OrderedList/OrderedList.module.js +3 -2
- package/esm/list/UnorderedList/UnorderedList.d.ts +2 -2
- package/esm/list/UnorderedList/UnorderedList.d.ts.map +1 -1
- package/esm/list/UnorderedList/UnorderedList.js +1 -1
- package/esm/list/UnorderedList/UnorderedList.js.map +1 -1
- package/esm/list/list-shared.module.js +3 -2
- package/esm/list/listContext.js.map +1 -1
- package/esm/node_modules/@primer/octicons-react/dist/icons/AlertFillIcon.js +28 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/AlertFillIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/ArrowUpIcon.js +20 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/ArrowUpIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/ArrowUpRightIcon.js +20 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/ArrowUpRightIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/CheckCircleFillIcon.js +28 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/CheckCircleFillIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/CheckIcon.js +20 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/CheckIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/ChevronDownIcon.js +28 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/ChevronDownIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/ChevronLeftIcon.js +28 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/ChevronLeftIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/ChevronRightIcon.js +28 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/ChevronRightIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/ChevronUpIcon.js +28 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/ChevronUpIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/CopilotIcon.js +33 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/CopilotIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/DashIcon.js +20 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/DashIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/LinkExternalIcon.js +20 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/LinkExternalIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/MarkGithubIcon.js +20 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/MarkGithubIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/MuteIcon.js +20 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/MuteIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/PaperAirplaneIcon.js +20 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/PaperAirplaneIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/PauseIcon.js +20 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/PauseIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/PlayIcon.js +20 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/PlayIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/ReplyIcon.js +20 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/ReplyIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/ScreenFullIcon.js +20 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/ScreenFullIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/ScreenNormalIcon.js +20 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/ScreenNormalIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/SearchIcon.js +20 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/SearchIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/TriangleDownIcon.js +20 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/TriangleDownIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/TriangleUpIcon.js +20 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/TriangleUpIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/UnmuteIcon.js +20 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/UnmuteIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/XIcon.js +28 -0
- package/esm/node_modules/@primer/octicons-react/dist/icons/XIcon.js.map +1 -0
- package/esm/node_modules/@primer/octicons-react/dist/renderOcticon-DuMQdmQC.js +132 -0
- package/esm/node_modules/@primer/octicons-react/dist/renderOcticon-DuMQdmQC.js.map +1 -0
- package/esm/node_modules/clsx/dist/clsx.js +1 -1
- package/esm/node_modules/clsx/dist/clsx.js.map +1 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/subdomain-nav-bar/colors-with-modes-BGj0AiDW.css +1 -0
- package/esm/river/River/River.js +2 -2
- package/esm/river/River/River.js.map +1 -1
- package/esm/river/RiverAccordion/RiverAccordion.d.ts +4 -4
- package/esm/river/RiverAccordion/RiverAccordion.js +3 -2
- package/esm/river/RiverAccordion/RiverAccordion.js.map +1 -1
- package/esm/river/RiverAccordion/RiverAccordion.module.js +16 -15
- package/esm/river/RiverBreakout/RiverBreakout.d.ts +1 -1
- package/esm/river/RiverBreakout/RiverBreakout.js +1 -1
- package/esm/river/RiverBreakout/RiverBreakout.js.map +1 -1
- package/esm/river/RiverBreakoutTabs/RiverBreakoutTabs.d.ts +5 -5
- package/esm/river/RiverBreakoutTabs/RiverBreakoutTabs.js +2 -2
- package/esm/river/RiverBreakoutTabs/RiverBreakoutTabs.js.map +1 -1
- package/esm/river/RiverBreakoutTabs/RiverBreakoutTabs.module.js +31 -30
- package/esm/river/RiverStoryScroll/RiverStoryScroll.d.ts +1 -1
- package/esm/river/RiverStoryScroll/RiverStoryScroll.d.ts.map +1 -1
- package/esm/river/RiverStoryScroll/RiverStoryScroll.js +5 -3
- package/esm/river/RiverStoryScroll/RiverStoryScroll.js.map +1 -1
- package/esm/river/RiverStoryScroll/RiverStoryScroll.module.js +8 -7
- package/esm/river/RiverStoryScroll/RiverStoryScrollProvider.d.ts +2 -2
- package/esm/river/RiverStoryScroll/RiverStoryScrollProvider.d.ts.map +1 -1
- package/esm/river/RiverStoryScroll/RiverStoryScrollProvider.js.map +1 -1
- package/esm/river/RiverStoryScroll/RiverStoryScrollResponder.d.ts +1 -1
- package/esm/river/RiverStoryScroll/RiverStoryScrollResponder.d.ts.map +1 -1
- package/esm/river/RiverStoryScroll/RiverStoryScrollResponder.js +1 -1
- package/esm/river/RiverStoryScroll/RiverStoryScrollResponder.js.map +1 -1
- package/esm/river/RiverStoryScroll/RiverStoryScrollTracker.d.ts +1 -1
- package/esm/river/RiverStoryScroll/RiverStoryScrollTracker.d.ts.map +1 -1
- package/esm/river/RiverStoryScroll/RiverStoryScrollTracker.js +1 -1
- package/esm/river/RiverStoryScroll/RiverStoryScrollTracker.js.map +1 -1
- package/esm/river/river-shared.module.js +13 -12
- package/esm/utils/getTextContent.js.map +1 -1
- package/esm/utils/isFragmentElement.js.map +1 -1
- package/lib/Accordion/Accordion.d.ts +2 -2
- package/lib/ActionMenu/ActionMenu.d.ts +2 -2
- package/lib/AnchorNav/AnchorNav.d.ts +4 -4
- package/lib/Bento/Bento.d.ts +4 -4
- package/lib/Box/Box.d.ts +1 -1
- package/lib/CTABanner/CTABanner.d.ts +1 -1
- package/lib/Card/Card.d.ts +2 -2
- package/lib/ComparisonTable/ComparisonTable.d.ts +3 -3
- package/lib/ExpandableArrow/ExpandableArrow.d.ts +2 -1
- package/lib/FAQ/FAQ.d.ts +2 -2
- package/lib/FAQ/FAQGroup.d.ts +2 -2
- package/lib/Footnotes/Footnotes.d.ts +2 -2
- package/lib/FrostedGlassVFX/FrostedGlassVFX.d.ts +1 -1
- package/lib/Grid/Grid.d.ts +2 -2
- package/lib/IDE/IDE.d.ts +1 -1
- package/lib/Icon/Icon.d.ts +2 -2
- package/lib/Image/Image.d.ts +1 -1
- package/lib/Link/Link.d.ts +1 -1
- package/lib/LogoSuite/LogoSuite.d.ts +1 -1
- package/lib/MediaPlaylist/MediaPlaylist.d.ts +4 -4
- package/lib/MinimalFooter/MinimalFooter.d.ts +3 -3
- package/lib/Pagination/Pagination.d.ts +1 -1
- package/lib/Pillar/Pillar.d.ts +2 -2
- package/lib/PricingOptions/PricingOptions.d.ts +1 -1
- package/lib/SectionIntroStacked/SectionIntroStacked.d.ts +3 -3
- package/lib/SubNav/SubNav.d.ts +4 -4
- package/lib/SubdomainNavBar/NavigationVisbilityObserver.d.ts +3 -1
- package/lib/SubdomainNavBar/SubdomainNavBar.d.ts +157 -20
- package/lib/SubdomainNavBar/SubdomainNavBarLinkContext.d.ts +8 -0
- package/lib/SubdomainNavBar/useSearchKeyboardShortcut.d.ts +7 -0
- package/lib/SubdomainNavBar/useSearchResults.d.ts +23 -0
- package/lib/SubdomainNavBar/useVisibilityObserver.d.ts +1 -1
- package/lib/Testimonial/Testimonial.d.ts +1 -1
- package/lib/Text/Text.d.ts +1 -1
- package/lib/TextCursorAnimation/TextCursorAnimation.d.ts +1 -1
- package/lib/ThemeProvider/ThemeProvider.d.ts +1 -1
- package/lib/Timeline/Timeline.d.ts +3 -3
- package/lib/VideoPlayer/VideoPlayer.d.ts +2 -2
- package/lib/VideoPlayer/components/CCButton/CCButton.d.ts +2 -2
- package/lib/VideoPlayer/components/Captions/Captions.d.ts +2 -2
- package/lib/VideoPlayer/components/ControlsBar/ControlsBar.d.ts +2 -2
- package/lib/VideoPlayer/components/FullScreenButton/FullScreenButton.d.ts +2 -2
- package/lib/VideoPlayer/components/IconControl/IconControl.d.ts +2 -2
- package/lib/VideoPlayer/components/MuteButton/MuteButton.d.ts +2 -2
- package/lib/VideoPlayer/components/PauseIcon/PauseIcon.d.ts +2 -2
- package/lib/VideoPlayer/components/PlayIcon/PlayIcon.d.ts +2 -2
- package/lib/VideoPlayer/components/PlayPauseButton/PlayPauseButton.d.ts +2 -2
- package/lib/VideoPlayer/components/Range/Range.d.ts +1 -1
- package/lib/VideoPlayer/components/SeekControl/SeekControl.d.ts +2 -2
- package/lib/VideoPlayer/components/VideoTooltip/VideoTooltip.d.ts +2 -2
- package/lib/VideoPlayer/components/VolumeControl/VolumeControl.d.ts +2 -1
- package/lib/animation/Animate/Animate.d.ts +1 -1
- package/lib/animation/AnimationProvider/AnimationProvider.d.ts +1 -1
- package/lib/component-helpers.d.ts +2 -2
- package/lib/css/main.css +1390 -1056
- 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/base.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-code/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-code/colors.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 +1 -1
- 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 +7 -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/base.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/base.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-code/colors.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/base.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/base.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-code/colors.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/base.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/json/colors.json +3 -0
- 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/base.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-code/colors.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/base.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/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/footer/base.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-code/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-code/colors.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/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/text-cursor-animation/base.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/forms/FormControl/FormControl.d.ts +5 -5
- package/lib/forms/Select/Select.d.ts +2 -2
- package/lib/index.js +1 -1
- package/lib/list/OrderedList/OrderedList.d.ts +2 -2
- package/lib/list/UnorderedList/UnorderedList.d.ts +2 -2
- package/lib/river/RiverAccordion/RiverAccordion.d.ts +4 -4
- package/lib/river/RiverBreakout/RiverBreakout.d.ts +1 -1
- package/lib/river/RiverBreakoutTabs/RiverBreakoutTabs.d.ts +5 -5
- package/lib/river/RiverStoryScroll/RiverStoryScroll.d.ts +1 -1
- package/lib/river/RiverStoryScroll/RiverStoryScrollProvider.d.ts +2 -2
- package/lib/river/RiverStoryScroll/RiverStoryScrollResponder.d.ts +1 -1
- package/lib/river/RiverStoryScroll/RiverStoryScrollTracker.d.ts +1 -1
- package/llms.txt +2 -2
- package/package.json +24 -24
- package/esm/SubdomainNavBar/SubdomainNavBar.module-Rf4qEDka.css +0 -1
- package/esm/node_modules/@primer/octicons-react/dist/index.esm.js +0 -434
- package/esm/node_modules/@primer/octicons-react/dist/index.esm.js.map +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/subdomain-nav-bar/colors-with-modes-ehJCoExh.css +0 -1
package/esm/SubNav/SubNav.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubNav.js","names":[],"sources":["../../src/SubNav/SubNav.tsx"],"sourcesContent":["import React, {\n Children,\n createContext,\n forwardRef,\n isValidElement,\n memo,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type PropsWithChildren,\n type ReactNode,\n type RefObject,\n} from 'react'\nimport {Button, ButtonSizes, ButtonVariants, Text, TextProps, ThemeProvider, useWindowSize} from '..'\n\nimport {clsx} from 'clsx'\nimport {TriangleDownIcon, TriangleUpIcon} from '@primer/octicons-react'\nimport {useId} from '../hooks/useId'\nimport {useKeyboardEscape} from '../hooks/useKeyboardEscape'\nimport {useOnClickOutside} from '../hooks/useOnClickOutside'\nimport {useFocusTrap} from '../hooks/useFocusTrap'\nimport {useProvidedRefOrCreate} from '../hooks/useRef'\nimport {useContainsFocus} from './useContainsFocus'\n\nimport type {BaseProps} from '../component-helpers'\n\n/**\n * Design tokens\n */\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/sub-nav/base.css'\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/sub-nav/colors-with-modes.css'\n\n/** * Main Stylesheet (as a CSS Module) */\nimport styles from './SubNav.module.css'\nimport {createPortal} from 'react-dom'\n\nconst testIds = {\n root: 'SubNav-root',\n get button() {\n return `${this.root}-button`\n },\n get overlay() {\n return `${this.root}-overlay`\n },\n get link() {\n return `${this.root}-link`\n },\n get heading() {\n return `${this.root}-heading`\n },\n get action() {\n return `${this.root}-action`\n },\n get subMenu() {\n return `${this.root}-sub-menu`\n },\n}\n\nexport const SubNavSubMenuVariants = ['dropdown', 'anchor'] as const\ntype SubMenuVariants = (typeof SubNavSubMenuVariants)[number]\n\ntype SubNavContextType = {\n portalRef: RefObject<HTMLDivElement | null>\n}\n\nconst SubNavContext = createContext<SubNavContextType | undefined>(undefined)\n\nexport const useSubNavContext = () => {\n const context = useContext(SubNavContext)\n if (!context) {\n throw new Error('useSubNavContext must be used within a SubNavProvider')\n }\n return context\n}\n\nfunction SubNavProvider({children}: {children: React.ReactNode}) {\n const anchoredNavOuterPortalRef = React.useRef<HTMLDivElement>(null)\n const anchoredNavPortalRef = React.useRef<HTMLDivElement>(null)\n\n const value = useMemo(\n () => ({\n portalRef: anchoredNavPortalRef,\n }),\n [],\n )\n\n useEffect(() => {\n const menuContainer = anchoredNavOuterPortalRef.current\n\n const observer = new IntersectionObserver(\n ([entry]) => {\n entry.target.classList.toggle(styles['SubNav__anchor-menu-outer-container--stuck'], entry.intersectionRatio < 1)\n },\n {threshold: [1]},\n )\n\n if (menuContainer) {\n observer.observe(menuContainer)\n }\n\n return () => {\n if (menuContainer) {\n observer.unobserve(menuContainer)\n }\n }\n }, [])\n\n return (\n <SubNavContext.Provider value={value}>\n {children}\n\n <div className={styles['SubNav__anchor-menu-outer-container']} ref={anchoredNavOuterPortalRef}>\n <div className={clsx(styles['SubNav__anchor-menu-container'])} ref={anchoredNavPortalRef} />\n </div>\n </SubNavContext.Provider>\n )\n}\n\nexport type SubNavProps = {\n /**\n * @deprecated The hasShadow prop is deprecated and will be removed in a future release.\n */\n hasShadow?: boolean\n /**\n * Allows the SubNav to be used at full width,\n * removing any internal padding and guttering.\n */\n fullWidth?: boolean\n 'data-testid'?: string\n} & PropsWithChildren<BaseProps<HTMLDivElement>>\n\nconst SubNavRoot = memo(\n forwardRef<HTMLDivElement, SubNavProps>(\n ({id, children, className, 'data-testid': testId, fullWidth, hasShadow}, ref) => {\n const rootRef = useProvidedRefOrCreate<HTMLDivElement>(ref as RefObject<HTMLDivElement>)\n const innerRootRef = React.useRef<HTMLDivElement>(null)\n const navRef = React.useRef<HTMLElement>(null)\n const overlayRef = React.useRef<HTMLUListElement>(null)\n const narrowButtonRef = useRef<HTMLButtonElement>(null)\n const [isOpenAtNarrow, setIsOpenAtNarrow] = useState(false)\n const idForLinkContainer = useId()\n const [hasAnchoredNav, setHasAnchoredNav] = useState(false)\n\n const {isLarge} = useWindowSize()\n\n useFocusTrap({containerRef: innerRootRef, disabled: !isOpenAtNarrow})\n\n const childrenArr = Children.toArray(children)\n\n const closeMenuCallback = useCallback(() => {\n if (isLarge) return\n setIsOpenAtNarrow(false)\n }, [isLarge])\n\n const handleMenuToggle = useCallback(() => {\n if (isLarge) return\n setIsOpenAtNarrow(prev => !prev)\n }, [isLarge])\n\n useOnClickOutside(innerRootRef, closeMenuCallback)\n useKeyboardEscape(closeMenuCallback)\n\n useEffect(() => {\n const navElement = navRef.current\n\n const updateAvailableHeight = () => {\n if (navElement) {\n const navTop = navElement.getBoundingClientRect().top\n navElement.style.setProperty('--subnav-available-height', `${window.innerHeight - navTop}px`)\n }\n }\n\n if (isOpenAtNarrow && !isLarge) {\n document.body.style.overflow = 'hidden'\n updateAvailableHeight()\n // eslint-disable-next-line github/prefer-observers\n window.addEventListener('resize', updateAvailableHeight)\n } else {\n document.body.style.overflow = 'auto'\n\n if (navElement) {\n navElement.style.removeProperty('--subnav-available-height')\n }\n }\n\n return () => {\n document.body.style.overflow = 'auto'\n window.removeEventListener('resize', updateAvailableHeight)\n\n if (navElement) {\n navElement.style.removeProperty('--subnav-available-height')\n }\n }\n }, [isOpenAtNarrow, isLarge])\n\n const activeLink = childrenArr.find(child => {\n return isValidElement<LinkBaseProps>(child) && Boolean(child.props['aria-current'])\n }) as React.ReactElement<LinkBaseProps> | undefined\n\n useEffect(() => {\n // check if there is an anchored nav in the SubNav.SubMenu child\n const hasAnchorVariant = childrenArr.some(child => {\n if (isValidElement<LinkBaseProps>(child) && child.type === LinkBase) {\n const childNodes = Children.toArray(child.props.children)\n const maybeSubMenu = childNodes[1]\n if (\n isValidElement<SubMenuProps>(maybeSubMenu) &&\n maybeSubMenu.type === SubMenuBase &&\n maybeSubMenu.props.variant === 'anchor'\n ) {\n return true\n }\n }\n return false\n })\n setHasAnchoredNav(hasAnchorVariant)\n }, [childrenArr])\n\n const {\n heading: HeadingChild,\n subheading: SubHeadingChild,\n links: LinkChildren,\n action: ActionChild,\n } = childrenArr.reduce(\n (\n acc: {\n heading?: React.ReactElement<HeadingBaseProps>\n subheading?: React.ReactElement<SubHeadingBaseProps>\n links: React.ReactElement<LinkBaseProps>[]\n action?: React.ReactElement<SubNavActionProps>\n },\n child,\n ) => {\n if (isValidElement(child)) {\n if (child.type === HeadingBase) {\n acc.heading = child as React.ReactElement<HeadingBaseProps>\n } else if (child.type === SubHeadingBase) {\n acc.subheading = child as React.ReactElement<SubHeadingBaseProps>\n } else if (child.type === LinkBase) {\n const linkChild = child as React.ReactElement<LinkBaseProps>\n const childNodes = Children.toArray(linkChild.props.children)\n const [link, subMenu] = childNodes\n const isAnchorVariant =\n isValidElement<SubMenuProps>(subMenu) &&\n subMenu.type === SubMenuBase &&\n subMenu.props.variant === 'anchor'\n\n acc.links.push(\n React.cloneElement(linkChild, {\n ...(isAnchorVariant ? {children: [link]} : {}),\n onClick: linkChild.props['aria-current'] ? closeMenuCallback : linkChild.props.onClick,\n }),\n )\n } else if (child.type === ActionBase) {\n acc.action = child as React.ReactElement<SubNavActionProps>\n }\n }\n return acc\n },\n {heading: undefined, subheading: undefined, links: [], action: undefined},\n )\n\n const activeLinkChildren = activeLink ? Children.toArray(activeLink.props.children) : []\n const activeLinklabel = activeLinkChildren[0]\n\n // needed to prevent rendering of anchor subnav inside the narrow <button> element\n const maybeSubMenu = activeLinkChildren[1]\n const MaybeSubNav =\n isValidElement<SubMenuProps>(maybeSubMenu) &&\n maybeSubMenu.type === SubMenuBase &&\n maybeSubMenu.props.variant === 'anchor'\n ? maybeSubMenu\n : null\n\n const subHeadingIsActive =\n isValidElement<SubHeadingBaseProps>(SubHeadingChild) &&\n SubHeadingChild.type === SubHeadingBase &&\n Boolean(SubHeadingChild.props['aria-current'])\n const narrowButtonLabel = SubHeadingChild ? activeLinklabel : null\n\n const NarrowButton = useMemo(\n () => (\n <div\n className={clsx(styles['SubNav__overlay-toggle'], isOpenAtNarrow && styles['SubNav__overlay-toggle--open'])}\n >\n <span\n className={clsx(\n styles['SubNav__overlay-toggle-content'],\n !narrowButtonLabel && styles['SubNav__overlay-toggle-content--end'],\n )}\n >\n <button\n ref={narrowButtonRef}\n className={styles['SubNav__overlay-toggle-label']}\n data-testid={testIds.button}\n onClick={isOpenAtNarrow ? closeMenuCallback : handleMenuToggle}\n aria-expanded={isOpenAtNarrow ? 'true' : 'false'}\n aria-controls={idForLinkContainer}\n aria-label={activeLinklabel ? `Navigation menu. Current page: ${activeLinklabel}` : 'Navigation menu'}\n >\n {narrowButtonLabel && (\n <Text as=\"span\" size=\"100\">\n {narrowButtonLabel}\n </Text>\n )}\n {isOpenAtNarrow ? (\n <TriangleUpIcon className={styles['SubNav__overlay-toggle-icon']} size={13} />\n ) : (\n <TriangleDownIcon className={styles['SubNav__overlay-toggle-icon']} size={13} />\n )}\n </button>\n </span>\n </div>\n ),\n [activeLinklabel, closeMenuCallback, handleMenuToggle, idForLinkContainer, isOpenAtNarrow, narrowButtonLabel],\n )\n\n return (\n <div\n ref={rootRef}\n className={clsx(\n styles['SubNav__container'],\n SubHeadingChild && styles['SubNav--has-sub-heading'],\n SubHeadingChild && subHeadingIsActive && styles['SubNav--subHeadingActive'],\n hasAnchoredNav && styles['SubNav__container--with-anchor-nav'],\n )}\n >\n <SubNavProvider>\n <nav\n ref={navRef}\n id={id}\n className={clsx(\n styles.SubNav,\n isOpenAtNarrow && styles['SubNav--open'],\n hasShadow && styles['SubNav--has-shadow'],\n fullWidth && styles['SubNav--full-width'],\n className,\n )}\n data-testid={testId || testIds.root}\n >\n <div ref={innerRootRef} className={styles['SubNav--header-container-outer']}>\n <div className={styles['SubNav__header-container']}>\n {HeadingChild && <div className={styles['SubNav__heading-container']}>{HeadingChild}</div>}\n\n {SubHeadingChild && (\n <div\n className={clsx(\n styles['SubNav__heading-container'],\n styles['SubNav__subheading-container'],\n subHeadingIsActive && styles['SubNav__subheading-container-active'],\n )}\n >\n {SubHeadingChild}\n </div>\n )}\n\n {!isLarge && (!SubHeadingChild || subHeadingIsActive) && NarrowButton}\n\n {MaybeSubNav && MaybeSubNav}\n </div>\n {!isLarge && SubHeadingChild && !subHeadingIsActive && NarrowButton}\n {LinkChildren.length > 0 && (\n <ul\n ref={overlayRef}\n id={idForLinkContainer}\n className={clsx(\n styles['SubNav__links-overlay'],\n isOpenAtNarrow && styles['SubNav__links-overlay--open'],\n )}\n data-testid={testIds.overlay}\n >\n {LinkChildren}\n {ActionChild && <li className={styles['SubNav__action-container']}>{ActionChild}</li>}\n </ul>\n )}\n </div>\n </nav>\n </SubNavProvider>\n </div>\n )\n },\n ),\n)\n\ntype HeadingBaseProps = {\n href: string\n 'data-testid'?: string\n} & PropsWithChildren<React.HTMLProps<HTMLAnchorElement>> &\n BaseProps<HTMLAnchorElement>\n\nconst HeadingBase = ({href, children, className, 'data-testid': testID, ...props}: HeadingBaseProps) => {\n return (\n <a\n href={href}\n className={clsx(styles['SubNav__heading'], className)}\n data-testid={testIds.heading || testID}\n {...props}\n >\n {children}\n </a>\n )\n}\n\ntype SubHeadingBaseProps = {\n href: string\n 'data-testid'?: string\n} & PropsWithChildren<React.HTMLProps<HTMLAnchorElement>> &\n BaseProps<HTMLAnchorElement>\n\nconst SubHeadingBase = ({href, children, className, 'data-testid': testID, ...props}: SubHeadingBaseProps) => {\n return (\n <a\n href={href}\n className={clsx(styles['SubNav__heading'], styles['SubNav__link'], styles['SubNav__subHeading'], className)}\n data-testid={testIds.heading || testID}\n {...props}\n >\n {children}\n </a>\n )\n}\n\ntype LinkBaseProps = {\n href: string\n 'data-testid'?: string\n variant?: TextProps['variant']\n _subMenuVariant?: SubMenuVariants\n} & PropsWithChildren<React.HTMLProps<HTMLAnchorElement>> &\n BaseProps<HTMLAnchorElement>\n\nconst LinkBaseWithSubmenu = forwardRef<HTMLDivElement, LinkBaseProps>(\n (\n {children, href, 'aria-current': ariaCurrent, 'data-testid': testId, className, _subMenuVariant, variant, ...props},\n forwardedRef,\n ) => {\n const submenuId = useId()\n const {isLarge} = useWindowSize()\n\n const [isExpanded, setIsExpanded] = useState(false)\n const ref = useProvidedRefOrCreate(forwardedRef as RefObject<HTMLDivElement>)\n const subMenuChildrenRef = useRef<HTMLDivElement>(null)\n\n useContainsFocus(ref, (containsFocus: boolean) => {\n if (!containsFocus) {\n setIsExpanded(false)\n }\n })\n\n const expand = useCallback(() => setIsExpanded(true), [])\n const collapse = useCallback(() => setIsExpanded(false), [])\n const toggleExpanded = useCallback(() => setIsExpanded(prev => !prev), [])\n const isAriaCurrent = Boolean(ariaCurrent) && ariaCurrent !== 'false'\n\n useKeyboardEscape(collapse)\n\n useEffect(() => {\n if (subMenuChildrenRef.current) {\n // Workaround to avoid React 18 / 19 type mismatches with the `inert` attribute.\n // This approach won't immediately apply the attribute in pure SSR contexts, only post-hydration\n // TODO: Move back to JSX when React 19 is fully adopted in Dotcom.\n // `inert` removes the collapsed submenu from tab order and the accessibility tree\n // without affecting visual appearance\n subMenuChildrenRef.current.toggleAttribute('inert', isLarge && !isExpanded)\n }\n }, [isLarge, isExpanded])\n\n const [label, SubMenuChildren] = children as ReactNode[]\n\n return (\n <div\n className={clsx(\n styles['SubNav__link--has-sub-menu'],\n isExpanded && styles['SubNav__link--expanded'],\n isAriaCurrent && styles['SubNav__link--has-active-sub-menu'],\n )}\n data-testid={testId || testIds.subMenu}\n ref={ref}\n onMouseOver={expand}\n onMouseOut={collapse}\n /**\n * onFocus and onBlur need to be defined to keep the jsx-a11y/mouse-events-have-key-events\n * eslint rule happy. The focus/blur behaviour is handled by useContainsFocus\n */\n onFocus={() => null}\n onBlur={() => null}\n >\n <a\n href={href}\n className={clsx(styles['SubNav__link'], ariaCurrent && styles['SubNav__link--active'], className)}\n aria-current={ariaCurrent}\n {...props}\n >\n <Text as=\"span\" size=\"100\" weight=\"medium\" className={styles['SubNav__link-label']}>\n {label}\n </Text>\n </a>\n {isLarge && (\n <button\n className={styles['SubNav__sub-menu-toggle']}\n onClick={toggleExpanded}\n aria-expanded={isExpanded ? 'true' : 'false'}\n aria-controls={submenuId}\n aria-label={`${label?.toString().trim()} submenu`}\n >\n <TriangleDownIcon className={styles['SubNav__sub-menu-icon']} size={16} />\n </button>\n )}\n\n <div id={submenuId} className={styles['SubNav__sub-menu-children']} ref={subMenuChildrenRef}>\n {SubMenuChildren}\n </div>\n </div>\n )\n },\n)\n\nconst LinkBase = forwardRef<HTMLAnchorElement | HTMLDivElement, LinkBaseProps>((props, ref) => {\n const [isInView, setIsInView] = useState(false)\n const childrenArr = Children.toArray(props.children)\n\n const hasSubMenu = childrenArr.some(child => {\n if (isValidElement(child)) {\n return child.type === SubMenuBase\n }\n })\n\n useEffect(() => {\n if (hasSubMenu) return\n const targetId = props.href.replace('#', '')\n const target = document.getElementById(targetId)\n if (!target) return\n\n const topOfWindow = '0px 0px -100%'\n const observerParams = {threshold: 0, root: null, rootMargin: topOfWindow}\n\n const handleIntersectionUpdate: IntersectionObserverCallback = ([entry]) => {\n setIsInView(entry.isIntersecting)\n }\n\n const observer = new IntersectionObserver(handleIntersectionUpdate, observerParams)\n observer.observe(target)\n return () => observer.disconnect()\n }, [hasSubMenu, props.href])\n\n if (hasSubMenu) {\n const isAnchorVariantSubMenu = childrenArr.some(child => {\n return isValidElement<SubMenuProps>(child) && child.type === SubMenuBase && child.props.variant === 'anchor'\n })\n\n return (\n <li>\n <LinkBaseWithSubmenu\n ref={ref as RefObject<HTMLDivElement>}\n {...props}\n _subMenuVariant={isAnchorVariantSubMenu ? 'anchor' : undefined}\n />\n </li>\n )\n }\n\n const {children, href, 'aria-current': ariaCurrent, 'data-testid': testId, variant, className, ...rest} = props\n\n return (\n <li>\n <a\n href={href}\n className={clsx(\n styles['SubNav__link'],\n ariaCurrent && styles['SubNav__link--active'],\n isInView && styles['SubNav__link--is-in-view'],\n className,\n )}\n aria-current={ariaCurrent}\n data-testid={testId || testIds.link}\n ref={ref as RefObject<HTMLAnchorElement>}\n {...rest}\n >\n <Text as=\"span\" size=\"100\" weight=\"medium\" className={styles['SubNav__link-label']}>\n {children}\n </Text>\n </a>\n </li>\n )\n})\n\ntype SubMenuProps = {\n variant?: SubMenuVariants\n} & React.HTMLAttributes<HTMLUListElement> &\n BaseProps<HTMLUListElement>\n\nfunction SubMenuBase({children, className, variant = 'dropdown', ...props}: SubMenuProps) {\n const context = React.useContext(SubNavContext)\n const navRef = useRef<HTMLElement>(null)\n\n const {isLarge} = useWindowSize()\n\n /**\n * Effect is needed to prevent the bubbling of onClick events to the overlay trigger.\n * Removing this effect will cause clicks on the anchor nav element to toggle the overlay.\n */\n useEffect(() => {\n const handleClick = (e: MouseEvent) => {\n if (navRef.current && !navRef.current.contains(e.target as Node)) {\n return\n }\n\n if (!(e.target instanceof HTMLAnchorElement)) {\n e.stopPropagation()\n }\n }\n\n if (variant === 'anchor') {\n document.addEventListener('click', handleClick, true) // Capture phase\n }\n\n return () => {\n document.removeEventListener('click', handleClick, true)\n }\n }, [variant])\n\n if (variant === 'anchor' && context?.portalRef.current) {\n return createPortal(\n <nav\n ref={navRef}\n className={clsx(styles['SubNav__sub-menu'], styles['SubNav__sub-menu--anchor'], className)}\n role=\"navigation\"\n aria-label=\"Sub navigation\"\n >\n <ul className={styles['SubNav__sub-menu-list']} {...props}>\n {React.Children.map(children, child => {\n if (isValidElement<LinkBaseProps>(child) && child.type === LinkBase) {\n return React.cloneElement(child, {\n onClick: e => {\n child.props.onClick?.(e)\n },\n })\n }\n return null\n })}\n </ul>\n </nav>,\n context.portalRef.current,\n )\n } else {\n const Tag = isLarge ? ThemeProvider : React.Fragment\n\n return (\n <Tag {...(isLarge ? {colorMode: 'light'} : {})}>\n <ul className={clsx(styles['SubNav__sub-menu'], styles[`SubNav__sub-menu--${variant}`], className)} {...props}>\n {children}\n </ul>\n </Tag>\n )\n }\n}\n\ntype SubNavActionProps = {\n /**\n * Required path or location for the action button to link to.\n */\n href: string\n /**\n * Optional sizes for the button.\n */\n size?: (typeof ButtonSizes)[number]\n /**\n * Optional sizes for the button.\n */\n variant?: (typeof ButtonVariants)[number]\n} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>\n\nfunction ActionBase({children, href, variant = 'primary', size = 'small', ...rest}: SubNavActionProps) {\n return (\n <Button\n className={styles['SubNav__action']}\n as=\"a\"\n href={href}\n variant={variant}\n data-testid={testIds.action}\n size={size}\n {...rest}\n >\n {children}\n </Button>\n )\n}\n\n/**\n * Use SubNav to display a secondary navigation beneath a primary header.\n * @see https://primer.style/brand/components/SubNav\n */\nexport const SubNav = Object.assign(SubNavRoot, {\n Heading: HeadingBase,\n SubHeading: SubHeadingBase,\n Link: LinkBase,\n Action: ActionBase,\n SubMenu: SubMenuBase,\n testIds,\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAuCA,IAAM,IAAU;CACd,MAAM;CACN,IAAI,SAAS;AACX,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,UAAU;A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AClD,EAAM,aAAa,GAAO,EAC/B,UAAS,MAAK;AACZ,MAAM,MAAM,UAAU,EAAE;MAE3B,CAAC,GAEG,KACP;GACC,CAAA;EACD,CAAA,EACN,EAAQ,UAAU,QACnB,GAKC,kBAHU,IAAU,IAAgB,EAAM,UAG1C;EAAK,GAAK,IAAU,EAAC,WAAW,SAAQ,GAAG,EAAE;YAC3C,kBAAC,MAAD;GAAI,WAAW,EAAK,EAAO,qBAAqB,EAAO,qBAAqB,MAAY,EAAU;GAAE,GAAI;GACrG;GACE,CAAA;EACD,CAAA;;AAoBZ,SAAS,EAAW,EAAC,aAAU,SAAM,aAAU,WAAW,UAAO,SAAS,GAAG,KAA0B;AACrG,QACE,kBAAC,GAAD;EACE,WAAW,EAAO;EAClB,IAAG;EACG;EACG;EACT,eAAa,EAAQ;EACf;EACN,GAAI;EAEH;EACM,CAAA;;AAQb,IAAa,IAAS,OAAO,OAAO,GAAY;CAC9C,SAAS;CACT,YAAY;CACZ,MAAM;CACN,QAAQ;CACR,SAAS;CACT;CACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"SubNav.js","names":[],"sources":["../../src/SubNav/SubNav.tsx"],"sourcesContent":["import React, {\n Children,\n createContext,\n forwardRef,\n isValidElement,\n memo,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type PropsWithChildren,\n type ReactNode,\n type RefObject,\n} from 'react'\nimport {Button, ButtonSizes, ButtonVariants, Text, TextProps, ThemeProvider, useWindowSize} from '..'\n\nimport {clsx} from 'clsx'\nimport {TriangleDownIcon, TriangleUpIcon} from '@primer/octicons-react'\nimport {useId} from '../hooks/useId'\nimport {useKeyboardEscape} from '../hooks/useKeyboardEscape'\nimport {useOnClickOutside} from '../hooks/useOnClickOutside'\nimport {useFocusTrap} from '../hooks/useFocusTrap'\nimport {useProvidedRefOrCreate} from '../hooks/useRef'\nimport {useContainsFocus} from './useContainsFocus'\n\nimport type {BaseProps} from '../component-helpers'\n\n/**\n * Design tokens\n */\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/sub-nav/base.css'\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/sub-nav/colors-with-modes.css'\n\n/** * Main Stylesheet (as a CSS Module) */\nimport styles from './SubNav.module.css'\nimport {createPortal} from 'react-dom'\n\nconst testIds = {\n root: 'SubNav-root',\n get button() {\n return `${this.root}-button`\n },\n get overlay() {\n return `${this.root}-overlay`\n },\n get link() {\n return `${this.root}-link`\n },\n get heading() {\n return `${this.root}-heading`\n },\n get action() {\n return `${this.root}-action`\n },\n get subMenu() {\n return `${this.root}-sub-menu`\n },\n}\n\nexport const SubNavSubMenuVariants = ['dropdown', 'anchor'] as const\ntype SubMenuVariants = (typeof SubNavSubMenuVariants)[number]\n\ntype SubNavContextType = {\n portalRef: RefObject<HTMLDivElement | null>\n}\n\nconst SubNavContext = createContext<SubNavContextType | undefined>(undefined)\n\nexport const useSubNavContext = () => {\n const context = useContext(SubNavContext)\n if (!context) {\n throw new Error('useSubNavContext must be used within a SubNavProvider')\n }\n return context\n}\n\nfunction SubNavProvider({children}: {children: React.ReactNode}) {\n const anchoredNavOuterPortalRef = React.useRef<HTMLDivElement>(null)\n const anchoredNavPortalRef = React.useRef<HTMLDivElement>(null)\n\n const value = useMemo(\n () => ({\n portalRef: anchoredNavPortalRef,\n }),\n [],\n )\n\n useEffect(() => {\n const menuContainer = anchoredNavOuterPortalRef.current\n\n const observer = new IntersectionObserver(\n ([entry]) => {\n entry.target.classList.toggle(styles['SubNav__anchor-menu-outer-container--stuck'], entry.intersectionRatio < 1)\n },\n {threshold: [1]},\n )\n\n if (menuContainer) {\n observer.observe(menuContainer)\n }\n\n return () => {\n if (menuContainer) {\n observer.unobserve(menuContainer)\n }\n }\n }, [])\n\n return (\n <SubNavContext.Provider value={value}>\n {children}\n\n <div className={styles['SubNav__anchor-menu-outer-container']} ref={anchoredNavOuterPortalRef}>\n <div className={clsx(styles['SubNav__anchor-menu-container'])} ref={anchoredNavPortalRef} />\n </div>\n </SubNavContext.Provider>\n )\n}\n\nexport type SubNavProps = {\n /**\n * @deprecated The hasShadow prop is deprecated and will be removed in a future release.\n */\n hasShadow?: boolean\n /**\n * Allows the SubNav to be used at full width,\n * removing any internal padding and guttering.\n */\n fullWidth?: boolean\n 'data-testid'?: string\n} & PropsWithChildren<BaseProps<HTMLDivElement>>\n\nconst SubNavRoot = memo(\n forwardRef<HTMLDivElement, SubNavProps>(\n ({id, children, className, 'data-testid': testId, fullWidth, hasShadow}, ref) => {\n const rootRef = useProvidedRefOrCreate<HTMLDivElement>(ref as RefObject<HTMLDivElement>)\n const innerRootRef = React.useRef<HTMLDivElement>(null)\n const navRef = React.useRef<HTMLElement>(null)\n const overlayRef = React.useRef<HTMLUListElement>(null)\n const narrowButtonRef = useRef<HTMLButtonElement>(null)\n const [isOpenAtNarrow, setIsOpenAtNarrow] = useState(false)\n const idForLinkContainer = useId()\n const [hasAnchoredNav, setHasAnchoredNav] = useState(false)\n\n const {isLarge} = useWindowSize()\n\n useFocusTrap({containerRef: innerRootRef, disabled: !isOpenAtNarrow})\n\n const childrenArr = Children.toArray(children)\n\n const closeMenuCallback = useCallback(() => {\n if (isLarge) return\n setIsOpenAtNarrow(false)\n }, [isLarge])\n\n const handleMenuToggle = useCallback(() => {\n if (isLarge) return\n setIsOpenAtNarrow(prev => !prev)\n }, [isLarge])\n\n useOnClickOutside(innerRootRef, closeMenuCallback)\n useKeyboardEscape(closeMenuCallback)\n\n useEffect(() => {\n const navElement = navRef.current\n\n const updateAvailableHeight = () => {\n if (navElement) {\n const navTop = navElement.getBoundingClientRect().top\n navElement.style.setProperty('--subnav-available-height', `${window.innerHeight - navTop}px`)\n }\n }\n\n if (isOpenAtNarrow && !isLarge) {\n document.body.style.overflow = 'hidden'\n updateAvailableHeight()\n // eslint-disable-next-line github/prefer-observers\n window.addEventListener('resize', updateAvailableHeight)\n } else {\n document.body.style.overflow = 'auto'\n\n if (navElement) {\n navElement.style.removeProperty('--subnav-available-height')\n }\n }\n\n return () => {\n document.body.style.overflow = 'auto'\n window.removeEventListener('resize', updateAvailableHeight)\n\n if (navElement) {\n navElement.style.removeProperty('--subnav-available-height')\n }\n }\n }, [isOpenAtNarrow, isLarge])\n\n const activeLink = childrenArr.find(child => {\n return isValidElement<LinkBaseProps>(child) && Boolean(child.props['aria-current'])\n }) as React.ReactElement<LinkBaseProps> | undefined\n\n useEffect(() => {\n // check if there is an anchored nav in the SubNav.SubMenu child\n const hasAnchorVariant = childrenArr.some(child => {\n if (isValidElement<LinkBaseProps>(child) && child.type === LinkBase) {\n const childNodes = Children.toArray(child.props.children)\n const maybeSubMenu = childNodes[1]\n if (\n isValidElement<SubMenuProps>(maybeSubMenu) &&\n maybeSubMenu.type === SubMenuBase &&\n maybeSubMenu.props.variant === 'anchor'\n ) {\n return true\n }\n }\n return false\n })\n setHasAnchoredNav(hasAnchorVariant)\n }, [childrenArr])\n\n const {\n heading: HeadingChild,\n subheading: SubHeadingChild,\n links: LinkChildren,\n action: ActionChild,\n } = childrenArr.reduce(\n (\n acc: {\n heading?: React.ReactElement<HeadingBaseProps>\n subheading?: React.ReactElement<SubHeadingBaseProps>\n links: React.ReactElement<LinkBaseProps>[]\n action?: React.ReactElement<SubNavActionProps>\n },\n child,\n ) => {\n if (isValidElement(child)) {\n if (child.type === HeadingBase) {\n acc.heading = child as React.ReactElement<HeadingBaseProps>\n } else if (child.type === SubHeadingBase) {\n acc.subheading = child as React.ReactElement<SubHeadingBaseProps>\n } else if (child.type === LinkBase) {\n const linkChild = child as React.ReactElement<LinkBaseProps>\n const childNodes = Children.toArray(linkChild.props.children)\n const [link, subMenu] = childNodes\n const isAnchorVariant =\n isValidElement<SubMenuProps>(subMenu) &&\n subMenu.type === SubMenuBase &&\n subMenu.props.variant === 'anchor'\n\n acc.links.push(\n React.cloneElement(linkChild, {\n ...(isAnchorVariant ? {children: [link]} : {}),\n onClick: linkChild.props['aria-current'] ? closeMenuCallback : linkChild.props.onClick,\n }),\n )\n } else if (child.type === ActionBase) {\n acc.action = child as React.ReactElement<SubNavActionProps>\n }\n }\n return acc\n },\n {heading: undefined, subheading: undefined, links: [], action: undefined},\n )\n\n const activeLinkChildren = activeLink ? Children.toArray(activeLink.props.children) : []\n const activeLinklabel = activeLinkChildren[0]\n\n // needed to prevent rendering of anchor subnav inside the narrow <button> element\n const maybeSubMenu = activeLinkChildren[1]\n const MaybeSubNav =\n isValidElement<SubMenuProps>(maybeSubMenu) &&\n maybeSubMenu.type === SubMenuBase &&\n maybeSubMenu.props.variant === 'anchor'\n ? maybeSubMenu\n : null\n\n const subHeadingIsActive =\n isValidElement<SubHeadingBaseProps>(SubHeadingChild) &&\n SubHeadingChild.type === SubHeadingBase &&\n Boolean(SubHeadingChild.props['aria-current'])\n const narrowButtonLabel = SubHeadingChild ? activeLinklabel : null\n\n const NarrowButton = useMemo(\n () => (\n <div\n className={clsx(styles['SubNav__overlay-toggle'], isOpenAtNarrow && styles['SubNav__overlay-toggle--open'])}\n >\n <span\n className={clsx(\n styles['SubNav__overlay-toggle-content'],\n !narrowButtonLabel && styles['SubNav__overlay-toggle-content--end'],\n )}\n >\n <button\n ref={narrowButtonRef}\n className={styles['SubNav__overlay-toggle-label']}\n data-testid={testIds.button}\n onClick={isOpenAtNarrow ? closeMenuCallback : handleMenuToggle}\n aria-expanded={isOpenAtNarrow ? 'true' : 'false'}\n aria-controls={idForLinkContainer}\n aria-label={activeLinklabel ? `Navigation menu. Current page: ${activeLinklabel}` : 'Navigation menu'}\n >\n {narrowButtonLabel && (\n <Text as=\"span\" size=\"100\">\n {narrowButtonLabel}\n </Text>\n )}\n {isOpenAtNarrow ? (\n <TriangleUpIcon className={styles['SubNav__overlay-toggle-icon']} size={13} />\n ) : (\n <TriangleDownIcon className={styles['SubNav__overlay-toggle-icon']} size={13} />\n )}\n </button>\n </span>\n </div>\n ),\n [activeLinklabel, closeMenuCallback, handleMenuToggle, idForLinkContainer, isOpenAtNarrow, narrowButtonLabel],\n )\n\n return (\n <div\n ref={rootRef}\n className={clsx(\n styles['SubNav__container'],\n SubHeadingChild && styles['SubNav--has-sub-heading'],\n SubHeadingChild && subHeadingIsActive && styles['SubNav--subHeadingActive'],\n hasAnchoredNav && styles['SubNav__container--with-anchor-nav'],\n )}\n >\n <SubNavProvider>\n <nav\n ref={navRef}\n id={id}\n className={clsx(\n styles.SubNav,\n isOpenAtNarrow && styles['SubNav--open'],\n hasShadow && styles['SubNav--has-shadow'],\n fullWidth && styles['SubNav--full-width'],\n className,\n )}\n data-testid={testId || testIds.root}\n >\n <div ref={innerRootRef} className={styles['SubNav--header-container-outer']}>\n <div className={styles['SubNav__header-container']}>\n {HeadingChild && <div className={styles['SubNav__heading-container']}>{HeadingChild}</div>}\n\n {SubHeadingChild && (\n <div\n className={clsx(\n styles['SubNav__heading-container'],\n styles['SubNav__subheading-container'],\n subHeadingIsActive && styles['SubNav__subheading-container-active'],\n )}\n >\n {SubHeadingChild}\n </div>\n )}\n\n {!isLarge && (!SubHeadingChild || subHeadingIsActive) && NarrowButton}\n\n {MaybeSubNav && MaybeSubNav}\n </div>\n {!isLarge && SubHeadingChild && !subHeadingIsActive && NarrowButton}\n {LinkChildren.length > 0 && (\n <ul\n ref={overlayRef}\n id={idForLinkContainer}\n className={clsx(\n styles['SubNav__links-overlay'],\n isOpenAtNarrow && styles['SubNav__links-overlay--open'],\n )}\n data-testid={testIds.overlay}\n >\n {LinkChildren}\n {ActionChild && <li className={styles['SubNav__action-container']}>{ActionChild}</li>}\n </ul>\n )}\n </div>\n </nav>\n </SubNavProvider>\n </div>\n )\n },\n ),\n)\n\ntype HeadingBaseProps = {\n href: string\n 'data-testid'?: string\n} & PropsWithChildren<React.HTMLProps<HTMLAnchorElement>> &\n BaseProps<HTMLAnchorElement>\n\nconst HeadingBase = ({href, children, className, 'data-testid': testID, ...props}: HeadingBaseProps) => {\n return (\n <a\n href={href}\n className={clsx(styles['SubNav__heading'], className)}\n data-testid={testIds.heading || testID}\n {...props}\n >\n {children}\n </a>\n )\n}\n\ntype SubHeadingBaseProps = {\n href: string\n 'data-testid'?: string\n} & PropsWithChildren<React.HTMLProps<HTMLAnchorElement>> &\n BaseProps<HTMLAnchorElement>\n\nconst SubHeadingBase = ({href, children, className, 'data-testid': testID, ...props}: SubHeadingBaseProps) => {\n return (\n <a\n href={href}\n className={clsx(styles['SubNav__heading'], styles['SubNav__link'], styles['SubNav__subHeading'], className)}\n data-testid={testIds.heading || testID}\n {...props}\n >\n {children}\n </a>\n )\n}\n\ntype LinkBaseProps = {\n href: string\n 'data-testid'?: string\n variant?: TextProps['variant']\n _subMenuVariant?: SubMenuVariants\n} & PropsWithChildren<React.HTMLProps<HTMLAnchorElement>> &\n BaseProps<HTMLAnchorElement>\n\nconst LinkBaseWithSubmenu = forwardRef<HTMLDivElement, LinkBaseProps>(\n (\n {children, href, 'aria-current': ariaCurrent, 'data-testid': testId, className, _subMenuVariant, variant, ...props},\n forwardedRef,\n ) => {\n const submenuId = useId()\n const {isLarge} = useWindowSize()\n\n const [isExpanded, setIsExpanded] = useState(false)\n const ref = useProvidedRefOrCreate(forwardedRef as RefObject<HTMLDivElement>)\n const subMenuChildrenRef = useRef<HTMLDivElement>(null)\n\n useContainsFocus(ref, (containsFocus: boolean) => {\n if (!containsFocus) {\n setIsExpanded(false)\n }\n })\n\n const expand = useCallback(() => setIsExpanded(true), [])\n const collapse = useCallback(() => setIsExpanded(false), [])\n const toggleExpanded = useCallback(() => setIsExpanded(prev => !prev), [])\n const isAriaCurrent = Boolean(ariaCurrent) && ariaCurrent !== 'false'\n\n useKeyboardEscape(collapse)\n\n useEffect(() => {\n if (subMenuChildrenRef.current) {\n // Workaround to avoid React 18 / 19 type mismatches with the `inert` attribute.\n // This approach won't immediately apply the attribute in pure SSR contexts, only post-hydration\n // TODO: Move back to JSX when React 19 is fully adopted in Dotcom.\n // `inert` removes the collapsed submenu from tab order and the accessibility tree\n // without affecting visual appearance\n subMenuChildrenRef.current.toggleAttribute('inert', isLarge && !isExpanded)\n }\n }, [isLarge, isExpanded])\n\n const [label, SubMenuChildren] = children as ReactNode[]\n\n return (\n <div\n className={clsx(\n styles['SubNav__link--has-sub-menu'],\n isExpanded && styles['SubNav__link--expanded'],\n isAriaCurrent && styles['SubNav__link--has-active-sub-menu'],\n )}\n data-testid={testId || testIds.subMenu}\n ref={ref}\n onMouseOver={expand}\n onMouseOut={collapse}\n /**\n * onFocus and onBlur need to be defined to keep the jsx-a11y/mouse-events-have-key-events\n * eslint rule happy. The focus/blur behaviour is handled by useContainsFocus\n */\n onFocus={() => null}\n onBlur={() => null}\n >\n <a\n href={href}\n className={clsx(styles['SubNav__link'], ariaCurrent && styles['SubNav__link--active'], className)}\n aria-current={ariaCurrent}\n {...props}\n >\n <Text as=\"span\" size=\"100\" weight=\"medium\" className={styles['SubNav__link-label']}>\n {label}\n </Text>\n </a>\n {isLarge && (\n <button\n className={styles['SubNav__sub-menu-toggle']}\n onClick={toggleExpanded}\n aria-expanded={isExpanded ? 'true' : 'false'}\n aria-controls={submenuId}\n aria-label={`${label?.toString().trim()} submenu`}\n >\n <TriangleDownIcon className={styles['SubNav__sub-menu-icon']} size={16} />\n </button>\n )}\n\n <div id={submenuId} className={styles['SubNav__sub-menu-children']} ref={subMenuChildrenRef}>\n {SubMenuChildren}\n </div>\n </div>\n )\n },\n)\n\nconst LinkBase = forwardRef<HTMLAnchorElement | HTMLDivElement, LinkBaseProps>((props, ref) => {\n const [isInView, setIsInView] = useState(false)\n const childrenArr = Children.toArray(props.children)\n\n const hasSubMenu = childrenArr.some(child => {\n if (isValidElement(child)) {\n return child.type === SubMenuBase\n }\n })\n\n useEffect(() => {\n if (hasSubMenu) return\n const targetId = props.href.replace('#', '')\n const target = document.getElementById(targetId)\n if (!target) return\n\n const topOfWindow = '0px 0px -100%'\n const observerParams = {threshold: 0, root: null, rootMargin: topOfWindow}\n\n const handleIntersectionUpdate: IntersectionObserverCallback = ([entry]) => {\n setIsInView(entry.isIntersecting)\n }\n\n const observer = new IntersectionObserver(handleIntersectionUpdate, observerParams)\n observer.observe(target)\n return () => observer.disconnect()\n }, [hasSubMenu, props.href])\n\n if (hasSubMenu) {\n const isAnchorVariantSubMenu = childrenArr.some(child => {\n return isValidElement<SubMenuProps>(child) && child.type === SubMenuBase && child.props.variant === 'anchor'\n })\n\n return (\n <li>\n <LinkBaseWithSubmenu\n ref={ref as RefObject<HTMLDivElement>}\n {...props}\n _subMenuVariant={isAnchorVariantSubMenu ? 'anchor' : undefined}\n />\n </li>\n )\n }\n\n const {children, href, 'aria-current': ariaCurrent, 'data-testid': testId, variant, className, ...rest} = props\n\n return (\n <li>\n <a\n href={href}\n className={clsx(\n styles['SubNav__link'],\n ariaCurrent && styles['SubNav__link--active'],\n isInView && styles['SubNav__link--is-in-view'],\n className,\n )}\n aria-current={ariaCurrent}\n data-testid={testId || testIds.link}\n ref={ref as RefObject<HTMLAnchorElement>}\n {...rest}\n >\n <Text as=\"span\" size=\"100\" weight=\"medium\" className={styles['SubNav__link-label']}>\n {children}\n </Text>\n </a>\n </li>\n )\n})\n\ntype SubMenuProps = {\n variant?: SubMenuVariants\n} & React.HTMLAttributes<HTMLUListElement> &\n BaseProps<HTMLUListElement>\n\nfunction SubMenuBase({children, className, variant = 'dropdown', ...props}: SubMenuProps) {\n const context = React.useContext(SubNavContext)\n const navRef = useRef<HTMLElement>(null)\n\n const {isLarge} = useWindowSize()\n\n /**\n * Effect is needed to prevent the bubbling of onClick events to the overlay trigger.\n * Removing this effect will cause clicks on the anchor nav element to toggle the overlay.\n */\n useEffect(() => {\n const handleClick = (e: MouseEvent) => {\n if (navRef.current && !navRef.current.contains(e.target as Node)) {\n return\n }\n\n if (!(e.target instanceof HTMLAnchorElement)) {\n e.stopPropagation()\n }\n }\n\n if (variant === 'anchor') {\n document.addEventListener('click', handleClick, true) // Capture phase\n }\n\n return () => {\n document.removeEventListener('click', handleClick, true)\n }\n }, [variant])\n\n if (variant === 'anchor' && context?.portalRef.current) {\n return createPortal(\n <nav\n ref={navRef}\n className={clsx(styles['SubNav__sub-menu'], styles['SubNav__sub-menu--anchor'], className)}\n role=\"navigation\"\n aria-label=\"Sub navigation\"\n >\n <ul className={styles['SubNav__sub-menu-list']} {...props}>\n {React.Children.map(children, child => {\n if (isValidElement<LinkBaseProps>(child) && child.type === LinkBase) {\n return React.cloneElement(child, {\n onClick: e => {\n child.props.onClick?.(e)\n },\n })\n }\n return null\n })}\n </ul>\n </nav>,\n context.portalRef.current,\n )\n } else {\n const Tag = isLarge ? ThemeProvider : React.Fragment\n\n return (\n <Tag {...(isLarge ? {colorMode: 'light'} : {})}>\n <ul className={clsx(styles['SubNav__sub-menu'], styles[`SubNav__sub-menu--${variant}`], className)} {...props}>\n {children}\n </ul>\n </Tag>\n )\n }\n}\n\ntype SubNavActionProps = {\n /**\n * Required path or location for the action button to link to.\n */\n href: string\n /**\n * Optional sizes for the button.\n */\n size?: (typeof ButtonSizes)[number]\n /**\n * Optional sizes for the button.\n */\n variant?: (typeof ButtonVariants)[number]\n} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>\n\nfunction ActionBase({children, href, variant = 'primary', size = 'small', ...rest}: SubNavActionProps) {\n return (\n <Button\n className={styles['SubNav__action']}\n as=\"a\"\n href={href}\n variant={variant}\n data-testid={testIds.action}\n size={size}\n {...rest}\n >\n {children}\n </Button>\n )\n}\n\n/**\n * Use SubNav to display a secondary navigation beneath a primary header.\n * @see https://primer.style/brand/components/SubNav\n */\nexport const SubNav = Object.assign(SubNavRoot, {\n Heading: HeadingBase,\n SubHeading: SubHeadingBase,\n Link: LinkBase,\n Action: ActionBase,\n SubMenu: SubMenuBase,\n testIds,\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuCA,IAAM,IAAU;CACd,MAAM;CACN,IAAI,SAAS;EACX,OAAO,GAAG,KAAK,KAAK;CACtB;CACA,IAAI,UAAU;EACZ,OAAO,GAAG,KAAK,KAAK;CACtB;CACA,IAAI,OAAO;EACT,OAAO,GA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,MAAK;EACL,cAAW;YAEX,kBAAC,MAAD;GAAI,WAAW,EAAO;GAA0B,GAAI;aACjD,EAAM,SAAS,IAAI,IAAU,MACxB,EAA8B,CAAK,KAAK,EAAM,SAAS,IAClD,EAAM,aAAa,GAAO,EAC/B,UAAS,MAAK;IACZ,EAAM,MAAM,UAAU,CAAC;GACzB,EACF,CAAC,IAEI,IACR;EACC,CAAA;CACD,CAAA,GACL,EAAQ,UAAU,OACpB,IAKE,kBAHU,IAAU,IAAgB,EAAM,UAG1C;EAAK,GAAK,IAAU,EAAC,WAAW,QAAO,IAAI,CAAC;YAC1C,kBAAC,MAAD;GAAI,WAAW,EAAK,EAAO,qBAAqB,EAAO,qBAAqB,MAAY,CAAS;GAAG,GAAI;GACrG;EACC,CAAA;CACD,CAAA;AAGX;AAiBA,SAAS,EAAW,EAAC,aAAU,SAAM,aAAU,WAAW,UAAO,SAAS,GAAG,KAA0B;CACrG,OACE,kBAAC,GAAD;EACE,WAAW,EAAO;EAClB,IAAG;EACG;EACG;EACT,eAAa,EAAQ;EACf;EACN,GAAI;EAEH;CACK,CAAA;AAEZ;AAMA,IAAa,IAAS,OAAO,OAAO,GAAY;CAC9C,SAAS;CACT,YAAY;CACZ,MAAM;CACN,QAAQ;CACR,SAAS;CACT;AACF,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import './SubNav.module-D-gLr0JO.css'
|
|
2
|
-
|
|
1
|
+
import './SubNav.module-D-gLr0JO.css';//#region src/SubNav/SubNav.module.css
|
|
2
|
+
var e = "Primer_Brand__SubNav-module__SubNav__container___e4u9B", t = "Primer_Brand__SubNav-module__SubNav___txUks", n = "Primer_Brand__SubNav-module__SubNav__heading___d8v1r", r = "Primer_Brand__SubNav-module__SubNav__subHeading___cmfhs", i = "Primer_Brand__SubNav-module__SubNav__link___rY_yE", a = "Primer_Brand__SubNav-module__SubNav__action___Yrrhg", o = {
|
|
3
|
+
SubNav__container: e,
|
|
3
4
|
"SubNav__container--with-anchor-nav": "Primer_Brand__SubNav-module__SubNav__container--with-anchor-nav___jf8vj",
|
|
4
|
-
SubNav:
|
|
5
|
-
SubNav__heading:
|
|
6
|
-
SubNav__subHeading:
|
|
7
|
-
SubNav__link:
|
|
5
|
+
SubNav: t,
|
|
6
|
+
SubNav__heading: n,
|
|
7
|
+
SubNav__subHeading: r,
|
|
8
|
+
SubNav__link: i,
|
|
8
9
|
"SubNav__link-label": "Primer_Brand__SubNav-module__SubNav__link-label___NVLOG",
|
|
9
10
|
"SubNav--header-container-outer": "Primer_Brand__SubNav-module__SubNav--header-container-outer___TODOB",
|
|
10
11
|
"SubNav__heading-container": "Primer_Brand__SubNav-module__SubNav__heading-container___09GuE",
|
|
@@ -36,7 +37,7 @@ import './SubNav.module-D-gLr0JO.css';var e = {
|
|
|
36
37
|
"SubNav__overlay-toggle-content": "Primer_Brand__SubNav-module__SubNav__overlay-toggle-content___r7g9W",
|
|
37
38
|
"SubNav__overlay-toggle-label": "Primer_Brand__SubNav-module__SubNav__overlay-toggle-label___FRenU",
|
|
38
39
|
"SubNav__link--has-sub-menu": "Primer_Brand__SubNav-module__SubNav__link--has-sub-menu___Sy_3p",
|
|
39
|
-
SubNav__action:
|
|
40
|
+
SubNav__action: a,
|
|
40
41
|
"SubNav__sub-menu": "Primer_Brand__SubNav-module__SubNav__sub-menu___b8DSd",
|
|
41
42
|
"SubNav__sub-menu--dropdown": "Primer_Brand__SubNav-module__SubNav__sub-menu--dropdown___uiVDU",
|
|
42
43
|
"SubNav__overlay-toggle-icon": "Primer_Brand__SubNav-module__SubNav__overlay-toggle-icon___Fo5xs",
|
|
@@ -47,6 +48,6 @@ import './SubNav.module-D-gLr0JO.css';var e = {
|
|
|
47
48
|
"fade-in-down": "Primer_Brand__SubNav-module__fade-in-down___UKi30"
|
|
48
49
|
};
|
|
49
50
|
//#endregion
|
|
50
|
-
export { e as default };
|
|
51
|
+
export { t as SubNav, a as SubNav__action, e as SubNav__container, n as SubNav__heading, i as SubNav__link, r as SubNav__subHeading, o as default };
|
|
51
52
|
|
|
52
53
|
//# sourceMappingURL=SubNav.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useContainsFocus.js","names":[],"sources":["../../src/SubNav/useContainsFocus.ts"],"sourcesContent":["import {useCallback, useEffect, useState, type RefObject} from 'react'\n\n/**\n * Determine if a child element of the provided ref is currently focussed.\n * @param containerRef The ref to the container element.\n * @param onFocusChange The callback to be called when the focus state changes.\n * @type T The type of the container element.\n * @returns The ref to be applied to the container element.\n */\nexport const useContainsFocus = <T extends HTMLElement>(\n containerRef?: RefObject<T | null>,\n onFocusChange?: (isFocussed: boolean) => void,\n) => {\n const [isChildFocused, setIsChildFocused] = useState(false)\n\n const updateState = useCallback(\n (isFocused: boolean) => {\n if (isFocused !== isChildFocused) {\n setIsChildFocused(isFocused)\n onFocusChange?.(isFocused)\n }\n },\n [isChildFocused, onFocusChange],\n )\n\n useEffect(() => {\n if (!containerRef) {\n return\n }\n\n const handleFocusIn = () => {\n updateState(true)\n }\n\n const handleFocusOut = (event: FocusEvent) => {\n if (containerRef.current && !containerRef.current.contains(event.relatedTarget as Node)) {\n updateState(false)\n }\n }\n\n const container = containerRef.current\n\n if (container) {\n container.addEventListener('focusin', handleFocusIn, true)\n container.addEventListener('focusout', handleFocusOut, true)\n\n return () => {\n container.removeEventListener('focusin', handleFocusIn, true)\n container.removeEventListener('focusout', handleFocusOut, true)\n }\n }\n }, [updateState, containerRef])\n}\n"],"mappings":";;AASA,IAAa,KACX,GACA,MACG;CACH,IAAM,CAAC,GAAgB,KAAqB,EAAS,
|
|
1
|
+
{"version":3,"file":"useContainsFocus.js","names":[],"sources":["../../src/SubNav/useContainsFocus.ts"],"sourcesContent":["import {useCallback, useEffect, useState, type RefObject} from 'react'\n\n/**\n * Determine if a child element of the provided ref is currently focussed.\n * @param containerRef The ref to the container element.\n * @param onFocusChange The callback to be called when the focus state changes.\n * @type T The type of the container element.\n * @returns The ref to be applied to the container element.\n */\nexport const useContainsFocus = <T extends HTMLElement>(\n containerRef?: RefObject<T | null>,\n onFocusChange?: (isFocussed: boolean) => void,\n) => {\n const [isChildFocused, setIsChildFocused] = useState(false)\n\n const updateState = useCallback(\n (isFocused: boolean) => {\n if (isFocused !== isChildFocused) {\n setIsChildFocused(isFocused)\n onFocusChange?.(isFocused)\n }\n },\n [isChildFocused, onFocusChange],\n )\n\n useEffect(() => {\n if (!containerRef) {\n return\n }\n\n const handleFocusIn = () => {\n updateState(true)\n }\n\n const handleFocusOut = (event: FocusEvent) => {\n if (containerRef.current && !containerRef.current.contains(event.relatedTarget as Node)) {\n updateState(false)\n }\n }\n\n const container = containerRef.current\n\n if (container) {\n container.addEventListener('focusin', handleFocusIn, true)\n container.addEventListener('focusout', handleFocusOut, true)\n\n return () => {\n container.removeEventListener('focusin', handleFocusIn, true)\n container.removeEventListener('focusout', handleFocusOut, true)\n }\n }\n }, [updateState, containerRef])\n}\n"],"mappings":";;AASA,IAAa,KACX,GACA,MACG;CACH,IAAM,CAAC,GAAgB,KAAqB,EAAS,EAAK,GAEpD,IAAc,GACjB,MAAuB;EACtB,AAAI,MAAc,MAChB,EAAkB,CAAS,GAC3B,IAAgB,CAAS;CAE7B,GACA,CAAC,GAAgB,CAAa,CAChC;CAEA,QAAgB;EACd,IAAI,CAAC,GACH;EAGF,IAAM,UAAsB;GAC1B,EAAY,EAAI;EAClB,GAEM,KAAkB,MAAsB;GAC5C,AAAI,EAAa,WAAW,CAAC,EAAa,QAAQ,SAAS,EAAM,aAAqB,KACpF,EAAY,EAAK;EAErB,GAEM,IAAY,EAAa;EAE/B,IAAI,GAIF,OAHA,EAAU,iBAAiB,WAAW,GAAe,EAAI,GACzD,EAAU,iBAAiB,YAAY,GAAgB,EAAI,SAE9C;GAEX,AADA,EAAU,oBAAoB,WAAW,GAAe,EAAI,GAC5D,EAAU,oBAAoB,YAAY,GAAgB,EAAI;EAChE;CAEJ,GAAG,CAAC,GAAa,CAAY,CAAC;AAChC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { BaseProps } from '../component-helpers';
|
|
3
|
-
type NavigationVisibilityObserverProps = PropsWithChildren<BaseProps<HTMLUListElement> & React.HTMLAttributes<HTMLUListElement
|
|
3
|
+
type NavigationVisibilityObserverProps = PropsWithChildren<BaseProps<HTMLUListElement> & React.HTMLAttributes<HTMLUListElement> & {
|
|
4
|
+
overflowMenuLabel: string;
|
|
5
|
+
}>;
|
|
4
6
|
export declare const NavigationVisbilityObserver: React.ForwardRefExoticComponent<Omit<NavigationVisibilityObserverProps, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
5
7
|
export {};
|
|
6
8
|
//# sourceMappingURL=NavigationVisbilityObserver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationVisbilityObserver.d.ts","sourceRoot":"","sources":["../../src/SubdomainNavBar/NavigationVisbilityObserver.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"NavigationVisbilityObserver.d.ts","sourceRoot":"","sources":["../../src/SubdomainNavBar/NavigationVisbilityObserver.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAuD,iBAAiB,EAAC,MAAM,OAAO,CAAA;AAIpG,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAA;AAa9C,KAAK,iCAAiC,GAAG,iBAAiB,CACxD,SAAS,CAAC,gBAAgB,CAAC,GACzB,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,GAAG;IACvC,iBAAiB,EAAE,MAAM,CAAA;CAC1B,CACJ,CAAA;AAED,eAAO,MAAM,2BAA2B,yHAmIvC,CAAA"}
|
|
@@ -1,73 +1,126 @@
|
|
|
1
|
-
import e from "../node_modules/clsx/dist/clsx.js";
|
|
1
|
+
import { clsx as e } from "../node_modules/clsx/dist/clsx.js";
|
|
2
2
|
import { useProvidedRefOrCreate as t } from "../hooks/useRef.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import s from "
|
|
9
|
-
import
|
|
10
|
-
import
|
|
3
|
+
import { useAnchoredPosition as n } from "../hooks/useAnchoredPosition.js";
|
|
4
|
+
import { useOnClickOutside as r } from "../hooks/useOnClickOutside.js";
|
|
5
|
+
import { useKeyboardEscape as i } from "../hooks/useKeyboardEscape.js";
|
|
6
|
+
import { TriangleDownIcon as a } from "../node_modules/@primer/octicons-react/dist/icons/TriangleDownIcon.js";
|
|
7
|
+
import { TriangleUpIcon as o } from "../node_modules/@primer/octicons-react/dist/icons/TriangleUpIcon.js";
|
|
8
|
+
import { useWindowSize as s } from "../hooks/useWindowSize.js";
|
|
9
|
+
import { useVisibilityObserver as c } from "./useVisibilityObserver.js";
|
|
10
|
+
import l from "./SubdomainNavBar.module.js";
|
|
11
|
+
import { SubdomainNavBarLinkContext as u } from "./SubdomainNavBarLinkContext.js";
|
|
12
|
+
import d, { forwardRef as f, useCallback as p, useEffect as m, useRef as h, useState as g } from "react";
|
|
13
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
11
14
|
//#region src/SubdomainNavBar/NavigationVisbilityObserver.tsx
|
|
12
|
-
var
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return c.cloneElement(t, { className: e(t.props.className, f && r && s["SubdomainNavBar-primary-nav-list-item--visible"], f && r === !1 && s["SubdomainNavBar-primary-nav-list-item--invisible"]) });
|
|
24
|
-
}
|
|
25
|
-
return t;
|
|
26
|
-
}), h && /* @__PURE__ */ p(g, {
|
|
27
|
-
visibilityMap: d,
|
|
28
|
-
children: n
|
|
29
|
-
})]
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
function g({ children: t, className: a, visibilityMap: o }) {
|
|
33
|
-
let [l, h] = f(null), g = d(null);
|
|
34
|
-
n(g, () => y());
|
|
35
|
-
let _ = !!l, v = (e) => {
|
|
36
|
-
l ? y() : h(e.currentTarget);
|
|
37
|
-
}, y = u(() => {
|
|
38
|
-
h(null);
|
|
39
|
-
}, []);
|
|
40
|
-
return r(y), /* @__PURE__ */ m("li", {
|
|
41
|
-
className: e(s["SubdomainNavBar-primary-nav-list-item--overflow"], a),
|
|
42
|
-
ref: g,
|
|
43
|
-
children: [/* @__PURE__ */ m("button", {
|
|
44
|
-
"aria-expanded": _ ? "true" : "false",
|
|
45
|
-
"aria-controls": "more-navigation",
|
|
46
|
-
"aria-haspopup": "true",
|
|
47
|
-
onClick: v,
|
|
48
|
-
className: e(s["SubdomainNavBar-link"], s["SubdomainNavBar-more-link"]),
|
|
49
|
-
children: ["More", /* @__PURE__ */ p(i, {})]
|
|
50
|
-
}), /* @__PURE__ */ p("div", {
|
|
51
|
-
id: "more-navigation",
|
|
52
|
-
style: { display: _ ? "block" : "none" },
|
|
53
|
-
className: e(s["SubdomainNavBar-overflow-menu"]),
|
|
54
|
-
children: /* @__PURE__ */ p("ul", {
|
|
55
|
-
className: e(s["SubdomainNavBar-overflow-menu-list"]),
|
|
56
|
-
children: c.Children.map(t, (t) => {
|
|
57
|
-
if (c.isValidElement(t)) {
|
|
58
|
-
let n = t.props["data-navitemid"];
|
|
59
|
-
return !n || o[n] ? null : /* @__PURE__ */ p(c.Fragment, { children: c.cloneElement(t, {
|
|
60
|
-
onClick: y,
|
|
61
|
-
className: e(s["SubdomainNavBar-overflow-menu-item"], t.props.className)
|
|
62
|
-
}) });
|
|
15
|
+
var y = f(({ children: a, className: o, overflowMenuLabel: f, ...y }, S) => {
|
|
16
|
+
let C = t(S), w = h(null), T = h(null), E = h(null), { isMedium: D } = s(), [O] = c(C, w, d.Children.toArray(a).map((e, t) => d.isValidElement(e) ? `${t}:${typeof e.props.children == "string" ? e.props.children : ""}` : `${t}:`).join("|"), !D), [k, A] = g(!1), j = Object.values(O).includes(!1), M = d.useId(), N = d.Children.toArray(a).findIndex((e, t) => d.isValidElement(e) ? O[t] === !1 : !1), P = N === -1 ? d.Children.count(a) * 2 : N * 2 - 1, F = d.Children.map(a, (t, n) => {
|
|
17
|
+
if (d.isValidElement(t)) {
|
|
18
|
+
let r = D && O[n] === !1;
|
|
19
|
+
return /* @__PURE__ */ _(u.Provider, {
|
|
20
|
+
value: { isOverflowed: r },
|
|
21
|
+
children: d.cloneElement(t, {
|
|
22
|
+
className: e(t.props.className, r && l["SubdomainNavBar-primary-nav-list-item--overflowed"]),
|
|
23
|
+
style: {
|
|
24
|
+
...t.props.style,
|
|
25
|
+
order: n * 2
|
|
63
26
|
}
|
|
64
|
-
return null;
|
|
65
27
|
})
|
|
66
|
-
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return t;
|
|
31
|
+
}), I = p(() => {
|
|
32
|
+
A(!1);
|
|
33
|
+
}, []), L = () => {
|
|
34
|
+
A((e) => !e);
|
|
35
|
+
}, R = p(() => {
|
|
36
|
+
k && (I(), T.current?.focus());
|
|
37
|
+
}, [I, k]);
|
|
38
|
+
m(() => {
|
|
39
|
+
j || I();
|
|
40
|
+
}, [I, j]), r(w, I, E), i(R);
|
|
41
|
+
let { position: z } = n({
|
|
42
|
+
floatingElementRef: E,
|
|
43
|
+
anchorElementRef: T,
|
|
44
|
+
align: "end",
|
|
45
|
+
side: "outside-bottom"
|
|
46
|
+
}, [
|
|
47
|
+
k,
|
|
48
|
+
j,
|
|
49
|
+
P,
|
|
50
|
+
O
|
|
51
|
+
]);
|
|
52
|
+
return D ? /* @__PURE__ */ v("div", {
|
|
53
|
+
className: e(l["SubdomainNavBar-primary-nav-overflow"], j && l["SubdomainNavBar-primary-nav-overflow--has-overflow"], o),
|
|
54
|
+
children: [/* @__PURE__ */ v("ul", {
|
|
55
|
+
className: l["SubdomainNavBar-primary-nav-list"],
|
|
56
|
+
ref: C,
|
|
57
|
+
...y,
|
|
58
|
+
children: [F, /* @__PURE__ */ _(b, {
|
|
59
|
+
ariaControls: M,
|
|
60
|
+
buttonRef: T,
|
|
61
|
+
menuOpen: k,
|
|
62
|
+
onClick: L,
|
|
63
|
+
order: P,
|
|
64
|
+
overflowMenuLabel: f,
|
|
65
|
+
ref: w,
|
|
66
|
+
visible: j
|
|
67
|
+
})]
|
|
68
|
+
}), /* @__PURE__ */ _(x, {
|
|
69
|
+
id: M,
|
|
70
|
+
menuOpen: k,
|
|
71
|
+
onClose: I,
|
|
72
|
+
position: z,
|
|
73
|
+
ref: E,
|
|
74
|
+
visibilityMap: O,
|
|
75
|
+
children: a
|
|
67
76
|
})]
|
|
77
|
+
}) : /* @__PURE__ */ _("ul", {
|
|
78
|
+
className: e(l["SubdomainNavBar-primary-nav-list"], o),
|
|
79
|
+
ref: C,
|
|
80
|
+
...y,
|
|
81
|
+
children: a
|
|
82
|
+
});
|
|
83
|
+
}), b = f(({ ariaControls: n, buttonRef: r, className: i, menuOpen: s, onClick: c, order: u, overflowMenuLabel: d, visible: f }, p) => {
|
|
84
|
+
let m = t(p);
|
|
85
|
+
return /* @__PURE__ */ _("li", {
|
|
86
|
+
"aria-hidden": !f || void 0,
|
|
87
|
+
className: e(l["SubdomainNavBar-primary-nav-list-item--overflow"], i),
|
|
88
|
+
ref: m,
|
|
89
|
+
style: { order: u },
|
|
90
|
+
children: /* @__PURE__ */ _("button", {
|
|
91
|
+
"aria-expanded": s ? "true" : "false",
|
|
92
|
+
"aria-controls": n,
|
|
93
|
+
onClick: c,
|
|
94
|
+
className: e(l["SubdomainNavBar-link"], l["SubdomainNavBar-more-link"]),
|
|
95
|
+
ref: r,
|
|
96
|
+
tabIndex: f ? void 0 : -1,
|
|
97
|
+
children: /* @__PURE__ */ v("span", {
|
|
98
|
+
className: l["SubdomainNavBar-link-content"],
|
|
99
|
+
children: [d, _(s ? o : a, {})]
|
|
100
|
+
})
|
|
101
|
+
})
|
|
68
102
|
});
|
|
69
|
-
}
|
|
103
|
+
}), x = f(({ children: t, className: n, id: r, menuOpen: i, onClose: a, position: o, visibilityMap: s }, c) => i ? /* @__PURE__ */ _("div", {
|
|
104
|
+
id: r,
|
|
105
|
+
ref: c,
|
|
106
|
+
style: {
|
|
107
|
+
top: `${o?.top ?? 0}px`,
|
|
108
|
+
left: `${o?.left ?? 0}px`,
|
|
109
|
+
visibility: o ? void 0 : "hidden"
|
|
110
|
+
},
|
|
111
|
+
className: e(l["SubdomainNavBar-overflow-menu"], n),
|
|
112
|
+
children: /* @__PURE__ */ _("ul", {
|
|
113
|
+
className: e(l["SubdomainNavBar-overflow-menu-list"]),
|
|
114
|
+
children: d.Children.map(t, (t, n) => d.isValidElement(t) && s[n] === !1 ? /* @__PURE__ */ _(u.Provider, {
|
|
115
|
+
value: {
|
|
116
|
+
isOverflowed: !1,
|
|
117
|
+
onLinkClick: a
|
|
118
|
+
},
|
|
119
|
+
children: d.cloneElement(t, { className: e(l["SubdomainNavBar-overflow-menu-item"], t.props.className) })
|
|
120
|
+
}) : null)
|
|
121
|
+
})
|
|
122
|
+
}) : null);
|
|
70
123
|
//#endregion
|
|
71
|
-
export {
|
|
124
|
+
export { y as NavigationVisbilityObserver };
|
|
72
125
|
|
|
73
126
|
//# sourceMappingURL=NavigationVisbilityObserver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationVisbilityObserver.js","names":[],"sources":["../../src/SubdomainNavBar/NavigationVisbilityObserver.tsx"],"sourcesContent":["import React, {forwardRef, useCallback, useRef, useState, PropsWithChildren} from 'react'\nimport {clsx} from 'clsx'\nimport {ChevronDownIcon} from '@primer/octicons-react'\n\nimport {BaseProps} from '../component-helpers'\nimport {useVisibilityObserver} from './useVisibilityObserver'\nimport {useOnClickOutside} from '../hooks/useOnClickOutside'\nimport type {VisibilityMap} from './useVisibilityObserver'\nimport type {SubdomainNavBarLinkProps} from './SubdomainNavBar'\n\nimport styles from './SubdomainNavBar.module.css'\nimport {useKeyboardEscape} from '../hooks/useKeyboardEscape'\nimport {useWindowSize} from '../hooks/useWindowSize'\nimport {useProvidedRefOrCreate} from '../hooks/useRef'\n\ntype NavigationVisibilityObserverProps = PropsWithChildren<\n BaseProps<HTMLUListElement> & React.HTMLAttributes<HTMLUListElement>\n>\n\nexport const NavigationVisbilityObserver = forwardRef<HTMLUListElement, NavigationVisibilityObserverProps>(\n ({children, className, ...rest}, forwardedRef) => {\n const navRef = useProvidedRefOrCreate<HTMLUListElement>(\n forwardedRef as React.RefObject<HTMLUListElement> | React.RefCallback<HTMLUListElement> | null,\n )\n const [visibilityMap] = useVisibilityObserver(navRef, children)\n const {isMedium} = useWindowSize()\n\n const showOverflow = Object.values(visibilityMap).includes(false)\n\n return (\n <ul className={clsx(styles['SubdomainNavBar-primary-nav-list'], className)} ref={navRef} {...rest}>\n {React.Children.map(children, child => {\n if (React.isValidElement<SubdomainNavBarLinkProps>(child)) {\n const visibilityKey = child.props['data-navitemid']\n if (!visibilityKey) {\n return child\n }\n const isVisible = visibilityMap[visibilityKey]\n return React.cloneElement(child, {\n className: clsx(\n child.props.className,\n isMedium && isVisible && styles['SubdomainNavBar-primary-nav-list-item--visible'],\n isMedium && isVisible === false && styles['SubdomainNavBar-primary-nav-list-item--invisible'],\n ),\n })\n }\n return child\n })}\n\n {showOverflow && <AnchoredOverlay visibilityMap={visibilityMap}>{children}</AnchoredOverlay>}\n </ul>\n )\n },\n)\n\ntype AnchoredOverlayProps = {\n visibilityMap: VisibilityMap\n} & BaseProps<HTMLDivElement>\n\nfunction AnchoredOverlay({children, className, visibilityMap}: React.PropsWithChildren<AnchoredOverlayProps>) {\n const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null)\n const ref = useRef<HTMLLIElement | null>(null)\n\n useOnClickOutside(ref, () => handleClose())\n\n const open = Boolean(anchorEl)\n\n const handleClick = event => {\n if (anchorEl) {\n handleClose()\n } else {\n setAnchorEl(event.currentTarget)\n }\n }\n\n const handleClose = useCallback(() => {\n setAnchorEl(null)\n }, [])\n\n useKeyboardEscape(handleClose)\n\n return (\n <li className={clsx(styles['SubdomainNavBar-primary-nav-list-item--overflow'], className)} ref={ref}>\n <button\n aria-expanded={open ? 'true' : 'false'}\n aria-controls=\"more-navigation\"\n aria-haspopup=\"true\"\n onClick={handleClick}\n className={clsx(styles['SubdomainNavBar-link'], styles['SubdomainNavBar-more-link'])}\n >\n More\n <ChevronDownIcon />\n </button>\n\n <div\n id=\"more-navigation\"\n style={{display: open ? 'block' : 'none'}}\n className={clsx(styles['SubdomainNavBar-overflow-menu'])}\n >\n <ul className={clsx(styles['SubdomainNavBar-overflow-menu-list'])}>\n {React.Children.map(children, child => {\n if (React.isValidElement<SubdomainNavBarLinkProps>(child)) {\n const navItemChild = child.props['data-navitemid']\n if (!navItemChild || visibilityMap[navItemChild]) {\n return null\n }\n\n return (\n <React.Fragment>\n {React.cloneElement(child, {\n onClick: handleClose,\n className: clsx(styles['SubdomainNavBar-overflow-menu-item'], child.props.className),\n })}\n </React.Fragment>\n )\n }\n return null\n })}\n </ul>\n </div>\n </li>\n )\n}\n"],"mappings":";;;;;;;;;;;AAmBA,IAAa,IAA8B,GACxC,EAAC,aAAU,cAAW,GAAG,KAAO,MAAiB;CAChD,IAAM,IAAS,EACb,EACD,EACK,CAAC,KAAiB,EAAsB,GAAQ,EAAS,EACzD,EAAC,gBAAY,GAAe,EAE5B,IAAe,OAAO,OAAO,EAAc,CAAC,SAAS,GAAM;AAEjE,QACE,kBAAC,MAAD;EAAI,WAAW,EAAK,EAAO,qCAAqC,EAAU;EAAE,KAAK;EAAQ,GAAI;YAA7F,CACG,EAAM,SAAS,IAAI,IAAU,MAAS;AACrC,OAAI,EAAM,eAAyC,EAAM,EAAE;IACzD,IAAM,IAAgB,EAAM,MAAM;AAClC,QAAI,CAAC,EACH,QAAO;IAET,IAAM,IAAY,EAAc;AAChC,WAAO,EAAM,aAAa,GAAO,EAC/B,WAAW,EACT,EAAM,MAAM,WACZ,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"NavigationVisbilityObserver.js","names":[],"sources":["../../src/SubdomainNavBar/NavigationVisbilityObserver.tsx"],"sourcesContent":["import React, {forwardRef, useCallback, useEffect, useRef, useState, PropsWithChildren} from 'react'\nimport {clsx} from 'clsx'\nimport {TriangleDownIcon, TriangleUpIcon} from '@primer/octicons-react'\n\nimport {BaseProps} from '../component-helpers'\nimport {useVisibilityObserver} from './useVisibilityObserver'\nimport {useOnClickOutside} from '../hooks/useOnClickOutside'\nimport type {VisibilityMap} from './useVisibilityObserver'\nimport type {SubdomainNavBarLinkProps} from './SubdomainNavBar'\n\nimport styles from './SubdomainNavBar.module.css'\nimport {useAnchoredPosition} from '../hooks/useAnchoredPosition'\nimport {useKeyboardEscape} from '../hooks/useKeyboardEscape'\nimport {useWindowSize} from '../hooks/useWindowSize'\nimport {useProvidedRefOrCreate} from '../hooks/useRef'\nimport {SubdomainNavBarLinkContext} from './SubdomainNavBarLinkContext'\n\ntype NavigationVisibilityObserverProps = PropsWithChildren<\n BaseProps<HTMLUListElement> &\n React.HTMLAttributes<HTMLUListElement> & {\n overflowMenuLabel: string\n }\n>\n\nexport const NavigationVisbilityObserver = forwardRef<HTMLUListElement, NavigationVisibilityObserverProps>(\n ({children, className, overflowMenuLabel, ...rest}, forwardedRef) => {\n const navRef = useProvidedRefOrCreate<HTMLUListElement>(\n forwardedRef as React.RefObject<HTMLUListElement> | React.RefCallback<HTMLUListElement> | null,\n )\n const overflowRef = useRef<HTMLLIElement | null>(null)\n const overflowButtonRef = useRef<HTMLButtonElement | null>(null)\n const overflowMenuRef = useRef<HTMLDivElement | null>(null)\n const {isMedium} = useWindowSize()\n const measurementKey = React.Children.toArray(children)\n .map((child, index) => {\n if (React.isValidElement<SubdomainNavBarLinkProps>(child)) {\n return `${index}:${typeof child.props.children === 'string' ? child.props.children : ''}`\n }\n\n return `${index}:`\n })\n .join('|')\n const [visibilityMap] = useVisibilityObserver(navRef, overflowRef, measurementKey, !isMedium)\n const [menuOpen, setMenuOpen] = useState(false)\n\n const showOverflow = Object.values(visibilityMap).includes(false)\n const overflowMenuId = React.useId()\n const firstOverflowedItemIndex = React.Children.toArray(children).findIndex((child, index) => {\n if (React.isValidElement<SubdomainNavBarLinkProps>(child)) {\n return visibilityMap[index] === false\n }\n\n return false\n })\n const overflowOrder =\n firstOverflowedItemIndex === -1 ? React.Children.count(children) * 2 : firstOverflowedItemIndex * 2 - 1\n\n const navItems = React.Children.map(children, (child, index) => {\n if (React.isValidElement<SubdomainNavBarLinkProps>(child)) {\n const isOverflowed = isMedium && visibilityMap[index] === false\n return (\n <SubdomainNavBarLinkContext.Provider value={{isOverflowed}}>\n {React.cloneElement(child, {\n className: clsx(\n child.props.className,\n isOverflowed && styles['SubdomainNavBar-primary-nav-list-item--overflowed'],\n ),\n style: {\n ...child.props.style,\n order: index * 2,\n },\n })}\n </SubdomainNavBarLinkContext.Provider>\n )\n }\n\n return child\n })\n\n const handleClose = useCallback(() => {\n setMenuOpen(false)\n }, [])\n\n const handleOverflowButtonClick = () => {\n setMenuOpen(prevMenuOpen => !prevMenuOpen)\n }\n\n const handleEscape = useCallback(() => {\n if (menuOpen) {\n handleClose()\n overflowButtonRef.current?.focus()\n }\n }, [handleClose, menuOpen])\n\n useEffect(() => {\n if (!showOverflow) {\n handleClose()\n }\n }, [handleClose, showOverflow])\n\n useOnClickOutside(overflowRef, handleClose, overflowMenuRef)\n useKeyboardEscape(handleEscape)\n\n const {position} = useAnchoredPosition(\n {\n floatingElementRef: overflowMenuRef,\n anchorElementRef: overflowButtonRef,\n align: 'end',\n side: 'outside-bottom',\n },\n [menuOpen, showOverflow, overflowOrder, visibilityMap],\n )\n\n if (!isMedium) {\n return (\n <ul className={clsx(styles['SubdomainNavBar-primary-nav-list'], className)} ref={navRef} {...rest}>\n {children}\n </ul>\n )\n }\n\n return (\n <div\n className={clsx(\n styles['SubdomainNavBar-primary-nav-overflow'],\n showOverflow && styles['SubdomainNavBar-primary-nav-overflow--has-overflow'],\n className,\n )}\n >\n <ul className={styles['SubdomainNavBar-primary-nav-list']} ref={navRef} {...rest}>\n {navItems}\n <OverflowButton\n ariaControls={overflowMenuId}\n buttonRef={overflowButtonRef}\n menuOpen={menuOpen}\n onClick={handleOverflowButtonClick}\n order={overflowOrder}\n overflowMenuLabel={overflowMenuLabel}\n ref={overflowRef}\n visible={showOverflow}\n />\n </ul>\n <OverflowMenu\n id={overflowMenuId}\n menuOpen={menuOpen}\n onClose={handleClose}\n position={position}\n ref={overflowMenuRef}\n visibilityMap={visibilityMap}\n >\n {children}\n </OverflowMenu>\n </div>\n )\n },\n)\n\ntype OverflowButtonProps = {\n ariaControls: string\n buttonRef: React.RefObject<HTMLButtonElement | null>\n menuOpen: boolean\n onClick: () => void\n order: number\n overflowMenuLabel: string\n visible: boolean\n} & BaseProps<HTMLLIElement>\n\nconst OverflowButton = forwardRef<HTMLLIElement, OverflowButtonProps>(\n ({ariaControls, buttonRef, className, menuOpen, onClick, order, overflowMenuLabel, visible}, forwardedRef) => {\n const ref = useProvidedRefOrCreate<HTMLLIElement>(\n forwardedRef as React.RefObject<HTMLLIElement> | React.RefCallback<HTMLLIElement> | null,\n )\n\n return (\n <li\n aria-hidden={visible ? undefined : true}\n className={clsx(styles['SubdomainNavBar-primary-nav-list-item--overflow'], className)}\n ref={ref}\n style={{order}}\n >\n <button\n aria-expanded={menuOpen ? 'true' : 'false'}\n aria-controls={ariaControls}\n onClick={onClick}\n className={clsx(styles['SubdomainNavBar-link'], styles['SubdomainNavBar-more-link'])}\n ref={buttonRef}\n tabIndex={visible ? undefined : -1}\n >\n <span className={styles['SubdomainNavBar-link-content']}>\n {overflowMenuLabel}\n {menuOpen ? <TriangleUpIcon /> : <TriangleDownIcon />}\n </span>\n </button>\n </li>\n )\n },\n)\n\ntype OverflowMenuProps = {\n id: string\n menuOpen: boolean\n onClose: () => void\n position?: {top: number; left: number}\n visibilityMap: VisibilityMap\n} & BaseProps<HTMLDivElement>\n\nconst OverflowMenu = forwardRef<HTMLDivElement, React.PropsWithChildren<OverflowMenuProps>>(\n ({children, className, id, menuOpen, onClose, position, visibilityMap}, forwardedRef) => {\n if (!menuOpen) {\n return null\n }\n\n return (\n <div\n id={id}\n ref={forwardedRef}\n style={{\n top: `${position?.top ?? 0}px`,\n left: `${position?.left ?? 0}px`,\n visibility: position ? undefined : 'hidden',\n }}\n className={clsx(styles['SubdomainNavBar-overflow-menu'], className)}\n >\n <ul className={clsx(styles['SubdomainNavBar-overflow-menu-list'])}>\n {React.Children.map(children, (child, index) => {\n if (React.isValidElement<SubdomainNavBarLinkProps>(child)) {\n if (visibilityMap[index] !== false) {\n return null\n }\n\n return (\n <SubdomainNavBarLinkContext.Provider value={{isOverflowed: false, onLinkClick: onClose}}>\n {React.cloneElement(child, {\n className: clsx(styles['SubdomainNavBar-overflow-menu-item'], child.props.className),\n })}\n </SubdomainNavBarLinkContext.Provider>\n )\n }\n return null\n })}\n </ul>\n </div>\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;;AAwBA,IAAa,IAA8B,GACxC,EAAC,aAAU,cAAW,sBAAmB,GAAG,KAAO,MAAiB;CACnE,IAAM,IAAS,EACb,CACF,GACM,IAAc,EAA6B,IAAI,GAC/C,IAAoB,EAAiC,IAAI,GACzD,IAAkB,EAA8B,IAAI,GACpD,EAAC,gBAAY,EAAc,GAU3B,CAAC,KAAiB,EAAsB,GAAQ,GAT/B,EAAM,SAAS,QAAQ,CAAQ,CAAC,CACpD,KAAK,GAAO,MACP,EAAM,eAAyC,CAAK,IAC/C,GAAG,EAAM,GAAG,OAAO,EAAM,MAAM,YAAa,WAAW,EAAM,MAAM,WAAW,OAGhF,GAAG,EAAM,EACjB,CAAC,CACD,KAAK,GAC2D,GAAgB,CAAC,CAAQ,GACtF,CAAC,GAAU,KAAe,EAAS,EAAK,GAExC,IAAe,OAAO,OAAO,CAAa,CAAC,CAAC,SAAS,EAAK,GAC1D,IAAiB,EAAM,MAAM,GAC7B,IAA2B,EAAM,SAAS,QAAQ,CAAQ,CAAC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