@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
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import './MediaPlaylist.module-BddC0boN.css'
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import './MediaPlaylist.module-BddC0boN.css';//#region src/MediaPlaylist/MediaPlaylist.module.css
|
|
2
|
+
var e = "Primer_Brand__MediaPlaylist-module__MediaPlaylist___mqadg", t = "Primer_Brand__MediaPlaylist-module__MediaPlaylist__panelContent___nD2Xr", n = "Primer_Brand__MediaPlaylist-module__MediaPlaylist__layout___Jxb17", r = "Primer_Brand__MediaPlaylist-module__MediaPlaylist__playlist___r232y", i = "Primer_Brand__MediaPlaylist-module__MediaPlaylist__heading___bvLnj", a = "Primer_Brand__MediaPlaylist-module__MediaPlaylist__headingLabel___cOPfs", o = "Primer_Brand__MediaPlaylist-module__MediaPlaylist__headingCounter___xJSQs", s = "Primer_Brand__MediaPlaylist-module__MediaPlaylist__mediaPanels___bgH_2", c = "Primer_Brand__MediaPlaylist-module__MediaPlaylist__mediaPanel___YI_I2", l = "Primer_Brand__MediaPlaylist-module__MediaPlaylist__panel___iC9Tx", u = "Primer_Brand__MediaPlaylist-module__MediaPlaylist__media___HVCCb", d = "Primer_Brand__MediaPlaylist-module__MediaPlaylist__tablist___EhGxB", f = "Primer_Brand__MediaPlaylist-module__MediaPlaylist__pagination___mct_v", p = "Primer_Brand__MediaPlaylist-module__MediaPlaylist__item___KJx6C", m = "Primer_Brand__MediaPlaylist-module__MediaPlaylist__itemHeading___j5Q2s", h = "Primer_Brand__MediaPlaylist-module__MediaPlaylist__itemHeadingContent___pzVd0", g = "Primer_Brand__MediaPlaylist-module__MediaPlaylist__itemHeadingDetails___wQCnu", _ = "Primer_Brand__MediaPlaylist-module__MediaPlaylist__itemHeadingTitle___F1sIm", v = "Primer_Brand__MediaPlaylist-module__MediaPlaylist__tab___LvxjX", y = "Primer_Brand__MediaPlaylist-module__MediaPlaylist__tabContent___9cPbZ", b = "Primer_Brand__MediaPlaylist-module__MediaPlaylist__thumbnail___PENaA", x = "Primer_Brand__MediaPlaylist-module__MediaPlaylist__content___m36IL", S = {
|
|
3
|
+
MediaPlaylist: e,
|
|
4
|
+
MediaPlaylist__panelContent: t,
|
|
5
|
+
MediaPlaylist__layout: n,
|
|
6
|
+
MediaPlaylist__playlist: r,
|
|
7
|
+
MediaPlaylist__heading: i,
|
|
8
|
+
MediaPlaylist__headingLabel: a,
|
|
9
|
+
MediaPlaylist__headingCounter: o,
|
|
10
|
+
MediaPlaylist__mediaPanels: s,
|
|
11
|
+
MediaPlaylist__mediaPanel: c,
|
|
12
|
+
MediaPlaylist__panel: l,
|
|
13
|
+
MediaPlaylist__media: u,
|
|
14
|
+
MediaPlaylist__tablist: d,
|
|
14
15
|
"MediaPlaylist--overflowItems": "Primer_Brand__MediaPlaylist-module__MediaPlaylist--overflowItems___QWHRc",
|
|
15
|
-
MediaPlaylist__pagination:
|
|
16
|
-
MediaPlaylist__item:
|
|
16
|
+
MediaPlaylist__pagination: f,
|
|
17
|
+
MediaPlaylist__item: p,
|
|
17
18
|
"MediaPlaylist__item--selected": "Primer_Brand__MediaPlaylist-module__MediaPlaylist__item--selected___Ihn_G",
|
|
18
|
-
MediaPlaylist__itemHeading:
|
|
19
|
-
MediaPlaylist__itemHeadingContent:
|
|
20
|
-
MediaPlaylist__itemHeadingDetails:
|
|
21
|
-
MediaPlaylist__itemHeadingTitle:
|
|
22
|
-
MediaPlaylist__tab:
|
|
23
|
-
MediaPlaylist__tabContent:
|
|
24
|
-
MediaPlaylist__thumbnail:
|
|
25
|
-
MediaPlaylist__content:
|
|
19
|
+
MediaPlaylist__itemHeading: m,
|
|
20
|
+
MediaPlaylist__itemHeadingContent: h,
|
|
21
|
+
MediaPlaylist__itemHeadingDetails: g,
|
|
22
|
+
MediaPlaylist__itemHeadingTitle: _,
|
|
23
|
+
MediaPlaylist__tab: v,
|
|
24
|
+
MediaPlaylist__tabContent: y,
|
|
25
|
+
MediaPlaylist__thumbnail: b,
|
|
26
|
+
MediaPlaylist__content: x
|
|
26
27
|
};
|
|
27
28
|
//#endregion
|
|
28
|
-
export { e as default };
|
|
29
|
+
export { e as MediaPlaylist, x as MediaPlaylist__content, i as MediaPlaylist__heading, o as MediaPlaylist__headingCounter, a as MediaPlaylist__headingLabel, p as MediaPlaylist__item, m as MediaPlaylist__itemHeading, h as MediaPlaylist__itemHeadingContent, g as MediaPlaylist__itemHeadingDetails, _ as MediaPlaylist__itemHeadingTitle, n as MediaPlaylist__layout, u as MediaPlaylist__media, c as MediaPlaylist__mediaPanel, s as MediaPlaylist__mediaPanels, f as MediaPlaylist__pagination, l as MediaPlaylist__panel, t as MediaPlaylist__panelContent, r as MediaPlaylist__playlist, v as MediaPlaylist__tab, y as MediaPlaylist__tabContent, d as MediaPlaylist__tablist, b as MediaPlaylist__thumbnail, S as default };
|
|
29
30
|
|
|
30
31
|
//# sourceMappingURL=MediaPlaylist.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMediaPlaylist.js","names":[],"sources":["../../src/MediaPlaylist/useMediaPlaylist.ts"],"sourcesContent":["import React, {useCallback, useEffect, useMemo, useRef} from 'react'\n\nimport type {PaginationPageType} from '../Pagination/model'\nimport {useTabs} from '../hooks/useTabs'\n\ntype UseMediaPlaylistProps = {\n children: React.ReactNode\n components: MediaPlaylistComponentTypes\n defaultSelectedIndex: number\n onChange?: (selectedIndex: number) => void\n selectedIndex?: number\n}\n\n/**\n * Internal only hook used by MediaPlaylist to manage state and behavior.\n * @private\n * @internal\n */\nexport type MediaPlaylistComponentTypes = {\n Heading: React.ElementType\n Item: React.ElementType\n ItemHeading: React.ElementType\n ItemContent: React.ElementType\n ItemMedia: React.ElementType\n}\n\ntype MediaPlaylistHeadingChildProps = {\n activeIndex?: number | null\n id?: string\n itemCount?: number\n}\n\ntype MediaPlaylistItemProps = React.PropsWithChildren<{\n className?: string\n thumbnail?: React.ReactNode\n}>\n\ntype MediaPlaylistItemChildProps = React.PropsWithChildren<Record<string, unknown>>\n\ntype MediaPlaylistItemChild = React.ReactElement<MediaPlaylistItemChildProps>\n\ntype MediaPlaylistItemData = {\n className?: string\n content: MediaPlaylistItemChild\n heading: MediaPlaylistItemChild\n media: MediaPlaylistItemChild\n thumbnail?: React.ReactNode\n}\n\n/**\n * Internal only hook used by MediaPlaylist to manage state and behavior.\n * @private\n * @internal\n */\nexport function useMediaPlaylist({\n children,\n components,\n defaultSelectedIndex,\n onChange,\n selectedIndex,\n}: UseMediaPlaylistProps) {\n const {headingChild, items} = useMemo(() => getMediaPlaylistChildren(children, components), [children, components])\n const itemCount = items.length\n const defaultActiveIndex = getValidIndex(defaultSelectedIndex, itemCount)\n\n const controlledActiveIndex =\n typeof selectedIndex === 'number' && Number.isFinite(selectedIndex) ? getValidIndex(selectedIndex, itemCount) : null\n\n const initialActiveIndex = controlledActiveIndex ?? defaultActiveIndex\n const initialActiveTab = initialActiveIndex === null ? undefined : String(initialActiveIndex)\n const hasOverflowItems = itemCount > 3\n const tabListRef = useRef<HTMLDivElement>(null)\n const itemRefs = useRef<Array<HTMLDivElement | null>>([])\n const suppressOnTabActivateRef = useRef(false)\n\n const scrollListToIndex = useCallback((index: number) => {\n const tabList = tabListRef.current\n const item = itemRefs.current[index]\n\n if (!tabList || !item || typeof tabList.scrollTo !== 'function') return\n\n tabList.scrollTo({\n top: Math.max(0, item.offsetTop - tabList.offsetTop),\n behavior: 'smooth',\n })\n }, [])\n\n const handleTabActivate = useCallback(\n (id: string) => {\n const nextIndex = Number(id)\n if (Number.isNaN(nextIndex)) return\n\n if (hasOverflowItems) {\n scrollListToIndex(nextIndex)\n }\n\n if (suppressOnTabActivateRef.current) {\n suppressOnTabActivateRef.current = false\n return\n }\n\n onChange?.(nextIndex)\n },\n [hasOverflowItems, onChange, scrollListToIndex],\n )\n\n const {activeTab, activateTab, getTabListProps, getTabPanelProps, getTabProps} = useTabs({\n defaultTab: initialActiveTab,\n onTabActivate: handleTabActivate,\n orientation: 'vertical',\n })\n\n const activeIndex = activeTab === null ? initialActiveIndex : getValidIndex(Number(activeTab), itemCount)\n const currentItemPage = activeIndex === null ? 1 : activeIndex + 1\n\n useEffect(() => {\n if (controlledActiveIndex === null) return\n\n const controlledTab = String(controlledActiveIndex)\n if (activeTab !== controlledTab) {\n suppressOnTabActivateRef.current = true\n activateTab(controlledTab)\n }\n }, [activateTab, activeTab, controlledActiveIndex])\n\n useEffect(() => {\n if (activeIndex === null || activeTab === String(activeIndex)) return\n\n suppressOnTabActivateRef.current = true\n activateTab(String(activeIndex))\n }, [activateTab, activeIndex, activeTab])\n\n const handlePageChange = useCallback(\n (event: React.MouseEvent, page: number) => {\n event.preventDefault()\n\n const nextIndex = getValidIndex(page - 1, itemCount)\n if (nextIndex === null) return\n\n scrollListToIndex(nextIndex)\n\n if (activeTab !== String(nextIndex)) {\n activateTab(String(nextIndex))\n }\n },\n [activateTab, activeTab, itemCount, scrollListToIndex],\n )\n\n const isItemSelected = useCallback((index: number) => activeTab === String(index), [activeTab])\n\n const setItemRef = useCallback((index: number, element: HTMLDivElement | null) => {\n itemRefs.current[index] = element\n }, [])\n\n const getPaginationAttributes = useCallback((pageNumber: number, page: PaginationPageType) => {\n switch (page.type) {\n case 'PREV':\n return {'aria-label': 'Previous video'}\n case 'NEXT':\n return {'aria-label': 'Next video'}\n case 'NUM': {\n const attributes: {[key: string]: string} = {'aria-label': `Video ${pageNumber}`}\n\n if (page.selected) {\n attributes['aria-current'] = 'step'\n }\n\n return attributes\n }\n case 'BREAK':\n return {}\n }\n }, [])\n\n return {\n activeIndex,\n currentItemPage,\n getPaginationAttributes,\n getTabListProps,\n getTabPanelProps,\n getTabProps,\n handlePageChange,\n hasOverflowItems,\n headingChild,\n isItemSelected,\n items,\n setItemRef,\n tabListRef,\n }\n}\n\nconst createComponentTypeGuard =\n <T>(componentType: React.ElementType) =>\n (element: unknown): element is React.ReactElement<T> =>\n React.isValidElement<T>(element) && element.type === componentType\n\nfunction getMediaPlaylistChildren(children: React.ReactNode, components: MediaPlaylistComponentTypes) {\n const isHeading = createComponentTypeGuard<MediaPlaylistHeadingChildProps>(components.Heading)\n const isItem = createComponentTypeGuard<MediaPlaylistItemProps>(components.Item)\n const isItemHeading = createComponentTypeGuard<MediaPlaylistItemChildProps>(components.ItemHeading)\n const isItemContent = createComponentTypeGuard<MediaPlaylistItemChildProps>(components.ItemContent)\n const isItemMedia = createComponentTypeGuard<MediaPlaylistItemChildProps>(components.ItemMedia)\n\n const playlistChildren = {\n headingChild: null as React.ReactElement<MediaPlaylistHeadingChildProps> | null,\n items: [] as MediaPlaylistItemData[],\n }\n\n for (const child of React.Children.toArray(children)) {\n if (isHeading(child)) {\n playlistChildren.headingChild = child\n continue\n }\n\n if (!isItem(child)) {\n continue\n }\n\n const itemChildren = React.Children.toArray(child.props.children)\n\n const itemParts = {\n heading: null as MediaPlaylistItemChild | null,\n content: null as MediaPlaylistItemChild | null,\n media: null as MediaPlaylistItemChild | null,\n }\n\n for (const itemChild of itemChildren) {\n if (isItemHeading(itemChild)) {\n itemParts.heading = itemChild\n }\n\n if (isItemContent(itemChild)) {\n itemParts.content = itemChild\n }\n\n if (isItemMedia(itemChild)) {\n itemParts.media = itemChild\n }\n }\n\n if (!itemParts.heading || !itemParts.content || !itemParts.media) {\n continue\n }\n\n playlistChildren.items.push({\n className: child.props.className,\n content: itemParts.content,\n heading: itemParts.heading,\n media: itemParts.media,\n thumbnail: child.props.thumbnail,\n })\n }\n\n return playlistChildren\n}\n\nconst getValidIndex = (index: number, length: number) => {\n if (length < 1) return null\n\n const normalizedIndex = Number.isFinite(index) ? Math.trunc(index) : 0\n return Math.min(Math.max(normalizedIndex, 0), length - 1)\n}\n"],"mappings":";;;AAsDA,SAAgB,EAAiB,EAC/B,aACA,eACA,yBACA,aACA,oBACwB;CACxB,IAAM,EAAC,iBAAc,aAAS,QAAc,EAAyB,GAAU,EAAW,EAAE,CAAC,GAAU,EAAW,CAAC,EAC7G,IAAY,EAAM,QAClB,IAAqB,EAAc,GAAsB,EAAU,EAEnE,IACJ,OAAO,KAAkB,YAAY,OAAO,SAAS,EAAc,GAAG,EAAc,GAAe,EAAU,GAAG,MAE5G,IAAqB,KAAyB,GAC9C,IAAmB,MAAuB,OAAO,KAAA,IAAY,OAAO,EAAmB,EACvF,IAAmB,IAAY,GAC/B,IAAa,EAAuB,KAAK,EACzC,IAAW,EAAqC,EAAE,CAAC,EACnD,IAA2B,EAAO,GAAM,EAExC,IAAoB,GAAa,MAAkB;EACvD,IAAM,IAAU,EAAW,SACrB,IAAO,EAAS,QAAQ;AAE1B,GAAC,KAAW,CAAC,KAAQ,OAAO,EAAQ,YAAa,cAErD,EAAQ,SAAS;GACf,KAAK,KAAK,IAAI,GAAG,EAAK,YAA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IAAM,KAAiB,GAAe,MAChC,IAAS,IAAU,OAGhB,KAAK,IAAI,KAAK,IADG,OAAO,SAAS,EAAM,GAAG,KAAK,MAAM,EAAM,GAAG,GAC3B,EAAE,EAAE,IAAS,EAAE"}
|
|
1
|
+
{"version":3,"file":"useMediaPlaylist.js","names":[],"sources":["../../src/MediaPlaylist/useMediaPlaylist.ts"],"sourcesContent":["import React, {useCallback, useEffect, useMemo, useRef} from 'react'\n\nimport type {PaginationPageType} from '../Pagination/model'\nimport {useTabs} from '../hooks/useTabs'\n\ntype UseMediaPlaylistProps = {\n children: React.ReactNode\n components: MediaPlaylistComponentTypes\n defaultSelectedIndex: number\n onChange?: (selectedIndex: number) => void\n selectedIndex?: number\n}\n\n/**\n * Internal only hook used by MediaPlaylist to manage state and behavior.\n * @private\n * @internal\n */\nexport type MediaPlaylistComponentTypes = {\n Heading: React.ElementType\n Item: React.ElementType\n ItemHeading: React.ElementType\n ItemContent: React.ElementType\n ItemMedia: React.ElementType\n}\n\ntype MediaPlaylistHeadingChildProps = {\n activeIndex?: number | null\n id?: string\n itemCount?: number\n}\n\ntype MediaPlaylistItemProps = React.PropsWithChildren<{\n className?: string\n thumbnail?: React.ReactNode\n}>\n\ntype MediaPlaylistItemChildProps = React.PropsWithChildren<Record<string, unknown>>\n\ntype MediaPlaylistItemChild = React.ReactElement<MediaPlaylistItemChildProps>\n\ntype MediaPlaylistItemData = {\n className?: string\n content: MediaPlaylistItemChild\n heading: MediaPlaylistItemChild\n media: MediaPlaylistItemChild\n thumbnail?: React.ReactNode\n}\n\n/**\n * Internal only hook used by MediaPlaylist to manage state and behavior.\n * @private\n * @internal\n */\nexport function useMediaPlaylist({\n children,\n components,\n defaultSelectedIndex,\n onChange,\n selectedIndex,\n}: UseMediaPlaylistProps) {\n const {headingChild, items} = useMemo(() => getMediaPlaylistChildren(children, components), [children, components])\n const itemCount = items.length\n const defaultActiveIndex = getValidIndex(defaultSelectedIndex, itemCount)\n\n const controlledActiveIndex =\n typeof selectedIndex === 'number' && Number.isFinite(selectedIndex) ? getValidIndex(selectedIndex, itemCount) : null\n\n const initialActiveIndex = controlledActiveIndex ?? defaultActiveIndex\n const initialActiveTab = initialActiveIndex === null ? undefined : String(initialActiveIndex)\n const hasOverflowItems = itemCount > 3\n const tabListRef = useRef<HTMLDivElement>(null)\n const itemRefs = useRef<Array<HTMLDivElement | null>>([])\n const suppressOnTabActivateRef = useRef(false)\n\n const scrollListToIndex = useCallback((index: number) => {\n const tabList = tabListRef.current\n const item = itemRefs.current[index]\n\n if (!tabList || !item || typeof tabList.scrollTo !== 'function') return\n\n tabList.scrollTo({\n top: Math.max(0, item.offsetTop - tabList.offsetTop),\n behavior: 'smooth',\n })\n }, [])\n\n const handleTabActivate = useCallback(\n (id: string) => {\n const nextIndex = Number(id)\n if (Number.isNaN(nextIndex)) return\n\n if (hasOverflowItems) {\n scrollListToIndex(nextIndex)\n }\n\n if (suppressOnTabActivateRef.current) {\n suppressOnTabActivateRef.current = false\n return\n }\n\n onChange?.(nextIndex)\n },\n [hasOverflowItems, onChange, scrollListToIndex],\n )\n\n const {activeTab, activateTab, getTabListProps, getTabPanelProps, getTabProps} = useTabs({\n defaultTab: initialActiveTab,\n onTabActivate: handleTabActivate,\n orientation: 'vertical',\n })\n\n const activeIndex = activeTab === null ? initialActiveIndex : getValidIndex(Number(activeTab), itemCount)\n const currentItemPage = activeIndex === null ? 1 : activeIndex + 1\n\n useEffect(() => {\n if (controlledActiveIndex === null) return\n\n const controlledTab = String(controlledActiveIndex)\n if (activeTab !== controlledTab) {\n suppressOnTabActivateRef.current = true\n activateTab(controlledTab)\n }\n }, [activateTab, activeTab, controlledActiveIndex])\n\n useEffect(() => {\n if (activeIndex === null || activeTab === String(activeIndex)) return\n\n suppressOnTabActivateRef.current = true\n activateTab(String(activeIndex))\n }, [activateTab, activeIndex, activeTab])\n\n const handlePageChange = useCallback(\n (event: React.MouseEvent, page: number) => {\n event.preventDefault()\n\n const nextIndex = getValidIndex(page - 1, itemCount)\n if (nextIndex === null) return\n\n scrollListToIndex(nextIndex)\n\n if (activeTab !== String(nextIndex)) {\n activateTab(String(nextIndex))\n }\n },\n [activateTab, activeTab, itemCount, scrollListToIndex],\n )\n\n const isItemSelected = useCallback((index: number) => activeTab === String(index), [activeTab])\n\n const setItemRef = useCallback((index: number, element: HTMLDivElement | null) => {\n itemRefs.current[index] = element\n }, [])\n\n const getPaginationAttributes = useCallback((pageNumber: number, page: PaginationPageType) => {\n switch (page.type) {\n case 'PREV':\n return {'aria-label': 'Previous video'}\n case 'NEXT':\n return {'aria-label': 'Next video'}\n case 'NUM': {\n const attributes: {[key: string]: string} = {'aria-label': `Video ${pageNumber}`}\n\n if (page.selected) {\n attributes['aria-current'] = 'step'\n }\n\n return attributes\n }\n case 'BREAK':\n return {}\n }\n }, [])\n\n return {\n activeIndex,\n currentItemPage,\n getPaginationAttributes,\n getTabListProps,\n getTabPanelProps,\n getTabProps,\n handlePageChange,\n hasOverflowItems,\n headingChild,\n isItemSelected,\n items,\n setItemRef,\n tabListRef,\n }\n}\n\nconst createComponentTypeGuard =\n <T>(componentType: React.ElementType) =>\n (element: unknown): element is React.ReactElement<T> =>\n React.isValidElement<T>(element) && element.type === componentType\n\nfunction getMediaPlaylistChildren(children: React.ReactNode, components: MediaPlaylistComponentTypes) {\n const isHeading = createComponentTypeGuard<MediaPlaylistHeadingChildProps>(components.Heading)\n const isItem = createComponentTypeGuard<MediaPlaylistItemProps>(components.Item)\n const isItemHeading = createComponentTypeGuard<MediaPlaylistItemChildProps>(components.ItemHeading)\n const isItemContent = createComponentTypeGuard<MediaPlaylistItemChildProps>(components.ItemContent)\n const isItemMedia = createComponentTypeGuard<MediaPlaylistItemChildProps>(components.ItemMedia)\n\n const playlistChildren = {\n headingChild: null as React.ReactElement<MediaPlaylistHeadingChildProps> | null,\n items: [] as MediaPlaylistItemData[],\n }\n\n for (const child of React.Children.toArray(children)) {\n if (isHeading(child)) {\n playlistChildren.headingChild = child\n continue\n }\n\n if (!isItem(child)) {\n continue\n }\n\n const itemChildren = React.Children.toArray(child.props.children)\n\n const itemParts = {\n heading: null as MediaPlaylistItemChild | null,\n content: null as MediaPlaylistItemChild | null,\n media: null as MediaPlaylistItemChild | null,\n }\n\n for (const itemChild of itemChildren) {\n if (isItemHeading(itemChild)) {\n itemParts.heading = itemChild\n }\n\n if (isItemContent(itemChild)) {\n itemParts.content = itemChild\n }\n\n if (isItemMedia(itemChild)) {\n itemParts.media = itemChild\n }\n }\n\n if (!itemParts.heading || !itemParts.content || !itemParts.media) {\n continue\n }\n\n playlistChildren.items.push({\n className: child.props.className,\n content: itemParts.content,\n heading: itemParts.heading,\n media: itemParts.media,\n thumbnail: child.props.thumbnail,\n })\n }\n\n return playlistChildren\n}\n\nconst getValidIndex = (index: number, length: number) => {\n if (length < 1) return null\n\n const normalizedIndex = Number.isFinite(index) ? Math.trunc(index) : 0\n return Math.min(Math.max(normalizedIndex, 0), length - 1)\n}\n"],"mappings":";;;AAsDA,SAAgB,EAAiB,EAC/B,aACA,eACA,yBACA,aACA,oBACwB;CACxB,IAAM,EAAC,iBAAc,aAAS,QAAc,EAAyB,GAAU,CAAU,GAAG,CAAC,GAAU,CAAU,CAAC,GAC5G,IAAY,EAAM,QAClB,IAAqB,EAAc,GAAsB,CAAS,GAElE,IACJ,OAAO,KAAkB,YAAY,OAAO,SAAS,CAAa,IAAI,EAAc,GAAe,CAAS,IAAI,MAE5G,IAAqB,KAAyB,GAC9C,IAAmB,MAAuB,OAAO,KAAA,IAAY,OAAO,CAAkB,GACtF,IAAmB,IAAY,GAC/B,IAAa,EAAuB,IAAI,GACxC,IAAW,EAAqC,CAAC,CAAC,GAClD,IAA2B,EAAO,EAAK,GAEvC,IAAoB,GAAa,MAAkB;EACvD,IAAM,IAAU,EAAW,SACrB,IAAO,EAAS,QAAQ;EAE1B,CAAC,KAAW,CAAC,KAAQ,OAAO,EAAQ,YAAa,cAErD,EAAQ,SAAS;GACf,KAAK,KAAK,IAAI,GA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AO,EAAU;GACjB,WAAW,EAAM,MAAM;EACzB,CAAC;CACH;CAEA,OAAO;AACT;AAEA,IAAM,KAAiB,GAAe,MAChC,IAAS,IAAU,OAGhB,KAAK,IAAI,KAAK,IADG,OAAO,SAAS,CAAK,IAAI,KAAK,MAAM,CAAK,IAAI,GAC3B,CAAC,GAAG,IAAS,CAAC"}
|
|
@@ -86,9 +86,9 @@ export type MinimalFooterProps = {
|
|
|
86
86
|
*/
|
|
87
87
|
copyrightStatement?: string | React.ReactElement;
|
|
88
88
|
} & BaseProps<HTMLElement>;
|
|
89
|
-
declare function Root({ centerComponent, className, children, copyrightStatement, logoHref, socialLinks, ...rest }: PropsWithChildren<MinimalFooterProps>):
|
|
89
|
+
declare function Root({ centerComponent, className, children, copyrightStatement, logoHref, socialLinks, ...rest }: PropsWithChildren<MinimalFooterProps>): React.JSX.Element;
|
|
90
90
|
type FootnoteProps = BaseProps<HTMLElement>;
|
|
91
|
-
declare function Footnotes({ children, className }: PropsWithChildren<FootnoteProps>):
|
|
91
|
+
declare function Footnotes({ children, className }: PropsWithChildren<FootnoteProps>): React.JSX.Element;
|
|
92
92
|
type LinkProps<C extends React.ElementType> = BaseProps<C> & {
|
|
93
93
|
as?: 'a' | 'button';
|
|
94
94
|
} & Omit<React.ComponentPropsWithoutRef<C>, keyof C>;
|
|
@@ -113,7 +113,7 @@ export type MinimalFooterBackToTopProps = {
|
|
|
113
113
|
*/
|
|
114
114
|
export declare const MinimalFooter: typeof Root & {
|
|
115
115
|
Footnotes: typeof Footnotes;
|
|
116
|
-
Link: <C extends React.ElementType = "a">({ as, children, ...rest }: PropsWithChildren<LinkProps<C>>) =>
|
|
116
|
+
Link: <C extends React.ElementType = "a">({ as, children, ...rest }: PropsWithChildren<LinkProps<C>>) => React.JSX.Element;
|
|
117
117
|
BackToTop: React.ForwardRefExoticComponent<Omit<MinimalFooterBackToTopProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
118
118
|
};
|
|
119
119
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MinimalFooter.d.ts","sourceRoot":"","sources":["../../src/MinimalFooter/MinimalFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,iBAAiB,EAAc,MAAM,OAAO,CAAA;AAKvE,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAA;AAG9C;;GAEG;AACH,OAAO,0GAA0G,CAAA;AACjH,OAAO,6FAA6F,CAAA;AAOpG,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDV,CAAA;AAEV,KAAK,cAAc,GAAG,MAAM,OAAO,cAAc,CAAA;AAGjD,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC,YAAY,CAAA;IACpC;;OAEG;IACH,WAAW,CAAC,EAAE,cAAc,EAAE,GAAG,KAAK,CAAA;IACtC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,YAAY,CAAA;CACjD,GAAG,SAAS,CAAC,WAAW,CAAC,CAAA;AAE1B,iBAAS,IAAI,CAAC,EACZ,eAAe,EACf,SAAS,EACT,QAAQ,EACR,kBAAkB,EAClB,QAA+B,EAC/B,WAAW,EACX,GAAG,IAAI,EACR,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,
|
|
1
|
+
{"version":3,"file":"MinimalFooter.d.ts","sourceRoot":"","sources":["../../src/MinimalFooter/MinimalFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,iBAAiB,EAAc,MAAM,OAAO,CAAA;AAKvE,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAA;AAG9C;;GAEG;AACH,OAAO,0GAA0G,CAAA;AACjH,OAAO,6FAA6F,CAAA;AAOpG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,iBAAiB,CAAC,CAAA;CACrD,GAAG,SAAS,CAAC,iBAAiB,CAAC,GAC9B,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC,CAAA;AAuE7E;;;GAGG;AACH,eAAO,MAAM,aAAa;;WAjHZ,CAAC,SAAS,KAAK,CAAC,WAAW,mCAAiC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;;CAqHvG,CAAA"}
|
|
@@ -1,8 +1,9 @@
|
|
|
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 { useReducedMotion as t } from "../hooks/useReducedMotion.js";
|
|
3
3
|
import { Text as n } from "../Text/Text.js";
|
|
4
|
-
import { ArrowUpIcon as r
|
|
5
|
-
import
|
|
4
|
+
import { ArrowUpIcon as r } from "../node_modules/@primer/octicons-react/dist/icons/ArrowUpIcon.js";
|
|
5
|
+
import { MarkGithubIcon as i } from "../node_modules/@primer/octicons-react/dist/icons/MarkGithubIcon.js";
|
|
6
|
+
import '../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/footer/base-C0fjI9_t.css';import '../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/footer/colors-with-modes-CMFhnjfv.css';/* empty css */
|
|
6
7
|
/* empty css */
|
|
7
8
|
import a from "./MinimalFooter.module.js";
|
|
8
9
|
import o, { forwardRef as s, useCallback as c } from "react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MinimalFooter.js","names":[],"sources":["../../src/MinimalFooter/MinimalFooter.tsx"],"sourcesContent":["import React, {forwardRef, PropsWithChildren, useCallback} from 'react'\nimport {clsx} from 'clsx'\nimport {ArrowUpIcon, MarkGithubIcon} from '@primer/octicons-react'\n\nimport {Text} from '../'\nimport {BaseProps} from '../component-helpers'\nimport {useReducedMotion} from '../hooks/useReducedMotion'\n\n/**\n * Design tokens\n */\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/footer/colors-with-modes.css'\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/footer/base.css'\n\n/**\n * Main Stylesheet (as a CSS Module)\n */\nimport styles from './MinimalFooter.module.css'\n\nconst socialLinkData = {\n x: {\n fullName: 'X',\n url: 'https://x.com/github',\n icon: 'https://github.githubassets.com/images/modules/site/icons/footer/x.svg',\n iconWidth: 20,\n iconHeight: 16,\n },\n github: {\n fullName: 'GitHub',\n url: 'https://github.com/github',\n icon: 'https://github.githubassets.com/images/modules/site/icons/footer/github-mark.svg',\n iconWidth: 20,\n iconHeight: 20,\n },\n linkedin: {\n fullName: 'LinkedIn',\n url: 'https://www.linkedin.com/company/github',\n icon: 'https://github.githubassets.com/images/modules/site/icons/footer/linkedin.svg',\n iconWidth: 19,\n iconHeight: 18,\n },\n youtube: {\n fullName: 'YouTube',\n url: 'https://www.youtube.com/github',\n icon: 'https://github.githubassets.com/images/modules/site/icons/footer/youtube.svg',\n iconWidth: 23,\n iconHeight: 16,\n },\n facebook: {\n fullName: 'Facebook',\n url: 'https://www.facebook.com/GitHub',\n icon: 'https://github.githubassets.com/images/modules/site/icons/footer/facebook.svg',\n iconWidth: 18,\n iconHeight: 18,\n },\n twitch: {\n fullName: 'Twitch',\n url: 'https://www.twitch.tv/github',\n icon: 'https://github.githubassets.com/images/modules/site/icons/footer/twitch.svg',\n iconWidth: 18,\n iconHeight: 18,\n },\n tiktok: {\n fullName: 'TikTok',\n url: 'https://www.tiktok.com/@github',\n icon: 'https://github.githubassets.com/images/modules/site/icons/footer/tiktok.svg',\n iconWidth: 18,\n iconHeight: 18,\n },\n instagram: {\n fullName: 'Instagram',\n url: 'https://www.instagram.com/github/',\n icon: 'https://github.githubassets.com/images/modules/site/icons/footer/instagram.svg',\n iconWidth: 24,\n iconHeight: 24,\n },\n} as const\n\ntype SocialLinkName = keyof typeof socialLinkData\nconst socialLinkNames = Object.keys(socialLinkData) as SocialLinkName[]\n\nexport type MinimalFooterProps = {\n /**\n * Escape-hatch for inserting custom React components.\n * Warning:\n * This prop isn't advertised in our docs but remains part of the public API for edge-cases.\n * Need to use this prop? Please check in with #primer-brand first to confirm correct usage.\n */\n centerComponent?: React.ReactElement\n /**\n * An array of social links to be displayed in the footer.\n */\n socialLinks?: SocialLinkName[] | false\n /**\n * The href for the GitHub logo.\n */\n logoHref?: string\n /**\n * The copyright statement to be displayed in the footer.\n * If not provided, the copyright statement will be the default GitHub copyright statement.\n */\n copyrightStatement?: string | React.ReactElement\n} & BaseProps<HTMLElement>\n\nfunction Root({\n centerComponent,\n className,\n children,\n copyrightStatement,\n logoHref = 'https://github.com',\n socialLinks,\n ...rest\n}: PropsWithChildren<MinimalFooterProps>) {\n let footnotes: React.ReactElement | undefined\n let backToTop: React.ReactElement | undefined\n const links: React.ReactElement[] = []\n\n for (const child of React.Children.toArray(children)) {\n if (!React.isValidElement(child)) {\n continue\n }\n\n if (child.type === Footnotes) {\n footnotes ??= child\n } else if (child.type === BackToTop) {\n backToTop ??= child\n } else if (child.type === Link && links.length < 5) {\n links.push(child)\n }\n }\n\n const currentYear = new Date().getFullYear()\n const resolvedSocialLinks = socialLinks === undefined ? socialLinkNames : socialLinks\n const renderedSocialLinks = resolvedSocialLinks === false ? [] : resolvedSocialLinks\n const hasSocialLinks = renderedSocialLinks.length > 0\n const hasLinks = links.length > 0\n const renderedLinks = hasLinks ? <div className={styles.MinimalFooter__links}>{links}</div> : null\n const copyright = (\n <Text\n as=\"p\"\n size=\"100\"\n font=\"monospace\"\n weight={{narrow: 'medium', wide: 'normal'}}\n variant=\"muted\"\n className={clsx(styles.MinimalFooter__copyright, styles.MinimalFooter__metaText)}\n >\n {copyrightStatement ? copyrightStatement : `\\u00A9 ${currentYear} GitHub. All rights reserved.`}\n </Text>\n )\n\n return (\n <footer\n className={clsx(styles.MinimalFooter, footnotes && styles['MinimalFooter--withFootnotes'], className)}\n {...rest}\n >\n {footnotes}\n <div className={styles.MinimalFooter__section}>\n <section className={styles.MinimalFooter__top}>\n <div className={styles.MinimalFooter__container}>\n <div className={styles['MinimalFooter__top-row']}>\n <LogoLink logoHref={logoHref} />\n {hasLinks || backToTop ? (\n <div className={styles['MinimalFooter__top-actions']}>\n {backToTop}\n {renderedLinks}\n </div>\n ) : null}\n </div>\n </div>\n </section>\n </div>\n {centerComponent ? (\n <div className={clsx(styles.MinimalFooter__section, styles['MinimalFooter__section--center'])}>\n <section className={styles.MinimalFooter__container}>{centerComponent}</section>\n </div>\n ) : null}\n <div className={clsx(styles.MinimalFooter__section, styles['MinimalFooter__section--bottom'])}>\n <section className={styles.MinimalFooter__bottom}>\n <div className={styles.MinimalFooter__container}>\n <div className={styles['MinimalFooter__bottom-row']}>\n {copyright}\n {hasSocialLinks ? <SocialLinks socialLinks={renderedSocialLinks} /> : null}\n </div>\n </div>\n </section>\n </div>\n </footer>\n )\n}\n\ntype FootnoteProps = BaseProps<HTMLElement>\n\nfunction Footnotes({children, className}: PropsWithChildren<FootnoteProps>) {\n const styledChildren = React.Children.map(children, child => {\n if (React.isValidElement<React.ComponentProps<typeof Text>>(child) && child.type === Text) {\n const textChild = child as React.ReactElement<React.ComponentProps<typeof Text>>\n const overrideProps: Partial<React.ComponentProps<typeof Text>> = {\n variant: 'muted',\n size: '100',\n className: clsx(styles['MinimalFooter__terms-item'], textChild.props.className),\n }\n\n if (!textChild.props.as) {\n overrideProps.as = 'p'\n }\n\n return React.cloneElement(textChild, overrideProps)\n }\n\n return null\n })\n\n return (\n <div className={clsx(styles.MinimalFooter__section, styles['MinimalFooter__section--footnotes'])}>\n <section className={styles.MinimalFooter__container}>\n <div className={clsx(styles.MinimalFooter__terms, className)}>{styledChildren}</div>\n </section>\n </div>\n )\n}\n\ntype SocialLinkProps = {name: SocialLinkName}\n\nconst SocialLink = ({name}: SocialLinkProps) => {\n const link = socialLinkData[name]\n return (\n <li>\n <a\n href={link.url}\n className={styles['MinimalFooter__social-link']}\n data-analytics-event={`{\"category\":\"Footer\",\"action\":\"go to ${link.fullName}\",\"label\":\"text:${name}\"}`}\n >\n <img\n className={styles['MinimalFooter__social-icon']}\n src={link.icon}\n height={link.iconHeight}\n width={link.iconWidth}\n loading=\"lazy\"\n decoding=\"async\"\n alt=\"\"\n />\n <span className=\"visually-hidden\">GitHub on {link.fullName}</span>\n </a>\n </li>\n )\n}\n\nfunction LogoLink({logoHref}: {logoHref?: string}) {\n return (\n <a\n href={logoHref}\n className={styles.MinimalFooter__logo}\n data-analytics-event='{\"category\":\"Footer\",\"action\":\"go to home\",\"label\":\"text:home\"}'\n aria-label=\"GitHub\"\n >\n <MarkGithubIcon size={24} />\n </a>\n )\n}\n\nfunction SocialLinks({socialLinks}: {socialLinks: SocialLinkName[]}) {\n return (\n <ul className={styles['MinimalFooter__social-links']}>\n {socialLinks.map(name => (\n <SocialLink key={name} name={name} />\n ))}\n </ul>\n )\n}\n\ntype LinkProps<C extends React.ElementType> = BaseProps<C> & {as?: 'a' | 'button'} & Omit<\n React.ComponentPropsWithoutRef<C>,\n keyof C\n >\n\nconst Link = <C extends React.ElementType = 'a'>({as, children, ...rest}: PropsWithChildren<LinkProps<C>>) => {\n const Component = as || 'a'\n return (\n <Component\n className={styles.MinimalFooter__link}\n data-analytics-event={\n rest['href'] ? `{\"category\":\"Footer\",\"action\":\"go to ${rest['href']}\",\"label\":\"text:${children}\"}` : undefined\n }\n {...rest}\n >\n <Text\n variant=\"muted\"\n size=\"100\"\n font=\"monospace\"\n weight={{narrow: 'medium', wide: 'normal'}}\n className={styles.MinimalFooter__metaText}\n >\n {children}\n </Text>\n </Component>\n )\n}\n\nexport type MinimalFooterBackToTopProps = {\n /**\n * The visible and accessible label.\n */\n children: React.ReactNode\n /**\n * The ID of the semantic top-of-page element that receives focus after keyboard activation.\n * Defaults to the first `<main>` element, then falls back to `<body>`.\n */\n focusTargetId?: string\n /**\n * Runs before the built-in behavior. Call `event.preventDefault()` to cancel scrolling and focus transfer.\n */\n onClick?: React.MouseEventHandler<HTMLButtonElement>\n} & BaseProps<HTMLButtonElement> &\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'children'>\n\n/**\n * Scrolls to the top and, after keyboard activation, moves focus to the configured top-of-page destination.\n */\nconst BackToTop = forwardRef<HTMLButtonElement, MinimalFooterBackToTopProps>(\n ({children, className, focusTargetId, onClick, type = 'button', ...rest}, ref) => {\n const prefersReducedMotion = useReducedMotion()\n\n const handleClick = useCallback<React.MouseEventHandler<HTMLButtonElement>>(\n event => {\n onClick?.(event)\n\n if (event.defaultPrevented) {\n return\n }\n\n window.scrollTo({\n top: 0,\n behavior: prefersReducedMotion ? 'instant' : 'smooth',\n })\n\n if (event.detail === 0) {\n const focusTarget = focusTargetId\n ? document.getElementById(focusTargetId)\n : document.querySelector<HTMLElement>('main') ??\n document.querySelector<HTMLElement>('body') ??\n document.documentElement\n\n if (!focusTarget) {\n if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test') {\n // eslint-disable-next-line no-console\n console.warn(`MinimalFooter.BackToTop: No element found with id \"${focusTargetId}\".`)\n }\n return\n }\n\n const hadTabIndex = focusTarget.hasAttribute('tabindex')\n\n if (!hadTabIndex) {\n focusTarget.tabIndex = -1\n focusTarget.addEventListener('blur', () => focusTarget.removeAttribute('tabindex'), {once: true})\n }\n\n focusTarget.focus({preventScroll: true})\n }\n },\n [focusTargetId, onClick, prefersReducedMotion],\n )\n\n return (\n <button\n ref={ref}\n type={type}\n className={clsx(styles.MinimalFooter__backToTop, className)}\n onClick={handleClick}\n {...rest}\n >\n <span className={styles['MinimalFooter__backToTop-content']}>\n <Text as=\"span\" size=\"100\" weight=\"medium\" className={styles.MinimalFooter__metaText}>\n {children}\n </Text>\n <span className={styles['MinimalFooter__backToTop-icon']} aria-hidden=\"true\">\n <ArrowUpIcon />\n </span>\n </span>\n </button>\n )\n },\n)\n\n/**\n * Use MinimalFooter to render a global footer on all GitHub pages.\n * @see https://primer.style/brand/components/MinimalFooter\n */\nexport const MinimalFooter = Object.assign(Root, {\n Footnotes,\n Link,\n BackToTop,\n})\n"],"mappings":";;;;;;;;;;AAmBA,IAAM,IAAiB;CACrB,GAAG;EACD,UAAU;EACV,KAAK;EACL,MAAM;EACN,WAAW;EACX,YAAY;EACb;CACD,QAAQ;EACN,UAAU;EACV,KAAK;EACL,MAAM;EACN,WAAW;EACX,YAAY;EACb;CACD,UAAU;EACR,UAAU;EACV,KAAK;EACL,MAAM;EACN,WAAW;EACX,YAAY;EACb;CACD,SAAS;EACP,UAAU;EACV,KAAK;EACL,MAAM;EACN,WAAW;EACX,YAAY;EACb;CACD,UAAU;EACR,UAAU;EACV,KAAK;EACL,MAAM;EACN,WAAW;EACX,YAAY;EACb;CACD,QAAQ;EACN,UAAU;EACV,KAAK;EACL,MAAM;EACN,WAAW;EACX,YAAY;EACb;CACD,QAAQ;EACN,UAAU;EACV,KAAK;EACL,MAAM;EACN,WAAW;EACX,YAAY;EACb;CACD,WAAW;EACT,UAAU;EACV,KAAK;EACL,MAAM;EACN,WAAW;EACX,YAAY;EACb;CACF,EAGK,IAAkB,OAAO,KAAK,EAAe;AAyBnD,SAAS,EAAK,EACZ,oBACA,cACA,aACA,uBACA,cAAW,sBACX,gBACA,GAAG,KACqC;CACxC,IAAI,GACA,GACE,IAA8B,EAAE;AAEtC,MAAK,IAAM,KAAS,EAAM,SAAS,QAAQ,EAAS,CAC7C,GAAM,eAAe,EAAM,KAI5B,EAAM,SAAS,IACjB,MAAc,IACL,EAAM,SAAS,IACxB,MAAc,IACL,EAAM,SAAS,KAAQ,EAAM,SAAS,KAC/C,EAAM,KAAK,EAAM;CAIrB,IAAM,qBAAc,IAAI,MAAM,EAAC,aAAa,EACtC,IAAsB,MAAgB,KAAA,IAAY,IAAkB,GACpE,IAAsB,MAAwB,KAAQ,EAAE,GAAG,GAC3D,IAAiB,EAAoB,SAAS,GAC9C,IAAW,EAAM,SAAS,GAC1B,IAAgB,IAAW,kBAAC,OAAD;EAAK,WAA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kBAAC,GAAD,EAAe,CAAA;IACV,CAAA,CACF;;EACA,CAAA;EAGd,EAMY,IAAgB,OAAO,OAAO,GAAM;CAC/C;CACA;CACA;CACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"MinimalFooter.js","names":[],"sources":["../../src/MinimalFooter/MinimalFooter.tsx"],"sourcesContent":["import React, {forwardRef, PropsWithChildren, useCallback} from 'react'\nimport {clsx} from 'clsx'\nimport {ArrowUpIcon, MarkGithubIcon} from '@primer/octicons-react'\n\nimport {Text} from '../'\nimport {BaseProps} from '../component-helpers'\nimport {useReducedMotion} from '../hooks/useReducedMotion'\n\n/**\n * Design tokens\n */\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/footer/colors-with-modes.css'\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/footer/base.css'\n\n/**\n * Main Stylesheet (as a CSS Module)\n */\nimport styles from './MinimalFooter.module.css'\n\nconst socialLinkData = {\n x: {\n fullName: 'X',\n url: 'https://x.com/github',\n icon: 'https://github.githubassets.com/images/modules/site/icons/footer/x.svg',\n iconWidth: 20,\n iconHeight: 16,\n },\n github: {\n fullName: 'GitHub',\n url: 'https://github.com/github',\n icon: 'https://github.githubassets.com/images/modules/site/icons/footer/github-mark.svg',\n iconWidth: 20,\n iconHeight: 20,\n },\n linkedin: {\n fullName: 'LinkedIn',\n url: 'https://www.linkedin.com/company/github',\n icon: 'https://github.githubassets.com/images/modules/site/icons/footer/linkedin.svg',\n iconWidth: 19,\n iconHeight: 18,\n },\n youtube: {\n fullName: 'YouTube',\n url: 'https://www.youtube.com/github',\n icon: 'https://github.githubassets.com/images/modules/site/icons/footer/youtube.svg',\n iconWidth: 23,\n iconHeight: 16,\n },\n facebook: {\n fullName: 'Facebook',\n url: 'https://www.facebook.com/GitHub',\n icon: 'https://github.githubassets.com/images/modules/site/icons/footer/facebook.svg',\n iconWidth: 18,\n iconHeight: 18,\n },\n twitch: {\n fullName: 'Twitch',\n url: 'https://www.twitch.tv/github',\n icon: 'https://github.githubassets.com/images/modules/site/icons/footer/twitch.svg',\n iconWidth: 18,\n iconHeight: 18,\n },\n tiktok: {\n fullName: 'TikTok',\n url: 'https://www.tiktok.com/@github',\n icon: 'https://github.githubassets.com/images/modules/site/icons/footer/tiktok.svg',\n iconWidth: 18,\n iconHeight: 18,\n },\n instagram: {\n fullName: 'Instagram',\n url: 'https://www.instagram.com/github/',\n icon: 'https://github.githubassets.com/images/modules/site/icons/footer/instagram.svg',\n iconWidth: 24,\n iconHeight: 24,\n },\n} as const\n\ntype SocialLinkName = keyof typeof socialLinkData\nconst socialLinkNames = Object.keys(socialLinkData) as SocialLinkName[]\n\nexport type MinimalFooterProps = {\n /**\n * Escape-hatch for inserting custom React components.\n * Warning:\n * This prop isn't advertised in our docs but remains part of the public API for edge-cases.\n * Need to use this prop? Please check in with #primer-brand first to confirm correct usage.\n */\n centerComponent?: React.ReactElement\n /**\n * An array of social links to be displayed in the footer.\n */\n socialLinks?: SocialLinkName[] | false\n /**\n * The href for the GitHub logo.\n */\n logoHref?: string\n /**\n * The copyright statement to be displayed in the footer.\n * If not provided, the copyright statement will be the default GitHub copyright statement.\n */\n copyrightStatement?: string | React.ReactElement\n} & BaseProps<HTMLElement>\n\nfunction Root({\n centerComponent,\n className,\n children,\n copyrightStatement,\n logoHref = 'https://github.com',\n socialLinks,\n ...rest\n}: PropsWithChildren<MinimalFooterProps>) {\n let footnotes: React.ReactElement | undefined\n let backToTop: React.ReactElement | undefined\n const links: React.ReactElement[] = []\n\n for (const child of React.Children.toArray(children)) {\n if (!React.isValidElement(child)) {\n continue\n }\n\n if (child.type === Footnotes) {\n footnotes ??= child\n } else if (child.type === BackToTop) {\n backToTop ??= child\n } else if (child.type === Link && links.length < 5) {\n links.push(child)\n }\n }\n\n const currentYear = new Date().getFullYear()\n const resolvedSocialLinks = socialLinks === undefined ? socialLinkNames : socialLinks\n const renderedSocialLinks = resolvedSocialLinks === false ? [] : resolvedSocialLinks\n const hasSocialLinks = renderedSocialLinks.length > 0\n const hasLinks = links.length > 0\n const renderedLinks = hasLinks ? <div className={styles.MinimalFooter__links}>{links}</div> : null\n const copyright = (\n <Text\n as=\"p\"\n size=\"100\"\n font=\"monospace\"\n weight={{narrow: 'medium', wide: 'normal'}}\n variant=\"muted\"\n className={clsx(styles.MinimalFooter__copyright, styles.MinimalFooter__metaText)}\n >\n {copyrightStatement ? copyrightStatement : `\\u00A9 ${currentYear} GitHub. All rights reserved.`}\n </Text>\n )\n\n return (\n <footer\n className={clsx(styles.MinimalFooter, footnotes && styles['MinimalFooter--withFootnotes'], className)}\n {...rest}\n >\n {footnotes}\n <div className={styles.MinimalFooter__section}>\n <section className={styles.MinimalFooter__top}>\n <div className={styles.MinimalFooter__container}>\n <div className={styles['MinimalFooter__top-row']}>\n <LogoLink logoHref={logoHref} />\n {hasLinks || backToTop ? (\n <div className={styles['MinimalFooter__top-actions']}>\n {backToTop}\n {renderedLinks}\n </div>\n ) : null}\n </div>\n </div>\n </section>\n </div>\n {centerComponent ? (\n <div className={clsx(styles.MinimalFooter__section, styles['MinimalFooter__section--center'])}>\n <section className={styles.MinimalFooter__container}>{centerComponent}</section>\n </div>\n ) : null}\n <div className={clsx(styles.MinimalFooter__section, styles['MinimalFooter__section--bottom'])}>\n <section className={styles.MinimalFooter__bottom}>\n <div className={styles.MinimalFooter__container}>\n <div className={styles['MinimalFooter__bottom-row']}>\n {copyright}\n {hasSocialLinks ? <SocialLinks socialLinks={renderedSocialLinks} /> : null}\n </div>\n </div>\n </section>\n </div>\n </footer>\n )\n}\n\ntype FootnoteProps = BaseProps<HTMLElement>\n\nfunction Footnotes({children, className}: PropsWithChildren<FootnoteProps>) {\n const styledChildren = React.Children.map(children, child => {\n if (React.isValidElement<React.ComponentProps<typeof Text>>(child) && child.type === Text) {\n const textChild = child as React.ReactElement<React.ComponentProps<typeof Text>>\n const overrideProps: Partial<React.ComponentProps<typeof Text>> = {\n variant: 'muted',\n size: '100',\n className: clsx(styles['MinimalFooter__terms-item'], textChild.props.className),\n }\n\n if (!textChild.props.as) {\n overrideProps.as = 'p'\n }\n\n return React.cloneElement(textChild, overrideProps)\n }\n\n return null\n })\n\n return (\n <div className={clsx(styles.MinimalFooter__section, styles['MinimalFooter__section--footnotes'])}>\n <section className={styles.MinimalFooter__container}>\n <div className={clsx(styles.MinimalFooter__terms, className)}>{styledChildren}</div>\n </section>\n </div>\n )\n}\n\ntype SocialLinkProps = {name: SocialLinkName}\n\nconst SocialLink = ({name}: SocialLinkProps) => {\n const link = socialLinkData[name]\n return (\n <li>\n <a\n href={link.url}\n className={styles['MinimalFooter__social-link']}\n data-analytics-event={`{\"category\":\"Footer\",\"action\":\"go to ${link.fullName}\",\"label\":\"text:${name}\"}`}\n >\n <img\n className={styles['MinimalFooter__social-icon']}\n src={link.icon}\n height={link.iconHeight}\n width={link.iconWidth}\n loading=\"lazy\"\n decoding=\"async\"\n alt=\"\"\n />\n <span className=\"visually-hidden\">GitHub on {link.fullName}</span>\n </a>\n </li>\n )\n}\n\nfunction LogoLink({logoHref}: {logoHref?: string}) {\n return (\n <a\n href={logoHref}\n className={styles.MinimalFooter__logo}\n data-analytics-event='{\"category\":\"Footer\",\"action\":\"go to home\",\"label\":\"text:home\"}'\n aria-label=\"GitHub\"\n >\n <MarkGithubIcon size={24} />\n </a>\n )\n}\n\nfunction SocialLinks({socialLinks}: {socialLinks: SocialLinkName[]}) {\n return (\n <ul className={styles['MinimalFooter__social-links']}>\n {socialLinks.map(name => (\n <SocialLink key={name} name={name} />\n ))}\n </ul>\n )\n}\n\ntype LinkProps<C extends React.ElementType> = BaseProps<C> & {as?: 'a' | 'button'} & Omit<\n React.ComponentPropsWithoutRef<C>,\n keyof C\n >\n\nconst Link = <C extends React.ElementType = 'a'>({as, children, ...rest}: PropsWithChildren<LinkProps<C>>) => {\n const Component = as || 'a'\n return (\n <Component\n className={styles.MinimalFooter__link}\n data-analytics-event={\n rest['href'] ? `{\"category\":\"Footer\",\"action\":\"go to ${rest['href']}\",\"label\":\"text:${children}\"}` : undefined\n }\n {...rest}\n >\n <Text\n variant=\"muted\"\n size=\"100\"\n font=\"monospace\"\n weight={{narrow: 'medium', wide: 'normal'}}\n className={styles.MinimalFooter__metaText}\n >\n {children}\n </Text>\n </Component>\n )\n}\n\nexport type MinimalFooterBackToTopProps = {\n /**\n * The visible and accessible label.\n */\n children: React.ReactNode\n /**\n * The ID of the semantic top-of-page element that receives focus after keyboard activation.\n * Defaults to the first `<main>` element, then falls back to `<body>`.\n */\n focusTargetId?: string\n /**\n * Runs before the built-in behavior. Call `event.preventDefault()` to cancel scrolling and focus transfer.\n */\n onClick?: React.MouseEventHandler<HTMLButtonElement>\n} & BaseProps<HTMLButtonElement> &\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'children'>\n\n/**\n * Scrolls to the top and, after keyboard activation, moves focus to the configured top-of-page destination.\n */\nconst BackToTop = forwardRef<HTMLButtonElement, MinimalFooterBackToTopProps>(\n ({children, className, focusTargetId, onClick, type = 'button', ...rest}, ref) => {\n const prefersReducedMotion = useReducedMotion()\n\n const handleClick = useCallback<React.MouseEventHandler<HTMLButtonElement>>(\n event => {\n onClick?.(event)\n\n if (event.defaultPrevented) {\n return\n }\n\n window.scrollTo({\n top: 0,\n behavior: prefersReducedMotion ? 'instant' : 'smooth',\n })\n\n if (event.detail === 0) {\n const focusTarget = focusTargetId\n ? document.getElementById(focusTargetId)\n : document.querySelector<HTMLElement>('main') ??\n document.querySelector<HTMLElement>('body') ??\n document.documentElement\n\n if (!focusTarget) {\n if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test') {\n // eslint-disable-next-line no-console\n console.warn(`MinimalFooter.BackToTop: No element found with id \"${focusTargetId}\".`)\n }\n return\n }\n\n const hadTabIndex = focusTarget.hasAttribute('tabindex')\n\n if (!hadTabIndex) {\n focusTarget.tabIndex = -1\n focusTarget.addEventListener('blur', () => focusTarget.removeAttribute('tabindex'), {once: true})\n }\n\n focusTarget.focus({preventScroll: true})\n }\n },\n [focusTargetId, onClick, prefersReducedMotion],\n )\n\n return (\n <button\n ref={ref}\n type={type}\n className={clsx(styles.MinimalFooter__backToTop, className)}\n onClick={handleClick}\n {...rest}\n >\n <span className={styles['MinimalFooter__backToTop-content']}>\n <Text as=\"span\" size=\"100\" weight=\"medium\" className={styles.MinimalFooter__metaText}>\n {children}\n </Text>\n <span className={styles['MinimalFooter__backToTop-icon']} aria-hidden=\"true\">\n <ArrowUpIcon />\n </span>\n </span>\n </button>\n )\n },\n)\n\n/**\n * Use MinimalFooter to render a global footer on all GitHub pages.\n * @see https://primer.style/brand/components/MinimalFooter\n */\nexport const MinimalFooter = Object.assign(Root, {\n Footnotes,\n Link,\n BackToTop,\n})\n"],"mappings":";;;;;;;;;;;AAmBA,IAAM,IAAiB;CACrB,GAAG;EACD,UAAU;EACV,KAAK;EACL,MAAM;EACN,WAAW;EACX,YAAY;CACd;CACA,QAAQ;EACN,UAAU;EACV,KAAK;EACL,MAAM;EACN,WAAW;EACX,YAAY;CACd;CACA,UAAU;EACR,UAAU;EACV,KAAK;EACL,MAAM;EACN,WAAW;EACX,YAAY;CACd;CACA,SAAS;EACP,UAAU;EACV,KAAK;EACL,MAAM;EACN,WAAW;EACX,YAAY;CACd;CACA,UAAU;EACR,UAAU;EACV,KAAK;EACL,MAAM;EACN,WAAW;EACX,YAAY;CACd;CACA,QAAQ;EACN,UAAU;EACV,KAAK;EACL,MAAM;EACN,WAAW;EACX,YAAY;CACd;CACA,QAAQ;EACN,UAAU;EACV,KAAK;EACL,MAAM;EACN,WAAW;EACX,YAAY;CACd;CACA,WAAW;EACT,UAAU;EACV,KAAK;EACL,MAAM;EACN,WAAW;EACX,YAAY;CACd;AACF,GAGM,IAAkB,OAAO,KAAK,CAAc;AAyBlD,SAAS,EAAK,EACZ,oBACA,cACA,aACA,uBACA,cAAW,sBACX,gBACA,GAAG,KACqC;CACxC,IAAI,GACA,GACE,IAA8B,CAAC;CAErC,KAAK,IAAM,K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AAiB,cAAc,EAAY,gBAAgB,UAAU,GAAG,EAAC,MAAM,GAAI,CAAC,IAGlG,EAAY,MAAM,EAAC,eAAe,GAAI,CAAC;EACzC;CACF,GACA;EAAC;EAAe;EAAS;CAAoB,CAC/C;CAEA,OACE,kBAAC,UAAD;EACO;EACC;EACN,WAAW,EAAK,EAAO,0BAA0B,CAAS;EAC1D,SAAS;EACT,GAAI;YAEJ,kBAAC,QAAD;GAAM,WAAW,EAAO;aAAxB,CACE,kBAAC,GAAD;IAAM,IAAG;IAAO,MAAK;IAAM,QAAO;IAAS,WAAW,EAAO;IAC1D;GACG,CAAA,GACN,kBAAC,QAAD;IAAM,WAAW,EAAO;IAAkC,eAAY;cACpE,kBAAC,GAAD,CAAc,CAAA;GACV,CAAA,CACF;;CACA,CAAA;AAEZ,CACF,GAMa,IAAgB,OAAO,OAAO,GAAM;CAC/C;CACA;CACA;AACF,CAAC"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import './MinimalFooter.module-CGtOtT5r.css'
|
|
2
|
-
|
|
1
|
+
import './MinimalFooter.module-CGtOtT5r.css';//#region src/MinimalFooter/MinimalFooter.module.css
|
|
2
|
+
var e = "Primer_Brand__MinimalFooter-module__MinimalFooter___xLq65", t = "Primer_Brand__MinimalFooter-module__MinimalFooter__container___mhY_8", n = "Primer_Brand__MinimalFooter-module__MinimalFooter__terms___gwB2R", r = "Primer_Brand__MinimalFooter-module__MinimalFooter__top___UXzkJ", i = "Primer_Brand__MinimalFooter-module__MinimalFooter__links___kwBz2", a = "Primer_Brand__MinimalFooter-module__MinimalFooter__backToTop___fmxit", o = "Primer_Brand__MinimalFooter-module__MinimalFooter__logo___rFLvw", s = "Primer_Brand__MinimalFooter-module__MinimalFooter__bottom___oi9Jk", c = "Primer_Brand__MinimalFooter-module__MinimalFooter__section___W7x7a", l = "Primer_Brand__MinimalFooter-module__MinimalFooter__copyright___qQ3QR", u = "Primer_Brand__MinimalFooter-module__MinimalFooter__metaText___peNSx", d = "Primer_Brand__MinimalFooter-module__MinimalFooter__link___T4gI3", f = {
|
|
3
|
+
MinimalFooter: e,
|
|
3
4
|
"MinimalFooter--withFootnotes": "Primer_Brand__MinimalFooter-module__MinimalFooter--withFootnotes___oUvH8",
|
|
4
|
-
MinimalFooter__container:
|
|
5
|
-
MinimalFooter__terms:
|
|
5
|
+
MinimalFooter__container: t,
|
|
6
|
+
MinimalFooter__terms: n,
|
|
6
7
|
"MinimalFooter__terms-item": "Primer_Brand__MinimalFooter-module__MinimalFooter__terms-item___VB5Sx",
|
|
7
|
-
MinimalFooter__top:
|
|
8
|
+
MinimalFooter__top: r,
|
|
8
9
|
"MinimalFooter__top-row": "Primer_Brand__MinimalFooter-module__MinimalFooter__top-row____WR7L",
|
|
9
10
|
"MinimalFooter__top-actions": "Primer_Brand__MinimalFooter-module__MinimalFooter__top-actions___dz_zd",
|
|
10
|
-
MinimalFooter__links:
|
|
11
|
-
MinimalFooter__backToTop:
|
|
12
|
-
MinimalFooter__logo:
|
|
13
|
-
MinimalFooter__bottom:
|
|
14
|
-
MinimalFooter__section:
|
|
11
|
+
MinimalFooter__links: i,
|
|
12
|
+
MinimalFooter__backToTop: a,
|
|
13
|
+
MinimalFooter__logo: o,
|
|
14
|
+
MinimalFooter__bottom: s,
|
|
15
|
+
MinimalFooter__section: c,
|
|
15
16
|
"MinimalFooter__section--footnotes": "Primer_Brand__MinimalFooter-module__MinimalFooter__section--footnotes___9t40F",
|
|
16
17
|
"MinimalFooter__section--center": "Primer_Brand__MinimalFooter-module__MinimalFooter__section--center___K3_Ia",
|
|
17
18
|
"MinimalFooter__section--bottom": "Primer_Brand__MinimalFooter-module__MinimalFooter__section--bottom___HwSJJ",
|
|
@@ -19,13 +20,13 @@ import './MinimalFooter.module-CGtOtT5r.css';var e = {
|
|
|
19
20
|
"MinimalFooter__social-links": "Primer_Brand__MinimalFooter-module__MinimalFooter__social-links___0zKRs",
|
|
20
21
|
"MinimalFooter__social-link": "Primer_Brand__MinimalFooter-module__MinimalFooter__social-link___T5TF0",
|
|
21
22
|
"MinimalFooter__social-icon": "Primer_Brand__MinimalFooter-module__MinimalFooter__social-icon___N1tDK",
|
|
22
|
-
MinimalFooter__copyright:
|
|
23
|
-
MinimalFooter__metaText:
|
|
24
|
-
MinimalFooter__link:
|
|
23
|
+
MinimalFooter__copyright: l,
|
|
24
|
+
MinimalFooter__metaText: u,
|
|
25
|
+
MinimalFooter__link: d,
|
|
25
26
|
"MinimalFooter__backToTop-content": "Primer_Brand__MinimalFooter-module__MinimalFooter__backToTop-content___umaLY",
|
|
26
27
|
"MinimalFooter__backToTop-icon": "Primer_Brand__MinimalFooter-module__MinimalFooter__backToTop-icon___y85GZ"
|
|
27
28
|
};
|
|
28
29
|
//#endregion
|
|
29
|
-
export { e as default };
|
|
30
|
+
export { e as MinimalFooter, a as MinimalFooter__backToTop, s as MinimalFooter__bottom, t as MinimalFooter__container, l as MinimalFooter__copyright, d as MinimalFooter__link, i as MinimalFooter__links, o as MinimalFooter__logo, u as MinimalFooter__metaText, c as MinimalFooter__section, n as MinimalFooter__terms, r as MinimalFooter__top, f as default };
|
|
30
31
|
|
|
31
32
|
//# sourceMappingURL=MinimalFooter.module.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
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 { useReducedMotion as t } from "../hooks/useReducedMotion.js";
|
|
3
|
-
import { PauseIcon as n } from "../node_modules/@primer/octicons-react/dist/
|
|
3
|
+
import { PauseIcon as n } from "../node_modules/@primer/octicons-react/dist/icons/PauseIcon.js";
|
|
4
4
|
import { useMinimalVideoPlayback as r } from "./useMinimalVideoPlayback.js";
|
|
5
5
|
import i from "./MinimalVideoPlayer.module.js";
|
|
6
6
|
import { forwardRef as a } from "react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MinimalVideoPlayer.js","names":[],"sources":["../../src/MinimalVideoPlayer/MinimalVideoPlayer.tsx"],"sourcesContent":["import {clsx} from 'clsx'\nimport {PauseIcon} from '@primer/octicons-react'\nimport React, {forwardRef, type ComponentPropsWithoutRef} from 'react'\n\nimport {useReducedMotion} from '../hooks/useReducedMotion'\nimport {useMinimalVideoPlayback} from './useMinimalVideoPlayback'\nimport styles from './MinimalVideoPlayer.module.css'\n\nexport type MinimalVideoPlayerProps = Omit<\n ComponentPropsWithoutRef<'video'>,\n 'autoPlay' | 'controls' | 'defaultMuted' | 'muted' | 'onVolumeChange' | 'playsInline' | 'title'\n> & {\n /**\n * Plays the video when it is visible.\n * @default true\n */\n autoPlay?: boolean\n /**\n * Provides an accessible name for the video.\n */\n title: string\n /**\n * Customizable labels for the internal play and pause control.\n */\n internalAccessibleLabels?: {\n play: string\n pause: string\n }\n ['data-testid']?: string\n}\n\nconst defaultInternalAccessibleLabels = {\n play: 'Play video',\n pause: 'Pause video',\n}\n\nconst testIds = {\n root: 'MinimalVideoPlayer',\n get video() {\n return `${this.root}-video`\n },\n get control() {\n return `${this.root}-control`\n },\n}\n\nexport const _MinimalVideoPlayer = forwardRef<HTMLVideoElement, MinimalVideoPlayerProps>(\n (\n {\n autoPlay = true,\n children,\n className,\n 'data-testid': testId,\n internalAccessibleLabels = defaultInternalAccessibleLabels,\n loop = true,\n onEnded,\n onPause,\n onPlay,\n onPlaying,\n title,\n ...rest\n },\n forwardedRef,\n ) => {\n const prefersReducedMotion = useReducedMotion()\n const {handlePlaybackEnded, handlePlaybackPaused, handlePlaybackStarted, isPlaying, togglePlayback, videoRef} =\n useMinimalVideoPlayback({\n autoPlay,\n forwardedRef,\n prefersReducedMotion,\n })\n\n return (\n <div className={styles.MinimalVideoPlayer} data-testid={testId || testIds.root}>\n <video\n {...rest}\n ref={videoRef}\n autoPlay={false}\n className={clsx(styles.MinimalVideoPlayer__video, className)}\n controls={false}\n data-testid={testIds.video}\n loop={loop}\n muted\n onEnded={event => {\n handlePlaybackEnded()\n onEnded?.(event)\n }}\n onPause={event => {\n handlePlaybackPaused()\n onPause?.(event)\n }}\n onPlay={event => {\n handlePlaybackStarted()\n onPlay?.(event)\n }}\n onPlaying={event => {\n handlePlaybackStarted()\n onPlaying?.(event)\n }}\n playsInline\n title={title}\n >\n {children}\n </video>\n <button\n aria-label={isPlaying ? internalAccessibleLabels.pause : internalAccessibleLabels.play}\n className={styles.MinimalVideoPlayer__control}\n data-testid={testIds.control}\n onClick={togglePlayback}\n type=\"button\"\n >\n {isPlaying ? (\n <PauseIcon aria-hidden=\"true\" />\n ) : (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M13.3777 6.94756C14.2069 7.40341 14.2069 8.59489 13.3777 9.05073L5.37808 13.4483C4.57834 13.8879 3.60001 13.3093 3.60001 12.3967L3.60001 3.60161C3.60001 2.689 4.57834 2.1104 5.37808 2.55003L13.3777 6.94756Z\"\n fill=\"currentColor\"\n />\n </svg>\n )}\n </button>\n </div>\n )\n },\n)\n\nexport const MinimalVideoPlayer = Object.assign(_MinimalVideoPlayer, {testIds})\n"],"mappings":";;;;;;;;AA+BA,IAAM,IAAkC;CACtC,MAAM;CACN,OAAO;
|
|
1
|
+
{"version":3,"file":"MinimalVideoPlayer.js","names":[],"sources":["../../src/MinimalVideoPlayer/MinimalVideoPlayer.tsx"],"sourcesContent":["import {clsx} from 'clsx'\nimport {PauseIcon} from '@primer/octicons-react'\nimport React, {forwardRef, type ComponentPropsWithoutRef} from 'react'\n\nimport {useReducedMotion} from '../hooks/useReducedMotion'\nimport {useMinimalVideoPlayback} from './useMinimalVideoPlayback'\nimport styles from './MinimalVideoPlayer.module.css'\n\nexport type MinimalVideoPlayerProps = Omit<\n ComponentPropsWithoutRef<'video'>,\n 'autoPlay' | 'controls' | 'defaultMuted' | 'muted' | 'onVolumeChange' | 'playsInline' | 'title'\n> & {\n /**\n * Plays the video when it is visible.\n * @default true\n */\n autoPlay?: boolean\n /**\n * Provides an accessible name for the video.\n */\n title: string\n /**\n * Customizable labels for the internal play and pause control.\n */\n internalAccessibleLabels?: {\n play: string\n pause: string\n }\n ['data-testid']?: string\n}\n\nconst defaultInternalAccessibleLabels = {\n play: 'Play video',\n pause: 'Pause video',\n}\n\nconst testIds = {\n root: 'MinimalVideoPlayer',\n get video() {\n return `${this.root}-video`\n },\n get control() {\n return `${this.root}-control`\n },\n}\n\nexport const _MinimalVideoPlayer = forwardRef<HTMLVideoElement, MinimalVideoPlayerProps>(\n (\n {\n autoPlay = true,\n children,\n className,\n 'data-testid': testId,\n internalAccessibleLabels = defaultInternalAccessibleLabels,\n loop = true,\n onEnded,\n onPause,\n onPlay,\n onPlaying,\n title,\n ...rest\n },\n forwardedRef,\n ) => {\n const prefersReducedMotion = useReducedMotion()\n const {handlePlaybackEnded, handlePlaybackPaused, handlePlaybackStarted, isPlaying, togglePlayback, videoRef} =\n useMinimalVideoPlayback({\n autoPlay,\n forwardedRef,\n prefersReducedMotion,\n })\n\n return (\n <div className={styles.MinimalVideoPlayer} data-testid={testId || testIds.root}>\n <video\n {...rest}\n ref={videoRef}\n autoPlay={false}\n className={clsx(styles.MinimalVideoPlayer__video, className)}\n controls={false}\n data-testid={testIds.video}\n loop={loop}\n muted\n onEnded={event => {\n handlePlaybackEnded()\n onEnded?.(event)\n }}\n onPause={event => {\n handlePlaybackPaused()\n onPause?.(event)\n }}\n onPlay={event => {\n handlePlaybackStarted()\n onPlay?.(event)\n }}\n onPlaying={event => {\n handlePlaybackStarted()\n onPlaying?.(event)\n }}\n playsInline\n title={title}\n >\n {children}\n </video>\n <button\n aria-label={isPlaying ? internalAccessibleLabels.pause : internalAccessibleLabels.play}\n className={styles.MinimalVideoPlayer__control}\n data-testid={testIds.control}\n onClick={togglePlayback}\n type=\"button\"\n >\n {isPlaying ? (\n <PauseIcon aria-hidden=\"true\" />\n ) : (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M13.3777 6.94756C14.2069 7.40341 14.2069 8.59489 13.3777 9.05073L5.37808 13.4483C4.57834 13.8879 3.60001 13.3093 3.60001 12.3967L3.60001 3.60161C3.60001 2.689 4.57834 2.1104 5.37808 2.55003L13.3777 6.94756Z\"\n fill=\"currentColor\"\n />\n </svg>\n )}\n </button>\n </div>\n )\n },\n)\n\nexport const MinimalVideoPlayer = Object.assign(_MinimalVideoPlayer, {testIds})\n"],"mappings":";;;;;;;;AA+BA,IAAM,IAAkC;CACtC,MAAM;CACN,OAAO;AACT,GAEM,IAAU;CACd,MAAM;CACN,IAAI,QAAQ;EACV,OAAO,GAAG,KAAK,KAAK;CACtB;CACA,IAAI,UAAU;EACZ,OAAO,GAAG,KAAK,KAAK;CACtB;AACF,GAEa,IAAsB,GAE/B,EACE,cAAW,IACX,aACA,cACA,eAAe,GACf,8BAA2B,GAC3B,UAAO,IACP,YACA,YACA,WACA,cACA,UACA,GAAG,KAEL,MACG;CAEH,IAAM,EAAC,wBAAqB,yBAAsB,0BAAuB,cAAW,mBAAgB,gBAClG,EAAwB;EACtB;EACA;EACA,sBALyB,EAKzB;CACF,CAAC;CAEH,OACE,kBAAC,OAAD;EAAK,WAAW,EAAO;EAAoB,eAAa,KAAU,EAAQ;YAA1E,CACE,kBAAC,SAAD;GACE,GAAI;GACJ,KAAK;GACL,UAAU;GACV,WAAW,EAAK,EAAO,2BAA2B,CAAS;GAC3D,UAAU;GACV,eAAa,EAAQ;GACf;GACN,OAAA;GACA,UAAS,MAAS;IAEhB,AADA,EAAoB,GACpB,IAAU,CAAK;GACjB;GACA,UAAS,MAAS;IAEhB,AADA,EAAqB,GACrB,IAAU,CAAK;GACjB;GACA,SAAQ,MAAS;IAEf,AADA,EAAsB,GACtB,IAAS,CAAK;GAChB;GACA,YAAW,MAAS;IAElB,AADA,EAAsB,GACtB,IAAY,CAAK;GACnB;GACA,aAAA;GACO;GAEN;EACI,CAAA,GACP,kBAAC,UAAD;GACE,cAAY,IAAY,EAAyB,QAAQ,EAAyB;GAClF,WAAW,EAAO;GAClB,eAAa,EAAQ;GACrB,SAAS;GACT,MAAK;aAEJ,IACC,kBAAC,GAAD,EAAW,eAAY,OAAQ,CAAA,IAE/B,kBAAC,OAAD;IAAK,OAAM;IAAK,QAAO;IAAK,SAAQ;IAAY,MAAK;IAAO,OAAM;cAChE,kBAAC,QAAD;KACE,GAAE;KACF,MAAK;IACN,CAAA;GACE,CAAA;EAED,CAAA,CACL;;AAET,CACF,GAEa,IAAqB,OAAO,OAAO,GAAqB,EAAC,WAAO,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import './MinimalVideoPlayer.module-Bcv4-Y5D.css'
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import './MinimalVideoPlayer.module-Bcv4-Y5D.css';//#region src/MinimalVideoPlayer/MinimalVideoPlayer.module.css
|
|
2
|
+
var e = "Primer_Brand__MinimalVideoPlayer-module__MinimalVideoPlayer___s8ncI", t = "Primer_Brand__MinimalVideoPlayer-module__MinimalVideoPlayer__video___f5cBj", n = "Primer_Brand__MinimalVideoPlayer-module__MinimalVideoPlayer__control___w7dA_", r = {
|
|
3
|
+
MinimalVideoPlayer: e,
|
|
4
|
+
MinimalVideoPlayer__video: t,
|
|
5
|
+
MinimalVideoPlayer__control: n
|
|
5
6
|
};
|
|
6
7
|
//#endregion
|
|
7
|
-
export { e as default };
|
|
8
|
+
export { e as MinimalVideoPlayer, n as MinimalVideoPlayer__control, t as MinimalVideoPlayer__video, r as default };
|
|
8
9
|
|
|
9
10
|
//# sourceMappingURL=MinimalVideoPlayer.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMinimalVideoPlayback.js","names":[],"sources":["../../src/MinimalVideoPlayer/useMinimalVideoPlayback.ts"],"sourcesContent":["import {useCallback, useEffect, useRef, useState, type Ref} from 'react'\n\nimport {useProvidedRefOrCreate} from '../hooks/useRef'\n\ntype UseMinimalVideoPlaybackOptions = {\n autoPlay: boolean\n forwardedRef: Ref<HTMLVideoElement>\n prefersReducedMotion: boolean\n}\n\nexport function useMinimalVideoPlayback({\n autoPlay,\n forwardedRef,\n prefersReducedMotion,\n}: UseMinimalVideoPlaybackOptions) {\n const videoRef = useProvidedRefOrCreate<HTMLVideoElement | null>(forwardedRef)\n const pausedByViewportRef = useRef(false)\n const initialAutoPlayHandledRef = useRef(false)\n const [isPlaying, setIsPlaying] = useState(false)\n\n const requestPlayback = useCallback(async () => {\n const video = videoRef.current\n\n if (!video) return\n\n try {\n await video.play()\n } catch {\n if (video.paused) {\n setIsPlaying(false)\n }\n }\n }, [videoRef])\n\n const handlePlaybackStarted = useCallback(() => setIsPlaying(true), [])\n const handlePlaybackPaused = useCallback(() => setIsPlaying(false), [])\n const handlePlaybackEnded = useCallback(() => {\n pausedByViewportRef.current = false\n setIsPlaying(false)\n }, [])\n\n useEffect(() => {\n const video = videoRef.current\n\n if (!video) return\n\n const handleVisibilityChange = (isVisible: boolean) => {\n if (isVisible) {\n if (pausedByViewportRef.current) {\n pausedByViewportRef.current = false\n if (autoPlay && !prefersReducedMotion) {\n requestPlayback()\n }\n return\n }\n\n if (!initialAutoPlayHandledRef.current && prefersReducedMotion) {\n initialAutoPlayHandledRef.current = true\n return\n }\n\n if (!initialAutoPlayHandledRef.current && autoPlay) {\n initialAutoPlayHandledRef.current = true\n requestPlayback()\n }\n return\n }\n\n if (!video.paused) {\n pausedByViewportRef.current = autoPlay && !prefersReducedMotion\n video.pause()\n }\n }\n\n if (typeof IntersectionObserver === 'undefined') {\n handleVisibilityChange(true)\n return\n }\n\n const observer = new IntersectionObserver(([entry]) => {\n handleVisibilityChange(entry.intersectionRatio > 0)\n })\n\n observer.observe(video)\n return () => observer.disconnect()\n }, [autoPlay, prefersReducedMotion, requestPlayback, videoRef])\n\n useEffect(() => {\n if (!prefersReducedMotion) return\n\n initialAutoPlayHandledRef.current = true\n pausedByViewportRef.current = false\n videoRef.current?.pause()\n }, [prefersReducedMotion, videoRef])\n\n const togglePlayback = useCallback(() => {\n const video = videoRef.current\n\n if (!video) return\n\n initialAutoPlayHandledRef.current = true\n pausedByViewportRef.current = false\n\n if (isPlaying) {\n setIsPlaying(false)\n video.pause()\n return\n }\n\n requestPlayback()\n }, [isPlaying, requestPlayback, videoRef])\n\n return {\n handlePlaybackEnded,\n handlePlaybackPaused,\n handlePlaybackStarted,\n isPlaying,\n togglePlayback,\n videoRef,\n }\n}\n"],"mappings":";;;AAUA,SAAgB,EAAwB,EACtC,aACA,iBACA,2BACiC;CACjC,IAAM,IAAW,EAAgD,
|
|
1
|
+
{"version":3,"file":"useMinimalVideoPlayback.js","names":[],"sources":["../../src/MinimalVideoPlayer/useMinimalVideoPlayback.ts"],"sourcesContent":["import {useCallback, useEffect, useRef, useState, type Ref} from 'react'\n\nimport {useProvidedRefOrCreate} from '../hooks/useRef'\n\ntype UseMinimalVideoPlaybackOptions = {\n autoPlay: boolean\n forwardedRef: Ref<HTMLVideoElement>\n prefersReducedMotion: boolean\n}\n\nexport function useMinimalVideoPlayback({\n autoPlay,\n forwardedRef,\n prefersReducedMotion,\n}: UseMinimalVideoPlaybackOptions) {\n const videoRef = useProvidedRefOrCreate<HTMLVideoElement | null>(forwardedRef)\n const pausedByViewportRef = useRef(false)\n const initialAutoPlayHandledRef = useRef(false)\n const [isPlaying, setIsPlaying] = useState(false)\n\n const requestPlayback = useCallback(async () => {\n const video = videoRef.current\n\n if (!video) return\n\n try {\n await video.play()\n } catch {\n if (video.paused) {\n setIsPlaying(false)\n }\n }\n }, [videoRef])\n\n const handlePlaybackStarted = useCallback(() => setIsPlaying(true), [])\n const handlePlaybackPaused = useCallback(() => setIsPlaying(false), [])\n const handlePlaybackEnded = useCallback(() => {\n pausedByViewportRef.current = false\n setIsPlaying(false)\n }, [])\n\n useEffect(() => {\n const video = videoRef.current\n\n if (!video) return\n\n const handleVisibilityChange = (isVisible: boolean) => {\n if (isVisible) {\n if (pausedByViewportRef.current) {\n pausedByViewportRef.current = false\n if (autoPlay && !prefersReducedMotion) {\n requestPlayback()\n }\n return\n }\n\n if (!initialAutoPlayHandledRef.current && prefersReducedMotion) {\n initialAutoPlayHandledRef.current = true\n return\n }\n\n if (!initialAutoPlayHandledRef.current && autoPlay) {\n initialAutoPlayHandledRef.current = true\n requestPlayback()\n }\n return\n }\n\n if (!video.paused) {\n pausedByViewportRef.current = autoPlay && !prefersReducedMotion\n video.pause()\n }\n }\n\n if (typeof IntersectionObserver === 'undefined') {\n handleVisibilityChange(true)\n return\n }\n\n const observer = new IntersectionObserver(([entry]) => {\n handleVisibilityChange(entry.intersectionRatio > 0)\n })\n\n observer.observe(video)\n return () => observer.disconnect()\n }, [autoPlay, prefersReducedMotion, requestPlayback, videoRef])\n\n useEffect(() => {\n if (!prefersReducedMotion) return\n\n initialAutoPlayHandledRef.current = true\n pausedByViewportRef.current = false\n videoRef.current?.pause()\n }, [prefersReducedMotion, videoRef])\n\n const togglePlayback = useCallback(() => {\n const video = videoRef.current\n\n if (!video) return\n\n initialAutoPlayHandledRef.current = true\n pausedByViewportRef.current = false\n\n if (isPlaying) {\n setIsPlaying(false)\n video.pause()\n return\n }\n\n requestPlayback()\n }, [isPlaying, requestPlayback, videoRef])\n\n return {\n handlePlaybackEnded,\n handlePlaybackPaused,\n handlePlaybackStarted,\n isPlaying,\n togglePlayback,\n videoRef,\n }\n}\n"],"mappings":";;;AAUA,SAAgB,EAAwB,EACtC,aACA,iBACA,2BACiC;CACjC,IAAM,IAAW,EAAgD,CAAY,GACvE,IAAsB,EAAO,EAAK,GAClC,IAA4B,EAAO,EAAK,GACxC,CAAC,GAAW,KAAgB,EAAS,EAAK,GAE1C,IAAkB,EAAY,YAAY;EAC9C,IAAM,IAAQ,EAAS;EAElB,OAEL,IAAI;GACF,MAAM,EAAM,KAAK;EACnB,QAAQ;GACN,AAAI,EAAM,UACR,EAAa,EAAK;EAEtB;CACF,GAAG,CAAC,CAAQ,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W;GAAiB;EAAQ,CAOtC;EACA;CACF;AACF"}
|
package/esm/NavList/NavList.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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 { useId as t } from "../hooks/useId.js";
|
|
3
|
-
import { TriangleDownIcon as n } from "../node_modules/@primer/octicons-react/dist/
|
|
3
|
+
import { TriangleDownIcon as n } from "../node_modules/@primer/octicons-react/dist/icons/TriangleDownIcon.js";
|
|
4
4
|
import '../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/nav-list/colors-with-modes-CGyt2t8f.css';/* empty css */
|
|
5
5
|
import r from "./NavList.module.js";
|
|
6
6
|
import i, { Children as a, createContext as o, forwardRef as s, isValidElement as c, useCallback as l, useContext as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavList.js","names":[],"sources":["../../src/NavList/NavList.tsx"],"sourcesContent":["import React, {\n Children,\n createContext,\n forwardRef,\n isValidElement,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type AriaAttributes,\n type MutableRefObject,\n type PropsWithChildren,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react'\n\nimport {clsx} from 'clsx'\nimport {TriangleDownIcon, type Icon} from '@primer/octicons-react'\nimport type {BaseProps} from '../component-helpers'\nimport {useId} from '../hooks/useId'\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/nav-list/colors-with-modes.css'\n\n/** * Main stylesheet (as a CSS Module) */\nimport styles from './NavList.module.css'\n\nconst testIds = {\n root: 'NavList',\n get list() {\n return `${this.root}-list`\n },\n get item() {\n return `${this.root}-item`\n },\n get link() {\n return `${this.root}-link`\n },\n get leadingVisual() {\n return `${this.root}-leading-visual`\n },\n get trailingVisual() {\n return `${this.root}-trailing-visual`\n },\n get subNav() {\n return `${this.root}-sub-nav`\n },\n get group() {\n return `${this.root}-group`\n },\n get groupTitle() {\n return `${this.root}-group-title`\n },\n get groupList() {\n return `${this.root}-group-list`\n },\n get toggle() {\n return `${this.root}-toggle`\n },\n}\n\nexport type NavListRootProps = {\n /**\n * Accessible label for the navigation landmark.\n */\n 'aria-label': string\n /**\n * ID of an element that labels the navigation landmark.\n */\n 'aria-labelledby'?: string\n children: ReactNode\n 'data-testid'?: string\n} & BaseProps<HTMLElement> &\n Omit<React.HTMLAttributes<HTMLElement>, 'aria-label' | 'aria-labelledby'>\n\ntype NavListLevel = 1 | 2 | 3 | 4 | 5\n\nconst MaxNavListLevel = 5\nconst NavListLevelContext = createContext<NavListLevel>(1)\nconst NavListSubNavContext = createContext<{\n expanded: boolean\n labelledBy?: string\n level: NavListLevel\n}>({\n expanded: true,\n level: 2,\n})\n\nconst NavListRoot = forwardRef<HTMLElement, NavListRootProps>(\n (\n {children, className, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'data-testid': testId, ...rest},\n ref,\n ) => {\n const childrenArray = useMemo(() => Children.toArray(children), [children])\n const hasTopLevelSubNav = useMemo(() => childrenArray.some(childHasDirectSubNav), [childrenArray])\n const hasTopLevelGroup = useMemo(() => childrenArray.some(childIsNavListGroupElement), [childrenArray])\n const rootLevel = hasTopLevelSubNav ? 1 : 2\n const hasFlatRootList = !hasTopLevelSubNav && !hasTopLevelGroup\n\n return (\n <nav\n ref={ref}\n className={clsx(styles.NavList, className)}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n data-testid={testId || testIds.root}\n {...rest}\n >\n <NavListLevelContext.Provider value={rootLevel}>\n <ul\n className={clsx(styles.NavList__list, hasFlatRootList && styles['NavList__list--flat'])}\n data-testid={testIds.list}\n >\n {children}\n </ul>\n </NavListLevelContext.Provider>\n </nav>\n )\n },\n)\n\ntype Visual = ReactElement | React.ElementType | Icon\ntype NavListItemAs = 'a' | 'button'\n\ntype NavListItemBaseProps = {\n /**\n * Leading visual rendered before the item label.\n */\n leadingVisual?: Visual\n /**\n * Trailing visual rendered after the item label.\n */\n trailingVisual?: Visual\n /**\n * Whether nested items should be expanded by default.\n */\n defaultExpanded?: boolean\n /**\n * Controls the nested item expanded state.\n */\n expanded?: boolean\n /**\n * Called when a nested item is expanded or collapsed.\n */\n onExpandedChange?: (expanded: boolean) => void\n /**\n * Marks the item as disabled. Disabled link items receive `aria-disabled`.\n */\n disabled?: boolean\n 'data-testid'?: string\n}\n\nexport type NavListItemProps<C extends NavListItemAs = 'a'> = {\n as?: C\n} & NavListItemBaseProps &\n PropsWithChildren<BaseProps<HTMLElement>> &\n Omit<React.ComponentPropsWithoutRef<C>, keyof NavListItemBaseProps | keyof BaseProps<HTMLElement> | 'as' | 'children'>\n\ntype NavListSubNavElement = ReactElement<NavListSubNavProps>\n\nconst NavListItem = forwardRef(\n (\n {\n as,\n children,\n className,\n defaultExpanded = false,\n disabled = false,\n expanded,\n leadingVisual,\n onClick,\n onExpandedChange,\n trailingVisual,\n 'aria-current': ariaCurrent,\n 'data-testid': testId,\n ...rest\n }: NavListItemProps<NavListItemAs>,\n ref: Ref<HTMLElement>,\n ) => {\n const Component = (as || 'a') as React.ElementType\n const level = useContext(NavListLevelContext)\n const subNavId = useId()\n const accordionButtonId = useId()\n const childrenArray = useMemo(() => Children.toArray(children), [children])\n const subNavChildren = useMemo(() => childrenArray.filter(isNavListSubNavElement), [childrenArray])\n const subNav = useMemo(() => childrenArray.find(isNavListSubNavElement), [childrenArray])\n const navListGroupChildren = useMemo(() => childrenArray.filter(childHasNavListGroupElement), [childrenArray])\n const labelChildren = useMemo(\n () => (subNav ? childrenArray.filter(child => child !== subNav) : childrenArray),\n [childrenArray, subNav],\n )\n const hasLabelContent = labelChildren.length > 0\n const hasSubNav = Boolean(subNav)\n const canExpand = level < MaxNavListLevel\n const isLeafItem = !hasSubNav\n const controlledSubNavId = subNav?.props.id ?? subNavId\n const hasCurrentSubNavItem = useMemo(() => hasCurrentDescendant(subNav?.props.children), [subNav?.props.children])\n const isControlled = expanded !== undefined\n const [uncontrolledExpanded, setUncontrolledExpanded] = useState(defaultExpanded || hasCurrentSubNavItem)\n const isExpanded = Boolean(isControlled ? expanded : uncontrolledExpanded)\n const {\n href,\n id: accordionButtonIdProp,\n ...accordionButtonProps\n } = rest as React.ButtonHTMLAttributes<HTMLButtonElement> & {\n href?: string\n }\n const controlledAccordionButtonId = accordionButtonIdProp ?? accordionButtonId\n const itemOnClick = onClick as React.MouseEventHandler<HTMLElement> | undefined\n const invalidMessage = useMemo(() => {\n if (navListGroupChildren.length > 0) {\n return 'NavList.Item: NavList.Group is not supported as a child. Use NavList.SubNav for nested disclosure. NavList.Item will not be rendered.'\n }\n\n if (hasSubNav && !canExpand) {\n return 'NavList.Item: NavList supports up to 5 levels. Level 5 items cannot contain NavList.SubNav. NavList.Item will not be rendered.'\n }\n\n if (subNavChildren.length > 1) {\n return 'NavList.Item: Only one NavList.SubNav child is supported. NavList.Item will not be rendered.'\n }\n\n if (hasSubNav && !hasLabelContent) {\n return 'NavList.Item: A label is required when using NavList.SubNav. NavList.Item will not be rendered.'\n }\n\n if (hasSubNav && (href !== undefined || as !== undefined)) {\n return 'NavList.Item: `href` and `as` are not supported when using NavList.SubNav because expandable items render as buttons. NavList.Item will not be rendered.'\n }\n }, [as, canExpand, hasLabelContent, hasSubNav, href, navListGroupChildren.length, subNavChildren.length])\n\n useEffect(() => {\n if (hasCurrentSubNavItem && !isControlled) {\n setUncontrolledExpanded(true)\n }\n }, [hasCurrentSubNavItem, isControlled])\n\n const setExpanded = useCallback(\n (value: boolean) => {\n if (!isControlled) {\n setUncontrolledExpanded(value)\n }\n onExpandedChange?.(value)\n },\n [isControlled, onExpandedChange],\n )\n\n const toggleExpanded = useCallback(() => {\n setExpanded(!isExpanded)\n }, [isExpanded, setExpanded])\n\n const handleClick = useCallback(\n (event: React.MouseEvent<HTMLElement>) => {\n if (disabled) {\n event.preventDefault()\n return\n }\n\n itemOnClick?.(event)\n },\n [disabled, itemOnClick],\n )\n\n const setAccordionButtonRef = useCallback(\n (node: HTMLButtonElement | null) => {\n assignRef(ref, node)\n },\n [ref],\n )\n\n const handleAccordionClick = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n if (disabled) {\n event.preventDefault()\n return\n }\n\n itemOnClick?.(event)\n\n if (!event.defaultPrevented) {\n toggleExpanded()\n }\n },\n [disabled, itemOnClick, toggleExpanded],\n )\n\n if (invalidMessage) {\n warnNavListValidation(invalidMessage)\n return null\n }\n\n const labelArea = (\n <span className={styles.NavList__labelArea}>\n {renderVisual(leadingVisual, styles.NavList__leadingVisual, testIds.leadingVisual)}\n <span className={styles.NavList__label}>{labelChildren}</span>\n {renderVisual(trailingVisual, styles.NavList__trailingVisual, testIds.trailingVisual)}\n </span>\n )\n\n return (\n <li\n className={clsx(\n styles.NavList__item,\n styles[`NavList__item--level-${level}`],\n isLeafItem && styles['NavList__item--leaf'],\n hasSubNav && isExpanded && styles['NavList__item--expanded'],\n hasCurrentSubNavItem && styles['NavList__item--has-current-descendant'],\n )}\n data-testid={testId || testIds.item}\n >\n <div className={styles.NavList__itemContent}>\n {hasSubNav && canExpand ? (\n <button\n ref={setAccordionButtonRef}\n id={controlledAccordionButtonId}\n type=\"button\"\n className={clsx(\n styles.NavList__link,\n styles.NavList__accordionButton,\n disabled && styles['NavList__link--disabled'],\n className,\n )}\n aria-expanded={isExpanded ? 'true' : 'false'}\n aria-controls={controlledSubNavId}\n data-testid={testIds.toggle}\n {...accordionButtonProps}\n disabled={disabled}\n onClick={handleAccordionClick}\n >\n <TriangleDownIcon className={styles.NavList__toggleIcon} aria-hidden=\"true\" />\n {labelArea}\n </button>\n ) : (\n <Component\n ref={ref}\n className={clsx(styles.NavList__link, disabled && styles['NavList__link--disabled'], className)}\n aria-current={ariaCurrent}\n aria-disabled={disabled || undefined}\n data-testid={testIds.link}\n onClick={handleClick}\n {...rest}\n >\n {labelArea}\n </Component>\n )}\n </div>\n\n {subNav ? (\n <NavListSubNavContext.Provider\n value={{expanded: isExpanded, labelledBy: controlledAccordionButtonId, level: (level + 1) as NavListLevel}}\n >\n {React.cloneElement(subNav, {\n id: controlledSubNavId,\n })}\n </NavListSubNavContext.Provider>\n ) : null}\n </li>\n )\n },\n) as <C extends NavListItemAs = 'a'>(props: NavListItemProps<C> & {ref?: Ref<HTMLElement>}) => ReactElement | null\n\nexport type NavListSubNavProps = {\n children: ReactNode\n 'data-testid'?: string\n} & BaseProps<HTMLUListElement> &\n React.HTMLAttributes<HTMLUListElement>\n\nconst NavListSubNav = forwardRef<HTMLUListElement, NavListSubNavProps>(\n ({children, className, 'aria-labelledby': ariaLabelledBy, 'data-testid': testId, ...rest}, ref) => {\n const {expanded, labelledBy, level} = useContext(NavListSubNavContext)\n const subNavRef = useRef<HTMLUListElement | null>(null)\n\n const setSubNavHeight = useCallback((subNav: HTMLUListElement) => {\n subNav.style.setProperty('--brand-NavList-subNav-height', `${subNav.scrollHeight}px`)\n }, [])\n\n const setSubNavAndAncestorHeights = useCallback(() => {\n let subNav = subNavRef.current\n\n while (subNav) {\n setSubNavHeight(subNav)\n subNav = subNav.parentElement?.closest<HTMLUListElement>(`.${styles.NavList__subNav}`) ?? null\n }\n }, [setSubNavHeight])\n\n const setSubNavRef = useCallback(\n (node: HTMLUListElement | null) => {\n subNavRef.current = node\n assignRef(ref, node)\n },\n [ref],\n )\n\n useEffect(() => {\n setSubNavAndAncestorHeights()\n }, [children, expanded, setSubNavAndAncestorHeights])\n\n useEffect(() => {\n subNavRef.current?.toggleAttribute('inert', !expanded)\n }, [expanded])\n\n useEffect(() => {\n const subNav = subNavRef.current\n\n if (!subNav || typeof ResizeObserver === 'undefined') {\n return\n }\n\n const resizeObserver = new ResizeObserver(setSubNavAndAncestorHeights)\n resizeObserver.observe(subNav)\n\n return () => {\n resizeObserver.disconnect()\n }\n }, [setSubNavAndAncestorHeights])\n\n return (\n <ul\n ref={setSubNavRef}\n className={clsx(styles.NavList__subNav, expanded && styles['NavList__subNav--expanded'], className)}\n aria-labelledby={ariaLabelledBy ?? labelledBy}\n {...rest}\n aria-hidden={expanded ? undefined : 'true'}\n data-testid={testId || testIds.subNav}\n >\n <NavListLevelContext.Provider value={level}>{children}</NavListLevelContext.Provider>\n </ul>\n )\n },\n)\n\nexport type NavListGroupProps = {\n /**\n * Heading text for the group.\n */\n title?: ReactNode\n children: ReactNode\n 'data-testid'?: string\n} & BaseProps<HTMLLIElement> &\n Omit<React.LiHTMLAttributes<HTMLLIElement>, 'title'>\n\nconst NavListGroup = forwardRef<HTMLLIElement, NavListGroupProps>(\n ({title, children, className, 'data-testid': testId, ...rest}, ref) => {\n const titleId = useId()\n const validChildren = useMemo(() => {\n const getValidChildren = (childrenToValidate: ReactNode): ReactNode[] =>\n Children.toArray(childrenToValidate).flatMap(child => {\n if (isNavListItemElement(child)) {\n return [child]\n }\n\n if (isValidElement(child) && child.type === React.Fragment) {\n return getValidChildren((child as ElementWithChildren).props.children)\n }\n\n return []\n })\n\n return getValidChildren(children)\n }, [children])\n const hasInvalidChild = useMemo(() => {\n const containsInvalidChild = (childrenToValidate: ReactNode): boolean =>\n Children.toArray(childrenToValidate).some(child => {\n if (isNavListItemElement(child)) {\n return false\n }\n\n if (isValidElement(child) && child.type === React.Fragment) {\n return containsInvalidChild((child as ElementWithChildren).props.children)\n }\n\n return true\n })\n\n return containsInvalidChild(children)\n }, [children])\n\n if (hasInvalidChild) {\n warnNavListValidation(\n 'NavList.Group: Only NavList.Item children are supported. Invalid children will not be rendered. Use NavList.SubNav as a child of NavList.Item for nested disclosure.',\n )\n }\n\n return (\n <li ref={ref} className={clsx(styles.NavList__group, className)} data-testid={testId || testIds.group} {...rest}>\n {title ? (\n <h3 id={titleId} className={styles.NavList__groupTitle} data-testid={testIds.groupTitle}>\n {title}\n </h3>\n ) : null}\n <ul\n className={styles.NavList__groupList}\n aria-labelledby={title ? titleId : undefined}\n data-testid={testIds.groupList}\n >\n <NavListLevelContext.Provider value={2}>{validChildren}</NavListLevelContext.Provider>\n </ul>\n </li>\n )\n },\n)\n\n/**\n * Use NavList to render vertical navigation links with groups and expandable nested lists.\n * @see https://primer.style/brand/components/NavList\n */\nexport const NavList = Object.assign(NavListRoot, {\n Item: NavListItem,\n SubNav: NavListSubNav,\n Group: NavListGroup,\n testIds,\n})\n\ntype ElementWithChildren = ReactElement<{children?: ReactNode}>\ntype ElementWithCurrent = ReactElement<{children?: ReactNode; 'aria-current'?: AriaAttributes['aria-current']}>\n\nfunction isNavListSubNavElement(node: ReactNode): node is NavListSubNavElement {\n return isValidElement<NavListSubNavProps>(node) && node.type === NavListSubNav\n}\n\nfunction isNavListItemElement(node: ReactNode): node is ReactElement<NavListItemProps> {\n return isValidElement<NavListItemProps>(node) && node.type === NavListItem\n}\n\nfunction isNavListGroupElement(node: ReactNode): node is ReactElement<NavListGroupProps> {\n return isValidElement<NavListGroupProps>(node) && node.type === NavListGroup\n}\n\nfunction isCurrentValue(value: AriaAttributes['aria-current']) {\n return Boolean(value) && value !== 'false'\n}\n\nfunction hasCurrentDescendant(node: ReactNode): boolean {\n return Children.toArray(node).some(child => {\n if (!isValidElement(child)) return false\n\n const currentChild = child as ElementWithCurrent\n if (isCurrentValue(currentChild.props['aria-current'])) return true\n\n return hasCurrentDescendant((child as ElementWithChildren).props.children)\n })\n}\n\nfunction assignRef<T>(ref: Ref<T> | undefined, value: T | null) {\n if (!ref) return\n\n if (typeof ref === 'function') {\n ref(value)\n return\n }\n\n ;(ref as MutableRefObject<T | null>).current = value\n}\n\nfunction childHasDirectSubNav(node: ReactNode): boolean {\n if (!isValidElement(node)) return false\n\n if (node.type === React.Fragment) {\n return Children.toArray((node as ElementWithChildren).props.children).some(childHasDirectSubNav)\n }\n\n return Children.toArray((node as ElementWithChildren).props.children).some(isNavListSubNavElement)\n}\n\nfunction childIsNavListGroupElement(node: ReactNode): boolean {\n if (!isValidElement(node)) return false\n\n if (node.type === React.Fragment) {\n return Children.toArray((node as ElementWithChildren).props.children).some(childIsNavListGroupElement)\n }\n\n return isNavListGroupElement(node)\n}\n\nfunction childHasNavListGroupElement(node: ReactNode): boolean {\n if (!isValidElement(node)) return false\n\n if (node.type === React.Fragment) {\n return Children.toArray((node as ElementWithChildren).props.children).some(childHasNavListGroupElement)\n }\n\n return isNavListGroupElement(node)\n}\n\nfunction renderVisual(visual: Visual | undefined, className: string, testId: string) {\n if (!visual) return null\n\n const visualElement = isValidElement(visual) ? visual : React.createElement(visual)\n\n if (!isValidElement<{className?: string; ['aria-hidden']?: string; focusable?: string}>(visualElement)) return null\n\n return (\n <span className={className} data-testid={testId}>\n {React.cloneElement(visualElement, {\n className: visualElement.props.className,\n 'aria-hidden': 'true',\n focusable: 'false',\n })}\n </span>\n )\n}\n\nfunction warnNavListValidation(message: string) {\n if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test') {\n // eslint-disable-next-line no-console\n console.warn(message)\n }\n}\n"],"mappings":";;;;;;;;AA4BA,IAAM,IAAU;CACd,MAAM;CACN,IAAI,OAAO;AACT,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,OAAO;AACT,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,OAAO;AACT,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,gBAAgB;AAClB,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,iBAAiB;AACnB,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,SAAS;AACX,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,QAAQ;AACV,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,aAAa;AACf,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,YAAY;AACd,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,SAAS;AACX,SAAO,GAAG,KAAK,KAAK;;CAEvB,EAkBK,IAAkB,GAClB,IAAsB,EAA4B,EAAE,EACpD,IAAuB,EAI1B;CACD,UAAU;CACV,OAAO;CACR,CAAC,EAEI,IAAc,GAE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../../src/NavList/NavList.tsx"],"sourcesContent":["import React, {\n Children,\n createContext,\n forwardRef,\n isValidElement,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type AriaAttributes,\n type MutableRefObject,\n type PropsWithChildren,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react'\n\nimport {clsx} from 'clsx'\nimport {TriangleDownIcon, type Icon} from '@primer/octicons-react'\nimport type {BaseProps} from '../component-helpers'\nimport {useId} from '../hooks/useId'\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/nav-list/colors-with-modes.css'\n\n/** * Main stylesheet (as a CSS Module) */\nimport styles from './NavList.module.css'\n\nconst testIds = {\n root: 'NavList',\n get list() {\n return `${this.root}-list`\n },\n get item() {\n return `${this.root}-item`\n },\n get link() {\n return `${this.root}-link`\n },\n get leadingVisual() {\n return `${this.root}-leading-visual`\n },\n get trailingVisual() {\n return `${this.root}-trailing-visual`\n },\n get subNav() {\n return `${this.root}-sub-nav`\n },\n get group() {\n return `${this.root}-group`\n },\n get groupTitle() {\n return `${this.root}-group-title`\n },\n get groupList() {\n return `${this.root}-group-list`\n },\n get toggle() {\n return `${this.root}-toggle`\n },\n}\n\nexport type NavListRootProps = {\n /**\n * Accessible label for the navigation landmark.\n */\n 'aria-label': string\n /**\n * ID of an element that labels the navigation landmark.\n */\n 'aria-labelledby'?: string\n children: ReactNode\n 'data-testid'?: string\n} & BaseProps<HTMLElement> &\n Omit<React.HTMLAttributes<HTMLElement>, 'aria-label' | 'aria-labelledby'>\n\ntype NavListLevel = 1 | 2 | 3 | 4 | 5\n\nconst MaxNavListLevel = 5\nconst NavListLevelContext = createContext<NavListLevel>(1)\nconst NavListSubNavContext = createContext<{\n expanded: boolean\n labelledBy?: string\n level: NavListLevel\n}>({\n expanded: true,\n level: 2,\n})\n\nconst NavListRoot = forwardRef<HTMLElement, NavListRootProps>(\n (\n {children, className, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'data-testid': testId, ...rest},\n ref,\n ) => {\n const childrenArray = useMemo(() => Children.toArray(children), [children])\n const hasTopLevelSubNav = useMemo(() => childrenArray.some(childHasDirectSubNav), [childrenArray])\n const hasTopLevelGroup = useMemo(() => childrenArray.some(childIsNavListGroupElement), [childrenArray])\n const rootLevel = hasTopLevelSubNav ? 1 : 2\n const hasFlatRootList = !hasTopLevelSubNav && !hasTopLevelGroup\n\n return (\n <nav\n ref={ref}\n className={clsx(styles.NavList, className)}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n data-testid={testId || testIds.root}\n {...rest}\n >\n <NavListLevelContext.Provider value={rootLevel}>\n <ul\n className={clsx(styles.NavList__list, hasFlatRootList && styles['NavList__list--flat'])}\n data-testid={testIds.list}\n >\n {children}\n </ul>\n </NavListLevelContext.Provider>\n </nav>\n )\n },\n)\n\ntype Visual = ReactElement | React.ElementType | Icon\ntype NavListItemAs = 'a' | 'button'\n\ntype NavListItemBaseProps = {\n /**\n * Leading visual rendered before the item label.\n */\n leadingVisual?: Visual\n /**\n * Trailing visual rendered after the item label.\n */\n trailingVisual?: Visual\n /**\n * Whether nested items should be expanded by default.\n */\n defaultExpanded?: boolean\n /**\n * Controls the nested item expanded state.\n */\n expanded?: boolean\n /**\n * Called when a nested item is expanded or collapsed.\n */\n onExpandedChange?: (expanded: boolean) => void\n /**\n * Marks the item as disabled. Disabled link items receive `aria-disabled`.\n */\n disabled?: boolean\n 'data-testid'?: string\n}\n\nexport type NavListItemProps<C extends NavListItemAs = 'a'> = {\n as?: C\n} & NavListItemBaseProps &\n PropsWithChildren<BaseProps<HTMLElement>> &\n Omit<React.ComponentPropsWithoutRef<C>, keyof NavListItemBaseProps | keyof BaseProps<HTMLElement> | 'as' | 'children'>\n\ntype NavListSubNavElement = ReactElement<NavListSubNavProps>\n\nconst NavListItem = forwardRef(\n (\n {\n as,\n children,\n className,\n defaultExpanded = false,\n disabled = false,\n expanded,\n leadingVisual,\n onClick,\n onExpandedChange,\n trailingVisual,\n 'aria-current': ariaCurrent,\n 'data-testid': testId,\n ...rest\n }: NavListItemProps<NavListItemAs>,\n ref: Ref<HTMLElement>,\n ) => {\n const Component = (as || 'a') as React.ElementType\n const level = useContext(NavListLevelContext)\n const subNavId = useId()\n const accordionButtonId = useId()\n const childrenArray = useMemo(() => Children.toArray(children), [children])\n const subNavChildren = useMemo(() => childrenArray.filter(isNavListSubNavElement), [childrenArray])\n const subNav = useMemo(() => childrenArray.find(isNavListSubNavElement), [childrenArray])\n const navListGroupChildren = useMemo(() => childrenArray.filter(childHasNavListGroupElement), [childrenArray])\n const labelChildren = useMemo(\n () => (subNav ? childrenArray.filter(child => child !== subNav) : childrenArray),\n [childrenArray, subNav],\n )\n const hasLabelContent = labelChildren.length > 0\n const hasSubNav = Boolean(subNav)\n const canExpand = level < MaxNavListLevel\n const isLeafItem = !hasSubNav\n const controlledSubNavId = subNav?.props.id ?? subNavId\n const hasCurrentSubNavItem = useMemo(() => hasCurrentDescendant(subNav?.props.children), [subNav?.props.children])\n const isControlled = expanded !== undefined\n const [uncontrolledExpanded, setUncontrolledExpanded] = useState(defaultExpanded || hasCurrentSubNavItem)\n const isExpanded = Boolean(isControlled ? expanded : uncontrolledExpanded)\n const {\n href,\n id: accordionButtonIdProp,\n ...accordionButtonProps\n } = rest as React.ButtonHTMLAttributes<HTMLButtonElement> & {\n href?: string\n }\n const controlledAccordionButtonId = accordionButtonIdProp ?? accordionButtonId\n const itemOnClick = onClick as React.MouseEventHandler<HTMLElement> | undefined\n const invalidMessage = useMemo(() => {\n if (navListGroupChildren.length > 0) {\n return 'NavList.Item: NavList.Group is not supported as a child. Use NavList.SubNav for nested disclosure. NavList.Item will not be rendered.'\n }\n\n if (hasSubNav && !canExpand) {\n return 'NavList.Item: NavList supports up to 5 levels. Level 5 items cannot contain NavList.SubNav. NavList.Item will not be rendered.'\n }\n\n if (subNavChildren.length > 1) {\n return 'NavList.Item: Only one NavList.SubNav child is supported. NavList.Item will not be rendered.'\n }\n\n if (hasSubNav && !hasLabelContent) {\n return 'NavList.Item: A label is required when using NavList.SubNav. NavList.Item will not be rendered.'\n }\n\n if (hasSubNav && (href !== undefined || as !== undefined)) {\n return 'NavList.Item: `href` and `as` are not supported when using NavList.SubNav because expandable items render as buttons. NavList.Item will not be rendered.'\n }\n }, [as, canExpand, hasLabelContent, hasSubNav, href, navListGroupChildren.length, subNavChildren.length])\n\n useEffect(() => {\n if (hasCurrentSubNavItem && !isControlled) {\n setUncontrolledExpanded(true)\n }\n }, [hasCurrentSubNavItem, isControlled])\n\n const setExpanded = useCallback(\n (value: boolean) => {\n if (!isControlled) {\n setUncontrolledExpanded(value)\n }\n onExpandedChange?.(value)\n },\n [isControlled, onExpandedChange],\n )\n\n const toggleExpanded = useCallback(() => {\n setExpanded(!isExpanded)\n }, [isExpanded, setExpanded])\n\n const handleClick = useCallback(\n (event: React.MouseEvent<HTMLElement>) => {\n if (disabled) {\n event.preventDefault()\n return\n }\n\n itemOnClick?.(event)\n },\n [disabled, itemOnClick],\n )\n\n const setAccordionButtonRef = useCallback(\n (node: HTMLButtonElement | null) => {\n assignRef(ref, node)\n },\n [ref],\n )\n\n const handleAccordionClick = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n if (disabled) {\n event.preventDefault()\n return\n }\n\n itemOnClick?.(event)\n\n if (!event.defaultPrevented) {\n toggleExpanded()\n }\n },\n [disabled, itemOnClick, toggleExpanded],\n )\n\n if (invalidMessage) {\n warnNavListValidation(invalidMessage)\n return null\n }\n\n const labelArea = (\n <span className={styles.NavList__labelArea}>\n {renderVisual(leadingVisual, styles.NavList__leadingVisual, testIds.leadingVisual)}\n <span className={styles.NavList__label}>{labelChildren}</span>\n {renderVisual(trailingVisual, styles.NavList__trailingVisual, testIds.trailingVisual)}\n </span>\n )\n\n return (\n <li\n className={clsx(\n styles.NavList__item,\n styles[`NavList__item--level-${level}`],\n isLeafItem && styles['NavList__item--leaf'],\n hasSubNav && isExpanded && styles['NavList__item--expanded'],\n hasCurrentSubNavItem && styles['NavList__item--has-current-descendant'],\n )}\n data-testid={testId || testIds.item}\n >\n <div className={styles.NavList__itemContent}>\n {hasSubNav && canExpand ? (\n <button\n ref={setAccordionButtonRef}\n id={controlledAccordionButtonId}\n type=\"button\"\n className={clsx(\n styles.NavList__link,\n styles.NavList__accordionButton,\n disabled && styles['NavList__link--disabled'],\n className,\n )}\n aria-expanded={isExpanded ? 'true' : 'false'}\n aria-controls={controlledSubNavId}\n data-testid={testIds.toggle}\n {...accordionButtonProps}\n disabled={disabled}\n onClick={handleAccordionClick}\n >\n <TriangleDownIcon className={styles.NavList__toggleIcon} aria-hidden=\"true\" />\n {labelArea}\n </button>\n ) : (\n <Component\n ref={ref}\n className={clsx(styles.NavList__link, disabled && styles['NavList__link--disabled'], className)}\n aria-current={ariaCurrent}\n aria-disabled={disabled || undefined}\n data-testid={testIds.link}\n onClick={handleClick}\n {...rest}\n >\n {labelArea}\n </Component>\n )}\n </div>\n\n {subNav ? (\n <NavListSubNavContext.Provider\n value={{expanded: isExpanded, labelledBy: controlledAccordionButtonId, level: (level + 1) as NavListLevel}}\n >\n {React.cloneElement(subNav, {\n id: controlledSubNavId,\n })}\n </NavListSubNavContext.Provider>\n ) : null}\n </li>\n )\n },\n) as <C extends NavListItemAs = 'a'>(props: NavListItemProps<C> & {ref?: Ref<HTMLElement>}) => ReactElement | null\n\nexport type NavListSubNavProps = {\n children: ReactNode\n 'data-testid'?: string\n} & BaseProps<HTMLUListElement> &\n React.HTMLAttributes<HTMLUListElement>\n\nconst NavListSubNav = forwardRef<HTMLUListElement, NavListSubNavProps>(\n ({children, className, 'aria-labelledby': ariaLabelledBy, 'data-testid': testId, ...rest}, ref) => {\n const {expanded, labelledBy, level} = useContext(NavListSubNavContext)\n const subNavRef = useRef<HTMLUListElement | null>(null)\n\n const setSubNavHeight = useCallback((subNav: HTMLUListElement) => {\n subNav.style.setProperty('--brand-NavList-subNav-height', `${subNav.scrollHeight}px`)\n }, [])\n\n const setSubNavAndAncestorHeights = useCallback(() => {\n let subNav = subNavRef.current\n\n while (subNav) {\n setSubNavHeight(subNav)\n subNav = subNav.parentElement?.closest<HTMLUListElement>(`.${styles.NavList__subNav}`) ?? null\n }\n }, [setSubNavHeight])\n\n const setSubNavRef = useCallback(\n (node: HTMLUListElement | null) => {\n subNavRef.current = node\n assignRef(ref, node)\n },\n [ref],\n )\n\n useEffect(() => {\n setSubNavAndAncestorHeights()\n }, [children, expanded, setSubNavAndAncestorHeights])\n\n useEffect(() => {\n subNavRef.current?.toggleAttribute('inert', !expanded)\n }, [expanded])\n\n useEffect(() => {\n const subNav = subNavRef.current\n\n if (!subNav || typeof ResizeObserver === 'undefined') {\n return\n }\n\n const resizeObserver = new ResizeObserver(setSubNavAndAncestorHeights)\n resizeObserver.observe(subNav)\n\n return () => {\n resizeObserver.disconnect()\n }\n }, [setSubNavAndAncestorHeights])\n\n return (\n <ul\n ref={setSubNavRef}\n className={clsx(styles.NavList__subNav, expanded && styles['NavList__subNav--expanded'], className)}\n aria-labelledby={ariaLabelledBy ?? labelledBy}\n {...rest}\n aria-hidden={expanded ? undefined : 'true'}\n data-testid={testId || testIds.subNav}\n >\n <NavListLevelContext.Provider value={level}>{children}</NavListLevelContext.Provider>\n </ul>\n )\n },\n)\n\nexport type NavListGroupProps = {\n /**\n * Heading text for the group.\n */\n title?: ReactNode\n children: ReactNode\n 'data-testid'?: string\n} & BaseProps<HTMLLIElement> &\n Omit<React.LiHTMLAttributes<HTMLLIElement>, 'title'>\n\nconst NavListGroup = forwardRef<HTMLLIElement, NavListGroupProps>(\n ({title, children, className, 'data-testid': testId, ...rest}, ref) => {\n const titleId = useId()\n const validChildren = useMemo(() => {\n const getValidChildren = (childrenToValidate: ReactNode): ReactNode[] =>\n Children.toArray(childrenToValidate).flatMap(child => {\n if (isNavListItemElement(child)) {\n return [child]\n }\n\n if (isValidElement(child) && child.type === React.Fragment) {\n return getValidChildren((child as ElementWithChildren).props.children)\n }\n\n return []\n })\n\n return getValidChildren(children)\n }, [children])\n const hasInvalidChild = useMemo(() => {\n const containsInvalidChild = (childrenToValidate: ReactNode): boolean =>\n Children.toArray(childrenToValidate).some(child => {\n if (isNavListItemElement(child)) {\n return false\n }\n\n if (isValidElement(child) && child.type === React.Fragment) {\n return containsInvalidChild((child as ElementWithChildren).props.children)\n }\n\n return true\n })\n\n return containsInvalidChild(children)\n }, [children])\n\n if (hasInvalidChild) {\n warnNavListValidation(\n 'NavList.Group: Only NavList.Item children are supported. Invalid children will not be rendered. Use NavList.SubNav as a child of NavList.Item for nested disclosure.',\n )\n }\n\n return (\n <li ref={ref} className={clsx(styles.NavList__group, className)} data-testid={testId || testIds.group} {...rest}>\n {title ? (\n <h3 id={titleId} className={styles.NavList__groupTitle} data-testid={testIds.groupTitle}>\n {title}\n </h3>\n ) : null}\n <ul\n className={styles.NavList__groupList}\n aria-labelledby={title ? titleId : undefined}\n data-testid={testIds.groupList}\n >\n <NavListLevelContext.Provider value={2}>{validChildren}</NavListLevelContext.Provider>\n </ul>\n </li>\n )\n },\n)\n\n/**\n * Use NavList to render vertical navigation links with groups and expandable nested lists.\n * @see https://primer.style/brand/components/NavList\n */\nexport const NavList = Object.assign(NavListRoot, {\n Item: NavListItem,\n SubNav: NavListSubNav,\n Group: NavListGroup,\n testIds,\n})\n\ntype ElementWithChildren = ReactElement<{children?: ReactNode}>\ntype ElementWithCurrent = ReactElement<{children?: ReactNode; 'aria-current'?: AriaAttributes['aria-current']}>\n\nfunction isNavListSubNavElement(node: ReactNode): node is NavListSubNavElement {\n return isValidElement<NavListSubNavProps>(node) && node.type === NavListSubNav\n}\n\nfunction isNavListItemElement(node: ReactNode): node is ReactElement<NavListItemProps> {\n return isValidElement<NavListItemProps>(node) && node.type === NavListItem\n}\n\nfunction isNavListGroupElement(node: ReactNode): node is ReactElement<NavListGroupProps> {\n return isValidElement<NavListGroupProps>(node) && node.type === NavListGroup\n}\n\nfunction isCurrentValue(value: AriaAttributes['aria-current']) {\n return Boolean(value) && value !== 'false'\n}\n\nfunction hasCurrentDescendant(node: ReactNode): boolean {\n return Children.toArray(node).some(child => {\n if (!isValidElement(child)) return false\n\n const currentChild = child as ElementWithCurrent\n if (isCurrentValue(currentChild.props['aria-current'])) return true\n\n return hasCurrentDescendant((child as ElementWithChildren).props.children)\n })\n}\n\nfunction assignRef<T>(ref: Ref<T> | undefined, value: T | null) {\n if (!ref) return\n\n if (typeof ref === 'function') {\n ref(value)\n return\n }\n\n ;(ref as MutableRefObject<T | null>).current = value\n}\n\nfunction childHasDirectSubNav(node: ReactNode): boolean {\n if (!isValidElement(node)) return false\n\n if (node.type === React.Fragment) {\n return Children.toArray((node as ElementWithChildren).props.children).some(childHasDirectSubNav)\n }\n\n return Children.toArray((node as ElementWithChildren).props.children).some(isNavListSubNavElement)\n}\n\nfunction childIsNavListGroupElement(node: ReactNode): boolean {\n if (!isValidElement(node)) return false\n\n if (node.type === React.Fragment) {\n return Children.toArray((node as ElementWithChildren).props.children).some(childIsNavListGroupElement)\n }\n\n return isNavListGroupElement(node)\n}\n\nfunction childHasNavListGroupElement(node: ReactNode): boolean {\n if (!isValidElement(node)) return false\n\n if (node.type === React.Fragment) {\n return Children.toArray((node as ElementWithChildren).props.children).some(childHasNavListGroupElement)\n }\n\n return isNavListGroupElement(node)\n}\n\nfunction renderVisual(visual: Visual | undefined, className: string, testId: string) {\n if (!visual) return null\n\n const visualElement = isValidElement(visual) ? visual : React.createElement(visual)\n\n if (!isValidElement<{className?: string; ['aria-hidden']?: string; focusable?: string}>(visualElement)) return null\n\n return (\n <span className={className} data-testid={testId}>\n {React.cloneElement(visualElement, {\n className: visualElement.props.className,\n 'aria-hidden': 'true',\n focusable: 'false',\n })}\n </span>\n )\n}\n\nfunction warnNavListValidation(message: string) {\n if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test') {\n // eslint-disable-next-line no-console\n console.warn(message)\n }\n}\n"],"mappings":";;;;;;;;AA4BA,IAAM,IAAU;CACd,MAAM;CACN,IAAI,O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