@primer/react-brand 0.80.0-rc.4bfa3a79 → 0.80.0-rc.b232dc70
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/CarouselPagination/index.md +96 -0
- package/docs/components/IconButton/react.md +33 -15
- package/docs/components/Testimonial/react.md +28 -22
- package/docs/components/TestimonialGroup/index.md +152 -0
- package/docs/components/index.md +3 -1
- package/docs/index.md +5 -3
- package/esm/CarouselPagination/CarouselPagination.d.ts +42 -0
- package/esm/CarouselPagination/CarouselPagination.d.ts.map +1 -0
- package/esm/CarouselPagination/CarouselPagination.js +97 -0
- package/esm/CarouselPagination/CarouselPagination.js.map +1 -0
- package/esm/CarouselPagination/CarouselPagination.module-F-qylhO7.css +1 -0
- package/esm/CarouselPagination/CarouselPagination.module.js +14 -0
- package/esm/CarouselPagination/CarouselPagination.module.js.map +1 -0
- package/esm/CarouselPagination/index.d.ts +2 -0
- package/esm/CarouselPagination/index.d.ts.map +1 -0
- package/esm/Hero/Hero.d.ts.map +1 -1
- package/esm/Hero/Hero.js +5 -3
- package/esm/Hero/Hero.js.map +1 -1
- package/esm/IconButton/IconButton.d.ts +1 -1
- package/esm/IconButton/IconButton.d.ts.map +1 -1
- package/esm/IconButton/IconButton.js +1 -1
- package/esm/IconButton/IconButton.js.map +1 -1
- package/esm/IconButton/{IconButton.module-D2UJBm7x.css → IconButton.module-DDLfSj96.css} +1 -1
- package/esm/IconButton/IconButton.module.js +1 -1
- package/esm/IconButton/IconButton.module.js.map +1 -1
- package/esm/Tabs/Tabs.d.ts +12 -0
- package/esm/Tabs/Tabs.d.ts.map +1 -1
- package/esm/Tabs/Tabs.js +84 -120
- package/esm/Tabs/Tabs.js.map +1 -1
- package/esm/Tabs/{Tabs.module-CK_p1qwC.css → Tabs.module-B-E_MTke.css} +1 -1
- package/esm/Tabs/Tabs.module.js +4 -8
- package/esm/Tabs/Tabs.module.js.map +1 -1
- package/esm/Testimonial/Testimonial.d.ts +7 -3
- package/esm/Testimonial/Testimonial.d.ts.map +1 -1
- package/esm/Testimonial/Testimonial.js +77 -77
- package/esm/Testimonial/Testimonial.js.map +1 -1
- package/esm/Testimonial/Testimonial.module-BqMYuLeo.css +1 -0
- package/esm/Testimonial/Testimonial.module.js +9 -14
- package/esm/Testimonial/Testimonial.module.js.map +1 -1
- package/esm/TestimonialGroup/TestimonialGroup.d.ts +35 -0
- package/esm/TestimonialGroup/TestimonialGroup.d.ts.map +1 -0
- package/esm/TestimonialGroup/TestimonialGroup.js +190 -0
- package/esm/TestimonialGroup/TestimonialGroup.js.map +1 -0
- package/esm/TestimonialGroup/TestimonialGroup.module-kFxPa1k1.css +1 -0
- package/esm/TestimonialGroup/TestimonialGroup.module.js +22 -0
- package/esm/TestimonialGroup/TestimonialGroup.module.js.map +1 -0
- package/esm/TestimonialGroup/index.d.ts +2 -0
- package/esm/TestimonialGroup/index.d.ts.map +1 -0
- package/esm/index.d.ts +2 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/index.esm.js +35 -33
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/carousel-pagination/colors-with-modes-IFYKunDL.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/testimonial/{base-CAG7koNB.css → base-h_olG8bi.css} +1 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/testimonial/colors-with-modes-BEiXR7-X.css +1 -0
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/testimonial-group/base-Cq-doRpg.css +1 -0
- package/lib/CarouselPagination/CarouselPagination.d.ts +41 -0
- package/lib/CarouselPagination/index.d.ts +1 -0
- package/lib/IconButton/IconButton.d.ts +1 -1
- package/lib/Tabs/Tabs.d.ts +12 -0
- package/lib/Testimonial/Testimonial.d.ts +7 -3
- package/lib/TestimonialGroup/TestimonialGroup.d.ts +34 -0
- package/lib/TestimonialGroup/index.d.ts +1 -0
- package/lib/css/main.css +477 -245
- 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/base.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/carousel-pagination/colors-with-modes.css +35 -0
- package/lib/design-tokens/css/tokens/functional/components/carousel-pagination/colors.css +13 -0
- 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/feature-comparison-table/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/feature-comparison-table/colors-with-modes.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/icon-button/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/icon-button/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/icon-button/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/spinner/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/spinner/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/spinner/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/statistic/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/sub-nav/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/sub-nav/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/subdomain-nav-bar/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tabs/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tabs/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tabs/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/testimonial/base.css +3 -1
- package/lib/design-tokens/css/tokens/functional/components/testimonial/colors-with-modes.css +1 -46
- package/lib/design-tokens/css/tokens/functional/components/testimonial/colors.css +1 -16
- package/lib/design-tokens/css/tokens/functional/components/testimonial-group/base.css +9 -0
- 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/base.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/toggle-switch/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/toggle-switch/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/toggle-switch/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/button/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/carousel-pagination/colors.js +43 -0
- 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/feature-comparison-table/base.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/icon-button/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/icon-button/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/spinner/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/spinner/colors.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 +9 -1
- package/lib/design-tokens/js/module/tokens/functional/components/testimonial/colors.js +1 -71
- package/lib/design-tokens/js/module/tokens/functional/components/testimonial-group/base.js +13 -0
- 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/tiles/base.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/toggle-switch/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/toggle-switch/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/button/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/carousel-pagination/colors.js +11 -0
- 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/feature-comparison-table/base.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/icon-button/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/icon-button/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/spinner/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/spinner/colors.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 +3 -1
- package/lib/design-tokens/js/tokens/functional/components/testimonial/colors.js +1 -16
- package/lib/design-tokens/js/tokens/functional/components/testimonial-group/base.js +7 -0
- 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/tiles/base.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/toggle-switch/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/toggle-switch/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 +6 -15
- 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/button/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/carousel-pagination/colors.scss +10 -0
- 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/feature-comparison-table/base.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/icon-button/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/icon-button/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/spinner/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/spinner/colors.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 +3 -1
- package/lib/design-tokens/scss/tokens/functional/components/testimonial/colors.scss +1 -16
- package/lib/design-tokens/scss/tokens/functional/components/testimonial-group/base.scss +6 -0
- 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/tiles/base.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/toggle-switch/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/toggle-switch/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/button/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/button/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/carousel-pagination/colors.d.ts +28 -0
- package/lib/design-tokens/ts/tokens/functional/components/carousel-pagination/colors.js +25 -0
- 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/feature-comparison-table/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/feature-comparison-table/base.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/icon-button/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/icon-button/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/icon-button/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/icon-button/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/spinner/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/spinner/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/spinner/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/spinner/colors.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 +9 -1
- package/lib/design-tokens/ts/tokens/functional/components/testimonial/base.js +9 -1
- package/lib/design-tokens/ts/tokens/functional/components/testimonial/colors.d.ts +2 -27
- package/lib/design-tokens/ts/tokens/functional/components/testimonial/colors.js +1 -26
- package/lib/design-tokens/ts/tokens/functional/components/testimonial-group/base.d.ts +16 -0
- package/lib/design-tokens/ts/tokens/functional/components/testimonial-group/base.js +13 -0
- 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/tiles/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tiles/base.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/toggle-switch/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/toggle-switch/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/toggle-switch/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/toggle-switch/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/token/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/token/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tooltip/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tooltip/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/video-player/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/video-player/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/border.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/border.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/breakpoints.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/breakpoints.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size-coarse.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size-coarse.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size-fine.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size-fine.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/viewport.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/viewport.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/typography/typography-responsive.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/typography/typography-responsive.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/typography/typography.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/typography/typography.js +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +1 -1
- package/llms.txt +5 -3
- package/package.json +1 -1
- package/esm/Testimonial/Testimonial.module-_jTJvM-4.css +0 -1
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/testimonial/colors-with-modes-isyQx5qj.css +0 -1
package/esm/Tabs/Tabs.js
CHANGED
|
@@ -2,18 +2,15 @@ import { clsx as e } from "../node_modules/clsx/dist/clsx.js";
|
|
|
2
2
|
import { AnimationProvider as t } from "../animation/AnimationProvider/AnimationProvider.js";
|
|
3
3
|
import { Animate as n } from "../animation/Animate/Animate.js";
|
|
4
4
|
import { useProvidedRefOrCreate as r } from "../hooks/useRef.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { ChevronLeftIcon as o } from "../node_modules/@primer/octicons-react/dist/icons/ChevronLeftIcon.js";
|
|
8
|
-
import { ChevronRightIcon as s } from "../node_modules/@primer/octicons-react/dist/icons/ChevronRightIcon.js";
|
|
9
|
-
import { useTabs as c } from "../hooks/useTabs.js";
|
|
5
|
+
import { useTabs as i } from "../hooks/useTabs.js";
|
|
6
|
+
import { CarouselPagination as a } from "../CarouselPagination/CarouselPagination.js";
|
|
10
7
|
import '../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/tabs/colors-with-modes-D9l5QVGg.css';import '../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/tabs/base-T7ABwZVf.css';/* empty css */
|
|
11
8
|
/* empty css */
|
|
12
|
-
import
|
|
13
|
-
import { Children as
|
|
14
|
-
import { jsx as
|
|
9
|
+
import o from "./Tabs.module.js";
|
|
10
|
+
import { Children as s, cloneElement as c, forwardRef as l, isValidElement as u, memo as d, useEffect as f, useRef as p } from "react";
|
|
11
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
15
12
|
//#region src/Tabs/Tabs.tsx
|
|
16
|
-
var
|
|
13
|
+
var g = {
|
|
17
14
|
root: "Tabs",
|
|
18
15
|
get tab() {
|
|
19
16
|
return `${this.root}-tab`;
|
|
@@ -24,39 +21,41 @@ var b = {
|
|
|
24
21
|
get indicators() {
|
|
25
22
|
return `${this.root}-indicators`;
|
|
26
23
|
}
|
|
27
|
-
},
|
|
24
|
+
}, _ = {
|
|
28
25
|
controlsNext: "Next tab",
|
|
29
|
-
controlsPrev: "Previous tab"
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
controlsPrev: "Previous tab",
|
|
27
|
+
controlsIndicator: "Go to tab {current}",
|
|
28
|
+
controlsNavigation: "Tab navigation"
|
|
29
|
+
}, v = l(({ align: t = "center", children: n, defaultActiveTab: r, onChange: l, variant: d = "default", className: v, "aria-label": x, "aria-labelledby": S, internalAccessibleLabels: C = _, ...w }, T) => {
|
|
30
|
+
let { activeTab: E, activateTab: D, getTabListProps: O, getTabProps: k, getTabPanelProps: A } = i({
|
|
32
31
|
defaultTab: r,
|
|
33
|
-
onTabActivate:
|
|
34
|
-
}),
|
|
35
|
-
let n = String(t), r = e.ref, i =
|
|
36
|
-
return
|
|
32
|
+
onTabActivate: l
|
|
33
|
+
}), j = p(null), M = p(null), N = p(null), P = s.toArray(n), F = P.filter((e) => u(e) && e.type === y).map((e, t) => {
|
|
34
|
+
let n = String(t), r = e.ref, i = k(n, r);
|
|
35
|
+
return c(e, {
|
|
37
36
|
...i,
|
|
38
37
|
id: e.props.id ?? i.id,
|
|
39
38
|
"aria-controls": e.props["aria-controls"] ?? i["aria-controls"],
|
|
40
39
|
value: n,
|
|
41
40
|
key: i.id,
|
|
42
|
-
isActive:
|
|
43
|
-
variant:
|
|
41
|
+
isActive: E === n,
|
|
42
|
+
variant: d
|
|
44
43
|
});
|
|
45
|
-
}),
|
|
46
|
-
let n =
|
|
47
|
-
return
|
|
44
|
+
}), I = P.filter((e) => u(e) && e.type === b).map((e, t) => {
|
|
45
|
+
let n = A(String(t));
|
|
46
|
+
return c(e, {
|
|
48
47
|
...n,
|
|
49
48
|
id: e.props.id ?? n.id,
|
|
50
49
|
key: String(t)
|
|
51
50
|
});
|
|
52
51
|
});
|
|
53
|
-
|
|
52
|
+
f(() => {
|
|
54
53
|
/* istanbul ignore next */
|
|
55
|
-
if (!
|
|
56
|
-
let e =
|
|
57
|
-
if (!
|
|
54
|
+
if (!j.current || !N.current) return;
|
|
55
|
+
let e = j.current.querySelector("[aria-selected=\"true\"]");
|
|
56
|
+
if (!E) return;
|
|
58
57
|
let t = () => {
|
|
59
|
-
let t =
|
|
58
|
+
let t = N.current, n = j.current;
|
|
60
59
|
/* istanbul ignore next */
|
|
61
60
|
if (!t || !n) return;
|
|
62
61
|
let r = window.getComputedStyle(n).getPropertyValue("--brand-Tabs-container-padding"), i = parseFloat(r) * 16, a = e.offsetLeft - i, o = e.offsetWidth;
|
|
@@ -64,16 +63,16 @@ var b = {
|
|
|
64
63
|
};
|
|
65
64
|
t();
|
|
66
65
|
let n = new ResizeObserver(t);
|
|
67
|
-
n.observe(
|
|
68
|
-
let r =
|
|
66
|
+
n.observe(j.current);
|
|
67
|
+
let r = j.current, i = r.clientWidth, a = window.getComputedStyle(r).getPropertyValue("--brand-Tabs-container-padding"), o = parseFloat(a) * 16, s = e.offsetLeft - o + e.offsetWidth / 2 - i / 2, c = r.scrollWidth - i, l = Math.max(0, Math.min(s, c));
|
|
69
68
|
return r.scrollTo({
|
|
70
69
|
left: l,
|
|
71
70
|
behavior: "smooth"
|
|
72
71
|
}), () => {
|
|
73
72
|
n.disconnect();
|
|
74
73
|
};
|
|
75
|
-
}, [
|
|
76
|
-
let e =
|
|
74
|
+
}, [E]), f(() => {
|
|
75
|
+
let e = j.current, t = M.current;
|
|
77
76
|
/* istanbul ignore next */
|
|
78
77
|
if (!e || !t) return;
|
|
79
78
|
/* istanbul ignore next */
|
|
@@ -86,112 +85,77 @@ var b = {
|
|
|
86
85
|
return r.observe(e), e.addEventListener("scroll", n), () => {
|
|
87
86
|
e.removeEventListener("scroll", n), r.disconnect();
|
|
88
87
|
};
|
|
89
|
-
}, [
|
|
90
|
-
let
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
]), U = h(() => {
|
|
97
|
-
A && A !== "0" && j(String(Number(A) - 1));
|
|
98
|
-
}, [A, j]), W = z.length >= 3, G = String(z.length - 1) === A;
|
|
99
|
-
return /* @__PURE__ */ y("div", {
|
|
100
|
-
className: e(l["Tabs-container"], l[`Tabs-container--align-${t}`], G && l["Tabs-container--lastTabIsActive"], S),
|
|
101
|
-
ref: k,
|
|
102
|
-
"data-testid": b.root,
|
|
103
|
-
...O,
|
|
88
|
+
}, [F]);
|
|
89
|
+
let L = O(typeof x == "string" ? { label: x } : { labelledBy: S }), R = F.length >= 3, z = String(F.length - 1) === E;
|
|
90
|
+
return /* @__PURE__ */ h("div", {
|
|
91
|
+
className: e(o["Tabs-container"], o[`Tabs-container--align-${t}`], z && o["Tabs-container--lastTabIsActive"], v),
|
|
92
|
+
ref: T,
|
|
93
|
+
"data-testid": g.root,
|
|
94
|
+
...w,
|
|
104
95
|
children: [
|
|
105
|
-
|
|
106
|
-
className:
|
|
107
|
-
"data-testid":
|
|
108
|
-
children: /* @__PURE__ */
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
children: /* @__PURE__ */ v(o, {
|
|
120
|
-
size: 16,
|
|
121
|
-
className: l["Tabs__control-icon"]
|
|
122
|
-
})
|
|
123
|
-
})
|
|
124
|
-
}),
|
|
125
|
-
/* @__PURE__ */ v(i, {
|
|
126
|
-
direction: "horizontal",
|
|
127
|
-
gap: 4,
|
|
128
|
-
padding: "none",
|
|
129
|
-
justifyContent: "space-between",
|
|
130
|
-
alignItems: "center",
|
|
131
|
-
children: z.map((t, n) => /* @__PURE__ */ v("div", { className: e(l.Tabs__indicator, A && Number(A) === n && l["Tabs__indicator--active"]) }, n))
|
|
132
|
-
}),
|
|
133
|
-
/* @__PURE__ */ v("button", {
|
|
134
|
-
onClick: H,
|
|
135
|
-
className: l.Tabs__control,
|
|
136
|
-
"aria-label": D.controlsNext,
|
|
137
|
-
children: /* @__PURE__ */ v(a, {
|
|
138
|
-
size: "100",
|
|
139
|
-
children: /* @__PURE__ */ v(s, {
|
|
140
|
-
size: 16,
|
|
141
|
-
className: l["Tabs__control-icon"]
|
|
142
|
-
})
|
|
143
|
-
})
|
|
144
|
-
})
|
|
145
|
-
]
|
|
96
|
+
F.length >= 3 && /* @__PURE__ */ m("div", {
|
|
97
|
+
className: o.Tabs__controls,
|
|
98
|
+
"data-testid": g.indicators,
|
|
99
|
+
children: /* @__PURE__ */ m(a, {
|
|
100
|
+
itemCount: F.length,
|
|
101
|
+
activeIndex: Number(E ?? 0),
|
|
102
|
+
"aria-label": C.controlsNavigation ?? _.controlsNavigation,
|
|
103
|
+
labels: {
|
|
104
|
+
previous: C.controlsPrev,
|
|
105
|
+
next: C.controlsNext,
|
|
106
|
+
item: C.controlsIndicator ?? _.controlsIndicator
|
|
107
|
+
},
|
|
108
|
+
itemAttributesBuilder: (e) => ({ "aria-controls": F[e].props["aria-controls"] }),
|
|
109
|
+
onChange: (e) => D(String(e))
|
|
146
110
|
})
|
|
147
111
|
}),
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
ref:
|
|
150
|
-
className: e(
|
|
151
|
-
children: /* @__PURE__ */
|
|
152
|
-
ref:
|
|
153
|
-
...
|
|
154
|
-
className: e(
|
|
155
|
-
children: [/* @__PURE__ */
|
|
156
|
-
ref:
|
|
157
|
-
className:
|
|
112
|
+
/* @__PURE__ */ m("div", {
|
|
113
|
+
ref: M,
|
|
114
|
+
className: e(o.Tablist__wrapper, o[`Tablist__wrapper--${d}`], z && o["Tablist__wrapper--lastTabIsActive"]),
|
|
115
|
+
children: /* @__PURE__ */ h("div", {
|
|
116
|
+
ref: j,
|
|
117
|
+
...L,
|
|
118
|
+
className: e(o.Tabs, o[`Tabs--${d}`], R && o["Tabs--hasMoreThanTwoTabs"]),
|
|
119
|
+
children: [/* @__PURE__ */ m("div", {
|
|
120
|
+
ref: N,
|
|
121
|
+
className: o.Tabs__slider,
|
|
158
122
|
"aria-hidden": !0
|
|
159
|
-
}),
|
|
123
|
+
}), F]
|
|
160
124
|
})
|
|
161
125
|
}),
|
|
162
|
-
|
|
163
|
-
className:
|
|
164
|
-
children:
|
|
126
|
+
I.length > 0 && /* @__PURE__ */ m("div", {
|
|
127
|
+
className: o.Tabs__panelContainer,
|
|
128
|
+
children: I
|
|
165
129
|
})
|
|
166
130
|
]
|
|
167
131
|
});
|
|
168
|
-
}),
|
|
169
|
-
ref: r(
|
|
170
|
-
className: e(
|
|
171
|
-
"data-testid":
|
|
172
|
-
...
|
|
132
|
+
}), y = l(({ children: t, className: n, isActive: i, variant: a, ...s }, c) => /* @__PURE__ */ m("button", {
|
|
133
|
+
ref: r(c),
|
|
134
|
+
className: e(o.Tabs__item, i && o["Tabs__item--active"], a && o[`Tabs__item--${a}`], n),
|
|
135
|
+
"data-testid": g.tab,
|
|
136
|
+
...s,
|
|
173
137
|
children: t
|
|
174
|
-
})),
|
|
175
|
-
let
|
|
138
|
+
})), b = d(function({ children: r, animation: i = !1, className: a, hidden: s, ...c }) {
|
|
139
|
+
let l = i ? /* @__PURE__ */ m(t, {
|
|
176
140
|
autoStaggerChildren: !1,
|
|
177
|
-
children: /* @__PURE__ */
|
|
141
|
+
children: /* @__PURE__ */ m(n, {
|
|
178
142
|
animate: i,
|
|
179
143
|
children: r
|
|
180
144
|
})
|
|
181
145
|
}) : r;
|
|
182
|
-
return /* @__PURE__ */
|
|
183
|
-
className: e(
|
|
184
|
-
"data-testid":
|
|
185
|
-
hidden:
|
|
186
|
-
...
|
|
187
|
-
children:
|
|
146
|
+
return /* @__PURE__ */ m("div", {
|
|
147
|
+
className: e(o.Tabs__panel, a),
|
|
148
|
+
"data-testid": g.panel,
|
|
149
|
+
hidden: s,
|
|
150
|
+
...c,
|
|
151
|
+
children: l
|
|
188
152
|
});
|
|
189
|
-
}),
|
|
190
|
-
Item:
|
|
191
|
-
Panel:
|
|
192
|
-
testIds:
|
|
153
|
+
}), x = Object.assign(v, {
|
|
154
|
+
Item: y,
|
|
155
|
+
Panel: b,
|
|
156
|
+
testIds: g
|
|
193
157
|
});
|
|
194
158
|
//#endregion
|
|
195
|
-
export {
|
|
159
|
+
export { x as Tabs };
|
|
196
160
|
|
|
197
161
|
//# sourceMappingURL=Tabs.js.map
|
package/esm/Tabs/Tabs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","names":[],"sources":["../../src/Tabs/Tabs.tsx"],"sourcesContent":["import React, {\n memo,\n ReactNode,\n forwardRef,\n Children,\n isValidElement,\n cloneElement,\n useRef,\n useEffect,\n HTMLAttributes,\n useCallback,\n} from 'react'\nimport {clsx} from 'clsx'\nimport {ChevronLeftIcon, ChevronRightIcon} from '@primer/octicons-react'\nimport {useTabs} from '../hooks/useTabs'\nimport {useProvidedRefOrCreate} from '../hooks/useRef'\nimport {BaseProps} from '../component-helpers'\nimport {Animate, AnimationProvider, AnimationVariants} from '../animation'\nimport {Text} from '../Text'\nimport {Stack} from '../Stack'\n\n/**\n * Design tokens\n */\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/tabs/base.css'\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/tabs/colors-with-modes.css'\n\n/** * Main Stylesheet (as a CSS Module) */\nimport styles from './Tabs.module.css'\n\nconst testIds = {\n root: 'Tabs',\n get tab() {\n return `${this.root}-tab`\n },\n get panel() {\n return `${this.root}-panel`\n },\n get indicators() {\n return `${this.root}-indicators`\n },\n}\n\n/**\n * Accessible label for the entire tabs component, used by screen readers to describe the tab group.\n * Note: Only use one of `aria-label` or `aria-labelled` by. Not both or neither.\n */\ntype LabelOrLabelledBy =\n | {'aria-label': string; 'aria-labelledby'?: never}\n | {'aria-labelledby': string; 'aria-label'?: never}\n\nexport type TabsProps = {\n /**\n * Visual style variant of the tabs. Affects the appearance and styling theme.\n */\n variant?: 'default' | 'accent' | 'underline'\n /**\n * Horizontal alignment of the tab navigation. Defaults to 'start'.\n */\n align?: 'start' | 'center'\n /**\n * Named children to be rendered as tab items and panels.\n */\n children: ReactNode\n /**\n * Sets the default active tab. \"0\" (first tab) by default.\n */\n defaultActiveTab?: string\n /**\n * Callback function triggered when the active tab changes. Receives the new active tab identifier.\n */\n onChange?: (activeTab: string) => void\n\n /**\n * Additional CSS class names to apply to the tabs container for custom styling.\n */\n className?: string\n /**\n * @param internalAccessibleLabels - Customizable labels for screen readers to improve accessibility. These are applied internally using the aria-label attribute.\n * @param internalAccessibleLabels.controlsNext - Label for the \"next tab\" control button, used by screen readers. Default is \"Next tab\".\n * @param internalAccessibleLabels.controlsPrev - Label for the \"previous tab\" control button, used by screen readers. Default is \"Previous tab\".\n */\n internalAccessibleLabels?: {\n controlsNext: string\n controlsPrev: string\n }\n} & LabelOrLabelledBy &\n BaseProps<HTMLDivElement> &\n Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'aria-label' | 'aria-labelledby'>\n\nconst defaultInternalAccessibleLabels = {\n controlsNext: 'Next tab',\n controlsPrev: 'Previous tab',\n}\n\nconst _TabsRoot = forwardRef<HTMLDivElement, TabsProps>(\n (\n {\n align = 'center',\n children,\n defaultActiveTab,\n onChange,\n variant = 'default',\n className,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n internalAccessibleLabels = defaultInternalAccessibleLabels,\n ...props\n },\n ref,\n ) => {\n const {activeTab, activateTab, getTabListProps, getTabProps, getTabPanelProps} = useTabs({\n defaultTab: defaultActiveTab,\n onTabActivate: onChange,\n })\n const tabsContainerRef = useRef<HTMLDivElement>(null)\n const tabsWrapperRef = useRef<HTMLDivElement>(null)\n const sliderRef = useRef<HTMLDivElement>(null)\n\n const childrenArray = Children.toArray(children)\n\n type TabsItemElement = React.ReactElement<TabsItemProps> & {ref?: React.Ref<HTMLButtonElement>}\n\n const tabs = childrenArray\n .filter((child): child is TabsItemElement => isValidElement<TabsItemProps>(child) && child.type === TabsItem)\n .map((tab, index) => {\n const tabId = String(index)\n const originalRef = tab.ref\n const tabProps = getTabProps<HTMLButtonElement>(tabId, originalRef)\n\n return cloneElement(tab, {\n ...tabProps,\n id: tab.props.id ?? tabProps.id,\n 'aria-controls': tab.props['aria-controls'] ?? tabProps['aria-controls'],\n value: tabId,\n key: tabProps.id,\n isActive: activeTab === tabId,\n variant,\n })\n })\n\n const panels = childrenArray\n .filter(\n (child): child is React.ReactElement<TabsPanelProps> =>\n isValidElement<TabsPanelProps>(child) && child.type === TabsPanel,\n )\n .map((child, index) => {\n const panelId = String(index)\n const tabPanelProps = getTabPanelProps(panelId)\n\n return cloneElement(child, {\n ...tabPanelProps,\n id: child.props.id ?? tabPanelProps.id,\n key: String(index),\n })\n })\n\n useEffect(() => {\n /* istanbul ignore next */\n if (!tabsContainerRef.current || !sliderRef.current) return\n\n const activeTabButton = tabsContainerRef.current.querySelector(`[aria-selected=\"true\"]`) as HTMLButtonElement\n\n if (!activeTab) return\n\n const updateSliderPosition = () => {\n const sliderElement = sliderRef.current\n const tabsContainer = tabsContainerRef.current\n /* istanbul ignore next */\n if (!sliderElement || !tabsContainer) return\n\n const containerPaddingRem = window\n .getComputedStyle(tabsContainer)\n .getPropertyValue('--brand-Tabs-container-padding')\n\n const containerPadding = parseFloat(containerPaddingRem) * 16 // base size\n\n const offsetX = activeTabButton.offsetLeft - containerPadding\n const width = activeTabButton.offsetWidth\n\n sliderElement.style.setProperty('--brand-Tabs-slider-x', `${offsetX}px`)\n sliderElement.style.setProperty('--brand-Tabs-slider-width', `${width}px`)\n }\n\n updateSliderPosition()\n\n const resizeObserver = new ResizeObserver(updateSliderPosition)\n resizeObserver.observe(tabsContainerRef.current)\n\n // On narrow viewports this will scroll the active tab into the center.\n // Important because we show a gradient in dark mode.\n const tabsContainer = tabsContainerRef.current\n const containerWidth = tabsContainer.clientWidth\n const containerPaddingRem = window\n .getComputedStyle(tabsContainer)\n .getPropertyValue('--brand-Tabs-container-padding')\n const containerPadding = parseFloat(containerPaddingRem) * 16\n const tabLeft = activeTabButton.offsetLeft - containerPadding\n const tabWidth = activeTabButton.offsetWidth\n const tabCenter = tabLeft + tabWidth / 2\n\n const targetScrollLeft = tabCenter - containerWidth / 2\n\n const maxScrollLeft = tabsContainer.scrollWidth - containerWidth // defines boudnary\n const finalScrollLeft = Math.max(0, Math.min(targetScrollLeft, maxScrollLeft))\n\n tabsContainer.scrollTo({\n left: finalScrollLeft,\n behavior: 'smooth',\n })\n\n return () => {\n resizeObserver.disconnect()\n }\n }, [activeTab])\n\n // Tracks the overflow state for mobile gradient visibility\n // Should only appear when enough items trigger an overflow\n // Related to gradient functionality\n useEffect(() => {\n const tabsContainer = tabsContainerRef.current\n const wrapperElement = tabsWrapperRef.current\n /* istanbul ignore next */\n if (!tabsContainer || !wrapperElement) return\n\n // This relies heavily on layout and measurement and, as such, isn't practical to test\n /* istanbul ignore next */\n const updateScrollState = () => {\n const {scrollLeft, scrollWidth, clientWidth} = tabsContainer\n const hasOverflow = scrollWidth > clientWidth\n\n const canScrollRight = hasOverflow && scrollLeft < scrollWidth - clientWidth - 1\n\n // Set CSS variables on the wrapper element for the gradient\n wrapperElement.style.setProperty('--scroll-offset', `${scrollLeft}px`)\n wrapperElement.style.setProperty('--has-overflow', hasOverflow ? '1' : '0')\n wrapperElement.style.setProperty('--can-scroll-right', canScrollRight ? '1' : '0')\n }\n\n updateScrollState()\n const resizeObserver = new ResizeObserver(updateScrollState)\n resizeObserver.observe(tabsContainer)\n\n // eslint-disable-next-line github/prefer-observers\n tabsContainer.addEventListener('scroll', updateScrollState)\n\n return () => {\n tabsContainer.removeEventListener('scroll', updateScrollState)\n resizeObserver.disconnect()\n }\n }, [tabs])\n\n /**\n * The LabelOrLabelledBy type guarantees that, if ariaLabel isn't a string,\n * then ariaLabelledBy is guaranteed to be a string, and vice versa.\n */\n const accessibleLabel = typeof ariaLabel === 'string' ? {label: ariaLabel} : {labelledBy: ariaLabelledBy}\n const tabListProps = getTabListProps(accessibleLabel)\n\n const handleNextTabControl = useCallback(() => {\n if (activeTab && activeTab !== String(tabs.length - 1)) {\n activateTab(String(Number(activeTab) + 1))\n }\n }, [activeTab, activateTab, tabs])\n\n const handlePrevTabControl = useCallback(() => {\n if (activeTab && activeTab !== '0') {\n activateTab(String(Number(activeTab) - 1))\n }\n }, [activeTab, activateTab])\n\n const hasMoreThanTwoTabs = tabs.length >= 3\n const isLastTabActive = String(tabs.length - 1) === activeTab\n\n return (\n <div\n className={clsx(\n styles['Tabs-container'],\n styles[`Tabs-container--align-${align}`],\n isLastTabActive && styles['Tabs-container--lastTabIsActive'],\n className,\n )}\n ref={ref}\n data-testid={testIds.root}\n {...props}\n >\n {/* Narrow only indicators and controls */}\n {tabs.length >= 3 && (\n <div className={styles.Tabs__controls} data-testid={testIds.indicators}>\n <Stack direction=\"horizontal\" padding=\"none\" justifyContent=\"space-between\">\n <button\n onClick={handlePrevTabControl}\n className={styles.Tabs__control}\n aria-label={internalAccessibleLabels.controlsPrev}\n >\n <Text size=\"100\">\n <ChevronLeftIcon size={16} className={styles['Tabs__control-icon']} />\n </Text>\n </button>\n <Stack direction=\"horizontal\" gap={4} padding=\"none\" justifyContent=\"space-between\" alignItems=\"center\">\n {tabs.map((_, index) => {\n return (\n <div\n key={index}\n className={clsx(\n styles.Tabs__indicator,\n activeTab && Number(activeTab) === index && styles['Tabs__indicator--active'],\n )}\n />\n )\n })}\n </Stack>\n <button\n onClick={handleNextTabControl}\n className={styles.Tabs__control}\n aria-label={internalAccessibleLabels.controlsNext}\n >\n <Text size=\"100\">\n <ChevronRightIcon size={16} className={styles['Tabs__control-icon']} />\n </Text>\n </button>\n </Stack>\n </div>\n )}\n\n <div\n ref={tabsWrapperRef}\n className={clsx(\n styles['Tablist__wrapper'],\n styles[`Tablist__wrapper--${variant}`],\n isLastTabActive && styles['Tablist__wrapper--lastTabIsActive'],\n )}\n >\n <div\n ref={tabsContainerRef}\n {...tabListProps}\n className={clsx(\n styles.Tabs,\n styles[`Tabs--${variant}`],\n hasMoreThanTwoTabs && styles['Tabs--hasMoreThanTwoTabs'],\n )}\n >\n <div ref={sliderRef} className={styles.Tabs__slider} aria-hidden />\n {tabs}\n </div>\n </div>\n\n {panels.length > 0 && <div className={styles['Tabs__panelContainer']}>{panels}</div>}\n </div>\n )\n },\n)\n\nexport type TabsItemProps = {\n children: ReactNode\n className?: string\n isActive?: boolean\n variant?: 'default' | 'accent' | 'underline'\n /**\n * ⚠️ WARNING: Setting a custom id will override the automatically generated ARIA attributes\n * (aria-controls, aria-labelledby). You will need to manually implement proper accessibility\n * relationships between tabs and panels.\n * @see https://primer.style/brand/components/Tabs/#custom-panels\n */\n id?: string\n} & Omit<React.ComponentPropsWithoutRef<'button'>, 'id'>\n\nconst TabsItem = forwardRef<HTMLButtonElement, TabsItemProps>(\n ({children, className, isActive, variant, ...props}, ref) => {\n const tabRef = useProvidedRefOrCreate(ref)\n\n return (\n <button\n ref={tabRef}\n className={clsx(\n styles.Tabs__item,\n isActive && styles['Tabs__item--active'],\n variant && styles[`Tabs__item--${variant}`],\n className,\n )}\n data-testid={testIds.tab}\n {...props}\n >\n {children}\n </button>\n )\n },\n)\n\nexport type TabsPanelProps = {\n children: ReactNode\n className?: string\n animation?: (typeof AnimationVariants)[number] | false\n hidden?: boolean\n /**\n * ⚠️ WARNING: Setting a custom id will override the automatically generated ARIA attributes\n * (aria-controls, aria-labelledby). You will need to manually implement proper accessibility\n * relationships between tabs and panels.\n * @see https://primer.style/brand/components/Tabs/#custom-panels\n */\n id?: string\n} & Omit<React.HTMLAttributes<HTMLDivElement>, 'id'>\n\nconst TabsPanel = memo(function TabsPanelComponent({\n children,\n animation = false,\n className,\n\n hidden,\n ...rest\n}: TabsPanelProps) {\n const conditionalRender = animation ? (\n <AnimationProvider autoStaggerChildren={false}>\n <Animate animate={animation}>{children}</Animate>\n </AnimationProvider>\n ) : (\n children\n )\n\n return (\n <div className={clsx(styles['Tabs__panel'], className)} data-testid={testIds.panel} hidden={hidden} {...rest}>\n {conditionalRender}\n </div>\n )\n})\n\n/**\n * Use Tabs to display a list of tabs with associated content panels.\n * @see https://primer.style/brand/components/Tabs\n */\nexport const Tabs = Object.assign(_TabsRoot, {\n Item: TabsItem,\n Panel: TabsPanel,\n testIds,\n})\n"],"mappings":";;;;;;;;;;;;;;;AA8BA,IAAM,IAAU;CACd,MAAM;CACN,IAAI,MAAM;EACR,OAAO,GAAG,KAAK,KAAK;CACtB;CACA,IAAI,QAAQ;EACV,OAAO,GAAG,KAAK,KAAK;CACtB;CACA,IAAI,aAAa;EACf,OAAO,GAAG,KAAK,KAAK;CACtB;AACF,GAiDM,IAAkC;CACtC,cAAc;CACd,cAAc;AAChB,GAEM,IAAY,GAEd,EACE,WAAQ,UACR,aACA,qBACA,aACA,aAAU,WACV,cACA,cAAc,GACd,mBAAmB,GACnB,8BAA2B,GAC3B,GAAG,KAEL,MACG;CACH,IAAM,EAAC,cAAW,gBAAa,oBAAiB,gBAAa,wBAAoB,EAAQ;EACvF,YAAY;EACZ,eAAe;CACjB,CAAC,GACK,IAAmB,EAAuB,IAAI,GAC9C,IAAiB,EAAuB,IAAI,GAC5C,IAAY,EAAuB,IAAI,GAEvC,IAAgB,EAAS,QAAQ,CAAQ,GAIzC,IAAO,EACV,QAAQ,MAAoC,EAA8B,CAAK,KAAK,EAAM,SAAS,CAAQ,CAAC,CAC5G,KAAK,GAAK,MAAU;EACnB,IAAM,IAAQ,OAAO,CAAK,GACpB,IAAc,EAAI,KAClB,IAAW,EAA+B,GAAO,CAAW;EAElE,OAAO,EAAa,GAAK;GACvB,GAAG;GACH,IAAI,EAAI,MAAM,MAAM,EAAS;GAC7B,iBAAiB,EAAI,MAAM,oBAAoB,EAAS;GACxD,OAAO;GACP,KAAK,EAAS;GACd,UAAU,MAAc;GAC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AU,YAAS,GAAG,KAAQ,MAIjD,kBAAC,UAAD;CACE,KAJW,EAAuB,CAI7B;CACL,WAAW,EACT,EAAO,YACP,KAAY,EAAO,uBACnB,KAAW,EAAO,eAAe,MACjC,CACF;CACA,eAAa,EAAQ;CACrB,GAAI;CAEH;AACK,CAAA,CAGd,GAgBM,IAAY,EAAK,SAA4B,EACjD,aACA,eAAY,IACZ,cAEA,WACA,GAAG,KACc;CACjB,IAAM,IAAoB,IACxB,kBAAC,GAAD;EAAmB,qBAAqB;YACtC,kBAAC,GAAD;GAAS,SAAS;GAAY;EAAkB,CAAA;CAC/B,CAAA,IAEnB;CAGF,OACE,kBAAC,OAAD;EAAK,WAAW,EAAK,EAAO,aAAgB,CAAS;EAAG,eAAa,EAAQ;EAAe;EAAQ,GAAI;YACrG;CACE,CAAA;AAET,CAAC,GAMY,IAAO,OAAO,OAAO,GAAW;CAC3C,MAAM;CACN,OAAO;CACP;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"Tabs.js","names":[],"sources":["../../src/Tabs/Tabs.tsx"],"sourcesContent":["import React, {\n memo,\n ReactNode,\n forwardRef,\n Children,\n isValidElement,\n cloneElement,\n useRef,\n useEffect,\n HTMLAttributes,\n} from 'react'\nimport {clsx} from 'clsx'\nimport {useTabs} from '../hooks/useTabs'\nimport {useProvidedRefOrCreate} from '../hooks/useRef'\nimport {BaseProps} from '../component-helpers'\nimport {Animate, AnimationProvider, AnimationVariants} from '../animation'\nimport {CarouselPagination} from '../CarouselPagination'\n\n/**\n * Design tokens\n */\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/tabs/base.css'\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/tabs/colors-with-modes.css'\n\n/** * Main Stylesheet (as a CSS Module) */\nimport styles from './Tabs.module.css'\n\nconst testIds = {\n root: 'Tabs',\n get tab() {\n return `${this.root}-tab`\n },\n get panel() {\n return `${this.root}-panel`\n },\n get indicators() {\n return `${this.root}-indicators`\n },\n}\n\n/**\n * Accessible label for the entire tabs component, used by screen readers to describe the tab group.\n * Note: Only use one of `aria-label` or `aria-labelled` by. Not both or neither.\n */\ntype LabelOrLabelledBy =\n | {'aria-label': string; 'aria-labelledby'?: never}\n | {'aria-labelledby': string; 'aria-label'?: never}\n\nexport type TabsProps = {\n /**\n * Visual style variant of the tabs. Affects the appearance and styling theme.\n */\n variant?: 'default' | 'accent' | 'underline'\n /**\n * Horizontal alignment of the tab navigation. Defaults to 'start'.\n */\n align?: 'start' | 'center'\n /**\n * Named children to be rendered as tab items and panels.\n */\n children: ReactNode\n /**\n * Sets the default active tab. \"0\" (first tab) by default.\n */\n defaultActiveTab?: string\n /**\n * Callback function triggered when the active tab changes. Receives the new active tab identifier.\n */\n onChange?: (activeTab: string) => void\n\n /**\n * Additional CSS class names to apply to the tabs container for custom styling.\n */\n className?: string\n /**\n * @param internalAccessibleLabels - Customizable labels for screen readers to improve accessibility. These are applied internally using the aria-label attribute.\n * @param internalAccessibleLabels.controlsNext - Label for the \"next tab\" control button, used by screen readers. Default is \"Next tab\".\n * @param internalAccessibleLabels.controlsPrev - Label for the \"previous tab\" control button, used by screen readers. Default is \"Previous tab\".\n * @param internalAccessibleLabels.controlsIndicator - Complete selector label using {current}. Default is \"Go to tab {current}\".\n * @param internalAccessibleLabels.controlsNavigation - Label for the complete mobile control group. Default is \"Tab navigation\".\n */\n internalAccessibleLabels?: {\n controlsNext: string\n controlsPrev: string\n controlsIndicator?: string\n controlsNavigation?: string\n }\n} & LabelOrLabelledBy &\n BaseProps<HTMLDivElement> &\n Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'aria-label' | 'aria-labelledby'>\n\nconst defaultInternalAccessibleLabels = {\n controlsNext: 'Next tab',\n controlsPrev: 'Previous tab',\n controlsIndicator: 'Go to tab {current}',\n controlsNavigation: 'Tab navigation',\n}\n\nconst _TabsRoot = forwardRef<HTMLDivElement, TabsProps>(\n (\n {\n align = 'center',\n children,\n defaultActiveTab,\n onChange,\n variant = 'default',\n className,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n internalAccessibleLabels = defaultInternalAccessibleLabels,\n ...props\n },\n ref,\n ) => {\n const {activeTab, activateTab, getTabListProps, getTabProps, getTabPanelProps} = useTabs({\n defaultTab: defaultActiveTab,\n onTabActivate: onChange,\n })\n const tabsContainerRef = useRef<HTMLDivElement>(null)\n const tabsWrapperRef = useRef<HTMLDivElement>(null)\n const sliderRef = useRef<HTMLDivElement>(null)\n\n const childrenArray = Children.toArray(children)\n\n type TabsItemElement = React.ReactElement<TabsItemProps> & {ref?: React.Ref<HTMLButtonElement>}\n\n const tabs = childrenArray\n .filter((child): child is TabsItemElement => isValidElement<TabsItemProps>(child) && child.type === TabsItem)\n .map((tab, index) => {\n const tabId = String(index)\n const originalRef = tab.ref\n const tabProps = getTabProps<HTMLButtonElement>(tabId, originalRef)\n\n return cloneElement(tab, {\n ...tabProps,\n id: tab.props.id ?? tabProps.id,\n 'aria-controls': tab.props['aria-controls'] ?? tabProps['aria-controls'],\n value: tabId,\n key: tabProps.id,\n isActive: activeTab === tabId,\n variant,\n })\n })\n\n const panels = childrenArray\n .filter(\n (child): child is React.ReactElement<TabsPanelProps> =>\n isValidElement<TabsPanelProps>(child) && child.type === TabsPanel,\n )\n .map((child, index) => {\n const panelId = String(index)\n const tabPanelProps = getTabPanelProps(panelId)\n\n return cloneElement(child, {\n ...tabPanelProps,\n id: child.props.id ?? tabPanelProps.id,\n key: String(index),\n })\n })\n\n useEffect(() => {\n /* istanbul ignore next */\n if (!tabsContainerRef.current || !sliderRef.current) return\n\n const activeTabButton = tabsContainerRef.current.querySelector(`[aria-selected=\"true\"]`) as HTMLButtonElement\n\n if (!activeTab) return\n\n const updateSliderPosition = () => {\n const sliderElement = sliderRef.current\n const tabsContainer = tabsContainerRef.current\n /* istanbul ignore next */\n if (!sliderElement || !tabsContainer) return\n\n const containerPaddingRem = window\n .getComputedStyle(tabsContainer)\n .getPropertyValue('--brand-Tabs-container-padding')\n\n const containerPadding = parseFloat(containerPaddingRem) * 16 // base size\n\n const offsetX = activeTabButton.offsetLeft - containerPadding\n const width = activeTabButton.offsetWidth\n\n sliderElement.style.setProperty('--brand-Tabs-slider-x', `${offsetX}px`)\n sliderElement.style.setProperty('--brand-Tabs-slider-width', `${width}px`)\n }\n\n updateSliderPosition()\n\n const resizeObserver = new ResizeObserver(updateSliderPosition)\n resizeObserver.observe(tabsContainerRef.current)\n\n // On narrow viewports this will scroll the active tab into the center.\n // Important because we show a gradient in dark mode.\n const tabsContainer = tabsContainerRef.current\n const containerWidth = tabsContainer.clientWidth\n const containerPaddingRem = window\n .getComputedStyle(tabsContainer)\n .getPropertyValue('--brand-Tabs-container-padding')\n const containerPadding = parseFloat(containerPaddingRem) * 16\n const tabLeft = activeTabButton.offsetLeft - containerPadding\n const tabWidth = activeTabButton.offsetWidth\n const tabCenter = tabLeft + tabWidth / 2\n\n const targetScrollLeft = tabCenter - containerWidth / 2\n\n const maxScrollLeft = tabsContainer.scrollWidth - containerWidth // defines boudnary\n const finalScrollLeft = Math.max(0, Math.min(targetScrollLeft, maxScrollLeft))\n\n tabsContainer.scrollTo({\n left: finalScrollLeft,\n behavior: 'smooth',\n })\n\n return () => {\n resizeObserver.disconnect()\n }\n }, [activeTab])\n\n // Tracks the overflow state for mobile gradient visibility\n // Should only appear when enough items trigger an overflow\n // Related to gradient functionality\n useEffect(() => {\n const tabsContainer = tabsContainerRef.current\n const wrapperElement = tabsWrapperRef.current\n /* istanbul ignore next */\n if (!tabsContainer || !wrapperElement) return\n\n // This relies heavily on layout and measurement and, as such, isn't practical to test\n /* istanbul ignore next */\n const updateScrollState = () => {\n const {scrollLeft, scrollWidth, clientWidth} = tabsContainer\n const hasOverflow = scrollWidth > clientWidth\n\n const canScrollRight = hasOverflow && scrollLeft < scrollWidth - clientWidth - 1\n\n // Set CSS variables on the wrapper element for the gradient\n wrapperElement.style.setProperty('--scroll-offset', `${scrollLeft}px`)\n wrapperElement.style.setProperty('--has-overflow', hasOverflow ? '1' : '0')\n wrapperElement.style.setProperty('--can-scroll-right', canScrollRight ? '1' : '0')\n }\n\n updateScrollState()\n const resizeObserver = new ResizeObserver(updateScrollState)\n resizeObserver.observe(tabsContainer)\n\n // eslint-disable-next-line github/prefer-observers\n tabsContainer.addEventListener('scroll', updateScrollState)\n\n return () => {\n tabsContainer.removeEventListener('scroll', updateScrollState)\n resizeObserver.disconnect()\n }\n }, [tabs])\n\n /**\n * The LabelOrLabelledBy type guarantees that, if ariaLabel isn't a string,\n * then ariaLabelledBy is guaranteed to be a string, and vice versa.\n */\n const accessibleLabel = typeof ariaLabel === 'string' ? {label: ariaLabel} : {labelledBy: ariaLabelledBy}\n const tabListProps = getTabListProps(accessibleLabel)\n\n const hasMoreThanTwoTabs = tabs.length >= 3\n const isLastTabActive = String(tabs.length - 1) === activeTab\n\n return (\n <div\n className={clsx(\n styles['Tabs-container'],\n styles[`Tabs-container--align-${align}`],\n isLastTabActive && styles['Tabs-container--lastTabIsActive'],\n className,\n )}\n ref={ref}\n data-testid={testIds.root}\n {...props}\n >\n {/* Narrow only indicators and controls */}\n {tabs.length >= 3 && (\n <div className={styles.Tabs__controls} data-testid={testIds.indicators}>\n <CarouselPagination\n itemCount={tabs.length}\n activeIndex={Number(activeTab ?? 0)}\n aria-label={\n internalAccessibleLabels.controlsNavigation ?? defaultInternalAccessibleLabels.controlsNavigation\n }\n labels={{\n previous: internalAccessibleLabels.controlsPrev,\n next: internalAccessibleLabels.controlsNext,\n item: internalAccessibleLabels.controlsIndicator ?? defaultInternalAccessibleLabels.controlsIndicator,\n }}\n itemAttributesBuilder={index => ({'aria-controls': tabs[index].props['aria-controls']})}\n onChange={index => activateTab(String(index))}\n />\n </div>\n )}\n\n <div\n ref={tabsWrapperRef}\n className={clsx(\n styles['Tablist__wrapper'],\n styles[`Tablist__wrapper--${variant}`],\n isLastTabActive && styles['Tablist__wrapper--lastTabIsActive'],\n )}\n >\n <div\n ref={tabsContainerRef}\n {...tabListProps}\n className={clsx(\n styles.Tabs,\n styles[`Tabs--${variant}`],\n hasMoreThanTwoTabs && styles['Tabs--hasMoreThanTwoTabs'],\n )}\n >\n <div ref={sliderRef} className={styles.Tabs__slider} aria-hidden />\n {tabs}\n </div>\n </div>\n\n {panels.length > 0 && <div className={styles['Tabs__panelContainer']}>{panels}</div>}\n </div>\n )\n },\n)\n\nexport type TabsItemProps = {\n children: ReactNode\n className?: string\n isActive?: boolean\n variant?: 'default' | 'accent' | 'underline'\n /**\n * ⚠️ WARNING: Setting a custom id will override the automatically generated ARIA attributes\n * (aria-controls, aria-labelledby). You will need to manually implement proper accessibility\n * relationships between tabs and panels.\n * @see https://primer.style/brand/components/Tabs/#custom-panels\n */\n id?: string\n} & Omit<React.ComponentPropsWithoutRef<'button'>, 'id'>\n\nconst TabsItem = forwardRef<HTMLButtonElement, TabsItemProps>(\n ({children, className, isActive, variant, ...props}, ref) => {\n const tabRef = useProvidedRefOrCreate(ref)\n\n return (\n <button\n ref={tabRef}\n className={clsx(\n styles.Tabs__item,\n isActive && styles['Tabs__item--active'],\n variant && styles[`Tabs__item--${variant}`],\n className,\n )}\n data-testid={testIds.tab}\n {...props}\n >\n {children}\n </button>\n )\n },\n)\n\nexport type TabsPanelProps = {\n children: ReactNode\n className?: string\n animation?: (typeof AnimationVariants)[number] | false\n hidden?: boolean\n /**\n * ⚠️ WARNING: Setting a custom id will override the automatically generated ARIA attributes\n * (aria-controls, aria-labelledby). You will need to manually implement proper accessibility\n * relationships between tabs and panels.\n * @see https://primer.style/brand/components/Tabs/#custom-panels\n */\n id?: string\n} & Omit<React.HTMLAttributes<HTMLDivElement>, 'id'>\n\nconst TabsPanel = memo(function TabsPanelComponent({\n children,\n animation = false,\n className,\n\n hidden,\n ...rest\n}: TabsPanelProps) {\n const conditionalRender = animation ? (\n <AnimationProvider autoStaggerChildren={false}>\n <Animate animate={animation}>{children}</Animate>\n </AnimationProvider>\n ) : (\n children\n )\n\n return (\n <div className={clsx(styles['Tabs__panel'], className)} data-testid={testIds.panel} hidden={hidden} {...rest}>\n {conditionalRender}\n </div>\n )\n})\n\n/**\n * Use Tabs to display a list of tabs with associated content panels.\n * @see https://primer.style/brand/components/Tabs\n */\nexport const Tabs = Object.assign(_TabsRoot, {\n Item: TabsItem,\n Panel: TabsPanel,\n testIds,\n})\n"],"mappings":";;;;;;;;;;;;AA2BA,IAAM,IAAU;CACd,MAAM;CACN,IAAI,MAAM;EACR,OAAO,GAAG,KAAK,KAAK;CACtB;CACA,IAAI,QAAQ;EACV,OAAO,GAAG,KAAK,KAAK;CACtB;CACA,IAAI,aAAa;EACf,OAAO,GAAG,KAAK,KAAK;CACtB;AACF,GAqDM,IAAkC;CACtC,cAAc;CACd,cAAc;CACd,mBAAmB;CACnB,oBAAoB;AACtB,GAEM,IAAY,GAEd,EACE,WAAQ,UACR,aACA,qBACA,aACA,aAAU,WACV,cACA,cAAc,GACd,mBAAmB,GACnB,8BAA2B,GAC3B,GAAG,KAEL,MACG;CACH,IAAM,EAAC,cAAW,gBAAa,oBAAiB,gBAAa,wBAAoB,EAAQ;EACvF,YAAY;EACZ,eAAe;CACjB,CAAC,GACK,IAAmB,EAAuB,IAAI,GAC9C,IAAiB,EAAuB,IAAI,GAC5C,IAAY,EAAuB,IAAI,GAEvC,IAAgB,EAAS,QAAQ,CAAQ,GAIzC,IAAO,EACV,QAAQ,MAAoC,EAA8B,CAAK,KAAK,EAAM,SAAS,CAAQ,CAAC,CAC5G,KAAK,GAAK,MAAU;EACnB,IAAM,IAAQ,OAAO,CAAK,GACpB,IAAc,EAAI,KAClB,IAAW,EAA+B,GAAO,CAAW;EAElE,OAAO,EAAa,GAAK;GACvB,GAAG;GACH,IAAI,EAAI,MAAM,MAAM,EAAS;GAC7B,iBAAiB,EAAI,MAAM,oBAAoB,EAAS;GACxD,OAAO;GACP,KAAK,EAAS;GACd,UAAU,MAAc;GACxB;EACF,CAAC;CACH,CAAC,GAEG,IAAS,EACZ,QACE,MACC,EA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,MAAM,iBAAgB;KACrF,WAAU,MAAS,EAAY,OAAO,CAAK,CAAC;IAC7C,CAAA;GACE,CAAA;GAGP,kBAAC,OAAD;IACE,KAAK;IACL,WAAW,EACT,EAAO,kBACP,EAAO,qBAAqB,MAC5B,KAAmB,EAAO,oCAC5B;cAEA,kBAAC,OAAD;KACE,KAAK;KACL,GAAI;KACJ,WAAW,EACT,EAAO,MACP,EAAO,SAAS,MAChB,KAAsB,EAAO,2BAC/B;eAPF,CASE,kBAAC,OAAD;MAAK,KAAK;MAAW,WAAW,EAAO;MAAc,eAAA;KAAa,CAAA,GACjE,CACE;;GACF,CAAA;GAEJ,EAAO,SAAS,KAAK,kBAAC,OAAD;IAAK,WAAW,EAAO;cAA0B;GAAY,CAAA;EAChF;;AAET,CACF,GAgBM,IAAW,GACd,EAAC,aAAU,cAAW,aAAU,YAAS,GAAG,KAAQ,MAIjD,kBAAC,UAAD;CACE,KAJW,EAAuB,CAI7B;CACL,WAAW,EACT,EAAO,YACP,KAAY,EAAO,uBACnB,KAAW,EAAO,eAAe,MACjC,CACF;CACA,eAAa,EAAQ;CACrB,GAAI;CAEH;AACK,CAAA,CAGd,GAgBM,IAAY,EAAK,SAA4B,EACjD,aACA,eAAY,IACZ,cAEA,WACA,GAAG,KACc;CACjB,IAAM,IAAoB,IACxB,kBAAC,GAAD;EAAmB,qBAAqB;YACtC,kBAAC,GAAD;GAAS,SAAS;GAAY;EAAkB,CAAA;CAC/B,CAAA,IAEnB;CAGF,OACE,kBAAC,OAAD;EAAK,WAAW,EAAK,EAAO,aAAgB,CAAS;EAAG,eAAa,EAAQ;EAAe;EAAQ,GAAI;YACrG;CACE,CAAA;AAET,CAAC,GAMY,IAAO,OAAO,OAAO,GAAW;CAC3C,MAAM;CACN,OAAO;CACP;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.Primer_Brand__Tabs-module__Tabs___zia5x{gap:var(--base-size-4);background-color:var(--brand-color-canvas-backdrop);border-radius:var(--brand-borderRadius-large);padding:var(--brand-Tabs-container-padding);width:fit-content;min-height:var(--base-size-48);display:flex;position:relative}.Primer_Brand__Tabs-module__Tabs-container___wuq7I{display:grid}@media screen and (width<=48rem){.Primer_Brand__Tabs-module__Tabs-container___wuq7I{flex-direction:column;align-items:center;width:100%;display:flex;position:relative}.Primer_Brand__Tabs-module__Tabs-container--align-start___n0cXk{align-items:flex-start}.Primer_Brand__Tabs-module__Tabs-container--align-center___LjUrd{align-items:center}.Primer_Brand__Tabs-module__Tablist__wrapper___MDIB8{width:fit-content;max-width:100%;position:relative;overflow:hidden}.Primer_Brand__Tabs-module__Tablist__wrapper___MDIB8:after{content:"";right:var(--brand-Tabs-list-borderWidth-active);top:var(--base-size-2);bottom:var(--base-size-2);background:linear-gradient(to left, var(--brand-color-canvas-default) 30%, transparent);width:var(--base-size-48);z-index:2;pointer-events:none;transition:opacity var(--brand-animation-duration-default) var(--brand-animation-easing-default), visibility var(--brand-animation-duration-default) var(--brand-animation-easing-default);opacity:0;opacity:calc(var(--has-overflow,0) * var(--can-scroll-right,0));border-radius:inherit;position:absolute}.Primer_Brand__Tabs-module__Tablist__wrapper--default___Wdb55:after,.Primer_Brand__Tabs-module__Tablist__wrapper--accent___QV6Jx:after{border-radius:var(--brand-borderRadius-full)}.Primer_Brand__Tabs-module__Tablist__wrapper--underline___IZ_zV:after{border-radius:var(--brand-borderRadius-large)}.Primer_Brand__Tabs-module__Tablist__wrapper--lastTabIsActive___jCePF:after{opacity:0;visibility:hidden}.Primer_Brand__Tabs-module__Tabs___zia5x{scrollbar-width:none;-ms-overflow-style:none;max-width:100%;overflow:auto hidden}.Primer_Brand__Tabs-module__Tabs___zia5x::-webkit-scrollbar{display:none}}.Primer_Brand__Tabs-module__Tabs-container--align-start___n0cXk{justify-items:flex-start}.Primer_Brand__Tabs-module__Tabs-container--align-center___LjUrd{justify-items:center}.Primer_Brand__Tabs-module__Tabs--default___MUcm6,.Primer_Brand__Tabs-module__Tabs--accent___p1SQc{border:var(--brand-Tabs-list-borderWidth-active) solid var(--brand-color-border-default);border-radius:var(--brand-borderRadius-full)}.Primer_Brand__Tabs-module__Tabs--underline___CAXqd{gap:var(--base-size-24)}.Primer_Brand__Tabs-module__Tabs__item___4V44f{z-index:1;cursor:pointer;padding:var(--base-size-8) var(--base-size-16);border-radius:var(--brand-borderRadius-full);transition:color var(--brand-animation-duration-fast) ease-in-out;white-space:nowrap;font-family:var(--brand-fontStack-sansSerif);font-weight:var(--brand-text-weight-600);font-size:var(--brand-text-size-200);line-height:var(--brand-text-lineHeight-200);letter-spacing:var(--brand-text-letterSpacing-200);color:var(--brand-color-text-default);background:0 0;border:0;position:relative}.Primer_Brand__Tabs-module__Tabs__slider___tkaHu{top:var(--base-size-4);bottom:var(--base-size-4);transition:all var(--brand-animation-duration-fast) var(--brand-animation-easing-glide);z-index:0;transform:translate(0);transform:translateX(var(--brand-Tabs-slider-x,0px));width:var(--brand-Tabs-slider-width);position:absolute}.Primer_Brand__Tabs-module__Tabs--default___MUcm6 .Primer_Brand__Tabs-module__Tabs__slider___tkaHu{border-radius:var(--brand-borderRadius-full);border:var(--brand-borderWidth-thin) solid var(--brand-Tabs-item-default-borderColor-active);background:var(--brand-Tabs-item-default-bgColor-active)}.Primer_Brand__Tabs-module__Tabs--accent___p1SQc .Primer_Brand__Tabs-module__Tabs__slider___tkaHu{border-radius:var(--brand-borderRadius-full);border:var(--brand-borderWidth-thin) solid transparent;background:var(--brand-Tabs-item-accent-bgColor-rest)}.Primer_Brand__Tabs-module__Tabs--underline___CAXqd .Primer_Brand__Tabs-module__Tabs__slider___tkaHu{border-bottom:var(--brand-borderWidth-thick) solid var(--brand-Tabs-item-underline-rest)}.Primer_Brand__Tabs-module__Tabs__item___4V44f:focus-visible{outline:var(--base-size-2) solid var(--brand-color-focus);outline-offset:var(--base-size-2)}.Primer_Brand__Tabs-module__Tabs__item--active___Guj0b{color:var(--brand-color-text-default)}.Primer_Brand__Tabs-module__Tabs--underline___CAXqd .Primer_Brand__Tabs-module__Tabs__item___4V44f{padding:var(--base-size-8);border-radius:var(--brand-borderRadius-medium)}.Primer_Brand__Tabs-module__Tabs--accent___p1SQc .Primer_Brand__Tabs-module__Tabs__item___4V44f{transition:color var(--brand-animation-duration-faster) ease}.Primer_Brand__Tabs-module__Tabs--accent___p1SQc .Primer_Brand__Tabs-module__Tabs__item--active___Guj0b{color:var(--brand-Tabs-item-accent-fgColor-rest)}.Primer_Brand__Tabs-module__Tabs__panelContainer___WhkhR{margin-
|
|
1
|
+
.Primer_Brand__Tabs-module__Tabs___zia5x{gap:var(--base-size-4);background-color:var(--brand-color-canvas-backdrop);border-radius:var(--brand-borderRadius-large);padding:var(--brand-Tabs-container-padding);width:fit-content;min-height:var(--base-size-48);display:flex;position:relative}.Primer_Brand__Tabs-module__Tabs-container___wuq7I{display:grid}@media screen and (width<=48rem){.Primer_Brand__Tabs-module__Tabs-container___wuq7I{flex-direction:column;align-items:center;width:100%;display:flex;position:relative}.Primer_Brand__Tabs-module__Tabs-container--align-start___n0cXk{align-items:flex-start}.Primer_Brand__Tabs-module__Tabs-container--align-center___LjUrd{align-items:center}.Primer_Brand__Tabs-module__Tablist__wrapper___MDIB8{width:fit-content;max-width:100%;position:relative;overflow:hidden}.Primer_Brand__Tabs-module__Tablist__wrapper___MDIB8:after{content:"";right:var(--brand-Tabs-list-borderWidth-active);top:var(--base-size-2);bottom:var(--base-size-2);background:linear-gradient(to left, var(--brand-color-canvas-default) 30%, transparent);width:var(--base-size-48);z-index:2;pointer-events:none;transition:opacity var(--brand-animation-duration-default) var(--brand-animation-easing-default), visibility var(--brand-animation-duration-default) var(--brand-animation-easing-default);opacity:0;opacity:calc(var(--has-overflow,0) * var(--can-scroll-right,0));border-radius:inherit;position:absolute}.Primer_Brand__Tabs-module__Tablist__wrapper--default___Wdb55:after,.Primer_Brand__Tabs-module__Tablist__wrapper--accent___QV6Jx:after{border-radius:var(--brand-borderRadius-full)}.Primer_Brand__Tabs-module__Tablist__wrapper--underline___IZ_zV:after{border-radius:var(--brand-borderRadius-large)}.Primer_Brand__Tabs-module__Tablist__wrapper--lastTabIsActive___jCePF:after{opacity:0;visibility:hidden}.Primer_Brand__Tabs-module__Tabs___zia5x{scrollbar-width:none;-ms-overflow-style:none;max-width:100%;overflow:auto hidden}.Primer_Brand__Tabs-module__Tabs___zia5x::-webkit-scrollbar{display:none}}.Primer_Brand__Tabs-module__Tabs-container--align-start___n0cXk{justify-items:flex-start}.Primer_Brand__Tabs-module__Tabs-container--align-center___LjUrd{justify-items:center}.Primer_Brand__Tabs-module__Tabs--default___MUcm6,.Primer_Brand__Tabs-module__Tabs--accent___p1SQc{border:var(--brand-Tabs-list-borderWidth-active) solid var(--brand-color-border-default);border-radius:var(--brand-borderRadius-full)}.Primer_Brand__Tabs-module__Tabs--underline___CAXqd{gap:var(--base-size-24)}.Primer_Brand__Tabs-module__Tabs__item___4V44f{z-index:1;cursor:pointer;padding:var(--base-size-8) var(--base-size-16);border-radius:var(--brand-borderRadius-full);transition:color var(--brand-animation-duration-fast) ease-in-out;white-space:nowrap;font-family:var(--brand-fontStack-sansSerif);font-weight:var(--brand-text-weight-600);font-size:var(--brand-text-size-200);line-height:var(--brand-text-lineHeight-200);letter-spacing:var(--brand-text-letterSpacing-200);color:var(--brand-color-text-default);background:0 0;border:0;position:relative}.Primer_Brand__Tabs-module__Tabs__slider___tkaHu{top:var(--base-size-4);bottom:var(--base-size-4);transition:all var(--brand-animation-duration-fast) var(--brand-animation-easing-glide);z-index:0;transform:translate(0);transform:translateX(var(--brand-Tabs-slider-x,0px));width:var(--brand-Tabs-slider-width);position:absolute}.Primer_Brand__Tabs-module__Tabs--default___MUcm6 .Primer_Brand__Tabs-module__Tabs__slider___tkaHu{border-radius:var(--brand-borderRadius-full);border:var(--brand-borderWidth-thin) solid var(--brand-Tabs-item-default-borderColor-active);background:var(--brand-Tabs-item-default-bgColor-active)}.Primer_Brand__Tabs-module__Tabs--accent___p1SQc .Primer_Brand__Tabs-module__Tabs__slider___tkaHu{border-radius:var(--brand-borderRadius-full);border:var(--brand-borderWidth-thin) solid transparent;background:var(--brand-Tabs-item-accent-bgColor-rest)}.Primer_Brand__Tabs-module__Tabs--underline___CAXqd .Primer_Brand__Tabs-module__Tabs__slider___tkaHu{border-bottom:var(--brand-borderWidth-thick) solid var(--brand-Tabs-item-underline-rest)}.Primer_Brand__Tabs-module__Tabs__item___4V44f:focus-visible{outline:var(--base-size-2) solid var(--brand-color-focus);outline-offset:var(--base-size-2)}.Primer_Brand__Tabs-module__Tabs__item--active___Guj0b{color:var(--brand-color-text-default)}.Primer_Brand__Tabs-module__Tabs--underline___CAXqd .Primer_Brand__Tabs-module__Tabs__item___4V44f{padding:var(--base-size-8);border-radius:var(--brand-borderRadius-medium)}.Primer_Brand__Tabs-module__Tabs--accent___p1SQc .Primer_Brand__Tabs-module__Tabs__item___4V44f{transition:color var(--brand-animation-duration-faster) ease}.Primer_Brand__Tabs-module__Tabs--accent___p1SQc .Primer_Brand__Tabs-module__Tabs__item--active___Guj0b{color:var(--brand-Tabs-item-accent-fgColor-rest)}.Primer_Brand__Tabs-module__Tabs__panelContainer___WhkhR{margin-block-start:var(--base-size-16)}.Primer_Brand__Tabs-module__Tabs__panel___UdoZQ{color:var(--brand-color-text-default)}.Primer_Brand__Tabs-module__Tabs__controls___Cg7GX{margin-block-end:var(--base-size-12)}@media screen and (width>=48rem){.Primer_Brand__Tabs-module__Tabs__controls___Cg7GX{display:none}.Primer_Brand__Tabs-module__Tabs__item___4V44f{padding-inline:var(--base-size-24)}}
|
package/esm/Tabs/Tabs.module.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import './Tabs.module-
|
|
2
|
-
var e = "Primer_Brand__Tabs-module__Tabs___zia5x", t = "Primer_Brand__Tabs-module__Tablist__wrapper___MDIB8", n = "Primer_Brand__Tabs-module__Tabs__item___4V44f", r = "Primer_Brand__Tabs-module__Tabs__slider___tkaHu", i = "Primer_Brand__Tabs-module__Tabs__panelContainer___WhkhR", a = "Primer_Brand__Tabs-module__Tabs__panel___UdoZQ", o = "Primer_Brand__Tabs-module__Tabs__controls___Cg7GX", s =
|
|
1
|
+
import './Tabs.module-B-E_MTke.css';//#region src/Tabs/Tabs.module.css
|
|
2
|
+
var e = "Primer_Brand__Tabs-module__Tabs___zia5x", t = "Primer_Brand__Tabs-module__Tablist__wrapper___MDIB8", n = "Primer_Brand__Tabs-module__Tabs__item___4V44f", r = "Primer_Brand__Tabs-module__Tabs__slider___tkaHu", i = "Primer_Brand__Tabs-module__Tabs__panelContainer___WhkhR", a = "Primer_Brand__Tabs-module__Tabs__panel___UdoZQ", o = "Primer_Brand__Tabs-module__Tabs__controls___Cg7GX", s = {
|
|
3
3
|
Tabs: e,
|
|
4
4
|
"Tabs-container": "Primer_Brand__Tabs-module__Tabs-container___wuq7I",
|
|
5
5
|
"Tabs-container--align-start": "Primer_Brand__Tabs-module__Tabs-container--align-start___n0cXk",
|
|
@@ -17,13 +17,9 @@ var e = "Primer_Brand__Tabs-module__Tabs___zia5x", t = "Primer_Brand__Tabs-modul
|
|
|
17
17
|
"Tabs__item--active": "Primer_Brand__Tabs-module__Tabs__item--active___Guj0b",
|
|
18
18
|
Tabs__panelContainer: i,
|
|
19
19
|
Tabs__panel: a,
|
|
20
|
-
Tabs__controls: o
|
|
21
|
-
Tabs__indicator: s,
|
|
22
|
-
"Tabs__indicator--active": "Primer_Brand__Tabs-module__Tabs__indicator--active___h_TV1",
|
|
23
|
-
Tabs__control: c,
|
|
24
|
-
"Tabs__control-icon": "Primer_Brand__Tabs-module__Tabs__control-icon___V9mNe"
|
|
20
|
+
Tabs__controls: o
|
|
25
21
|
};
|
|
26
22
|
//#endregion
|
|
27
|
-
export { t as Tablist__wrapper, e as Tabs,
|
|
23
|
+
export { t as Tablist__wrapper, e as Tabs, o as Tabs__controls, n as Tabs__item, a as Tabs__panel, i as Tabs__panelContainer, r as Tabs__slider, s as default };
|
|
28
24
|
|
|
29
25
|
//# sourceMappingURL=Tabs.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.module.js","names":[],"sources":["../../src/Tabs/Tabs.module.css"],"sourcesContent":[".Tabs {\n position: relative;\n display: flex;\n gap: var(--base-size-4);\n background-color: var(--brand-color-canvas-backdrop);\n border-radius: var(--brand-borderRadius-large);\n padding: var(--brand-Tabs-container-padding);\n width: fit-content;\n min-height: var(--base-size-48);\n}\n\n.Tabs-container {\n display: grid;\n}\n\n@media screen and (max-width: 48rem) {\n .Tabs-container {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n position: relative;\n }\n\n .Tabs-container--align-start {\n align-items: flex-start;\n }\n\n .Tabs-container--align-center {\n align-items: center;\n }\n\n .Tablist__wrapper {\n position: relative;\n width: fit-content;\n max-width: 100%;\n overflow: hidden;\n }\n\n .Tablist__wrapper::after {\n content: '';\n position: absolute;\n right: var(--brand-Tabs-list-borderWidth-active);\n top: var(--base-size-2);\n bottom: var(--base-size-2);\n background: linear-gradient(to left, var(--brand-color-canvas-default) 30%, transparent);\n width: var(--base-size-48);\n z-index: 2;\n pointer-events: none;\n transition: opacity var(--brand-animation-duration-default) var(--brand-animation-easing-default),\n visibility var(--brand-animation-duration-default) var(--brand-animation-easing-default);\n opacity: calc(var(--has-overflow, 0) * var(--can-scroll-right, 0));\n border-radius: inherit;\n }\n\n .Tablist__wrapper--default::after,\n .Tablist__wrapper--accent::after {\n border-radius: var(--brand-borderRadius-full);\n }\n\n .Tablist__wrapper--underline::after {\n border-radius: var(--brand-borderRadius-large);\n }\n\n .Tablist__wrapper--lastTabIsActive::after {\n opacity: 0;\n visibility: hidden;\n }\n\n .Tabs {\n max-width: 100%;\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none;\n -ms-overflow-style: none;\n }\n\n .Tabs::-webkit-scrollbar {\n display: none;\n }\n}\n\n.Tabs-container--align-start {\n justify-items: flex-start;\n}\n\n.Tabs-container--align-center {\n justify-items: center;\n}\n\n.Tabs--default,\n.Tabs--accent {\n border: var(--brand-Tabs-list-borderWidth-active) solid var(--brand-color-border-default);\n border-radius: var(--brand-borderRadius-full);\n}\n\n.Tabs--underline {\n gap: var(--base-size-24);\n}\n\n.Tabs__item {\n position: relative;\n z-index: 1;\n border: 0;\n background: transparent;\n cursor: pointer;\n padding: var(--base-size-8) var(--base-size-16);\n border-radius: var(--brand-borderRadius-full);\n transition: color var(--brand-animation-duration-fast) ease-in-out;\n white-space: nowrap;\n font-family: var(--brand-fontStack-sansSerif);\n font-weight: var(--brand-text-weight-600);\n font-size: var(--brand-text-size-200);\n line-height: var(--brand-text-lineHeight-200);\n letter-spacing: var(--brand-text-letterSpacing-200);\n color: var(--brand-color-text-default);\n}\n\n.Tabs__slider {\n position: absolute;\n top: var(--base-size-4);\n bottom: var(--base-size-4);\n transition: all var(--brand-animation-duration-fast) var(--brand-animation-easing-glide);\n z-index: 0;\n transform: translateX(var(--brand-Tabs-slider-x, 0px));\n width: var(--brand-Tabs-slider-width);\n}\n\n.Tabs--default .Tabs__slider {\n border-radius: var(--brand-borderRadius-full);\n border: var(--brand-borderWidth-thin) solid var(--brand-Tabs-item-default-borderColor-active);\n background: var(--brand-Tabs-item-default-bgColor-active);\n}\n\n.Tabs--accent .Tabs__slider {\n border-radius: var(--brand-borderRadius-full);\n border: var(--brand-borderWidth-thin) solid transparent;\n background: var(--brand-Tabs-item-accent-bgColor-rest);\n}\n\n.Tabs--underline .Tabs__slider {\n border-bottom: var(--brand-borderWidth-thick) solid var(--brand-Tabs-item-underline-rest);\n}\n\n.Tabs__item:focus-visible {\n outline: var(--base-size-2) solid var(--brand-color-focus);\n outline-offset: var(--base-size-2);\n}\n\n.Tabs__item--active {\n color: var(--brand-color-text-default);\n}\n\n.Tabs--underline .Tabs__item {\n padding: var(--base-size-8);\n\n border-radius: var(--brand-borderRadius-medium);\n}\n\n.Tabs--accent .Tabs__item {\n transition: color var(--brand-animation-duration-faster) ease;\n}\n\n.Tabs--accent .Tabs__item--active {\n color: var(--brand-Tabs-item-accent-fgColor-rest);\n}\n\n.Tabs__panelContainer {\n margin-
|
|
1
|
+
{"version":3,"file":"Tabs.module.js","names":[],"sources":["../../src/Tabs/Tabs.module.css"],"sourcesContent":[".Tabs {\n position: relative;\n display: flex;\n gap: var(--base-size-4);\n background-color: var(--brand-color-canvas-backdrop);\n border-radius: var(--brand-borderRadius-large);\n padding: var(--brand-Tabs-container-padding);\n width: fit-content;\n min-height: var(--base-size-48);\n}\n\n.Tabs-container {\n display: grid;\n}\n\n@media screen and (max-width: 48rem) {\n .Tabs-container {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n position: relative;\n }\n\n .Tabs-container--align-start {\n align-items: flex-start;\n }\n\n .Tabs-container--align-center {\n align-items: center;\n }\n\n .Tablist__wrapper {\n position: relative;\n width: fit-content;\n max-width: 100%;\n overflow: hidden;\n }\n\n .Tablist__wrapper::after {\n content: '';\n position: absolute;\n right: var(--brand-Tabs-list-borderWidth-active);\n top: var(--base-size-2);\n bottom: var(--base-size-2);\n background: linear-gradient(to left, var(--brand-color-canvas-default) 30%, transparent);\n width: var(--base-size-48);\n z-index: 2;\n pointer-events: none;\n transition: opacity var(--brand-animation-duration-default) var(--brand-animation-easing-default),\n visibility var(--brand-animation-duration-default) var(--brand-animation-easing-default);\n opacity: calc(var(--has-overflow, 0) * var(--can-scroll-right, 0));\n border-radius: inherit;\n }\n\n .Tablist__wrapper--default::after,\n .Tablist__wrapper--accent::after {\n border-radius: var(--brand-borderRadius-full);\n }\n\n .Tablist__wrapper--underline::after {\n border-radius: var(--brand-borderRadius-large);\n }\n\n .Tablist__wrapper--lastTabIsActive::after {\n opacity: 0;\n visibility: hidden;\n }\n\n .Tabs {\n max-width: 100%;\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none;\n -ms-overflow-style: none;\n }\n\n .Tabs::-webkit-scrollbar {\n display: none;\n }\n}\n\n.Tabs-container--align-start {\n justify-items: flex-start;\n}\n\n.Tabs-container--align-center {\n justify-items: center;\n}\n\n.Tabs--default,\n.Tabs--accent {\n border: var(--brand-Tabs-list-borderWidth-active) solid var(--brand-color-border-default);\n border-radius: var(--brand-borderRadius-full);\n}\n\n.Tabs--underline {\n gap: var(--base-size-24);\n}\n\n.Tabs__item {\n position: relative;\n z-index: 1;\n border: 0;\n background: transparent;\n cursor: pointer;\n padding: var(--base-size-8) var(--base-size-16);\n border-radius: var(--brand-borderRadius-full);\n transition: color var(--brand-animation-duration-fast) ease-in-out;\n white-space: nowrap;\n font-family: var(--brand-fontStack-sansSerif);\n font-weight: var(--brand-text-weight-600);\n font-size: var(--brand-text-size-200);\n line-height: var(--brand-text-lineHeight-200);\n letter-spacing: var(--brand-text-letterSpacing-200);\n color: var(--brand-color-text-default);\n}\n\n.Tabs__slider {\n position: absolute;\n top: var(--base-size-4);\n bottom: var(--base-size-4);\n transition: all var(--brand-animation-duration-fast) var(--brand-animation-easing-glide);\n z-index: 0;\n transform: translateX(var(--brand-Tabs-slider-x, 0px));\n width: var(--brand-Tabs-slider-width);\n}\n\n.Tabs--default .Tabs__slider {\n border-radius: var(--brand-borderRadius-full);\n border: var(--brand-borderWidth-thin) solid var(--brand-Tabs-item-default-borderColor-active);\n background: var(--brand-Tabs-item-default-bgColor-active);\n}\n\n.Tabs--accent .Tabs__slider {\n border-radius: var(--brand-borderRadius-full);\n border: var(--brand-borderWidth-thin) solid transparent;\n background: var(--brand-Tabs-item-accent-bgColor-rest);\n}\n\n.Tabs--underline .Tabs__slider {\n border-bottom: var(--brand-borderWidth-thick) solid var(--brand-Tabs-item-underline-rest);\n}\n\n.Tabs__item:focus-visible {\n outline: var(--base-size-2) solid var(--brand-color-focus);\n outline-offset: var(--base-size-2);\n}\n\n.Tabs__item--active {\n color: var(--brand-color-text-default);\n}\n\n.Tabs--underline .Tabs__item {\n padding: var(--base-size-8);\n\n border-radius: var(--brand-borderRadius-medium);\n}\n\n.Tabs--accent .Tabs__item {\n transition: color var(--brand-animation-duration-faster) ease;\n}\n\n.Tabs--accent .Tabs__item--active {\n color: var(--brand-Tabs-item-accent-fgColor-rest);\n}\n\n.Tabs__panelContainer {\n margin-block-start: var(--base-size-16);\n}\n\n.Tabs__panel {\n color: var(--brand-color-text-default);\n}\n\n.Tabs__controls {\n margin-block-end: var(--base-size-12);\n}\n\n@media screen and (min-width: 48rem) {\n .Tabs__controls {\n display: none;\n }\n\n .Tabs__item {\n padding-inline: var(--base-size-24);\n }\n}\n"],"mappings":""}
|
|
@@ -4,8 +4,8 @@ import type { AvatarProps } from '../';
|
|
|
4
4
|
import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/testimonial/base.css';
|
|
5
5
|
import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/testimonial/colors-with-modes.css';
|
|
6
6
|
type TestimonialSize = 'small' | 'large';
|
|
7
|
-
export declare const TestimonialQuoteMarkColors: readonly ["default", "blue", "coral", "green", "gray", "indigo", "lemon", "lime", "orange", "pink", "purple", "red", "teal", "yellow"
|
|
8
|
-
export declare const defaultQuoteMarkColor
|
|
7
|
+
export declare const TestimonialQuoteMarkColors: readonly ["default", "blue", "coral", "green", "gray", "indigo", "lemon", "lime", "orange", "pink", "purple", "red", "teal", "yellow"];
|
|
8
|
+
export declare const defaultQuoteMarkColor = "green";
|
|
9
9
|
export declare const TestimonialVariants: readonly ["subtle", "default", "minimal", "expressive"];
|
|
10
10
|
type TestimonialVariant = (typeof TestimonialVariants)[number];
|
|
11
11
|
export declare const defaultTestimonialVariant: TestimonialVariant;
|
|
@@ -28,6 +28,10 @@ export type TestimonialProps = {
|
|
|
28
28
|
size?: TestimonialSize;
|
|
29
29
|
/** Sets the color of the quote mark */
|
|
30
30
|
quoteMarkColor?: (typeof TestimonialQuoteMarkColors)[number];
|
|
31
|
+
/** Class applied to the quote mark. */
|
|
32
|
+
quoteMarkClassName?: string;
|
|
33
|
+
/** Class applied to the attribution wrapper. */
|
|
34
|
+
mediaClassName?: string;
|
|
31
35
|
} & BaseProps<HTMLElement> & React.HTMLAttributes<HTMLElement>;
|
|
32
36
|
/**
|
|
33
37
|
* Testimonial quote child element
|
|
@@ -52,7 +56,7 @@ type LogoProps = {
|
|
|
52
56
|
* Testimonial avatar child element
|
|
53
57
|
* <Testimonial.Avatar>
|
|
54
58
|
*/
|
|
55
|
-
declare function _Avatar({ size, ...rest }: AvatarProps): React.JSX.Element;
|
|
59
|
+
declare function _Avatar({ size, className, ...rest }: AvatarProps): React.JSX.Element;
|
|
56
60
|
/**
|
|
57
61
|
* Use Testimonial to display a quote from a customer or user.
|
|
58
62
|
* @see https://primer.style/brand/components/Testimonial
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Testimonial.d.ts","sourceRoot":"","sources":["../../src/Testimonial/Testimonial.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,cAAc,EAGd,QAAQ,EAGT,MAAM,OAAO,CAAA;AAEd,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAA;AAE9C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,KAAK,CAAA;AAIpC,OAAO,kGAAkG,CAAA;AACzG,OAAO,+GAA+G,CAAA;AAKtH,KAAK,eAAe,GAAG,OAAO,GAAG,OAAO,CAAA;AAExC,eAAO,MAAM,0BAA0B,
|
|
1
|
+
{"version":3,"file":"Testimonial.d.ts","sourceRoot":"","sources":["../../src/Testimonial/Testimonial.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,cAAc,EAGd,QAAQ,EAGT,MAAM,OAAO,CAAA;AAEd,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAA;AAE9C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,KAAK,CAAA;AAIpC,OAAO,kGAAkG,CAAA;AACzG,OAAO,+GAA+G,CAAA;AAKtH,KAAK,eAAe,GAAG,OAAO,GAAG,OAAO,CAAA;AAExC,eAAO,MAAM,0BAA0B,wIAAuB,CAAA;AAC9D,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