@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionMenu.js","names":[],"sources":["../../src/ActionMenu/ActionMenu.tsx"],"sourcesContent":["import React, {\n Children,\n isValidElement,\n cloneElement,\n useRef,\n useCallback,\n useState,\n useEffect,\n PropsWithChildren,\n forwardRef,\n memo,\n ReactElement,\n useMemo,\n} from 'react'\nimport {Button, ButtonProps} from '../Button'\nimport {Text} from '../Text'\nimport {ThemeProvider, useTheme} from '../ThemeProvider'\nimport {useAnchoredPosition} from '../hooks/useAnchoredPosition'\nimport {useOnClickOutside} from '../hooks/useOnClickOutside'\nimport {useKeyboardEscape} from '../hooks/useKeyboardEscape'\n\nimport {clsx} from 'clsx'\nimport {CheckIcon, ChevronDownIcon, type Icon} from '@primer/octicons-react'\nimport {useId} from '../hooks/useId'\n\nimport {FocusKeys, type PositionSettings, focusZone} from '@primer/behaviors'\nimport type {BaseProps} from '../component-helpers'\n\n/**\n * Design tokens\n */\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/action-menu/colors-with-modes.css'\n\n/** * Main Stylesheet (as a CSS Module) */\nimport styles from './ActionMenu.module.css'\n\nconst testIds = {\n root: 'ActionMenu',\n get button() {\n return `${this.root}-button`\n },\n get overlay() {\n return `${this.root}-overlay`\n },\n get list() {\n return `${this.root}-list`\n },\n get item() {\n return `${this.root}-list-item`\n },\n}\n\n// primer behaviors doesn't export these values, recreating manually\n// https://github.com/primer/behaviors/blob/main/src/anchored-position.ts#L5\nexport const actionMenuOverlaySides = [\n 'inside-top',\n 'inside-bottom',\n 'inside-left',\n 'inside-right',\n 'inside-center',\n 'outside-top',\n 'outside-bottom',\n 'outside-left',\n 'outside-right',\n] as PositionSettings['side'][]\n\nexport const ActionMenuSizes = ['small', 'medium'] as const\n\nexport const ActionMenuButtonModes = ['default', 'split-button'] as const\nexport type ActionMenuButtonModes = (typeof ActionMenuButtonModes)[number]\n\nexport type ActionMenuSizes = (typeof ActionMenuSizes)[number]\n\nexport type ActionMenuProps = {\n /**\n * The content of the ActionMenu. Must be an ActionMenu.Button and an ActionMenu.Overlay\n */\n children:\n | ReactElement<ActionMenuButtonProps>\n | ReactElement<ActionMenuOverlayProps>\n | Array<ReactElement<ActionMenuButtonProps> | ReactElement<ActionMenuOverlayProps>>\n /**\n * Determines whether the ActionMenu is disabled\n */\n disabled?: boolean\n /**\n * Determines whether the ActionMenu is open by default\n */\n open?: boolean\n /**\n * Callback that is called when an item is selected.\n * The value of the selected item is passed as an argument.\n */\n onSelect?: (newValue: string) => void\n /**\n * The selection variant of the ActionMenu.\n * - `single`: Only one item can be selected at a time. Menu items as a menuitemradio.\n * - `none`: No items can be selected. Menu items as a menuitem.\n */\n selectionVariant?: 'single' | 'none'\n /**\n * Test id for the ActionMenu\n */\n 'data-testid'?: string\n /**\n * Horizontal alignment of the menu relative to the bottom of the button\n */\n menuAlignment?: 'start' | 'end'\n /**\n * Size configuratin of the ActionMenu\n */\n size?: ActionMenuSizes\n /*\n * Side the menu overlay appears\n */\n menuSide?: PositionSettings['side']\n /**\n * Alternative behavior for the button and menu items\n * - `default`: The button and menu items behave as a standard button and menu item.\n * - `split-button`: The button behaves as a split button, and the menu items behave as links.\n */\n mode?: ActionMenuButtonModes\n} & BaseProps<HTMLDivElement>\n\ntype ActionMenuContextType = {\n size?: ActionMenuSizes\n setSize?: React.Dispatch<React.SetStateAction<ActionMenuSizes | undefined>>\n onMenuToggle?: () => void\n}\n\nconst ActionMenuContext = React.createContext<ActionMenuContextType>({})\n\nexport const useActionMenuContext = (): ActionMenuContextType => {\n return React.useContext(ActionMenuContext)\n}\n\ntype ActionMenuProviderProps = ActionMenuProps & Pick<ActionMenuContextType, 'onMenuToggle'>\n\nexport const ActionMenuProvider: React.FC<ActionMenuProviderProps> = ({size, children, onMenuToggle}) => {\n const [currentSize, setSize] = useState(size)\n\n return (\n <ActionMenuContext.Provider value={{size: currentSize, setSize, onMenuToggle}}>\n {children}\n </ActionMenuContext.Provider>\n )\n}\n\nconst _ActionMenuRoot = memo(\n ({\n id,\n children,\n 'data-testid': testId,\n disabled,\n open = false,\n selectionVariant = 'none',\n menuAlignment = 'end',\n size = 'medium',\n menuSide,\n onSelect,\n mode = 'default',\n }: ActionMenuProps) => {\n const [showMenu, setShowMenu] = useState(open)\n const floatingElementRef = useRef<HTMLUListElement>(null)\n const anchorElementRef = useRef<HTMLButtonElement>(null)\n const instanceId = useId(id)\n\n useOnClickOutside(floatingElementRef, () => setShowMenu(false), anchorElementRef)\n\n const closeMenuCallback = useCallback(() => {\n setShowMenu(false)\n }, [])\n\n useKeyboardEscape(closeMenuCallback)\n\n const toggleMenu = useCallback(() => {\n setShowMenu(!showMenu)\n }, [showMenu])\n\n const handleOnSelect = useCallback(\n (newValue: string) => {\n if (onSelect) onSelect(newValue)\n toggleMenu()\n },\n [onSelect, toggleMenu],\n )\n\n const handleItemSelection = useCallback(\n (newValue: string) => {\n handleOnSelect(newValue)\n toggleMenu()\n anchorElementRef.current?.focus()\n },\n [handleOnSelect, toggleMenu, anchorElementRef],\n )\n\n useEffect(() => {\n if (showMenu && floatingElementRef.current) {\n const floatingElement = floatingElementRef.current\n const isSplitLayout = mode === 'split-button'\n const splitLayoutFilter = isSplitLayout ? element => element.tagName === 'A' : undefined\n\n focusZone(floatingElementRef.current, {\n bindKeys: FocusKeys.ArrowVertical,\n focusableElementFilter: splitLayoutFilter,\n focusInStrategy: isSplitLayout ? 'first' : undefined,\n })\n\n // enter selects item\n floatingElement.addEventListener('keydown', event => {\n if (event.key === 'Enter') {\n const target = event.target as HTMLElement\n\n // Get the proper element containing the data-value\n const targetElement = target.tagName === 'A' ? target.closest('li') : target\n\n if (!targetElement || targetElement.getAttribute('aria-disabled') === 'true') return\n\n const value = targetElement.getAttribute('data-value')\n if (value) {\n handleOnSelect(value)\n setShowMenu(false)\n setTimeout(() => {\n anchorElementRef.current?.focus()\n }, 10)\n }\n }\n })\n\n const targetSelector = isSplitLayout ? 'a' : 'li'\n\n // focusses first item\n const firstItem = floatingElementRef.current.querySelector(targetSelector)\n if (firstItem) {\n setTimeout(() => {\n firstItem.focus()\n }, 10)\n }\n\n const lastItem =\n floatingElement.querySelectorAll(targetSelector)[floatingElement.querySelectorAll(targetSelector).length - 1]\n lastItem.addEventListener('keydown', (event: Event) => {\n const keyboardEvent = event as KeyboardEvent\n if (keyboardEvent.key === 'ArrowDown') {\n keyboardEvent.preventDefault()\n firstItem?.focus()\n }\n })\n\n firstItem?.addEventListener('keydown', (event: Event) => {\n const keyboardEvent = event as KeyboardEvent\n if (keyboardEvent.key === 'ArrowUp') {\n keyboardEvent.preventDefault()\n lastItem.focus()\n }\n })\n\n //on escape refocus\n floatingElement.addEventListener('keydown', (event: Event) => {\n const keyboardEvent = event as KeyboardEvent\n if (keyboardEvent.key === 'Escape') {\n anchorElementRef.current?.focus()\n }\n })\n }\n }, [showMenu, floatingElementRef, mode, handleItemSelection, toggleMenu, handleOnSelect])\n\n // Calculate the position of the menu\n const {position} = useAnchoredPosition(\n {\n floatingElementRef,\n anchorElementRef,\n align: menuAlignment,\n allowOutOfBounds: true,\n side: menuSide,\n },\n [showMenu],\n )\n\n const {Button: SelectButton, Overlay: SelectOverlay} = Children.toArray(children).reduce<{\n Button?: ReactElement<ActionMenuButtonProps>\n Overlay?: ReactElement<ActionMenuOverlayProps>\n }>((acc, child) => {\n if (isValidElement<ActionMenuButtonProps>(child) && child.type === ActionMenuButton) {\n acc.Button = cloneElement(child, {\n ref: anchorElementRef as React.RefObject<HTMLButtonElement>,\n className: clsx(child.props.className, styles[`ActionMenu__button--${mode}`], showMenu),\n menuOpen: showMenu,\n disabled,\n id: `${instanceId}-button`,\n size,\n _mode: mode,\n })\n } else if (isValidElement<ActionMenuOverlayProps>(child) && child.type === ActionMenuOverlay) {\n acc.Overlay = cloneElement(child, {\n ref: floatingElementRef as React.RefObject<HTMLUListElement>,\n className: clsx(\n styles.ActionMenu__menu,\n position && styles['ActionMenu__menu--visible'],\n position && styles[`ActionMenu__menu--pos-${position.anchorSide}`],\n styles[`ActionMenu__menu--${size}`],\n mode === 'split-button' && 'ActionMenu__menu--split',\n ),\n style: {\n top: `${position?.top ?? 0}px`,\n left: `${position?.left ?? 0}px`,\n },\n id: `${instanceId}-menu`,\n children: Children.map(child.props.children, item => {\n if (isValidElement<ActionMenuItemBaseProps>(item)) {\n return cloneElement(item, {\n handler: handleItemSelection,\n type: mode === 'split-button' ? 'link' : selectionVariant,\n })\n }\n return item\n }),\n })\n }\n return acc\n }, {})\n\n return (\n <ActionMenuProvider size={size} onMenuToggle={toggleMenu}>\n <div\n id={instanceId}\n className={clsx(styles.ActionMenu, disabled && styles['ActionMenu--disabled'])}\n data-testid={testId || testIds.root}\n >\n {SelectButton}\n {showMenu ? SelectOverlay : null}\n </div>\n </ActionMenuProvider>\n )\n },\n)\n\ntype ActionMenuButtonProps = PropsWithChildren<\n BaseProps<HTMLButtonElement> & Pick<React.ButtonHTMLAttributes<HTMLButtonElement>, 'id' | 'disabled' | 'onClick'>\n> & {\n as?: ButtonProps<'a'>['as']\n href?: ButtonProps<'a'>['href']\n menuOpen?: boolean\n 'data-testid'?: string\n size?: ActionMenuSizes\n _mode?: ActionMenuButtonModes\n variant?: ButtonProps<'a'>['variant']\n leadingVisual?: ButtonProps<'a'>['leadingVisual']\n}\n\nconst ActionMenuButton = forwardRef<HTMLButtonElement, ActionMenuButtonProps>(\n (\n {\n as,\n href,\n id,\n children,\n className,\n 'data-testid': testId,\n disabled,\n menuOpen,\n size,\n _mode = 'default',\n onClick,\n leadingVisual,\n variant,\n ...props\n },\n ref,\n ) => {\n const {onMenuToggle} = useActionMenuContext()\n const handleClick = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(event)\n\n if (!event.defaultPrevented) {\n onMenuToggle?.()\n }\n },\n [onClick, onMenuToggle],\n )\n\n if (_mode === 'split-button') {\n const splitButtonVariant = variant ?? 'primary'\n\n return (\n <div className={clsx(styles.ActionMenu__button, styles[`ActionMenu__button--${size}`], className)}>\n <Button\n as={as}\n href={href}\n className={clsx(\n styles['ActionMenu__innerButton--split-button'],\n styles[`ActionMenu__innerButton--${splitButtonVariant}`],\n styles[`ActionMenu__innerButton--${size}`],\n disabled && styles['ActionMenu__innerButton--disabled'],\n )}\n variant={splitButtonVariant}\n aria-disabled={disabled}\n data-testid={testId || testIds.button}\n size={size}\n leadingVisual={leadingVisual}\n onClick={onClick}\n {...props}\n >\n <span className={styles['ActionMenu__button-text']}>{children}</span>\n </Button>\n <Button\n ref={ref}\n id={id}\n as=\"button\"\n className={styles['ActionMenu__innerButton--split-button']}\n variant={splitButtonVariant}\n aria-haspopup=\"true\"\n aria-label=\"Menu\"\n size={size}\n aria-expanded={menuOpen ? 'true' : 'false'}\n onClick={onMenuToggle}\n disabled={disabled}\n >\n <ChevronDownIcon className={styles['ActionMenu__inner-button-dropdown-icon']} />\n </Button>\n </div>\n )\n }\n\n return (\n <Button\n ref={ref}\n id={id}\n className={clsx(styles.ActionMenu__button, styles[`ActionMenu__button--${size}`], className)}\n aria-haspopup=\"true\"\n aria-expanded={menuOpen ? 'true' : 'false'}\n disabled={disabled}\n data-testid={testId || testIds.button}\n size={size}\n variant={variant}\n leadingVisual={leadingVisual}\n trailingVisual={<ChevronDownIcon />}\n onClick={handleClick}\n {...props}\n >\n <span className={styles['ActionMenu__button-text']}>{children}</span>\n </Button>\n )\n },\n)\n\ntype ActionMenuItemBaseProps = {\n handler?: (newValue: string) => void\n type?: 'none' | 'single' | 'link'\n disabled?: boolean\n size?: ActionMenuSizes\n leadingVisual?: React.ReactElement | React.ReactNode | Icon\n} & PropsWithChildren<React.HTMLProps<HTMLLIElement>>\n\ntype ActionMenuItemAnchorProps = ActionMenuItemBaseProps & {\n as: 'a'\n} & Omit<React.HTMLProps<HTMLAnchorElement>, keyof ActionMenuItemBaseProps | 'as'>\n\n// Type for when 'as' is not set or is anything other than 'a'\ntype ActionMenuItemDefaultProps = ActionMenuItemBaseProps & {\n as?: string\n value?: string\n selected?: boolean\n} & Omit<React.HTMLProps<HTMLLIElement>, keyof ActionMenuItemBaseProps | 'as'>\n\nconst roleTypeMap = {\n none: 'menuitem',\n single: 'menuitemradio',\n link: 'menuitem',\n}\n\nconst ActionMenuItem = ({\n as,\n children,\n className,\n disabled,\n handler,\n selected,\n type,\n value,\n onClick,\n onKeyDown,\n leadingVisual: LeadingVisual,\n ...props\n}: ActionMenuItemAnchorProps | ActionMenuItemDefaultProps) => {\n const {size} = useActionMenuContext()\n\n const handleClick = useCallback(\n (e: React.MouseEvent<HTMLLIElement>) => {\n onClick?.(e)\n\n if (!disabled) {\n handler?.(String(value))\n }\n },\n [handler, value, disabled, onClick],\n )\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLLIElement>) => {\n onKeyDown?.(e)\n\n if (!disabled && e.key === 'Enter') {\n handler?.(String(value))\n }\n },\n [handler, value, disabled, onKeyDown],\n )\n\n const liProps = useMemo<React.HTMLProps<HTMLLIElement> & {'data-value': unknown}>(\n () => ({\n className: clsx(\n styles.ActionMenu__item,\n type === 'single' && styles[`ActionMenu__item--selection-type-${type}`],\n size && styles[`ActionMenu__item--${size}`],\n className,\n ),\n role: roleTypeMap[type || 'single'],\n 'aria-disabled': disabled,\n tabIndex: -1,\n 'data-value': value,\n ...props,\n }),\n [props, type, size, className, disabled, value],\n )\n\n const contents = useMemo(\n () => (\n <>\n {React.isValidElement<{width?: number; height?: number}>(LeadingVisual)\n ? React.cloneElement(LeadingVisual, {\n width: LeadingVisual.props.width || 20,\n height: LeadingVisual.props.width || 20,\n })\n : null}\n {type === 'single' && (\n <span className={styles['ActionMenu__item-leadingVisual']}>\n {selected && (\n <CheckIcon\n className={clsx(styles['ActionMenu__item-icon'], disabled && styles['ActionMenu__item-icon--disabled'])}\n size={16}\n />\n )}\n </span>\n )}\n\n <span className={styles['ActionMenu__item-text']}>\n <Text\n variant={disabled ? 'muted' : 'default'}\n size={size === 'medium' ? '200' : '100'}\n className={clsx(disabled && styles['ActionMenu__item-content--disabled'])}\n >\n {children}\n </Text>\n </span>\n </>\n ),\n [LeadingVisual, children, selected, disabled, size, type],\n )\n\n if (as === 'a') {\n return (\n <li\n // This role will be overridden by the role prop in `liProps`. It's just here to keep the linter happy\n role=\"menuitem\"\n {...liProps}\n // Intentionally not calling handle[Click/KeyDown] here so as to not call the handler\n onClick={onClick}\n onKeyDown={onKeyDown}\n >\n <a\n className={clsx(styles['ActionMenu__item-anchor'], disabled && styles['ActionMenu__item--disabled'])}\n href={props.href}\n >\n {contents}\n </a>\n </li>\n )\n }\n\n return (\n // eslint-disable-next-line jsx-a11y/role-supports-aria-props\n <li\n // This role will be overridden by the role prop in `liProps`. It's just here to keep the linter happy\n role=\"menuitem\"\n {...liProps}\n aria-checked={type === 'none' ? undefined : selected ? 'true' : 'false'}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n >\n {contents}\n </li>\n )\n}\n\ntype ActionMenuOverlayProps = PropsWithChildren<\n BaseProps<HTMLUListElement> & React.HTMLAttributes<HTMLUListElement>\n> & {\n 'aria-label': string\n id?: string\n 'data-testid'?: string\n menuOpen?: boolean\n style?: React.CSSProperties\n}\n\nconst ActionMenuOverlay = forwardRef<HTMLUListElement, ActionMenuOverlayProps>(\n ({children, className, 'data-testid': testId, menuOpen, ...rest}, ref) => {\n const {colorMode: defaultColorMode} = useTheme()\n\n const colorMode = className?.includes('ActionMenu__menu--split') ? 'light' : defaultColorMode\n\n return (\n <ThemeProvider colorMode={colorMode}>\n <ul ref={ref} className={clsx(className)} role=\"menu\" data-testid={testId || testIds.list} {...rest}>\n {children}\n </ul>\n </ThemeProvider>\n )\n },\n)\n\n/**\n * Use ActionMenu to display a list of actions or selections that expand through a trigger button.\n * @see https://primer.style/brand/components/ActionMenu\n */\nexport const ActionMenu = Object.assign(_ActionMenuRoot, {\n Button: ActionMenuButton,\n Item: ActionMenuItem,\n Overlay: ActionMenuOverlay,\n testIds,\n})\n"],"mappings":";;;;;;;;;;;;;;;;AAoCA,IAAM,IAAU;CACd,MAAM;CACN,IAAI,SAAS;AACX,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,UAAU;AACZ,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,OAAO;AACT,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,OAAO;AACT,SAAO,GAAG,KAAK,KAAK;;CAEvB,EAIY,IAAyB;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,EAEY,IAAkB,CAAC,SAAS,SAAS,EAErC,IAAwB,CAAC,WAAW,eAAe,EA8D1D,IAAoB,EAAM,cAAqC,EAAE,CAAC,EAE3D,UACJ,EAAM,WAAW,EAAkB,EAK/B,KAAyD,EAAC,SAAM,aAAU,sBAAkB;CACvG,IAAM,CAAC,GAAa,KAAW,EAAS,EAAK;AAE7C,QACE,kBAAC,EAAkB,UAAnB;EAA4B,OAAO;GAAC,MAAM;GAAa;GA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QAAQ;CACR,MAAM;CACN,SAAS;CACT;CACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"ActionMenu.js","names":[],"sources":["../../src/ActionMenu/ActionMenu.tsx"],"sourcesContent":["import React, {\n Children,\n isValidElement,\n cloneElement,\n useRef,\n useCallback,\n useState,\n useEffect,\n PropsWithChildren,\n forwardRef,\n memo,\n ReactElement,\n useMemo,\n} from 'react'\nimport {Button, ButtonProps} from '../Button'\nimport {Text} from '../Text'\nimport {ThemeProvider, useTheme} from '../ThemeProvider'\nimport {useAnchoredPosition} from '../hooks/useAnchoredPosition'\nimport {useOnClickOutside} from '../hooks/useOnClickOutside'\nimport {useKeyboardEscape} from '../hooks/useKeyboardEscape'\n\nimport {clsx} from 'clsx'\nimport {CheckIcon, ChevronDownIcon, type Icon} from '@primer/octicons-react'\nimport {useId} from '../hooks/useId'\n\nimport {FocusKeys, type PositionSettings, focusZone} from '@primer/behaviors'\nimport type {BaseProps} from '../component-helpers'\n\n/**\n * Design tokens\n */\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/action-menu/colors-with-modes.css'\n\n/** * Main Stylesheet (as a CSS Module) */\nimport styles from './ActionMenu.module.css'\n\nconst testIds = {\n root: 'ActionMenu',\n get button() {\n return `${this.root}-button`\n },\n get overlay() {\n return `${this.root}-overlay`\n },\n get list() {\n return `${this.root}-list`\n },\n get item() {\n return `${this.root}-list-item`\n },\n}\n\n// primer behaviors doesn't export these values, recreating manually\n// https://github.com/primer/behaviors/blob/main/src/anchored-position.ts#L5\nexport const actionMenuOverlaySides = [\n 'inside-top',\n 'inside-bottom',\n 'inside-left',\n 'inside-right',\n 'inside-center',\n 'outside-top',\n 'outside-bottom',\n 'outside-left',\n 'outside-right',\n] as PositionSettings['side'][]\n\nexport const ActionMenuSizes = ['small', 'medium'] as const\n\nexport const ActionMenuButtonModes = ['default', 'split-button'] as const\nexport type ActionMenuButtonModes = (typeof ActionMenuButtonModes)[number]\n\nexport type ActionMenuSizes = (typeof ActionMenuSizes)[number]\n\nexport type ActionMenuProps = {\n /**\n * The content of the ActionMenu. Must be an ActionMenu.Button and an ActionMenu.Overlay\n */\n children:\n | ReactElement<ActionMenuButtonProps>\n | ReactElement<ActionMenuOverlayProps>\n | Array<ReactElement<ActionMenuButtonProps> | ReactElement<ActionMenuOverlayProps>>\n /**\n * Determines whether the ActionMenu is disabled\n */\n disabled?: boolean\n /**\n * Determines whether the ActionMenu is open by default\n */\n open?: boolean\n /**\n * Callback that is called when an item is selected.\n * The value of the selected item is passed as an argument.\n */\n onSelect?: (newValue: string) => void\n /**\n * The selection variant of the ActionMenu.\n * - `single`: Only one item can be selected at a time. Menu items as a menuitemradio.\n * - `none`: No items can be selected. Menu items as a menuitem.\n */\n selectionVariant?: 'single' | 'none'\n /**\n * Test id for the ActionMenu\n */\n 'data-testid'?: string\n /**\n * Horizontal alignment of the menu relative to the bottom of the button\n */\n menuAlignment?: 'start' | 'end'\n /**\n * Size configuratin of the ActionMenu\n */\n size?: ActionMenuSizes\n /*\n * Side the menu overlay appears\n */\n menuSide?: PositionSettings['side']\n /**\n * Alternative behavior for the button and menu items\n * - `default`: The button and menu items behave as a standard button and menu item.\n * - `split-button`: The button behaves as a split button, and the menu items behave as links.\n */\n mode?: ActionMenuButtonModes\n} & BaseProps<HTMLDivElement>\n\ntype ActionMenuContextType = {\n size?: ActionMenuSizes\n setSize?: React.Dispatch<React.SetStateAction<ActionMenuSizes | undefined>>\n onMenuToggle?: () => void\n}\n\nconst ActionMenuContext = React.createContext<ActionMenuContextType>({})\n\nexport const useActionMenuContext = (): ActionMenuContextType => {\n return React.useContext(ActionMenuContext)\n}\n\ntype ActionMenuProviderProps = ActionMenuProps & Pick<ActionMenuContextType, 'onMenuToggle'>\n\nexport const ActionMenuProvider: React.FC<ActionMenuProviderProps> = ({size, children, onMenuToggle}) => {\n const [currentSize, setSize] = useState(size)\n\n return (\n <ActionMenuContext.Provider value={{size: currentSize, setSize, onMenuToggle}}>\n {children}\n </ActionMenuContext.Provider>\n )\n}\n\nconst _ActionMenuRoot = memo(\n ({\n id,\n children,\n 'data-testid': testId,\n disabled,\n open = false,\n selectionVariant = 'none',\n menuAlignment = 'end',\n size = 'medium',\n menuSide,\n onSelect,\n mode = 'default',\n }: ActionMenuProps) => {\n const [showMenu, setShowMenu] = useState(open)\n const floatingElementRef = useRef<HTMLUListElement>(null)\n const anchorElementRef = useRef<HTMLButtonElement>(null)\n const instanceId = useId(id)\n\n useOnClickOutside(floatingElementRef, () => setShowMenu(false), anchorElementRef)\n\n const closeMenuCallback = useCallback(() => {\n setShowMenu(false)\n }, [])\n\n useKeyboardEscape(closeMenuCallback)\n\n const toggleMenu = useCallback(() => {\n setShowMenu(!showMenu)\n }, [showMenu])\n\n const handleOnSelect = useCallback(\n (newValue: string) => {\n if (onSelect) onSelect(newValue)\n toggleMenu()\n },\n [onSelect, toggleMenu],\n )\n\n const handleItemSelection = useCallback(\n (newValue: string) => {\n handleOnSelect(newValue)\n toggleMenu()\n anchorElementRef.current?.focus()\n },\n [handleOnSelect, toggleMenu, anchorElementRef],\n )\n\n useEffect(() => {\n if (showMenu && floatingElementRef.current) {\n const floatingElement = floatingElementRef.current\n const isSplitLayout = mode === 'split-button'\n const splitLayoutFilter = isSplitLayout ? element => element.tagName === 'A' : undefined\n\n focusZone(floatingElementRef.current, {\n bindKeys: FocusKeys.ArrowVertical,\n focusableElementFilter: splitLayoutFilter,\n focusInStrategy: isSplitLayout ? 'first' : undefined,\n })\n\n // enter selects item\n floatingElement.addEventListener('keydown', event => {\n if (event.key === 'Enter') {\n const target = event.target as HTMLElement\n\n // Get the proper element containing the data-value\n const targetElement = target.tagName === 'A' ? target.closest('li') : target\n\n if (!targetElement || targetElement.getAttribute('aria-disabled') === 'true') return\n\n const value = targetElement.getAttribute('data-value')\n if (value) {\n handleOnSelect(value)\n setShowMenu(false)\n setTimeout(() => {\n anchorElementRef.current?.focus()\n }, 10)\n }\n }\n })\n\n const targetSelector = isSplitLayout ? 'a' : 'li'\n\n // focusses first item\n const firstItem = floatingElementRef.current.querySelector(targetSelector)\n if (firstItem) {\n setTimeout(() => {\n firstItem.focus()\n }, 10)\n }\n\n const lastItem =\n floatingElement.querySelectorAll(targetSelector)[floatingElement.querySelectorAll(targetSelector).length - 1]\n lastItem.addEventListener('keydown', (event: Event) => {\n const keyboardEvent = event as KeyboardEvent\n if (keyboardEvent.key === 'ArrowDown') {\n keyboardEvent.preventDefault()\n firstItem?.focus()\n }\n })\n\n firstItem?.addEventListener('keydown', (event: Event) => {\n const keyboardEvent = event as KeyboardEvent\n if (keyboardEvent.key === 'ArrowUp') {\n keyboardEvent.preventDefault()\n lastItem.focus()\n }\n })\n\n //on escape refocus\n floatingElement.addEventListener('keydown', (event: Event) => {\n const keyboardEvent = event as KeyboardEvent\n if (keyboardEvent.key === 'Escape') {\n anchorElementRef.current?.focus()\n }\n })\n }\n }, [showMenu, floatingElementRef, mode, handleItemSelection, toggleMenu, handleOnSelect])\n\n // Calculate the position of the menu\n const {position} = useAnchoredPosition(\n {\n floatingElementRef,\n anchorElementRef,\n align: menuAlignment,\n allowOutOfBounds: true,\n side: menuSide,\n },\n [showMenu],\n )\n\n const {Button: SelectButton, Overlay: SelectOverlay} = Children.toArray(children).reduce<{\n Button?: ReactElement<ActionMenuButtonProps>\n Overlay?: ReactElement<ActionMenuOverlayProps>\n }>((acc, child) => {\n if (isValidElement<ActionMenuButtonProps>(child) && child.type === ActionMenuButton) {\n acc.Button = cloneElement(child, {\n ref: anchorElementRef as React.RefObject<HTMLButtonElement>,\n className: clsx(child.props.className, styles[`ActionMenu__button--${mode}`], showMenu),\n menuOpen: showMenu,\n disabled,\n id: `${instanceId}-button`,\n size,\n _mode: mode,\n })\n } else if (isValidElement<ActionMenuOverlayProps>(child) && child.type === ActionMenuOverlay) {\n acc.Overlay = cloneElement(child, {\n ref: floatingElementRef as React.RefObject<HTMLUListElement>,\n className: clsx(\n styles.ActionMenu__menu,\n position && styles['ActionMenu__menu--visible'],\n position && styles[`ActionMenu__menu--pos-${position.anchorSide}`],\n styles[`ActionMenu__menu--${size}`],\n mode === 'split-button' && 'ActionMenu__menu--split',\n ),\n style: {\n top: `${position?.top ?? 0}px`,\n left: `${position?.left ?? 0}px`,\n },\n id: `${instanceId}-menu`,\n children: Children.map(child.props.children, item => {\n if (isValidElement<ActionMenuItemBaseProps>(item)) {\n return cloneElement(item, {\n handler: handleItemSelection,\n type: mode === 'split-button' ? 'link' : selectionVariant,\n })\n }\n return item\n }),\n })\n }\n return acc\n }, {})\n\n return (\n <ActionMenuProvider size={size} onMenuToggle={toggleMenu}>\n <div\n id={instanceId}\n className={clsx(styles.ActionMenu, disabled && styles['ActionMenu--disabled'])}\n data-testid={testId || testIds.root}\n >\n {SelectButton}\n {showMenu ? SelectOverlay : null}\n </div>\n </ActionMenuProvider>\n )\n },\n)\n\ntype ActionMenuButtonProps = PropsWithChildren<\n BaseProps<HTMLButtonElement> & Pick<React.ButtonHTMLAttributes<HTMLButtonElement>, 'id' | 'disabled' | 'onClick'>\n> & {\n as?: ButtonProps<'a'>['as']\n href?: ButtonProps<'a'>['href']\n menuOpen?: boolean\n 'data-testid'?: string\n size?: ActionMenuSizes\n _mode?: ActionMenuButtonModes\n variant?: ButtonProps<'a'>['variant']\n leadingVisual?: ButtonProps<'a'>['leadingVisual']\n}\n\nconst ActionMenuButton = forwardRef<HTMLButtonElement, ActionMenuButtonProps>(\n (\n {\n as,\n href,\n id,\n children,\n className,\n 'data-testid': testId,\n disabled,\n menuOpen,\n size,\n _mode = 'default',\n onClick,\n leadingVisual,\n variant,\n ...props\n },\n ref,\n ) => {\n const {onMenuToggle} = useActionMenuContext()\n const handleClick = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(event)\n\n if (!event.defaultPrevented) {\n onMenuToggle?.()\n }\n },\n [onClick, onMenuToggle],\n )\n\n if (_mode === 'split-button') {\n const splitButtonVariant = variant ?? 'primary'\n\n return (\n <div className={clsx(styles.ActionMenu__button, styles[`ActionMenu__button--${size}`], className)}>\n <Button\n as={as}\n href={href}\n className={clsx(\n styles['ActionMenu__innerButton--split-button'],\n styles[`ActionMenu__innerButton--${splitButtonVariant}`],\n styles[`ActionMenu__innerButton--${size}`],\n disabled && styles['ActionMenu__innerButton--disabled'],\n )}\n variant={splitButtonVariant}\n aria-disabled={disabled}\n data-testid={testId || testIds.button}\n size={size}\n leadingVisual={leadingVisual}\n onClick={onClick}\n {...props}\n >\n <span className={styles['ActionMenu__button-text']}>{children}</span>\n </Button>\n <Button\n ref={ref}\n id={id}\n as=\"button\"\n className={styles['ActionMenu__innerButton--split-button']}\n variant={splitButtonVariant}\n aria-haspopup=\"true\"\n aria-label=\"Menu\"\n size={size}\n aria-expanded={menuOpen ? 'true' : 'false'}\n onClick={onMenuToggle}\n disabled={disabled}\n >\n <ChevronDownIcon className={styles['ActionMenu__inner-button-dropdown-icon']} />\n </Button>\n </div>\n )\n }\n\n return (\n <Button\n ref={ref}\n id={id}\n className={clsx(styles.ActionMenu__button, styles[`ActionMenu__button--${size}`], className)}\n aria-haspopup=\"true\"\n aria-expanded={menuOpen ? 'true' : 'false'}\n disabled={disabled}\n data-testid={testId || testIds.button}\n size={size}\n variant={variant}\n leadingVisual={leadingVisual}\n trailingVisual={<ChevronDownIcon />}\n onClick={handleClick}\n {...props}\n >\n <span className={styles['ActionMenu__button-text']}>{children}</span>\n </Button>\n )\n },\n)\n\ntype ActionMenuItemBaseProps = {\n handler?: (newValue: string) => void\n type?: 'none' | 'single' | 'link'\n disabled?: boolean\n size?: ActionMenuSizes\n leadingVisual?: React.ReactElement | React.ReactNode | Icon\n} & PropsWithChildren<React.HTMLProps<HTMLLIElement>>\n\ntype ActionMenuItemAnchorProps = ActionMenuItemBaseProps & {\n as: 'a'\n} & Omit<React.HTMLProps<HTMLAnchorElement>, keyof ActionMenuItemBaseProps | 'as'>\n\n// Type for when 'as' is not set or is anything other than 'a'\ntype ActionMenuItemDefaultProps = ActionMenuItemBaseProps & {\n as?: string\n value?: string\n selected?: boolean\n} & Omit<React.HTMLProps<HTMLLIElement>, keyof ActionMenuItemBaseProps | 'as'>\n\nconst roleTypeMap = {\n none: 'menuitem',\n single: 'menuitemradio',\n link: 'menuitem',\n}\n\nconst ActionMenuItem = ({\n as,\n children,\n className,\n disabled,\n handler,\n selected,\n type,\n value,\n onClick,\n onKeyDown,\n leadingVisual: LeadingVisual,\n ...props\n}: ActionMenuItemAnchorProps | ActionMenuItemDefaultProps) => {\n const {size} = useActionMenuContext()\n\n const handleClick = useCallback(\n (e: React.MouseEvent<HTMLLIElement>) => {\n onClick?.(e)\n\n if (!disabled) {\n handler?.(String(value))\n }\n },\n [handler, value, disabled, onClick],\n )\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLLIElement>) => {\n onKeyDown?.(e)\n\n if (!disabled && e.key === 'Enter') {\n handler?.(String(value))\n }\n },\n [handler, value, disabled, onKeyDown],\n )\n\n const liProps = useMemo<React.HTMLProps<HTMLLIElement> & {'data-value': unknown}>(\n () => ({\n className: clsx(\n styles.ActionMenu__item,\n type === 'single' && styles[`ActionMenu__item--selection-type-${type}`],\n size && styles[`ActionMenu__item--${size}`],\n className,\n ),\n role: roleTypeMap[type || 'single'],\n 'aria-disabled': disabled,\n tabIndex: -1,\n 'data-value': value,\n ...props,\n }),\n [props, type, size, className, disabled, value],\n )\n\n const contents = useMemo(\n () => (\n <>\n {React.isValidElement<{width?: number; height?: number}>(LeadingVisual)\n ? React.cloneElement(LeadingVisual, {\n width: LeadingVisual.props.width || 20,\n height: LeadingVisual.props.width || 20,\n })\n : null}\n {type === 'single' && (\n <span className={styles['ActionMenu__item-leadingVisual']}>\n {selected && (\n <CheckIcon\n className={clsx(styles['ActionMenu__item-icon'], disabled && styles['ActionMenu__item-icon--disabled'])}\n size={16}\n />\n )}\n </span>\n )}\n\n <span className={styles['ActionMenu__item-text']}>\n <Text\n variant={disabled ? 'muted' : 'default'}\n size={size === 'medium' ? '200' : '100'}\n className={clsx(disabled && styles['ActionMenu__item-content--disabled'])}\n >\n {children}\n </Text>\n </span>\n </>\n ),\n [LeadingVisual, children, selected, disabled, size, type],\n )\n\n if (as === 'a') {\n return (\n <li\n // This role will be overridden by the role prop in `liProps`. It's just here to keep the linter happy\n role=\"menuitem\"\n {...liProps}\n // Intentionally not calling handle[Click/KeyDown] here so as to not call the handler\n onClick={onClick}\n onKeyDown={onKeyDown}\n >\n <a\n className={clsx(styles['ActionMenu__item-anchor'], disabled && styles['ActionMenu__item--disabled'])}\n href={props.href}\n >\n {contents}\n </a>\n </li>\n )\n }\n\n return (\n // eslint-disable-next-line jsx-a11y/role-supports-aria-props\n <li\n // This role will be overridden by the role prop in `liProps`. It's just here to keep the linter happy\n role=\"menuitem\"\n {...liProps}\n aria-checked={type === 'none' ? undefined : selected ? 'true' : 'false'}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n >\n {contents}\n </li>\n )\n}\n\ntype ActionMenuOverlayProps = PropsWithChildren<\n BaseProps<HTMLUListElement> & React.HTMLAttributes<HTMLUListElement>\n> & {\n 'aria-label': string\n id?: string\n 'data-testid'?: string\n menuOpen?: boolean\n style?: React.CSSProperties\n}\n\nconst ActionMenuOverlay = forwardRef<HTMLUListElement, ActionMenuOverlayProps>(\n ({children, className, 'data-testid': testId, menuOpen, ...rest}, ref) => {\n const {colorMode: defaultColorMode} = useTheme()\n\n const colorMode = className?.includes('ActionMenu__menu--split') ? 'light' : defaultColorMode\n\n return (\n <ThemeProvider colorMode={colorMode}>\n <ul ref={ref} className={clsx(className)} role=\"menu\" data-testid={testId || testIds.list} {...rest}>\n {children}\n </ul>\n </ThemeProvider>\n )\n },\n)\n\n/**\n * Use ActionMenu to display a list of actions or selections that expand through a trigger button.\n * @see https://primer.style/brand/components/ActionMenu\n */\nexport const ActionMenu = Object.assign(_ActionMenuRoot, {\n Button: ActionMenuButton,\n Item: ActionMenuItem,\n Overlay: ActionMenuOverlay,\n testIds,\n})\n"],"mappings":";;;;;;;;;;;;;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AU;EAAU;EAAU;EAAM;CAAI,CAC1D;CAsBA,OApBI,MAAO,MAEP,kBAAC,MAAD;EAEE,MAAK;EACL,GAAI;EAEK;EACE;YAEX,kBAAC,KAAD;GACE,WAAW,EAAK,EAAO,4BAA4B,KAAY,EAAO,6BAA6B;GACnG,MAAM,EAAM;aAEX;EACA,CAAA;CACD,CAAA,IAMN,kBAAC,MAAD;EAEE,MAAK;EACL,GAAI;EACJ,gBAAc,MAAS,SAAS,KAAA,IAAY,IAAW,SAAS;EAChE,SAAS;EACT,WAAW;YAEV;CACC,CAAA;AAER,GAYM,IAAoB,GACvB,EAAC,aAAU,cAAW,eAAe,GAAQ,aAAU,GAAG,KAAO,MAAQ;CACxE,IAAM,EAAC,WAAW,MAAoB,EAAS;CAI/C,OACE,kBAAC,GAAD;EAA0B,WAHV,GAAW,SAAS,yBAAyB,IAAI,UAAU;YAIzE,kBAAC,MAAD;GAAS;GAAK,WAAW,EAAK,CAAS;GAAG,MAAK;GAAO,eAAa,KAAU,EAAQ;GAAM,GAAI;GAC5F;EACC,CAAA;CACS,CAAA;AAEnB,CACF,GAMa,IAAa,OAAO,OAAO,GAAiB;CACvD,QAAQ;CACR,MAAM;CACN,SAAS;CACT;AACF,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import './ActionMenu.module-BAeHTqHw.css'
|
|
2
|
-
|
|
1
|
+
import './ActionMenu.module-BAeHTqHw.css';//#region src/ActionMenu/ActionMenu.module.css
|
|
2
|
+
var e = "Primer_Brand__ActionMenu-module__ActionMenu___xLxGU", t = "Primer_Brand__ActionMenu-module__ActionMenu__button___vFLAF", n = "Primer_Brand__ActionMenu-module__ActionMenu__menu___BEldF", r = "Primer_Brand__ActionMenu-module__ActionMenu__item___2FZw4", i = {
|
|
3
|
+
ActionMenu: e,
|
|
3
4
|
"ActionMenu--disabled": "Primer_Brand__ActionMenu-module__ActionMenu--disabled___UsizV",
|
|
4
|
-
ActionMenu__button:
|
|
5
|
+
ActionMenu__button: t,
|
|
5
6
|
"ActionMenu__button--default": "Primer_Brand__ActionMenu-module__ActionMenu__button--default___heDoV",
|
|
6
7
|
"ActionMenu__button--small": "Primer_Brand__ActionMenu-module__ActionMenu__button--small___UAUPB",
|
|
7
8
|
"ActionMenu__button--medium": "Primer_Brand__ActionMenu-module__ActionMenu__button--medium___n5ovs",
|
|
@@ -11,7 +12,7 @@ import './ActionMenu.module-BAeHTqHw.css';var e = {
|
|
|
11
12
|
"ActionMenu__innerButton--medium": "Primer_Brand__ActionMenu-module__ActionMenu__innerButton--medium___C2bJi",
|
|
12
13
|
"ActionMenu__inner-button-dropdown-icon": "Primer_Brand__ActionMenu-module__ActionMenu__inner-button-dropdown-icon___IGvTk",
|
|
13
14
|
"ActionMenu__innerButton--disabled": "Primer_Brand__ActionMenu-module__ActionMenu__innerButton--disabled___WrkOb",
|
|
14
|
-
ActionMenu__menu:
|
|
15
|
+
ActionMenu__menu: n,
|
|
15
16
|
"ActionMenu__menu--small": "Primer_Brand__ActionMenu-module__ActionMenu__menu--small___xbb8m",
|
|
16
17
|
"ActionMenu__menu--medium": "Primer_Brand__ActionMenu-module__ActionMenu__menu--medium___3QqgD",
|
|
17
18
|
"ActionMenu__menu--visible": "Primer_Brand__ActionMenu-module__ActionMenu__menu--visible___QzhaX",
|
|
@@ -19,7 +20,7 @@ import './ActionMenu.module-BAeHTqHw.css';var e = {
|
|
|
19
20
|
"overlay-appear-outside-bottom": "Primer_Brand__ActionMenu-module__overlay-appear-outside-bottom___egiij",
|
|
20
21
|
"ActionMenu__menu--pos-outside-top": "Primer_Brand__ActionMenu-module__ActionMenu__menu--pos-outside-top___4TZek",
|
|
21
22
|
"overlay-appear-outside-top": "Primer_Brand__ActionMenu-module__overlay-appear-outside-top____Ko4E",
|
|
22
|
-
ActionMenu__item:
|
|
23
|
+
ActionMenu__item: r,
|
|
23
24
|
"ActionMenu__item-anchor": "Primer_Brand__ActionMenu-module__ActionMenu__item-anchor___dX7CI",
|
|
24
25
|
"ActionMenu__item-anchor--disabled": "Primer_Brand__ActionMenu-module__ActionMenu__item-anchor--disabled___Lx1Az",
|
|
25
26
|
"ActionMenu__item--medium": "Primer_Brand__ActionMenu-module__ActionMenu__item--medium___YWN8M",
|
|
@@ -32,6 +33,6 @@ import './ActionMenu.module-BAeHTqHw.css';var e = {
|
|
|
32
33
|
"ActionMenu__item-icon--disabled": "Primer_Brand__ActionMenu-module__ActionMenu__item-icon--disabled___BjIIo"
|
|
33
34
|
};
|
|
34
35
|
//#endregion
|
|
35
|
-
export { e as default };
|
|
36
|
+
export { e as ActionMenu, t as ActionMenu__button, r as ActionMenu__item, n as ActionMenu__menu, i as default };
|
|
36
37
|
|
|
37
38
|
//# sourceMappingURL=ActionMenu.module.js.map
|
|
@@ -19,7 +19,7 @@ export type AnchorNavProps = BaseProps<HTMLElement> & {
|
|
|
19
19
|
*/
|
|
20
20
|
hideUntilSticky?: boolean;
|
|
21
21
|
} & React.ComponentPropsWithoutRef<'nav'>;
|
|
22
|
-
declare function AnchorNavBase({ children, enableDefaultBgColor, hideUntilSticky, ...rest }: AnchorNavProps):
|
|
22
|
+
declare function AnchorNavBase({ children, enableDefaultBgColor, hideUntilSticky, ...rest }: AnchorNavProps): React.JSX.Element;
|
|
23
23
|
type AnchorNavLinkIntersectionOptions = {
|
|
24
24
|
/**
|
|
25
25
|
* The area of the element that should trigger the next linked section to be highlighted.
|
|
@@ -45,15 +45,15 @@ type AnchorNavLinkProps = BaseProps<HTMLAnchorElement> & {
|
|
|
45
45
|
prefersReducedMotion?: boolean;
|
|
46
46
|
updateCurrentActiveNav?: (id: string | null) => void;
|
|
47
47
|
} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>;
|
|
48
|
-
declare function NavLinkBase({ alignment, children, href, isActive, toggleMenuCallback, prefersReducedMotion, intersectionOptions, updateCurrentActiveNav, ...rest }: AnchorNavLinkProps):
|
|
48
|
+
declare function NavLinkBase({ alignment, children, href, isActive, toggleMenuCallback, prefersReducedMotion, intersectionOptions, updateCurrentActiveNav, ...rest }: AnchorNavLinkProps): React.JSX.Element;
|
|
49
49
|
type AnchorNavActionProps = {
|
|
50
50
|
/**
|
|
51
51
|
* Required path or location for the action button to link to.
|
|
52
52
|
*/
|
|
53
53
|
href: string;
|
|
54
54
|
} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> & ButtonBaseProps;
|
|
55
|
-
declare function ActionBase({ children, href, variant, size, ...rest }: AnchorNavActionProps):
|
|
56
|
-
declare function SecondaryActionBase({ children, href, variant, size, ...rest }: AnchorNavActionProps):
|
|
55
|
+
declare function ActionBase({ children, href, variant, size, ...rest }: AnchorNavActionProps): React.JSX.Element;
|
|
56
|
+
declare function SecondaryActionBase({ children, href, variant, size, ...rest }: AnchorNavActionProps): React.JSX.Element;
|
|
57
57
|
/**
|
|
58
58
|
* AnchorNav allows users to navigate to different sections of a page.
|
|
59
59
|
* @see https://primer.style/brand/components/AnchorNav
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnchorNav.d.ts","sourceRoot":"","sources":["../../src/AnchorNav/AnchorNav.tsx"],"names":[],"mappings":"AACA,OAAO,KAA0D,MAAM,OAAO,CAAA;AAI9E,OAAO,EAAS,eAAe,EAAO,MAAM,KAAK,CAAA;AAKjD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAA;AAEnD;;GAEG;AACH,OAAO,8GAA8G,CAAA;AAwBrH,MAAM,MAAM,cAAc,GAAG,SAAS,CAAC,WAAW,CAAC,GAAG;IACpD;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,CAAA;IAC3B;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAA;AAEzC,iBAAS,aAAa,CAAC,EAAC,QAAQ,EAAE,oBAA4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I,CAAA;CACrD,GAAG,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,CAAA;AAE/D,iBAAS,WAAW,CAAC,EACnB,SAAmB,EACnB,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,kBAAkB,EAClB,oBAAoB,EACpB,mBAA4C,EAC5C,sBAAsB,EACtB,GAAG,IAAI,EACR,EAAE,kBAAkB,qBAuEpB;AAED,KAAK,oBAAoB,GAAG;IAC1B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;CACb,GAAG,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,GAC7D,eAAe,CAAA;AAEjB,iBAAS,UAAU,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,OAAqB,EAAE,IAAc,EAAE,GAAG,IAAI,EAAC,EAAE,oBAAoB,qBAczG;AAED,iBAAS,mBAAmB,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,OAAqB,EAAE,IAAc,EAAE,GAAG,IAAI,EAAC,EAAE,oBAAoB,qBAclH;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;CAKpB,CAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
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
3
|
import { Text as n } from "../Text/Text.js";
|
|
4
4
|
import { Button as r } from "../Button/Button.js";
|
|
5
5
|
import { useKeyboardEscape as i } from "../hooks/useKeyboardEscape.js";
|
|
6
|
-
import { ChevronDownIcon as a
|
|
6
|
+
import { ChevronDownIcon as a } from "../node_modules/@primer/octicons-react/dist/icons/ChevronDownIcon.js";
|
|
7
|
+
import { ChevronUpIcon as o } from "../node_modules/@primer/octicons-react/dist/icons/ChevronUpIcon.js";
|
|
7
8
|
import { useWindowSize as s } from "../hooks/useWindowSize.js";
|
|
8
9
|
import c from "./AnchorNav.module.js";
|
|
9
10
|
import { useExpandedMenu as l } from "./useExpandedMenu.js";
|
|
@@ -43,10 +44,14 @@ function y({ children: r, enableDefaultBgColor: y = !1, hideUntilSticky: C = !1,
|
|
|
43
44
|
L(e);
|
|
44
45
|
}
|
|
45
46
|
}, [H]), f(() => {
|
|
46
|
-
|
|
47
|
+
let e = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
48
|
+
ee(e.matches);
|
|
47
49
|
}, []), f(() => {
|
|
48
50
|
let e = () => {
|
|
49
|
-
|
|
51
|
+
if (M) {
|
|
52
|
+
let e = window.pageYOffset > M;
|
|
53
|
+
F(e);
|
|
54
|
+
}
|
|
50
55
|
};
|
|
51
56
|
return window.addEventListener("scroll", e), () => {
|
|
52
57
|
window.removeEventListener("scroll", e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnchorNav.js","names":[],"sources":["../../src/AnchorNav/AnchorNav.tsx"],"sourcesContent":["import {clsx} from 'clsx'\nimport React, {useCallback, useEffect, useMemo, useRef, useState} from 'react'\nimport {ChevronDownIcon, ChevronUpIcon} from '@primer/octicons-react'\nimport {useId} from '../hooks/useId'\n\nimport {Button, ButtonBaseProps, Text} from '../'\nimport {useWindowSize} from '../hooks/useWindowSize'\nimport {useKeyboardEscape} from '../hooks/useKeyboardEscape'\nimport {useExpandedMenu} from './useExpandedMenu'\n\nimport type {BaseProps} from '../component-helpers'\n\n/**\n * Design tokens\n */\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/anchor-nav/colors-with-modes.css'\n\n/** * Main Stylesheet (as a CSS Module) */\nimport styles from './AnchorNav.module.css'\n\nconst testIds = {\n root: 'AnchorNav',\n get menuButton() {\n return `${this.root}-menu-button`\n },\n get menuLinks() {\n return `${this.root}-menu-links`\n },\n get action() {\n return `${this.root}-action`\n },\n get secondaryAction() {\n return `${this.root}-secondary-action`\n },\n get navSpacer() {\n return `${this.root}-nav-spacer`\n },\n}\n\nexport type AnchorNavProps = BaseProps<HTMLElement> & {\n /**\n * Accepts all of `AnchorNav.Item` and `AnchorNav.Action` child components.\n */\n children: React.ReactNode[]\n /**\n * Enable the idle state background color, which is transparent by default.\n */\n enableDefaultBgColor?: boolean\n /**\n * When true, the anchor nav will hide until it is sticky.\n */\n hideUntilSticky?: boolean\n} & React.ComponentPropsWithoutRef<'nav'>\n\nfunction AnchorNavBase({children, enableDefaultBgColor = false, hideUntilSticky = false, ...rest}: AnchorNavProps) {\n const [menuOpen, setMenuOpen] = useState(false)\n const [prefersReducedMotion, setPrefersReducedMotion] = useState(false)\n const [currentActiveNavItem, setCurrentActiveNavItem] = useState<string | null>()\n const [intersectionEntry, setIntersectionEntry] = useState<IntersectionObserverEntry>()\n const [initialYOffset, setInitialYOffset] = useState<undefined | number>()\n const [navShouldFix, setNavShouldFix] = useState<boolean>(false)\n const [navHeight, setNavHeight] = useState<number>(0)\n\n const wrapperRef = useRef<HTMLDivElement | null>(null)\n const rootRef = useRef<HTMLElement | null>(null)\n const linkContainerRef = useRef<HTMLDivElement | null>(null)\n const innerContainerRef = useRef<HTMLDivElement | null>(null)\n\n const {isLarge} = useWindowSize()\n const idForLinkContainer = useId()\n\n const closeMenuCallback = useCallback(() => setMenuOpen(false), [setMenuOpen])\n const toggleMenuCallback = useCallback(() => setMenuOpen(!menuOpen), [menuOpen])\n\n const ValidChildren = useMemo(\n () =>\n React.Children.toArray(children).filter(\n (child: React.ReactNode): boolean => React.isValidElement(child) && typeof child.type !== 'string',\n ),\n [children],\n )\n\n useEffect(() => {\n if (initialYOffset === undefined && intersectionEntry) {\n setInitialYOffset(intersectionEntry.boundingClientRect.y + window.scrollY)\n }\n }, [initialYOffset, intersectionEntry])\n\n const handleIntersectionUpdate = ([nextEntry]: IntersectionObserverEntry[]): void => {\n setIntersectionEntry(nextEntry)\n }\n\n useKeyboardEscape(closeMenuCallback)\n useExpandedMenu(menuOpen, linkContainerRef, innerContainerRef, !isLarge, closeMenuCallback)\n\n useEffect(() => {\n if (wrapperRef.current) {\n const height = wrapperRef.current.offsetHeight\n setNavHeight(height)\n }\n }, [isLarge])\n\n useEffect(() => {\n const queryResult = window.matchMedia('(prefers-reduced-motion: reduce)')\n\n setPrefersReducedMotion(queryResult.matches)\n }, [])\n\n useEffect(() => {\n const handler = () => {\n if (initialYOffset) {\n const isPastInitialYOffset = window.pageYOffset > initialYOffset\n setNavShouldFix(isPastInitialYOffset)\n }\n }\n // eslint-disable-next-line github/prefer-observers\n window.addEventListener('scroll', handler)\n return () => {\n window.removeEventListener('scroll', handler)\n }\n }, [initialYOffset])\n\n useEffect(() => {\n const node = hideUntilSticky ? wrapperRef.current : rootRef.current\n\n const supportsIntersectionObserver = !!window.IntersectionObserver\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!supportsIntersectionObserver || !node) return\n\n const topOfWindow = '0px 0px -100%'\n const observerParams = {threshold: 0, root: null, rootMargin: topOfWindow}\n const observer = new IntersectionObserver(handleIntersectionUpdate, observerParams)\n\n observer.observe(node)\n\n return () => observer.disconnect()\n }, [hideUntilSticky])\n\n const handleMenuToggle = useCallback(\n event => {\n event?.preventDefault()\n toggleMenuCallback()\n },\n [toggleMenuCallback],\n )\n\n const handleUpdateToCurrentActiveNavItem = useCallback(\n (id: string | null) => {\n setCurrentActiveNavItem(id)\n },\n [setCurrentActiveNavItem],\n )\n\n const numLinks = ValidChildren.filter(child => React.isValidElement(child) && child.type === NavLinkBase).length\n const Links = ValidChildren.map((child, index) => {\n if (React.isValidElement<AnchorNavLinkProps>(child) && child.type === NavLinkBase) {\n const defaultProps: AnchorNavLinkProps = {\n href: child.props.href,\n toggleMenuCallback,\n prefersReducedMotion,\n updateCurrentActiveNav: handleUpdateToCurrentActiveNavItem,\n alignment: numLinks < 4 ? 'start' : 'center',\n }\n return React.cloneElement(child, {\n isActive: index === 0,\n ...defaultProps,\n })\n }\n\n return null\n })\n .filter(Boolean)\n .slice(0, 5)\n\n const Action = ValidChildren.reduce<React.ReactElement<AnchorNavActionProps>[]>((acc, child) => {\n if (React.isValidElement<AnchorNavActionProps>(child) && child.type === ActionBase) {\n acc.push(React.cloneElement(child))\n }\n return acc\n }, [])\n\n const SecondaryAction = ValidChildren.reduce<React.ReactElement<AnchorNavActionProps>[]>((acc, child) => {\n if (React.isValidElement<AnchorNavActionProps>(child) && child.type === SecondaryActionBase) {\n acc.push(React.cloneElement(child))\n }\n return acc\n }, [])\n\n const hasLargerSizeActions =\n Action.some(action => action.props.size && action.props.size !== 'small') ||\n SecondaryAction.some(action => action.props.size && action.props.size !== 'small')\n\n /* On page load, the rootMargin positions and/or thresholds of the IntersectionObserver\n * may not be met depending on the position of the AnchorNav on the page.\n * The following useEffect ensures that the first link always marked as the active link, until\n * the observer kicks in. Without this, the active link is undefined.\n */\n useEffect(() => {\n if (!currentActiveNavItem && Links.length > 0) {\n setCurrentActiveNavItem(Links[0]?.props.children as string)\n }\n }, [currentActiveNavItem, Links])\n\n const hasTwoActions = Action.length > 0 && SecondaryAction.length > 0\n\n return (\n <div ref={wrapperRef}>\n <nav\n ref={rootRef}\n aria-label=\"Anchored navigation\"\n data-sticky={navShouldFix.toString()}\n className={clsx(\n styles.AnchorNav,\n hideUntilSticky && styles['AnchorNav--hide-until-sticky'],\n navShouldFix && styles['AnchorNav--stuck'],\n menuOpen && styles['AnchorNav--expanded'],\n enableDefaultBgColor && styles['AnchorNav--with-default-background-color'],\n )}\n {...rest}\n >\n <div\n ref={innerContainerRef}\n className={clsx(\n styles['AnchorNav-inner-container'],\n menuOpen && styles['AnchorNav-inner-container--expanded'],\n )}\n >\n <button\n onClick={handleMenuToggle}\n className={clsx(styles['AnchorNav-menu-button'])}\n aria-expanded={menuOpen}\n aria-controls={idForLinkContainer}\n data-testid={testIds.menuButton}\n >\n {menuOpen ? (\n <ChevronUpIcon size={16} className={styles['AnchorNav-menu-button-arrow']} fill=\"currentcolor\" />\n ) : (\n <ChevronDownIcon size={16} className={styles['AnchorNav-menu-button-arrow']} fill=\"currentcolor\" />\n )}\n <span className=\"visually-hidden\">Anchor navigation menu. Currently selected: </span>\n <Text as=\"span\" className={clsx(styles['AnchorNav-link-label'])}>\n {currentActiveNavItem}\n </Text>\n </button>\n {/**Replace with unique ids and test ids */}\n <div\n id={idForLinkContainer}\n data-testid={testIds.menuLinks}\n className={styles['AnchorNav-link-container']}\n ref={linkContainerRef}\n >\n {Links}\n </div>\n <span\n data-forward-focus=\"true\"\n className={clsx(\n styles['AnchorNav__actionsContainer'],\n hasLargerSizeActions && styles['AnchorNav__actionsContainer--no-offset'],\n hasTwoActions && styles['AnchorNav__actionsContainer--multiple'],\n )}\n >\n {Action.length && SecondaryAction.length && React.isValidElement<AnchorNavActionProps>(Action[0])\n ? React.cloneElement(Action[0], {\n variant: 'primary',\n })\n : Action}\n {SecondaryAction}\n </span>\n </div>\n <span\n className={clsx(menuOpen && styles['AnchorNav-overlay--expanded'])}\n onClick={closeMenuCallback}\n aria-hidden\n />\n </nav>\n {navShouldFix && <div style={{height: navHeight}} aria-hidden=\"true\" data-testid={testIds.navSpacer} />}\n </div>\n )\n}\n\ntype AnchorNavLinkIntersectionOptions = {\n /**\n * The area of the element that should trigger the next linked section to be highlighted.\n */\n rootMargin: 'start' | 'middle'\n}\n\ntype AnchorNavLinkProps = BaseProps<HTMLAnchorElement> & {\n /**\n * Optional text alignment for the link. Defaults to 'start' if there are less than 4 links, otherwise 'center'.\n */\n alignment?: 'start' | 'center'\n /**\n * Required path or location for the anchor to link to.\n */\n href: string\n /**\n * Optional boolean to indicate if the link is the current active link.\n * Typically doesn't need to be sset unless custom animation is being used.\n */\n isActive?: boolean // internal prop, not exposed in docs\n toggleMenuCallback?: () => void // internal prop, not exposed in docs\n intersectionOptions?: AnchorNavLinkIntersectionOptions // internal prop, not exposed in docs\n prefersReducedMotion?: boolean // internal prop, not exposed in docs\n updateCurrentActiveNav?: (id: string | null) => void // internal prop, not exposed in docs\n} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>\n\nfunction NavLinkBase({\n alignment = 'start',\n children,\n href,\n isActive,\n toggleMenuCallback,\n prefersReducedMotion,\n intersectionOptions = {rootMargin: 'middle'},\n updateCurrentActiveNav,\n ...rest\n}: AnchorNavLinkProps) {\n const {isLarge} = useWindowSize()\n const [intersectionEntry, setIntersectionEntry] = useState<IntersectionObserverEntry>()\n\n const isAnchor = /^#/.test(href)\n const anchoredContentIsVisible = !!intersectionEntry?.isIntersecting\n\n const handleIntersectionUpdate = ([nextEntry]: IntersectionObserverEntry[]): void => {\n setIntersectionEntry(nextEntry)\n }\n\n useEffect(() => {\n const node = document.querySelector(isAnchor ? href : `#${href}`)\n\n const supportsIntersectionObserver = !!window.IntersectionObserver\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!supportsIntersectionObserver || !node) return\n\n const rootMarginTop = '0px'\n const rootMarginCenter = '-50% 0% -50% 0%'\n\n const rootMargin = intersectionOptions.rootMargin === 'start' ? rootMarginTop : rootMarginCenter\n\n const observerParams = {threshold: intersectionOptions.rootMargin === 'start' ? 0.4 : 0, root: null, rootMargin}\n\n const observer = new IntersectionObserver(handleIntersectionUpdate, observerParams)\n\n observer.observe(node)\n\n return () => observer.disconnect()\n }, [href, intersectionOptions.rootMargin, isAnchor])\n\n // updates root AnchorNav to notify of active section\n useEffect(() => {\n if (anchoredContentIsVisible && updateCurrentActiveNav && typeof children === 'string') {\n updateCurrentActiveNav(children)\n }\n }, [anchoredContentIsVisible, children, updateCurrentActiveNav])\n\n const handleClick = useCallback(() => {\n if (toggleMenuCallback && !isLarge) {\n toggleMenuCallback()\n }\n }, [isLarge, toggleMenuCallback])\n\n return (\n <a\n className={clsx(\n styles['AnchorNav-link'],\n styles[`AnchorNav-link--${alignment}`],\n anchoredContentIsVisible && styles['AnchorNav-link--is-active'],\n )}\n href={isAnchor ? href : `#${href}`}\n aria-current={anchoredContentIsVisible && 'true'}\n data-first={isActive}\n data-active={anchoredContentIsVisible ? 'true' : 'false'}\n onClick={handleClick}\n {...rest}\n >\n <Text\n as=\"span\"\n className={clsx(\n styles['AnchorNav-link-label'],\n anchoredContentIsVisible && styles['AnchorNav-link-label--is-active'],\n )}\n >\n {children}\n </Text>\n </a>\n )\n}\n\ntype AnchorNavActionProps = {\n /**\n * Required path or location for the action button to link to.\n */\n href: string\n} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> &\n ButtonBaseProps\n\nfunction ActionBase({children, href, variant = 'secondary', size = 'small', ...rest}: AnchorNavActionProps) {\n return (\n <Button\n as=\"a\"\n variant={variant}\n className={clsx(styles['AnchorNav-action'])}\n href={href}\n data-testid={testIds.action}\n size={size}\n {...rest}\n >\n {children}\n </Button>\n )\n}\n\nfunction SecondaryActionBase({children, href, variant = 'secondary', size = 'small', ...rest}: AnchorNavActionProps) {\n return (\n <Button\n as=\"a\"\n variant={variant}\n className={clsx(styles['AnchorNav-action'])}\n href={href}\n data-testid={testIds.secondaryAction}\n size={size}\n {...rest}\n >\n {children}\n </Button>\n )\n}\n\n/**\n * AnchorNav allows users to navigate to different sections of a page.\n * @see https://primer.style/brand/components/AnchorNav\n */\nexport const AnchorNav = Object.assign(AnchorNavBase, {\n Link: NavLinkBase,\n Action: ActionBase,\n SecondaryAction: SecondaryActionBase,\n testIds,\n})\n"],"mappings":";;;;;;;;;;;;;AAoBA,IAAM,IAAU;CACd,MAAM;CACN,IAAI,aAAa;AACf,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,YAAY;AACd,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,SAAS;AACX,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,kBAAkB;AACpB,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,YAAY;AACd,SAAO,GAAG,KAAK,KAAK;;CAEvB;AAiBD,SAAS,EAAc,EAAC,aAAU,0BAAuB,IAAO,qBAAkB,IAAO,GAAG,KAAuB;CACjH,IAAM,CAAC,GA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gBAAc,KAA4B;EAC1C,cAAY;EACZ,eAAa,IAA2B,SAAS;EACjD,SAAS;EACT,GAAI;YAEJ,kBAAC,GAAD;GACE,IAAG;GACH,WAAW,EACT,EAAO,yBACP,KAA4B,EAAO,mCACpC;GAEA;GACI,CAAA;EACL,CAAA;;AAYR,SAAS,EAAW,EAAC,aAAU,SAAM,aAAU,aAAa,UAAO,SAAS,GAAG,KAA6B;AAC1G,QACE,kBAAC,GAAD;EACE,IAAG;EACM;EACT,WAAW,EAAK,EAAO,oBAAoB;EACrC;EACN,eAAa,EAAQ;EACf;EACN,GAAI;EAEH;EACM,CAAA;;AAIb,SAAS,EAAoB,EAAC,aAAU,SAAM,aAAU,aAAa,UAAO,SAAS,GAAG,KAA6B;AACnH,QACE,kBAAC,GAAD;EACE,IAAG;EACM;EACT,WAAW,EAAK,EAAO,oBAAoB;EACrC;EACN,eAAa,EAAQ;EACf;EACN,GAAI;EAEH;EACM,CAAA;;AAQb,IAAa,IAAY,OAAO,OAAO,GAAe;CACpD,MAAM;CACN,QAAQ;CACR,iBAAiB;CACjB;CACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"AnchorNav.js","names":[],"sources":["../../src/AnchorNav/AnchorNav.tsx"],"sourcesContent":["import {clsx} from 'clsx'\nimport React, {useCallback, useEffect, useMemo, useRef, useState} from 'react'\nimport {ChevronDownIcon, ChevronUpIcon} from '@primer/octicons-react'\nimport {useId} from '../hooks/useId'\n\nimport {Button, ButtonBaseProps, Text} from '../'\nimport {useWindowSize} from '../hooks/useWindowSize'\nimport {useKeyboardEscape} from '../hooks/useKeyboardEscape'\nimport {useExpandedMenu} from './useExpandedMenu'\n\nimport type {BaseProps} from '../component-helpers'\n\n/**\n * Design tokens\n */\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/anchor-nav/colors-with-modes.css'\n\n/** * Main Stylesheet (as a CSS Module) */\nimport styles from './AnchorNav.module.css'\n\nconst testIds = {\n root: 'AnchorNav',\n get menuButton() {\n return `${this.root}-menu-button`\n },\n get menuLinks() {\n return `${this.root}-menu-links`\n },\n get action() {\n return `${this.root}-action`\n },\n get secondaryAction() {\n return `${this.root}-secondary-action`\n },\n get navSpacer() {\n return `${this.root}-nav-spacer`\n },\n}\n\nexport type AnchorNavProps = BaseProps<HTMLElement> & {\n /**\n * Accepts all of `AnchorNav.Item` and `AnchorNav.Action` child components.\n */\n children: React.ReactNode[]\n /**\n * Enable the idle state background color, which is transparent by default.\n */\n enableDefaultBgColor?: boolean\n /**\n * When true, the anchor nav will hide until it is sticky.\n */\n hideUntilSticky?: boolean\n} & React.ComponentPropsWithoutRef<'nav'>\n\nfunction AnchorNavBase({children, enableDefaultBgColor = false, hideUntilSticky = false, ...rest}: AnchorNavProps) {\n const [menuOpen, setMenuOpen] = useState(false)\n const [prefersReducedMotion, setPrefersReducedMotion] = useState(false)\n const [currentActiveNavItem, setCurrentActiveNavItem] = useState<string | null>()\n const [intersectionEntry, setIntersectionEntry] = useState<IntersectionObserverEntry>()\n const [initialYOffset, setInitialYOffset] = useState<undefined | number>()\n const [navShouldFix, setNavShouldFix] = useState<boolean>(false)\n const [navHeight, setNavHeight] = useState<number>(0)\n\n const wrapperRef = useRef<HTMLDivElement | null>(null)\n const rootRef = useRef<HTMLElement | null>(null)\n const linkContainerRef = useRef<HTMLDivElement | null>(null)\n const innerContainerRef = useRef<HTMLDivElement | null>(null)\n\n const {isLarge} = useWindowSize()\n const idForLinkContainer = useId()\n\n const closeMenuCallback = useCallback(() => setMenuOpen(false), [setMenuOpen])\n const toggleMenuCallback = useCallback(() => setMenuOpen(!menuOpen), [menuOpen])\n\n const ValidChildren = useMemo(\n () =>\n React.Children.toArray(children).filter(\n (child: React.ReactNode): boolean => React.isValidElement(child) && typeof child.type !== 'string',\n ),\n [children],\n )\n\n useEffect(() => {\n if (initialYOffset === undefined && intersectionEntry) {\n setInitialYOffset(intersectionEntry.boundingClientRect.y + window.scrollY)\n }\n }, [initialYOffset, intersectionEntry])\n\n const handleIntersectionUpdate = ([nextEntry]: IntersectionObserverEntry[]): void => {\n setIntersectionEntry(nextEntry)\n }\n\n useKeyboardEscape(closeMenuCallback)\n useExpandedMenu(menuOpen, linkContainerRef, innerContainerRef, !isLarge, closeMenuCallback)\n\n useEffect(() => {\n if (wrapperRef.current) {\n const height = wrapperRef.current.offsetHeight\n setNavHeight(height)\n }\n }, [isLarge])\n\n useEffect(() => {\n const queryResult = window.matchMedia('(prefers-reduced-motion: reduce)')\n\n setPrefersReducedMotion(queryResult.matches)\n }, [])\n\n useEffect(() => {\n const handler = () => {\n if (initialYOffset) {\n const isPastInitialYOffset = window.pageYOffset > initialYOffset\n setNavShouldFix(isPastInitialYOffset)\n }\n }\n // eslint-disable-next-line github/prefer-observers\n window.addEventListener('scroll', handler)\n return () => {\n window.removeEventListener('scroll', handler)\n }\n }, [initialYOffset])\n\n useEffect(() => {\n const node = hideUntilSticky ? wrapperRef.current : rootRef.current\n\n const supportsIntersectionObserver = !!window.IntersectionObserver\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!supportsIntersectionObserver || !node) return\n\n const topOfWindow = '0px 0px -100%'\n const observerParams = {threshold: 0, root: null, rootMargin: topOfWindow}\n const observer = new IntersectionObserver(handleIntersectionUpdate, observerParams)\n\n observer.observe(node)\n\n return () => observer.disconnect()\n }, [hideUntilSticky])\n\n const handleMenuToggle = useCallback(\n event => {\n event?.preventDefault()\n toggleMenuCallback()\n },\n [toggleMenuCallback],\n )\n\n const handleUpdateToCurrentActiveNavItem = useCallback(\n (id: string | null) => {\n setCurrentActiveNavItem(id)\n },\n [setCurrentActiveNavItem],\n )\n\n const numLinks = ValidChildren.filter(child => React.isValidElement(child) && child.type === NavLinkBase).length\n const Links = ValidChildren.map((child, index) => {\n if (React.isValidElement<AnchorNavLinkProps>(child) && child.type === NavLinkBase) {\n const defaultProps: AnchorNavLinkProps = {\n href: child.props.href,\n toggleMenuCallback,\n prefersReducedMotion,\n updateCurrentActiveNav: handleUpdateToCurrentActiveNavItem,\n alignment: numLinks < 4 ? 'start' : 'center',\n }\n return React.cloneElement(child, {\n isActive: index === 0,\n ...defaultProps,\n })\n }\n\n return null\n })\n .filter(Boolean)\n .slice(0, 5)\n\n const Action = ValidChildren.reduce<React.ReactElement<AnchorNavActionProps>[]>((acc, child) => {\n if (React.isValidElement<AnchorNavActionProps>(child) && child.type === ActionBase) {\n acc.push(React.cloneElement(child))\n }\n return acc\n }, [])\n\n const SecondaryAction = ValidChildren.reduce<React.ReactElement<AnchorNavActionProps>[]>((acc, child) => {\n if (React.isValidElement<AnchorNavActionProps>(child) && child.type === SecondaryActionBase) {\n acc.push(React.cloneElement(child))\n }\n return acc\n }, [])\n\n const hasLargerSizeActions =\n Action.some(action => action.props.size && action.props.size !== 'small') ||\n SecondaryAction.some(action => action.props.size && action.props.size !== 'small')\n\n /* On page load, the rootMargin positions and/or thresholds of the IntersectionObserver\n * may not be met depending on the position of the AnchorNav on the page.\n * The following useEffect ensures that the first link always marked as the active link, until\n * the observer kicks in. Without this, the active link is undefined.\n */\n useEffect(() => {\n if (!currentActiveNavItem && Links.length > 0) {\n setCurrentActiveNavItem(Links[0]?.props.children as string)\n }\n }, [currentActiveNavItem, Links])\n\n const hasTwoActions = Action.length > 0 && SecondaryAction.length > 0\n\n return (\n <div ref={wrapperRef}>\n <nav\n ref={rootRef}\n aria-label=\"Anchored navigation\"\n data-sticky={navShouldFix.toString()}\n className={clsx(\n styles.AnchorNav,\n hideUntilSticky && styles['AnchorNav--hide-until-sticky'],\n navShouldFix && styles['AnchorNav--stuck'],\n menuOpen && styles['AnchorNav--expanded'],\n enableDefaultBgColor && styles['AnchorNav--with-default-background-color'],\n )}\n {...rest}\n >\n <div\n ref={innerContainerRef}\n className={clsx(\n styles['AnchorNav-inner-container'],\n menuOpen && styles['AnchorNav-inner-container--expanded'],\n )}\n >\n <button\n onClick={handleMenuToggle}\n className={clsx(styles['AnchorNav-menu-button'])}\n aria-expanded={menuOpen}\n aria-controls={idForLinkContainer}\n data-testid={testIds.menuButton}\n >\n {menuOpen ? (\n <ChevronUpIcon size={16} className={styles['AnchorNav-menu-button-arrow']} fill=\"currentcolor\" />\n ) : (\n <ChevronDownIcon size={16} className={styles['AnchorNav-menu-button-arrow']} fill=\"currentcolor\" />\n )}\n <span className=\"visually-hidden\">Anchor navigation menu. Currently selected: </span>\n <Text as=\"span\" className={clsx(styles['AnchorNav-link-label'])}>\n {currentActiveNavItem}\n </Text>\n </button>\n {/**Replace with unique ids and test ids */}\n <div\n id={idForLinkContainer}\n data-testid={testIds.menuLinks}\n className={styles['AnchorNav-link-container']}\n ref={linkContainerRef}\n >\n {Links}\n </div>\n <span\n data-forward-focus=\"true\"\n className={clsx(\n styles['AnchorNav__actionsContainer'],\n hasLargerSizeActions && styles['AnchorNav__actionsContainer--no-offset'],\n hasTwoActions && styles['AnchorNav__actionsContainer--multiple'],\n )}\n >\n {Action.length && SecondaryAction.length && React.isValidElement<AnchorNavActionProps>(Action[0])\n ? React.cloneElement(Action[0], {\n variant: 'primary',\n })\n : Action}\n {SecondaryAction}\n </span>\n </div>\n <span\n className={clsx(menuOpen && styles['AnchorNav-overlay--expanded'])}\n onClick={closeMenuCallback}\n aria-hidden\n />\n </nav>\n {navShouldFix && <div style={{height: navHeight}} aria-hidden=\"true\" data-testid={testIds.navSpacer} />}\n </div>\n )\n}\n\ntype AnchorNavLinkIntersectionOptions = {\n /**\n * The area of the element that should trigger the next linked section to be highlighted.\n */\n rootMargin: 'start' | 'middle'\n}\n\ntype AnchorNavLinkProps = BaseProps<HTMLAnchorElement> & {\n /**\n * Optional text alignment for the link. Defaults to 'start' if there are less than 4 links, otherwise 'center'.\n */\n alignment?: 'start' | 'center'\n /**\n * Required path or location for the anchor to link to.\n */\n href: string\n /**\n * Optional boolean to indicate if the link is the current active link.\n * Typically doesn't need to be sset unless custom animation is being used.\n */\n isActive?: boolean // internal prop, not exposed in docs\n toggleMenuCallback?: () => void // internal prop, not exposed in docs\n intersectionOptions?: AnchorNavLinkIntersectionOptions // internal prop, not exposed in docs\n prefersReducedMotion?: boolean // internal prop, not exposed in docs\n updateCurrentActiveNav?: (id: string | null) => void // internal prop, not exposed in docs\n} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>\n\nfunction NavLinkBase({\n alignment = 'start',\n children,\n href,\n isActive,\n toggleMenuCallback,\n prefersReducedMotion,\n intersectionOptions = {rootMargin: 'middle'},\n updateCurrentActiveNav,\n ...rest\n}: AnchorNavLinkProps) {\n const {isLarge} = useWindowSize()\n const [intersectionEntry, setIntersectionEntry] = useState<IntersectionObserverEntry>()\n\n const isAnchor = /^#/.test(href)\n const anchoredContentIsVisible = !!intersectionEntry?.isIntersecting\n\n const handleIntersectionUpdate = ([nextEntry]: IntersectionObserverEntry[]): void => {\n setIntersectionEntry(nextEntry)\n }\n\n useEffect(() => {\n const node = document.querySelector(isAnchor ? href : `#${href}`)\n\n const supportsIntersectionObserver = !!window.IntersectionObserver\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!supportsIntersectionObserver || !node) return\n\n const rootMarginTop = '0px'\n const rootMarginCenter = '-50% 0% -50% 0%'\n\n const rootMargin = intersectionOptions.rootMargin === 'start' ? rootMarginTop : rootMarginCenter\n\n const observerParams = {threshold: intersectionOptions.rootMargin === 'start' ? 0.4 : 0, root: null, rootMargin}\n\n const observer = new IntersectionObserver(handleIntersectionUpdate, observerParams)\n\n observer.observe(node)\n\n return () => observer.disconnect()\n }, [href, intersectionOptions.rootMargin, isAnchor])\n\n // updates root AnchorNav to notify of active section\n useEffect(() => {\n if (anchoredContentIsVisible && updateCurrentActiveNav && typeof children === 'string') {\n updateCurrentActiveNav(children)\n }\n }, [anchoredContentIsVisible, children, updateCurrentActiveNav])\n\n const handleClick = useCallback(() => {\n if (toggleMenuCallback && !isLarge) {\n toggleMenuCallback()\n }\n }, [isLarge, toggleMenuCallback])\n\n return (\n <a\n className={clsx(\n styles['AnchorNav-link'],\n styles[`AnchorNav-link--${alignment}`],\n anchoredContentIsVisible && styles['AnchorNav-link--is-active'],\n )}\n href={isAnchor ? href : `#${href}`}\n aria-current={anchoredContentIsVisible && 'true'}\n data-first={isActive}\n data-active={anchoredContentIsVisible ? 'true' : 'false'}\n onClick={handleClick}\n {...rest}\n >\n <Text\n as=\"span\"\n className={clsx(\n styles['AnchorNav-link-label'],\n anchoredContentIsVisible && styles['AnchorNav-link-label--is-active'],\n )}\n >\n {children}\n </Text>\n </a>\n )\n}\n\ntype AnchorNavActionProps = {\n /**\n * Required path or location for the action button to link to.\n */\n href: string\n} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> &\n ButtonBaseProps\n\nfunction ActionBase({children, href, variant = 'secondary', size = 'small', ...rest}: AnchorNavActionProps) {\n return (\n <Button\n as=\"a\"\n variant={variant}\n className={clsx(styles['AnchorNav-action'])}\n href={href}\n data-testid={testIds.action}\n size={size}\n {...rest}\n >\n {children}\n </Button>\n )\n}\n\nfunction SecondaryActionBase({children, href, variant = 'secondary', size = 'small', ...rest}: AnchorNavActionProps) {\n return (\n <Button\n as=\"a\"\n variant={variant}\n className={clsx(styles['AnchorNav-action'])}\n href={href}\n data-testid={testIds.secondaryAction}\n size={size}\n {...rest}\n >\n {children}\n </Button>\n )\n}\n\n/**\n * AnchorNav allows users to navigate to different sections of a page.\n * @see https://primer.style/brand/components/AnchorNav\n */\nexport const AnchorNav = Object.assign(AnchorNavBase, {\n Link: NavLinkBase,\n Action: ActionBase,\n SecondaryAction: SecondaryActionBase,\n testIds,\n})\n"],"mappings":";;;;;;;;;;;;;;AAoBA,IAAM,IAAU;CACd,MAAM;CACN,IAAI,aAAa;EACf,OAAO,GAAG,KAAK,KAAK;CACtB;CACA,IAAI,YAAY;EACd,OAAO,GAAG,KAAK,KAAK;CACtB;CACA,IAAI,SAAS;EACX,OAAO,GAAG,KAAK,KAAK;CACtB;CACA,IAAI,kBAAkB;EACpB,OAAO,GAAG,KAAK,KAAK;CACtB;CACA,IAAI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AA0B,OAAO,KAAa,YAC5E,EAAuB,CAAQ;CAEnC,GAAG;EAAC;EAA0B;EAAU;CAAsB,CAAC;CAE/D,IAAM,IAAc,QAAkB;EACpC,AAAI,KAAsB,CAAC,KACzB,EAAmB;CAEvB,GAAG,CAAC,GAAS,CAAkB,CAAC;CAEhC,OACE,kBAAC,KAAD;EACE,WAAW,EACT,EAAO,mBACP,EAAO,mBAAmB,MAC1B,KAA4B,EAAO,4BACrC;EACA,MAAM,IAAW,IAAO,IAAI;EAC5B,gBAAc,KAA4B;EAC1C,cAAY;EACZ,eAAa,IAA2B,SAAS;EACjD,SAAS;EACT,GAAI;YAEJ,kBAAC,GAAD;GACE,IAAG;GACH,WAAW,EACT,EAAO,yBACP,KAA4B,EAAO,kCACrC;GAEC;EACG,CAAA;CACL,CAAA;AAEP;AAUA,SAAS,EAAW,EAAC,aAAU,SAAM,aAAU,aAAa,UAAO,SAAS,GAAG,KAA6B;CAC1G,OACE,kBAAC,GAAD;EACE,IAAG;EACM;EACT,WAAW,EAAK,EAAO,mBAAmB;EACpC;EACN,eAAa,EAAQ;EACf;EACN,GAAI;EAEH;CACK,CAAA;AAEZ;AAEA,SAAS,EAAoB,EAAC,aAAU,SAAM,aAAU,aAAa,UAAO,SAAS,GAAG,KAA6B;CACnH,OACE,kBAAC,GAAD;EACE,IAAG;EACM;EACT,WAAW,EAAK,EAAO,mBAAmB;EACpC;EACN,eAAa,EAAQ;EACf;EACN,GAAI;EAEH;CACK,CAAA;AAEZ;AAMA,IAAa,IAAY,OAAO,OAAO,GAAe;CACpD,MAAM;CACN,QAAQ;CACR,iBAAiB;CACjB;AACF,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import './AnchorNav.module-33_8-9r9.css'
|
|
2
|
-
|
|
1
|
+
import './AnchorNav.module-33_8-9r9.css';//#region src/AnchorNav/AnchorNav.module.css
|
|
2
|
+
var e = "Primer_Brand__AnchorNav-module__AnchorNav___fA9HX", t = "Primer_Brand__AnchorNav-module__AnchorNav__actionsContainer___GrYsv", n = {
|
|
3
|
+
AnchorNav: e,
|
|
3
4
|
"AnchorNav--no-bg-scroll": "Primer_Brand__AnchorNav-module__AnchorNav--no-bg-scroll___xg4JR",
|
|
4
5
|
"AnchorNav--hide-until-sticky": "Primer_Brand__AnchorNav-module__AnchorNav--hide-until-sticky___028xm",
|
|
5
6
|
"AnchorNav--stuck": "Primer_Brand__AnchorNav-module__AnchorNav--stuck___SgtFL",
|
|
@@ -8,7 +9,7 @@ import './AnchorNav.module-33_8-9r9.css';var e = {
|
|
|
8
9
|
"AnchorNav-link-container": "Primer_Brand__AnchorNav-module__AnchorNav-link-container___CDgv3",
|
|
9
10
|
"AnchorNav-inner-container": "Primer_Brand__AnchorNav-module__AnchorNav-inner-container___t_JyN",
|
|
10
11
|
"AnchorNav-inner-container--expanded": "Primer_Brand__AnchorNav-module__AnchorNav-inner-container--expanded___sba8G",
|
|
11
|
-
AnchorNav__actionsContainer:
|
|
12
|
+
AnchorNav__actionsContainer: t,
|
|
12
13
|
"AnchorNav__actionsContainer--no-offset": "Primer_Brand__AnchorNav-module__AnchorNav__actionsContainer--no-offset___gqZlb",
|
|
13
14
|
"AnchorNav-link": "Primer_Brand__AnchorNav-module__AnchorNav-link___0gyOX",
|
|
14
15
|
"fade-in": "Primer_Brand__AnchorNav-module__fade-in___cNMRW",
|
|
@@ -24,6 +25,6 @@ import './AnchorNav.module-33_8-9r9.css';var e = {
|
|
|
24
25
|
"AnchorNav__actionsContainer--multiple": "Primer_Brand__AnchorNav-module__AnchorNav__actionsContainer--multiple___pToLt"
|
|
25
26
|
};
|
|
26
27
|
//#endregion
|
|
27
|
-
export { e as default };
|
|
28
|
+
export { e as AnchorNav, t as AnchorNav__actionsContainer, n as default };
|
|
28
29
|
|
|
29
30
|
//# sourceMappingURL=AnchorNav.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useExpandedMenu.js","names":[],"sources":["../../src/AnchorNav/useExpandedMenu.ts"],"sourcesContent":["import React, {useEffect} from 'react'\nimport styles from './AnchorNav.module.css'\n\nexport const useExpandedMenu = (\n open: boolean,\n linkContainerRef: React.RefObject<HTMLElement | null>,\n innerContainerRef: React.RefObject<HTMLElement | null>,\n isNarrow: boolean,\n closeMenuCallback: () => void,\n) => {\n // Prevent background scroll when menu is open\n useEffect(() => {\n if (open && isNarrow) {\n document.body.classList.add(styles['AnchorNav--no-bg-scroll'])\n } else {\n document.body.classList.remove(styles['AnchorNav--no-bg-scroll'])\n }\n }, [open, isNarrow])\n\n // Move focus to the first menu item when the menu opens\n useEffect(() => {\n if (open && isNarrow) {\n const firstLink = linkContainerRef.current?.firstChild as HTMLElement | null\n firstLink?.focus()\n }\n }, [open, isNarrow, linkContainerRef])\n\n // Close the menu when focus moves outside the menu container\n useEffect(() => {\n const element = innerContainerRef.current\n if (element && open && isNarrow) {\n const handleFocusOut = (event: FocusEvent) => {\n if (!element.contains(event.relatedTarget as Node)) {\n closeMenuCallback()\n }\n }\n\n element.addEventListener('focusout', handleFocusOut)\n\n return () => {\n element.removeEventListener('focusout', handleFocusOut)\n }\n }\n }, [open, isNarrow, innerContainerRef, closeMenuCallback])\n}\n"],"mappings":";;;AAGA,IAAa,KACX,GACA,GACA,GACA,GACA,MACG;
|
|
1
|
+
{"version":3,"file":"useExpandedMenu.js","names":[],"sources":["../../src/AnchorNav/useExpandedMenu.ts"],"sourcesContent":["import React, {useEffect} from 'react'\nimport styles from './AnchorNav.module.css'\n\nexport const useExpandedMenu = (\n open: boolean,\n linkContainerRef: React.RefObject<HTMLElement | null>,\n innerContainerRef: React.RefObject<HTMLElement | null>,\n isNarrow: boolean,\n closeMenuCallback: () => void,\n) => {\n // Prevent background scroll when menu is open\n useEffect(() => {\n if (open && isNarrow) {\n document.body.classList.add(styles['AnchorNav--no-bg-scroll'])\n } else {\n document.body.classList.remove(styles['AnchorNav--no-bg-scroll'])\n }\n }, [open, isNarrow])\n\n // Move focus to the first menu item when the menu opens\n useEffect(() => {\n if (open && isNarrow) {\n const firstLink = linkContainerRef.current?.firstChild as HTMLElement | null\n firstLink?.focus()\n }\n }, [open, isNarrow, linkContainerRef])\n\n // Close the menu when focus moves outside the menu container\n useEffect(() => {\n const element = innerContainerRef.current\n if (element && open && isNarrow) {\n const handleFocusOut = (event: FocusEvent) => {\n if (!element.contains(event.relatedTarget as Node)) {\n closeMenuCallback()\n }\n }\n\n element.addEventListener('focusout', handleFocusOut)\n\n return () => {\n element.removeEventListener('focusout', handleFocusOut)\n }\n }\n }, [open, isNarrow, innerContainerRef, closeMenuCallback])\n}\n"],"mappings":";;;AAGA,IAAa,KACX,GACA,GACA,GACA,GACA,MACG;CAmBH,AAjBA,QAAgB;EACd,AAAI,KAAQ,IACV,SAAS,KAAK,UAAU,IAAI,EAAO,0BAA0B,IAE7D,SAAS,KAAK,UAAU,OAAO,EAAO,0BAA0B;CAEpE,GAAG,CAAC,GAAM,CAAQ,CAAC,GAGnB,QAAgB;EACd,AAAI,KAAQ,MACQ,EAAiB,SAAS,WAAA,EACjC,MAAM;CAErB,GAAG;EAAC;EAAM;EAAU;CAAgB,CAAC,GAGrC,QAAgB;EACd,IAAM,IAAU,EAAkB;EAClC,IAAI,KAAW,KAAQ,GAAU;GAC/B,IAAM,KAAkB,MAAsB;IAC5C,AAAK,EAAQ,SAAS,EAAM,aAAqB,KAC/C,EAAkB;GAEtB;GAIA,OAFA,EAAQ,iBAAiB,YAAY,CAAc,SAEtC;IACX,EAAQ,oBAAoB,YAAY,CAAc;GACxD;EACF;CACF,GAAG;EAAC;EAAM;EAAU;EAAmB;CAAiB,CAAC;AAC3D"}
|
package/esm/Avatar/Avatar.js
CHANGED
package/esm/Avatar/Avatar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.js","names":[],"sources":["../../src/Avatar/Avatar.tsx"],"sourcesContent":["import React, {forwardRef, useMemo} from 'react'\nimport {clsx} from 'clsx'\nimport styles from './Avatar.module.css'\n\nimport type {BaseProps} from '../component-helpers'\n\nexport const AvatarSizes = [32, 40, 48, 64, 80] as const\nexport const AvatarShapes = ['circle', 'square'] as const\n\ntype AvatarSizeVariants = (typeof AvatarSizes)[number]\n\ntype ResponsiveSizeMap = {\n narrow?: AvatarSizeVariants\n regular?: AvatarSizeVariants\n wide?: AvatarSizeVariants\n}\n\nexport type AvatarProps = BaseProps<HTMLImageElement> & {\n size?: (typeof AvatarSizes)[number] | ResponsiveSizeMap\n shape?: (typeof AvatarShapes)[number]\n src: string\n alt: string\n ['data-testid']?: string\n} & React.ImgHTMLAttributes<HTMLImageElement>\n\nconst testIds = {\n root: 'Avatar',\n get image() {\n return `${this.root}__image`\n },\n}\n\nconst _Avatar = forwardRef<HTMLImageElement, AvatarProps>(\n ({alt, className, size = AvatarSizes[1], shape = AvatarShapes[0], 'data-testid': testId, src, ...props}, ref) => {\n const sizeClass = useMemo(() => {\n return typeof size === 'number'\n ? styles[`Avatar--size-${size}`]\n : Object.keys(size)\n .map(viewport => {\n return styles[`Avatar-${viewport}--size-${size[viewport]}`]\n })\n .join(' ')\n }, [size])\n\n return (\n <span\n ref={ref}\n className={clsx(styles.Avatar, sizeClass, styles[`Avatar--shape-${shape}`], className)}\n data-testid={testId || testIds.root}\n >\n <img className={clsx(styles.Avatar__image)} src={src} alt={alt} data-testid={testIds.image} {...props} />\n </span>\n )\n },\n)\n\nexport const Avatar = Object.assign(_Avatar, {testIds})\n"],"mappings":";;;;;AAMA,IAAa,IAAc;CAAC;CAAI;CAAI;CAAI;CAAI;
|
|
1
|
+
{"version":3,"file":"Avatar.js","names":[],"sources":["../../src/Avatar/Avatar.tsx"],"sourcesContent":["import React, {forwardRef, useMemo} from 'react'\nimport {clsx} from 'clsx'\nimport styles from './Avatar.module.css'\n\nimport type {BaseProps} from '../component-helpers'\n\nexport const AvatarSizes = [32, 40, 48, 64, 80] as const\nexport const AvatarShapes = ['circle', 'square'] as const\n\ntype AvatarSizeVariants = (typeof AvatarSizes)[number]\n\ntype ResponsiveSizeMap = {\n narrow?: AvatarSizeVariants\n regular?: AvatarSizeVariants\n wide?: AvatarSizeVariants\n}\n\nexport type AvatarProps = BaseProps<HTMLImageElement> & {\n size?: (typeof AvatarSizes)[number] | ResponsiveSizeMap\n shape?: (typeof AvatarShapes)[number]\n src: string\n alt: string\n ['data-testid']?: string\n} & React.ImgHTMLAttributes<HTMLImageElement>\n\nconst testIds = {\n root: 'Avatar',\n get image() {\n return `${this.root}__image`\n },\n}\n\nconst _Avatar = forwardRef<HTMLImageElement, AvatarProps>(\n ({alt, className, size = AvatarSizes[1], shape = AvatarShapes[0], 'data-testid': testId, src, ...props}, ref) => {\n const sizeClass = useMemo(() => {\n return typeof size === 'number'\n ? styles[`Avatar--size-${size}`]\n : Object.keys(size)\n .map(viewport => {\n return styles[`Avatar-${viewport}--size-${size[viewport]}`]\n })\n .join(' ')\n }, [size])\n\n return (\n <span\n ref={ref}\n className={clsx(styles.Avatar, sizeClass, styles[`Avatar--shape-${shape}`], className)}\n data-testid={testId || testIds.root}\n >\n <img className={clsx(styles.Avatar__image)} src={src} alt={alt} data-testid={testIds.image} {...props} />\n </span>\n )\n },\n)\n\nexport const Avatar = Object.assign(_Avatar, {testIds})\n"],"mappings":";;;;;AAMA,IAAa,IAAc;CAAC;CAAI;CAAI;CAAI;CAAI;AAAE,GACjC,IAAe,CAAC,UAAU,QAAQ,GAkBzC,IAAU;CACd,MAAM;CACN,IAAI,QAAQ;EACV,OAAO,GAAG,KAAK,KAAK;CACtB;AACF,GAEM,IAAU,GACb,EAAC,QAAK,cAAW,UAAO,EAAY,IAAI,WAAQ,EAAa,IAAI,eAAe,GAAQ,QAAK,GAAG,KAAQ,MAAQ;CAC/G,IAAM,IAAY,QACT,OAAO,KAAS,WACnB,EAAO,gBAAgB,OACvB,OAAO,KAAK,CAAI,CAAC,CACd,KAAI,MACI,EAAO,UAAU,EAAS,SAAS,EAAK,KAChD,CAAC,CACD,KAAK,GAAG,GACd,CAAC,CAAI,CAAC;CAET,OACE,kBAAC,QAAD;EACO;EACL,WAAW,EAAK,EAAO,QAAQ,GAAW,EAAO,iBAAiB,MAAU,CAAS;EACrF,eAAa,KAAU,EAAQ;YAE/B,kBAAC,OAAD;GAAK,WAAW,EAAK,EAAO,aAAa;GAAQ;GAAU;GAAK,eAAa,EAAQ;GAAO,GAAI;EAAQ,CAAA;CACpG,CAAA;AAEV,CACF,GAEa,IAAS,OAAO,OAAO,GAAS,EAAC,WAAO,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import './Avatar.module-DUQdD7On.css'
|
|
2
|
-
|
|
1
|
+
import './Avatar.module-DUQdD7On.css';//#region src/Avatar/Avatar.module.css
|
|
2
|
+
var e = "Primer_Brand__Avatar-module__Avatar___VP3QQ", t = "Primer_Brand__Avatar-module__Avatar__image___ImYTc", n = {
|
|
3
|
+
Avatar: e,
|
|
3
4
|
"Avatar--shape-circle": "Primer_Brand__Avatar-module__Avatar--shape-circle___Yz6Zj",
|
|
4
5
|
"Avatar--shape-square": "Primer_Brand__Avatar-module__Avatar--shape-square___f2Rrz",
|
|
5
|
-
Avatar__image:
|
|
6
|
+
Avatar__image: t,
|
|
6
7
|
"Avatar--size-32": "Primer_Brand__Avatar-module__Avatar--size-32___P1cC2",
|
|
7
8
|
"Avatar--size-40": "Primer_Brand__Avatar-module__Avatar--size-40___fFZWc",
|
|
8
9
|
"Avatar--size-48": "Primer_Brand__Avatar-module__Avatar--size-48___ZrSSm",
|
|
@@ -23,6 +24,6 @@ import './Avatar.module-DUQdD7On.css';var e = {
|
|
|
23
24
|
"Avatar-wide--size-80": "Primer_Brand__Avatar-module__Avatar-wide--size-80___MptXL"
|
|
24
25
|
};
|
|
25
26
|
//#endregion
|
|
26
|
-
export { e as default };
|
|
27
|
+
export { e as Avatar, t as Avatar__image, n as default };
|
|
27
28
|
|
|
28
29
|
//# sourceMappingURL=Avatar.module.js.map
|
package/esm/Bento/Bento.d.ts
CHANGED
|
@@ -50,10 +50,10 @@ type BentoVisualProps = {
|
|
|
50
50
|
* @deprecated Bento is deprecated and will be removed in a future release. Use CTABanner or River instead.
|
|
51
51
|
* @see https://primer.style/brand/components/Bento
|
|
52
52
|
*/
|
|
53
|
-
export declare const Bento: (({ className, ...rest }: BentoProps) =>
|
|
54
|
-
Item: ({ className, columnStart, columnSpan, rowStart, rowSpan, flow, colorMode, visualAsBackground, order, bgColor, children, ...rest }: BentoItemProps) =>
|
|
55
|
-
Visual: ({ horizontalAlign, verticalAlign, fillMedia, overflow, position, padding, className, children, ...rest }: BentoVisualProps) =>
|
|
56
|
-
Content: ({ children, leadingVisual: LeadingVisual, padding, verticalAlign, horizontalAlign, className, ...rest }: BentoContentProps) =>
|
|
53
|
+
export declare const Bento: (({ className, ...rest }: BentoProps) => React.JSX.Element) & {
|
|
54
|
+
Item: ({ className, columnStart, columnSpan, rowStart, rowSpan, flow, colorMode, visualAsBackground, order, bgColor, children, ...rest }: BentoItemProps) => React.JSX.Element;
|
|
55
|
+
Visual: ({ horizontalAlign, verticalAlign, fillMedia, overflow, position, padding, className, children, ...rest }: BentoVisualProps) => React.JSX.Element;
|
|
56
|
+
Content: ({ children, leadingVisual: LeadingVisual, padding, verticalAlign, horizontalAlign, className, ...rest }: BentoContentProps) => React.JSX.Element;
|
|
57
57
|
Heading: React.ForwardRefExoticComponent<Omit<React.PropsWithChildren<BentoHeadingProps>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
58
58
|
};
|
|
59
59
|
export {};
|
package/esm/Bento/Bento.js
CHANGED
package/esm/Bento/Bento.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bento.js","names":[],"sources":["../../src/Bento/Bento.tsx"],"sourcesContent":["import React, {ReactElement, forwardRef, useCallback, useMemo, Ref, PropsWithChildren} from 'react'\nimport {clsx} from 'clsx'\nimport {useWindowSize, BreakpointSize} from '../hooks/useWindowSize'\nimport type {BaseProps} from '../component-helpers'\nimport findElementInChildren from '../findElementInChildren'\n\nimport {Heading, Text, Link, HeadingProps, TextProps, LinkProps, ColorMode as FullColorMode, Image} from '../'\nimport {Label, type LabelProps} from '../Label'\n\nimport type {IconProps} from '../Icon'\n\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/bento/base.css'\nimport styles from './Bento.module.css'\n\ntype ColorMode = Exclude<FullColorMode, 'auto'>\n\nexport type Size = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge'\nexport type ColumnIndex = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12\n\ntype ResponsiveColumnIndex = Partial<Record<Size, ColumnIndex>>\ntype ResponsiveRowIndex = Partial<Record<Size, number>>\n\ntype Flow = 'row' | 'column'\ntype ResponsiveFlow = Partial<Record<Size, Flow>>\n\ntype Align = 'start' | 'center' | 'end'\ntype ResponsiveAlign = Partial<Record<Size, Align>>\n\ntype Padding = 'condensed' | 'normal' | 'spacious'\ntype ResponsivePadding = Partial<Record<Size, Padding>>\n\ntype Order = 'default' | 'reversed'\ntype ResponsiveOrder = Partial<Record<Size, Order>>\n\ntype BentoProps = React.HTMLAttributes<HTMLDivElement> & BaseProps<HTMLDivElement>\n\nconst Root = ({className, ...rest}: BentoProps) => {\n return <section className={clsx(styles.Bento, className)} {...rest}></section>\n}\n\ntype ValidChildren = React.ReactElement<BentoVisualProps | BentoContentProps>\ntype ValidItemChildren = [ValidChildren?, ValidChildren?]\n\ntype BentoItemProps = {\n columnStart?: ColumnIndex | ResponsiveColumnIndex\n columnSpan?: ColumnIndex | ResponsiveColumnIndex\n rowStart?: number | ResponsiveRowIndex\n rowSpan?: number | ResponsiveRowIndex\n flow?: Flow | ResponsiveFlow\n colorMode?: ColorMode\n visualAsBackground?: boolean\n order?: Order | ResponsiveOrder\n bgColor?: 'default' | 'subtle'\n} & React.HTMLAttributes<HTMLDivElement> &\n BaseProps<HTMLDivElement>\n\nconst returnClassBasedOnResponsiveMap = (\n classIdentifier: string,\n propName: string,\n prop?:\n | ResponsiveColumnIndex\n | ColumnIndex\n | ResponsiveRowIndex\n | number\n | ResponsiveFlow\n | Flow\n | ResponsiveAlign\n | Align\n | ResponsivePadding\n | Padding,\n) => {\n const classesToMerge: string[] = []\n if (typeof prop === 'number' || typeof prop === 'string') {\n classesToMerge.push(styles[`${classIdentifier}--${propName}-${prop}`])\n } else if (typeof prop === 'object') {\n for (const [key, value] of Object.entries(prop)) {\n classesToMerge.push(styles[`${classIdentifier}--${key}-${propName}-${value}`])\n }\n }\n return classesToMerge\n}\n\ntype ReturnOrderedChildrenProps = {\n order: Order | ResponsiveOrder\n children: React.ReactNode\n currentBreakpointSize?: BreakpointSize\n}\n\nconst returnOrderedChildren = ({order, children, currentBreakpointSize}: ReturnOrderedChildrenProps) => {\n if (typeof order === 'string') {\n return order === 'default' ? children : React.Children.toArray(children).reverse()\n } else if (typeof order === 'object' && currentBreakpointSize) {\n // This handles setting the order based on breakpoints as you might expect via CSS\n const filledStyleOrder: ResponsiveOrder = {}\n let previousSize: Order = 'default'\n for (const size of Object.keys(BreakpointSize)) {\n const lowerCaseSize = size.toLocaleLowerCase()\n if (order[lowerCaseSize]) previousSize = order[lowerCaseSize]\n filledStyleOrder[lowerCaseSize] = order[lowerCaseSize] || previousSize\n }\n return filledStyleOrder[currentBreakpointSize] === 'default' ? children : React.Children.toArray(children).reverse()\n } else {\n return children\n }\n}\n\nconst Item = ({\n className,\n columnStart,\n columnSpan = 12,\n rowStart,\n rowSpan = 2,\n flow = 'row',\n colorMode,\n visualAsBackground = false,\n order = 'default',\n bgColor = 'subtle',\n children,\n ...rest\n}: BentoItemProps) => {\n const {currentBreakpointSize} = useWindowSize()\n\n const validChildren = React.Children.toArray(children).reduce<ValidItemChildren>((acc, child) => {\n if (React.isValidElement<BentoVisualProps>(child) && child.type === Visual) {\n acc.push(child)\n }\n if (React.isValidElement<BentoContentProps>(child) && child.type === Content) {\n acc.push(child)\n }\n return acc\n }, [])\n\n const contentChildPadding =\n validChildren.find(\n (child): child is React.ReactElement<BentoContentProps> =>\n React.isValidElement<BentoContentProps>(child) && child.type === Content,\n )?.props.padding || 'spacious'\n\n const bentoItemClassArray = [styles.Bento__Item, styles[`Bento__Item--bgColor-${bgColor}`]]\n\n bentoItemClassArray.push(\n ...returnClassBasedOnResponsiveMap('Bento__Item', 'column-span', columnSpan),\n ...returnClassBasedOnResponsiveMap('Bento__Item', 'row-span', rowSpan),\n ...returnClassBasedOnResponsiveMap('Bento__Item', 'column-start', columnStart),\n ...returnClassBasedOnResponsiveMap('Bento__Item', 'row-start', rowStart),\n ...returnClassBasedOnResponsiveMap('Bento__Item', 'flow', flow),\n ...returnClassBasedOnResponsiveMap('Bento__Item', 'gap', contentChildPadding),\n )\n\n if (!visualAsBackground && React.Children.toArray(children).length >= 1) {\n if (flow === 'column') {\n bentoItemClassArray.push(styles['Bento-column-padding-override'])\n }\n if (flow === 'row') {\n bentoItemClassArray.push(styles['Bento-row-padding-override'])\n }\n }\n\n const colorModeProp = colorMode ? {'data-color-mode': colorMode} : {}\n\n const orderedChildren = returnOrderedChildren({order, children: validChildren, currentBreakpointSize})\n\n return (\n <div\n {...colorModeProp}\n className={clsx(\n ...bentoItemClassArray,\n (visualAsBackground || React.Children.toArray(children).length === 1) &&\n styles[`Bento__Item--visual-as-background`],\n className,\n )}\n {...rest}\n >\n {orderedChildren}\n </div>\n )\n}\n\ntype BentoContentProps = {\n leadingVisual?: ReactElement<IconProps>\n padding?: Padding | ResponsivePadding\n verticalAlign?: Align | ResponsiveAlign\n horizontalAlign?: Exclude<Align, 'end'> | Partial<Record<Size, Exclude<Align, 'end'>>>\n} & React.HTMLAttributes<HTMLDivElement> &\n BaseProps<HTMLDivElement>\n\nconst Content = ({\n children,\n leadingVisual: LeadingVisual,\n padding = 'spacious',\n verticalAlign,\n horizontalAlign = 'start',\n className,\n ...rest\n}: BentoContentProps) => {\n const bentoContentClassArray = [styles.Bento__Content]\n bentoContentClassArray.push(\n ...returnClassBasedOnResponsiveMap('Bento__Item', 'verticalAlign', verticalAlign),\n ...returnClassBasedOnResponsiveMap('Bento__Item', 'horizontalAlign', horizontalAlign),\n ...returnClassBasedOnResponsiveMap('Bento', 'padding', padding),\n )\n\n const memoizedChildren = useMemo(() => React.Children.toArray(children), [children])\n\n const HeadingChildren = memoizedChildren.filter(\n (child): child is React.ReactElement<BentoHeadingProps> =>\n React.isValidElement<BentoHeadingProps>(child) && child.type === _Heading,\n )\n\n const LabelChild = memoizedChildren.find(\n (child): child is React.ReactElement<LabelProps> => React.isValidElement<LabelProps>(child) && child.type === Label,\n )\n const TextChild = memoizedChildren.find(\n (child): child is React.ReactElement<TextProps> => React.isValidElement<TextProps>(child) && child.type === Text,\n )\n const LinkChild = memoizedChildren.find(\n (child): child is React.ReactElement<LinkProps> => React.isValidElement<LinkProps>(child) && child.type === Link,\n )\n\n const usesDeprecatedLabel = React.isValidElement<LabelProps>(LabelChild)\n\n if (usesDeprecatedLabel && (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test')) {\n // eslint-disable-next-line no-console\n console.warn('Bento.Content: standalone `Label` children are deprecated. Remove it or migrate from Bento.')\n }\n\n return (\n <div className={clsx(styles[`Bento-padding--${padding}`], ...bentoContentClassArray, className)} {...rest}>\n {React.isValidElement<IconProps>(LeadingVisual) &&\n React.cloneElement(LeadingVisual, {\n className: styles['Bento__Content-icon'],\n size: LeadingVisual.props.size || 44,\n })}\n\n {usesDeprecatedLabel &&\n React.cloneElement(LabelChild as React.ReactElement<LabelProps>, {\n className: clsx(styles['Bento__Content-label'], LabelChild.props.className),\n })}\n\n {HeadingChildren.map(HeadingChild =>\n React.cloneElement(HeadingChild, {\n className: clsx(\n !React.isValidElement(TextChild) && styles['Bento__heading--no-text'],\n horizontalAlign === 'center' && styles['Bento__heading--with-max-width'],\n HeadingChild.props.className,\n ),\n }),\n )}\n\n {React.isValidElement<TextProps>(TextChild) &&\n React.cloneElement(TextChild, {\n variant: TextChild.props.variant || 'muted',\n as: TextChild.props.as || 'p',\n size: TextChild.props.size || '300',\n className: clsx(styles['Bento__Content-text'], TextChild.props.className),\n })}\n\n {React.isValidElement<LinkProps>(LinkChild) &&\n React.cloneElement(LinkChild, {\n variant: LinkChild.props.variant || 'accent',\n className: clsx(styles['Bento__call-to-action'], LinkChild.props.className),\n })}\n </div>\n )\n}\n\ntype BentoHeadingProps = {\n variant?: 'default' | 'muted'\n} & BaseProps<HTMLHeadingElement> &\n HeadingProps\n\nconst _Heading = forwardRef(\n (\n {\n as = 'h3',\n size = '5',\n weight = 'medium',\n variant = 'default',\n className,\n children,\n ...props\n }: PropsWithChildren<BentoHeadingProps>,\n ref: Ref<HTMLHeadingElement>,\n ) => {\n const childrenArray = useMemo(() => React.Children.toArray(children), [children])\n\n const getConditionalVariant = useCallback(() => {\n if (findElementInChildren(children, 'b') || findElementInChildren(children, 'em')) {\n return 'muted'\n }\n return 'default'\n }, [children])\n\n const defaultColor = childrenArray.length === 1 ? 'default' : getConditionalVariant()\n\n return (\n <Heading\n ref={ref}\n className={clsx(\n defaultColor === 'muted' && styles[`Bento__heading--muted`],\n variant === 'muted' && styles[`Bento__heading--muted`],\n className,\n )}\n size={size}\n as={as}\n weight={weight}\n {...props}\n >\n {children}\n </Heading>\n )\n },\n)\n\ntype BentoVisualProps = {\n horizontalAlign?: Align\n verticalAlign?: Align\n fillMedia?: boolean\n overflow?: 'hidden' | 'initial'\n position?: string\n padding?: Padding | ResponsivePadding\n} & React.HTMLAttributes<HTMLDivElement> &\n BaseProps<HTMLDivElement>\n\nconst Visual = ({\n horizontalAlign,\n verticalAlign,\n fillMedia = true,\n overflow = 'hidden',\n position = '50% 50%',\n padding,\n className,\n children,\n ...rest\n}: BentoVisualProps) => {\n const bentoVisualClassArray = [\n styles.Bento__Visual,\n horizontalAlign && styles[`Bento__Visual--horizontalAlign-${horizontalAlign}`],\n verticalAlign && styles[`Bento__Visual--verticalAlign-${verticalAlign}`],\n styles[`Bento__Visual--overflow-${overflow}`],\n ]\n bentoVisualClassArray.push(...returnClassBasedOnResponsiveMap('Bento', 'padding', padding))\n const childrenToRender = React.Children.map(children, child => {\n if (React.isValidElement(child)) {\n if (React.isValidElement<React.ImgHTMLAttributes<HTMLImageElement>>(child) && child.type === 'img') {\n return React.cloneElement(child, {\n style: {...child.props.style, objectPosition: position},\n })\n }\n if (React.isValidElement<React.ComponentProps<typeof Image>>(child) && child.type === Image) {\n return React.cloneElement(child, {\n style: {...child.props.style, objectPosition: position},\n })\n }\n return child\n }\n return null\n })\n return (\n <div\n className={clsx(\n ...bentoVisualClassArray,\n fillMedia && styles['Bento__Visual--fill'],\n !fillMedia && styles['Bento__Visual--no-fill'],\n className,\n )}\n {...rest}\n >\n {childrenToRender}\n </div>\n )\n}\n\n/**\n * Use Bento to present content in a responsive grid layout.\n * @deprecated Bento is deprecated and will be removed in a future release. Use CTABanner or River instead.\n * @see https://primer.style/brand/components/Bento\n */\nexport const Bento = Object.assign(Root, {Item, Visual, Content, Heading: _Heading})\n"],"mappings":";;;;;;;;;;;;;AAoCA,IAAM,KAAQ,EAAC,cAAW,GAAG,QACpB,kBAAC,WAAD;CAAS,WAAW,EAAK,EAAO,OAAO,EAAU;CAAE,GAAI;CAAgB,CAAA,EAmB1E,KACJ,GACA,GACA,MAWG;CACH,IAAM,IAA2B,EAAE;AACnC,KAAI,OAAO,KAAS,YAAY,OAAO,KAAS,SAC9C,GAAe,KAAK,EAAO,GAAG,EAAgB,IAAI,EAAS,GAAG,KAAQ;UAC7D,OAAO,KAAS,SACzB,MAAK,IAAM,CAAC,GAAK,MAAU,OAAO,QAAQ,EAAK,CAC7C,GAAe,KAAK,EAAO,GAAG,EAAgB,IAAI,EAAI,GAAG,EAAS,GAAG,KAAS;AAGlF,QAAO;GASH,KAAyB,EAAC,UAAO,aAAU,+BAAuD;AACtG,KAAI,OAAO,KAAU,SACnB,QAAO,MAAU,YAAY,IAAW,EAAM,SAAS,QAAQ,EAAS,CAAC,SAAS;KACzE,OAAO,KAA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AAiB,EAAO,gCAAgC;EACxD,EAAO,2BAA2B;EACnC;AACD,GAAsB,KAAK,GAAG,EAAgC,SAAS,WAAW,EAAQ,CAAC;CAC3F,IAAM,IAAmB,EAAM,SAAS,IAAI,IAAU,MAChD,EAAM,eAAe,EAAM,GACzB,EAAM,eAA0D,EAAM,IAAI,EAAM,SAAS,SAKzF,EAAM,eAAmD,EAAM,IAAI,EAAM,SAAS,IAC7E,EAAM,aAAa,GAAO,EAC/B,OAAO;EAAC,GAAG,EAAM,MAAM;EAAO,gBAAgB;EAAS,EACxD,CAAC,GAEG,IAEF,KACP;AACF,QACE,kBAAC,OAAD;EACE,WAAW,EACT,GAAG,GACH,KAAa,EAAO,wBACpB,CAAC,KAAa,EAAO,2BACrB,EACD;EACD,GAAI;YAEH;EACG,CAAA;GASG,IAAQ,OAAO,OAAO,GAAM;CAAC;CAAM;CAAQ;CAAS,SAAS;CAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"Bento.js","names":[],"sources":["../../src/Bento/Bento.tsx"],"sourcesContent":["import React, {ReactElement, forwardRef, useCallback, useMemo, Ref, PropsWithChildren} from 'react'\nimport {clsx} from 'clsx'\nimport {useWindowSize, BreakpointSize} from '../hooks/useWindowSize'\nimport type {BaseProps} from '../component-helpers'\nimport findElementInChildren from '../findElementInChildren'\n\nimport {Heading, Text, Link, HeadingProps, TextProps, LinkProps, ColorMode as FullColorMode, Image} from '../'\nimport {Label, type LabelProps} from '../Label'\n\nimport type {IconProps} from '../Icon'\n\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/bento/base.css'\nimport styles from './Bento.module.css'\n\ntype ColorMode = Exclude<FullColorMode, 'auto'>\n\nexport type Size = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge'\nexport type ColumnIndex = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12\n\ntype ResponsiveColumnIndex = Partial<Record<Size, ColumnIndex>>\ntype ResponsiveRowIndex = Partial<Record<Size, number>>\n\ntype Flow = 'row' | 'column'\ntype ResponsiveFlow = Partial<Record<Size, Flow>>\n\ntype Align = 'start' | 'center' | 'end'\ntype ResponsiveAlign = Partial<Record<Size, Align>>\n\ntype Padding = 'condensed' | 'normal' | 'spacious'\ntype ResponsivePadding = Partial<Record<Size, Padding>>\n\ntype Order = 'default' | 'reversed'\ntype ResponsiveOrder = Partial<Record<Size, Order>>\n\ntype BentoProps = React.HTMLAttributes<HTMLDivElement> & BaseProps<HTMLDivElement>\n\nconst Root = ({className, ...rest}: BentoProps) => {\n return <section className={clsx(styles.Bento, className)} {...rest}></section>\n}\n\ntype ValidChildren = React.ReactElement<BentoVisualProps | BentoContentProps>\ntype ValidItemChildren = [ValidChildren?, ValidChildren?]\n\ntype BentoItemProps = {\n columnStart?: ColumnIndex | ResponsiveColumnIndex\n columnSpan?: ColumnIndex | ResponsiveColumnIndex\n rowStart?: number | ResponsiveRowIndex\n rowSpan?: number | ResponsiveRowIndex\n flow?: Flow | ResponsiveFlow\n colorMode?: ColorMode\n visualAsBackground?: boolean\n order?: Order | ResponsiveOrder\n bgColor?: 'default' | 'subtle'\n} & React.HTMLAttributes<HTMLDivElement> &\n BaseProps<HTMLDivElement>\n\nconst returnClassBasedOnResponsiveMap = (\n classIdentifier: string,\n propName: string,\n prop?:\n | ResponsiveColumnIndex\n | ColumnIndex\n | ResponsiveRowIndex\n | number\n | ResponsiveFlow\n | Flow\n | ResponsiveAlign\n | Align\n | ResponsivePadding\n | Padding,\n) => {\n const classesToMerge: string[] = []\n if (typeof prop === 'number' || typeof prop === 'string') {\n classesToMerge.push(styles[`${classIdentifier}--${propName}-${prop}`])\n } else if (typeof prop === 'object') {\n for (const [key, value] of Object.entries(prop)) {\n classesToMerge.push(styles[`${classIdentifier}--${key}-${propName}-${value}`])\n }\n }\n return classesToMerge\n}\n\ntype ReturnOrderedChildrenProps = {\n order: Order | ResponsiveOrder\n children: React.ReactNode\n currentBreakpointSize?: BreakpointSize\n}\n\nconst returnOrderedChildren = ({order, children, currentBreakpointSize}: ReturnOrderedChildrenProps) => {\n if (typeof order === 'string') {\n return order === 'default' ? children : React.Children.toArray(children).reverse()\n } else if (typeof order === 'object' && currentBreakpointSize) {\n // This handles setting the order based on breakpoints as you might expect via CSS\n const filledStyleOrder: ResponsiveOrder = {}\n let previousSize: Order = 'default'\n for (const size of Object.keys(BreakpointSize)) {\n const lowerCaseSize = size.toLocaleLowerCase()\n if (order[lowerCaseSize]) previousSize = order[lowerCaseSize]\n filledStyleOrder[lowerCaseSize] = order[lowerCaseSize] || previousSize\n }\n return filledStyleOrder[currentBreakpointSize] === 'default' ? children : React.Children.toArray(children).reverse()\n } else {\n return children\n }\n}\n\nconst Item = ({\n className,\n columnStart,\n columnSpan = 12,\n rowStart,\n rowSpan = 2,\n flow = 'row',\n colorMode,\n visualAsBackground = false,\n order = 'default',\n bgColor = 'subtle',\n children,\n ...rest\n}: BentoItemProps) => {\n const {currentBreakpointSize} = useWindowSize()\n\n const validChildren = React.Children.toArray(children).reduce<ValidItemChildren>((acc, child) => {\n if (React.isValidElement<BentoVisualProps>(child) && child.type === Visual) {\n acc.push(child)\n }\n if (React.isValidElement<BentoContentProps>(child) && child.type === Content) {\n acc.push(child)\n }\n return acc\n }, [])\n\n const contentChildPadding =\n validChildren.find(\n (child): child is React.ReactElement<BentoContentProps> =>\n React.isValidElement<BentoContentProps>(child) && child.type === Content,\n )?.props.padding || 'spacious'\n\n const bentoItemClassArray = [styles.Bento__Item, styles[`Bento__Item--bgColor-${bgColor}`]]\n\n bentoItemClassArray.push(\n ...returnClassBasedOnResponsiveMap('Bento__Item', 'column-span', columnSpan),\n ...returnClassBasedOnResponsiveMap('Bento__Item', 'row-span', rowSpan),\n ...returnClassBasedOnResponsiveMap('Bento__Item', 'column-start', columnStart),\n ...returnClassBasedOnResponsiveMap('Bento__Item', 'row-start', rowStart),\n ...returnClassBasedOnResponsiveMap('Bento__Item', 'flow', flow),\n ...returnClassBasedOnResponsiveMap('Bento__Item', 'gap', contentChildPadding),\n )\n\n if (!visualAsBackground && React.Children.toArray(children).length >= 1) {\n if (flow === 'column') {\n bentoItemClassArray.push(styles['Bento-column-padding-override'])\n }\n if (flow === 'row') {\n bentoItemClassArray.push(styles['Bento-row-padding-override'])\n }\n }\n\n const colorModeProp = colorMode ? {'data-color-mode': colorMode} : {}\n\n const orderedChildren = returnOrderedChildren({order, children: validChildren, currentBreakpointSize})\n\n return (\n <div\n {...colorModeProp}\n className={clsx(\n ...bentoItemClassArray,\n (visualAsBackground || React.Children.toArray(children).length === 1) &&\n styles[`Bento__Item--visual-as-background`],\n className,\n )}\n {...rest}\n >\n {orderedChildren}\n </div>\n )\n}\n\ntype BentoContentProps = {\n leadingVisual?: ReactElement<IconProps>\n padding?: Padding | ResponsivePadding\n verticalAlign?: Align | ResponsiveAlign\n horizontalAlign?: Exclude<Align, 'end'> | Partial<Record<Size, Exclude<Align, 'end'>>>\n} & React.HTMLAttributes<HTMLDivElement> &\n BaseProps<HTMLDivElement>\n\nconst Content = ({\n children,\n leadingVisual: LeadingVisual,\n padding = 'spacious',\n verticalAlign,\n horizontalAlign = 'start',\n className,\n ...rest\n}: BentoContentProps) => {\n const bentoContentClassArray = [styles.Bento__Content]\n bentoContentClassArray.push(\n ...returnClassBasedOnResponsiveMap('Bento__Item', 'verticalAlign', verticalAlign),\n ...returnClassBasedOnResponsiveMap('Bento__Item', 'horizontalAlign', horizontalAlign),\n ...returnClassBasedOnResponsiveMap('Bento', 'padding', padding),\n )\n\n const memoizedChildren = useMemo(() => React.Children.toArray(children), [children])\n\n const HeadingChildren = memoizedChildren.filter(\n (child): child is React.ReactElement<BentoHeadingProps> =>\n React.isValidElement<BentoHeadingProps>(child) && child.type === _Heading,\n )\n\n const LabelChild = memoizedChildren.find(\n (child): child is React.ReactElement<LabelProps> => React.isValidElement<LabelProps>(child) && child.type === Label,\n )\n const TextChild = memoizedChildren.find(\n (child): child is React.ReactElement<TextProps> => React.isValidElement<TextProps>(child) && child.type === Text,\n )\n const LinkChild = memoizedChildren.find(\n (child): child is React.ReactElement<LinkProps> => React.isValidElement<LinkProps>(child) && child.type === Link,\n )\n\n const usesDeprecatedLabel = React.isValidElement<LabelProps>(LabelChild)\n\n if (usesDeprecatedLabel && (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test')) {\n // eslint-disable-next-line no-console\n console.warn('Bento.Content: standalone `Label` children are deprecated. Remove it or migrate from Bento.')\n }\n\n return (\n <div className={clsx(styles[`Bento-padding--${padding}`], ...bentoContentClassArray, className)} {...rest}>\n {React.isValidElement<IconProps>(LeadingVisual) &&\n React.cloneElement(LeadingVisual, {\n className: styles['Bento__Content-icon'],\n size: LeadingVisual.props.size || 44,\n })}\n\n {usesDeprecatedLabel &&\n React.cloneElement(LabelChild as React.ReactElement<LabelProps>, {\n className: clsx(styles['Bento__Content-label'], LabelChild.props.className),\n })}\n\n {HeadingChildren.map(HeadingChild =>\n React.cloneElement(HeadingChild, {\n className: clsx(\n !React.isValidElement(TextChild) && styles['Bento__heading--no-text'],\n horizontalAlign === 'center' && styles['Bento__heading--with-max-width'],\n HeadingChild.props.className,\n ),\n }),\n )}\n\n {React.isValidElement<TextProps>(TextChild) &&\n React.cloneElement(TextChild, {\n variant: TextChild.props.variant || 'muted',\n as: TextChild.props.as || 'p',\n size: TextChild.props.size || '300',\n className: clsx(styles['Bento__Content-text'], TextChild.props.className),\n })}\n\n {React.isValidElement<LinkProps>(LinkChild) &&\n React.cloneElement(LinkChild, {\n variant: LinkChild.props.variant || 'accent',\n className: clsx(styles['Bento__call-to-action'], LinkChild.props.className),\n })}\n </div>\n )\n}\n\ntype BentoHeadingProps = {\n variant?: 'default' | 'muted'\n} & BaseProps<HTMLHeadingElement> &\n HeadingProps\n\nconst _Heading = forwardRef(\n (\n {\n as = 'h3',\n size = '5',\n weight = 'medium',\n variant = 'default',\n className,\n children,\n ...props\n }: PropsWithChildren<BentoHeadingProps>,\n ref: Ref<HTMLHeadingElement>,\n ) => {\n const childrenArray = useMemo(() => React.Children.toArray(children), [children])\n\n const getConditionalVariant = useCallback(() => {\n if (findElementInChildren(children, 'b') || findElementInChildren(children, 'em')) {\n return 'muted'\n }\n return 'default'\n }, [children])\n\n const defaultColor = childrenArray.length === 1 ? 'default' : getConditionalVariant()\n\n return (\n <Heading\n ref={ref}\n className={clsx(\n defaultColor === 'muted' && styles[`Bento__heading--muted`],\n variant === 'muted' && styles[`Bento__heading--muted`],\n className,\n )}\n size={size}\n as={as}\n weight={weight}\n {...props}\n >\n {children}\n </Heading>\n )\n },\n)\n\ntype BentoVisualProps = {\n horizontalAlign?: Align\n verticalAlign?: Align\n fillMedia?: boolean\n overflow?: 'hidden' | 'initial'\n position?: string\n padding?: Padding | ResponsivePadding\n} & React.HTMLAttributes<HTMLDivElement> &\n BaseProps<HTMLDivElement>\n\nconst Visual = ({\n horizontalAlign,\n verticalAlign,\n fillMedia = true,\n overflow = 'hidden',\n position = '50% 50%',\n padding,\n className,\n children,\n ...rest\n}: BentoVisualProps) => {\n const bentoVisualClassArray = [\n styles.Bento__Visual,\n horizontalAlign && styles[`Bento__Visual--horizontalAlign-${horizontalAlign}`],\n verticalAlign && styles[`Bento__Visual--verticalAlign-${verticalAlign}`],\n styles[`Bento__Visual--overflow-${overflow}`],\n ]\n bentoVisualClassArray.push(...returnClassBasedOnResponsiveMap('Bento', 'padding', padding))\n const childrenToRender = React.Children.map(children, child => {\n if (React.isValidElement(child)) {\n if (React.isValidElement<React.ImgHTMLAttributes<HTMLImageElement>>(child) && child.type === 'img') {\n return React.cloneElement(child, {\n style: {...child.props.style, objectPosition: position},\n })\n }\n if (React.isValidElement<React.ComponentProps<typeof Image>>(child) && child.type === Image) {\n return React.cloneElement(child, {\n style: {...child.props.style, objectPosition: position},\n })\n }\n return child\n }\n return null\n })\n return (\n <div\n className={clsx(\n ...bentoVisualClassArray,\n fillMedia && styles['Bento__Visual--fill'],\n !fillMedia && styles['Bento__Visual--no-fill'],\n className,\n )}\n {...rest}\n >\n {childrenToRender}\n </div>\n )\n}\n\n/**\n * Use Bento to present content in a responsive grid layout.\n * @deprecated Bento is deprecated and will be removed in a future release. Use CTABanner or River instead.\n * @see https://primer.style/brand/components/Bento\n */\nexport const Bento = Object.assign(Root, {Item, Visual, Content, Heading: _Heading})\n"],"mappings":";;;;;;;;;;;;;AAoCA,IAAM,KAAQ,EAAC,cAAW,GAAG,QACpB,kBAAC,WAAD;CAAS,WAAW,EAAK,EAAO,OAAO,CAAS;CAAG,GAAI;AAAe,CAAA,GAmBzE,KACJ,GACA,GACA,MAWG;CACH,IAAM,IAA2B,CAAC;CAClC,IAAI,OAAO,KAAS,YAAY,OAAO,KAAS,UAC9C,EAAe,KAAK,EAAO,GAAG,EAAgB,IAAI,EAAS,GAAG,IAAO;MAChE,IAAI,OAAO,KAAS,UACzB,KAAK,IAAM,CAAC,GAAK,MAAU,OAAO,QAAQ,CAAI,GAC5C,EAAe,KAAK,EAAO,GAAG,EAAgB,IAAI,EAAI,GAAG,EAAS,GAAG,IAAQ;CAGjF,OAAO;AACT,GAQM,KAAyB,EAAC,UAAO,aAAU,+BAAuD;CACtG,IAAI,OAAO,KAAU,UACnB,OAAO,MAAU,YAAY,IAAW,EAAM,SAAS,QAAQ,CAAQ,CAAC,CAAC,QAAQ;CAC5E,IAAI,OAAO,KAAU,YAAY,GAAuB;EAE7D,IAAM,IAAoC,CAAC,GACvC,IAAsB;EAC1B,KAAK,IAAM,KAAQ,OAAO,KAAK,CAAc,GAAG;GAC9C,IAAM,IAAgB,EAAK,kBAAkB;GAE7C,AADI,EAAM,OAAgB,IAAe,EAAM,KAC/C,EAAiB,KAAiB,EAAM,MAAkB;EAC5D;EACA,OAAO,EAAiB,OAA2B,YAAY,IAAW,EAAM,SAAS,QAAQ,CAAQ,CAAC,CAAC,QAAQ;CACrH,OACE,OAAO;AAEX,GAEM,KAAQ,EACZ,cACA,gBACA,gBAAa,IACb,aACA,aAAU,GACV,UAAO,OACP,cACA,wBAAqB,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EACxD,CAAC,IAEI,IAEF,IACR;CACD,OACE,kBAAC,OAAD;EACE,WAAW,EACT,GAAG,GACH,KAAa,EAAO,wBACpB,CAAC,KAAa,EAAO,2BACrB,CACF;EACA,GAAI;YAEH;CACE,CAAA;AAET,GAOa,IAAQ,OAAO,OAAO,GAAM;CAAC;CAAM;CAAQ;CAAS,SAAS;AAAQ,CAAC"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import './Bento.module-4fhgWKyL.css'
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import './Bento.module-4fhgWKyL.css';//#region src/Bento/Bento.module.css
|
|
2
|
+
var e = "Primer_Brand__Bento-module__Bento____h548", t = "Primer_Brand__Bento-module__Bento__Item___SEy6_", n = "Primer_Brand__Bento-module__Bento__Content___MlfVL", r = "Primer_Brand__Bento-module__Bento__Visual___fl3ZX", i = {
|
|
3
|
+
Bento: e,
|
|
4
|
+
Bento__Item: t,
|
|
4
5
|
"Bento__Item--bgColor-default": "Primer_Brand__Bento-module__Bento__Item--bgColor-default___Cdofb",
|
|
5
6
|
"Bento__Item--bgColor-subtle": "Primer_Brand__Bento-module__Bento__Item--bgColor-subtle___nh7EW",
|
|
6
7
|
"Bento__Item--visual-as-background": "Primer_Brand__Bento-module__Bento__Item--visual-as-background___p6wEV",
|
|
7
|
-
Bento__Content:
|
|
8
|
+
Bento__Content: n,
|
|
8
9
|
"Bento__Content-icon": "Primer_Brand__Bento-module__Bento__Content-icon___QiNqz",
|
|
9
10
|
"Bento__heading--no-text": "Primer_Brand__Bento-module__Bento__heading--no-text___KZzv4",
|
|
10
11
|
"Bento__heading--muted": "Primer_Brand__Bento-module__Bento__heading--muted___fwZBT",
|
|
11
12
|
"Bento__heading--with-max-width": "Primer_Brand__Bento-module__Bento__heading--with-max-width___RbXVR",
|
|
12
|
-
Bento__Visual:
|
|
13
|
+
Bento__Visual: r,
|
|
13
14
|
"Bento__Visual--overflow-hidden": "Primer_Brand__Bento-module__Bento__Visual--overflow-hidden___Atzfs",
|
|
14
15
|
"Bento__Visual--overflow-initial": "Primer_Brand__Bento-module__Bento__Visual--overflow-initial___bC1dM",
|
|
15
16
|
"Bento__Visual--horizontalAlign-center": "Primer_Brand__Bento-module__Bento__Visual--horizontalAlign-center___WM3rk",
|
|
@@ -451,6 +452,6 @@ import './Bento.module-4fhgWKyL.css';var e = {
|
|
|
451
452
|
"Bento-row-padding-override": "Primer_Brand__Bento-module__Bento-row-padding-override___DXC_D"
|
|
452
453
|
};
|
|
453
454
|
//#endregion
|
|
454
|
-
export { e as default };
|
|
455
|
+
export { e as Bento, n as Bento__Content, t as Bento__Item, r as Bento__Visual, i as default };
|
|
455
456
|
|
|
456
457
|
//# sourceMappingURL=Bento.module.js.map
|