@primer/react-brand 0.71.0 → 0.71.1-rc.1b68fd40
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/Pagination/index.md +28 -10
- package/docs/index.md +2 -2
- package/esm/Pagination/Pagination.d.ts +7 -1
- package/esm/Pagination/Pagination.d.ts.map +1 -1
- package/esm/Pagination/Pagination.js +63 -50
- package/esm/Pagination/Pagination.js.map +1 -1
- package/lib/Pagination/Pagination.d.ts +7 -1
- package/lib/css/main.css +68 -68
- package/lib/design-tokens/css/tokens/base/colors/color-scales-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/base/colors/light.css +1 -1
- package/lib/design-tokens/css/tokens/base/size/size.css +1 -1
- package/lib/design-tokens/css/tokens/base/typography/typography.css +1 -1
- package/lib/design-tokens/css/tokens/functional/animation/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/colors/global-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/colors/global.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/accordion/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/action-menu/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/anchor-nav/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/bento/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/blinking-cursor/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/breadcrumbs/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/button/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/card/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/card/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/card/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/comparison-table/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/comparison-table/comparison-table.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/cta-banner/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/eyebrow-banner/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/eyebrow-banner/eyebrow-banner.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/faq/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/faq/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/faq/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/faq/faq.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/footer/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/footer/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/frosted-glass-vfx/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/frosted-glass-vfx/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/grid/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/grid/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/grid/grid.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/hero/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/icon/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/icon/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/ide/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/ide/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/image/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-link/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-link/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-link/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/label/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/label/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/link/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/link/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/logosuite/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/logosuite/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/logosuite/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/media-playlist/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/media-playlist/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/nav-list/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/pricing-options/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/pricing-options/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/pricing-options/pricing-options.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/prose/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/prose/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/river/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/river/river.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/river-story-scroll/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/section/section.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/statistic/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/sub-nav/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/sub-nav/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/subdomain-nav-bar/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tabs/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tabs/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tabs/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/testimonial/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/testimonial/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/testimonial/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tiles/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/timeline/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/timeline/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/timeline/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/token/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/token/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tooltip/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tooltip/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/video-player/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/video-player/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/border.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/breakpoints.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/size-coarse.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/size-fine.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/size.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/viewport.css +1 -1
- package/lib/design-tokens/css/tokens/functional/typography/typography-responsive.css +1 -1
- package/lib/design-tokens/css/tokens/functional/typography/typography.css +1 -1
- package/lib/design-tokens/js/module/tokens/base/colors/light.js +1 -1
- package/lib/design-tokens/js/module/tokens/base/size/size.js +1 -1
- package/lib/design-tokens/js/module/tokens/base/typography/typography.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/animation/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/colors/global.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/bento/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/card/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/card/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/comparison-table/comparison-table.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/eyebrow-banner/eyebrow-banner.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/faq/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/faq/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/faq/faq.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/footer/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/frosted-glass-vfx/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/grid/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/grid/grid.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/hero/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/icon/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/ide/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/image/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/inline-link/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/inline-link/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/label/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/link/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/logosuite/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/logosuite/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/media-playlist/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/pricing-options/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/pricing-options/pricing-options.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/prose/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/river/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/river/river.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/section/section.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/statistic/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/sub-nav/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/tabs/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/tabs/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/testimonial/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/testimonial/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/text-cursor-animation/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/timeline/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/timeline/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/token/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/tooltip/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/video-player/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/border.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/breakpoints.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/size-coarse.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/size-fine.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/size.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/viewport.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/typography/typography-responsive.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/typography/typography.js +1 -1
- package/lib/design-tokens/js/tokens/base/colors/light.js +1 -1
- package/lib/design-tokens/js/tokens/base/size/size.js +1 -1
- package/lib/design-tokens/js/tokens/base/typography/typography.js +1 -1
- package/lib/design-tokens/js/tokens/functional/animation/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/colors/global.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/bento/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/card/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/card/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/comparison-table/comparison-table.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/eyebrow-banner/eyebrow-banner.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/faq/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/faq/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/faq/faq.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/footer/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/frosted-glass-vfx/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/grid/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/grid/grid.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/hero/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/icon/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/ide/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/image/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/inline-link/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/inline-link/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/label/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/link/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/logosuite/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/logosuite/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/media-playlist/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/pricing-options/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/pricing-options/pricing-options.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/prose/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/river/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/river/river.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/section/section.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/statistic/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/sub-nav/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/tabs/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/tabs/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/testimonial/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/testimonial/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/text-cursor-animation/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/timeline/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/timeline/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/token/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/tooltip/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/video-player/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/border.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/breakpoints.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/size-coarse.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/size-fine.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/size.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/viewport.js +1 -1
- package/lib/design-tokens/js/tokens/functional/typography/typography-responsive.js +1 -1
- package/lib/design-tokens/js/tokens/functional/typography/typography.js +1 -1
- package/lib/design-tokens/scss/tokens/base/colors/light.scss +1 -1
- package/lib/design-tokens/scss/tokens/base/size/size.scss +1 -1
- package/lib/design-tokens/scss/tokens/base/typography/typography.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/animation/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/colors/global.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/bento/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/card/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/card/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/comparison-table/comparison-table.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/eyebrow-banner/eyebrow-banner.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/faq/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/faq/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/faq/faq.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/footer/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/frosted-glass-vfx/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/grid/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/grid/grid.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/hero/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/icon/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/ide/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/image/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/inline-link/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/inline-link/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/label/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/link/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/logosuite/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/logosuite/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/media-playlist/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/pricing-options/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/pricing-options/pricing-options.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/prose/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/river/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/river/river.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/section/section.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/statistic/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/sub-nav/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/tabs/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/tabs/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/testimonial/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/testimonial/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/text-cursor-animation/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/timeline/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/timeline/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/token/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/tooltip/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/video-player/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/size/border.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/size/breakpoints.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/size/size-coarse.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/size/size-fine.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/size/size.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/size/viewport.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/typography/typography-responsive.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/typography/typography.scss +1 -1
- package/lib/design-tokens/ts/tokens/base/colors/light.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/base/colors/light.js +1 -1
- package/lib/design-tokens/ts/tokens/base/size/size.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/base/size/size.js +1 -1
- package/lib/design-tokens/ts/tokens/base/typography/typography.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/base/typography/typography.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/animation/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/animation/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/colors/global.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/colors/global.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/bento/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/bento/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/card/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/card/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/card/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/card/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/comparison-table/comparison-table.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/comparison-table/comparison-table.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/eyebrow-banner/eyebrow-banner.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/eyebrow-banner/eyebrow-banner.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/faq.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/faq.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/footer/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/footer/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/frosted-glass-vfx/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/frosted-glass-vfx/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/grid/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/grid/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/grid/grid.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/grid/grid.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/hero/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/hero/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/icon/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/icon/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/ide/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/ide/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/image/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/image/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-link/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-link/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-link/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-link/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/label/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/label/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/link/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/link/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/logosuite/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/logosuite/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/logosuite/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/logosuite/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/media-playlist/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/media-playlist/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/pricing-options/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/pricing-options/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/pricing-options/pricing-options.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/pricing-options/pricing-options.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/prose/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/prose/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/river/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/river/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/river/river.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/river/river.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/section/section.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/section/section.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/statistic/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/statistic/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/sub-nav/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/sub-nav/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tabs/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tabs/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tabs/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tabs/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/testimonial/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/testimonial/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/testimonial/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/testimonial/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/text-cursor-animation/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/text-cursor-animation/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/timeline/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/timeline/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/timeline/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/timeline/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/token/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/token/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tooltip/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tooltip/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/video-player/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/video-player/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/border.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/border.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/breakpoints.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/breakpoints.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size-coarse.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size-coarse.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size-fine.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size-fine.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/viewport.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/viewport.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/typography/typography-responsive.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/typography/typography-responsive.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/typography/typography.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/typography/typography.js +1 -1
- package/lib/index.js +1 -1
- package/llms.txt +2 -2
- package/package.json +1 -1
|
@@ -64,17 +64,35 @@ render(<App />)
|
|
|
64
64
|
/>
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
+
### Custom button labels
|
|
68
|
+
|
|
69
|
+
Use the `labels` prop to customize the visible text of the previous and next controls. When localizing content, remember to also set the matching `prevAriaLabel` and `nextAriaLabel` labels so that the accessible names stay in sync with the visible text.
|
|
70
|
+
|
|
71
|
+
```jsx
|
|
72
|
+
<Pagination
|
|
73
|
+
pageCount={3}
|
|
74
|
+
currentPage={2}
|
|
75
|
+
labels={{
|
|
76
|
+
prev: 'Précédent',
|
|
77
|
+
next: 'Suivant',
|
|
78
|
+
prevAriaLabel: 'Page précédente',
|
|
79
|
+
nextAriaLabel: 'Page suivante',
|
|
80
|
+
}}
|
|
81
|
+
/>
|
|
82
|
+
```
|
|
83
|
+
|
|
67
84
|
## Component props
|
|
68
85
|
|
|
69
86
|
### Pagination `Required`
|
|
70
87
|
|
|
71
|
-
| name | type
|
|
72
|
-
| ----------------------- |
|
|
73
|
-
| `pageCount` | `number`
|
|
74
|
-
| `currentPage` | `number`
|
|
75
|
-
| `onPageChange` | `(e: React.MouseEvent, n: number) => void`
|
|
76
|
-
| `hrefBuilder` | `(n: number) => string`
|
|
77
|
-
| `pageAttributesBuilder` | `(n: number, page: PaginationPageType) => {[attributeName: string]: string}`
|
|
78
|
-
| `marginPageCount` | `number`
|
|
79
|
-
| `showPages` | `boolean`
|
|
80
|
-
| `surroundingPageCount` | `number`
|
|
88
|
+
| name | type | default | required | description |
|
|
89
|
+
| ----------------------- | -------------------------------------------------------------------------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------- |
|
|
90
|
+
| `pageCount` | `number` | | `true` | The total number of pages |
|
|
91
|
+
| `currentPage` | `number` | | `true` | The current page number |
|
|
92
|
+
| `onPageChange` | `(e: React.MouseEvent, n: number) => void` | | `false` | Callback function for when the page changes |
|
|
93
|
+
| `hrefBuilder` | `(n: number) => string` | | `false` | Function to build the href for each page |
|
|
94
|
+
| `pageAttributesBuilder` | `(n: number, page: PaginationPageType) => {[attributeName: string]: string}` | | `false` | Forward custom attributes to pagination items. |
|
|
95
|
+
| `marginPageCount` | `number` | | `false` | Defines how many pages are to be displayed on the left and right of the component. Will be reduced on narrow viewports. |
|
|
96
|
+
| `showPages` | `boolean` | | `false` | Whether to show the page numbers |
|
|
97
|
+
| `surroundingPageCount` | `number` | | `false` | The number of pages to show on each side of the current page. Will be hidden on narrow viewports. |
|
|
98
|
+
| `labels` | `{prev?: string; next?: string; prevAriaLabel?: string; nextAriaLabel?: string}` | | `false` | Custom text and accessible labels for the previous and next controls. Provide any subset. |
|
package/docs/index.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Primer Brand docs (v0.71.
|
|
1
|
+
# Primer Brand docs (v0.71.1-rc.1b68fd40)
|
|
2
2
|
|
|
3
|
-
These docs are bundled with `@primer/react-brand@0.71.
|
|
3
|
+
These docs are bundled with `@primer/react-brand@0.71.1-rc.1b68fd40` and match your installed version.
|
|
4
4
|
|
|
5
5
|
New here? Start with [Getting started](getting-started/index.md) for installation, global
|
|
6
6
|
stylesheet and font setup. Component directories are named after their import (e.g.
|
|
@@ -11,11 +11,17 @@ export type PaginationProps = {
|
|
|
11
11
|
marginPageCount?: number;
|
|
12
12
|
showPages?: boolean;
|
|
13
13
|
surroundingPageCount?: number;
|
|
14
|
+
labels?: {
|
|
15
|
+
prev?: string;
|
|
16
|
+
next?: string;
|
|
17
|
+
prevAriaLabel?: string;
|
|
18
|
+
nextAriaLabel?: string;
|
|
19
|
+
};
|
|
14
20
|
'data-testid'?: string;
|
|
15
21
|
} & Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>;
|
|
16
22
|
/**
|
|
17
23
|
* Use Pagination to display a sequence of links that allow navigation to discrete, related pages.
|
|
18
24
|
* @see https://primer.style/brand/components/Pagination
|
|
19
25
|
*/
|
|
20
|
-
export declare const Pagination: React.MemoExoticComponent<({ id, className, pageCount, currentPage, onPageChange, hrefBuilder, pageAttributesBuilder, marginPageCount, showPages, surroundingPageCount, "aria-label": ariaLabel, "data-testid": testId, ...rest }: PaginationProps) => import("react/jsx-runtime").JSX.Element>;
|
|
26
|
+
export declare const Pagination: React.MemoExoticComponent<({ id, className, pageCount, currentPage, onPageChange, hrefBuilder, pageAttributesBuilder, marginPageCount, showPages, surroundingPageCount, labels, "aria-label": ariaLabel, "data-testid": testId, ...rest }: PaginationProps) => import("react/jsx-runtime").JSX.Element>;
|
|
21
27
|
//# sourceMappingURL=Pagination.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../src/Pagination/Pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAA;AAM9C,OAAO,EAAuB,kBAAkB,EAAC,MAAM,SAAS,CAAA;AAKhE,MAAM,MAAM,eAAe,GAAG;IAE5B,SAAS,EAAE,MAAM,CAAA;IAEjB,WAAW,EAAE,MAAM,CAAA;IAEnB,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAEvD,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IAEnC,qBAAqB,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,KAAK;QAAC,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAAA;KAAC,CAAA;IAElG,eAAe,CAAC,EAAE,MAAM,CAAA;IAExB,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB,oBAAoB,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../src/Pagination/Pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAA;AAM9C,OAAO,EAAuB,kBAAkB,EAAC,MAAM,SAAS,CAAA;AAKhE,MAAM,MAAM,eAAe,GAAG;IAE5B,SAAS,EAAE,MAAM,CAAA;IAEjB,WAAW,EAAE,MAAM,CAAA;IAEnB,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAEvD,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IAEnC,qBAAqB,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,KAAK;QAAC,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAAA;KAAC,CAAA;IAElG,eAAe,CAAC,EAAE,MAAM,CAAA;IAExB,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAE7B,MAAM,CAAC,EAAE;QACP,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,aAAa,CAAC,EAAE,MAAM,CAAA;QACtB,aAAa,CAAC,EAAE,MAAM,CAAA;KACvB,CAAA;IACD,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,CAAA;AAS1D;;;GAGG;AACH,eAAO,MAAM,UAAU,6OAgBlB,eAAe,6CAsEnB,CAAA"}
|
|
@@ -7,59 +7,72 @@ import a from "./Pagination.module.js";
|
|
|
7
7
|
import o, { memo as s, useCallback as c } from "react";
|
|
8
8
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
9
|
//#region src/Pagination/Pagination.tsx
|
|
10
|
-
var d =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
var d = {
|
|
11
|
+
prev: "Previous",
|
|
12
|
+
next: "Next",
|
|
13
|
+
prevAriaLabel: "Previous Page",
|
|
14
|
+
nextAriaLabel: "Next Page"
|
|
15
|
+
}, f = s(({ id: t, className: n, pageCount: s, currentPage: u, onPageChange: f, hrefBuilder: h = m, pageAttributesBuilder: g, marginPageCount: _ = 1, showPages: v = !0, surroundingPageCount: y = 2, labels: b, "aria-label": x, "data-testid": S, ...C }) => {
|
|
16
|
+
let { width: w } = r();
|
|
17
|
+
w && w < 768 && (_ = 1, y = 0);
|
|
18
|
+
let T = b?.prev ?? d.prev, E = b?.next ?? d.next, D = b?.prevAriaLabel ?? d.prevAriaLabel, O = b?.nextAriaLabel ?? d.nextAriaLabel, k = o.useRef(null), A = c((e) => (t) => {
|
|
19
|
+
f && f(t, e);
|
|
20
|
+
}, [f]), j = o.useMemo(() => i(s, u, v, _, y).map((e) => /* @__PURE__ */ l(p, {
|
|
16
21
|
page: e,
|
|
17
|
-
hrefBuilder:
|
|
18
|
-
pageAttributesBuilder:
|
|
19
|
-
|
|
22
|
+
hrefBuilder: h,
|
|
23
|
+
pageAttributesBuilder: g,
|
|
24
|
+
prevLabel: T,
|
|
25
|
+
nextLabel: E,
|
|
26
|
+
prevAriaLabel: D,
|
|
27
|
+
nextAriaLabel: O,
|
|
28
|
+
onClick: A(e.num)
|
|
20
29
|
}, `${e.type}-${e.num}`)), [
|
|
21
30
|
s,
|
|
22
31
|
u,
|
|
23
|
-
_,
|
|
24
|
-
g,
|
|
25
32
|
v,
|
|
26
|
-
|
|
33
|
+
_,
|
|
34
|
+
y,
|
|
27
35
|
h,
|
|
28
|
-
|
|
36
|
+
g,
|
|
37
|
+
T,
|
|
38
|
+
E,
|
|
39
|
+
D,
|
|
40
|
+
O,
|
|
41
|
+
A
|
|
29
42
|
]);
|
|
30
43
|
return /* @__PURE__ */ l("nav", {
|
|
31
|
-
ref:
|
|
44
|
+
ref: k,
|
|
32
45
|
id: t,
|
|
33
46
|
className: e(a.Pagination, n),
|
|
34
|
-
"data-testid":
|
|
35
|
-
"aria-label":
|
|
36
|
-
...
|
|
47
|
+
"data-testid": S,
|
|
48
|
+
"aria-label": x || "Pagination",
|
|
49
|
+
...C,
|
|
37
50
|
children: /* @__PURE__ */ l("div", {
|
|
38
51
|
className: e(a.Pagination__inner),
|
|
39
|
-
children:
|
|
52
|
+
children: j
|
|
40
53
|
})
|
|
41
54
|
});
|
|
42
|
-
}),
|
|
43
|
-
let [
|
|
55
|
+
}), p = ({ page: r, hrefBuilder: i, pageAttributesBuilder: s, prevLabel: c, nextLabel: d, prevAriaLabel: f, nextAriaLabel: p, onClick: m }) => {
|
|
56
|
+
let [h, g] = o.useState(!1), _ = {
|
|
44
57
|
role: "button",
|
|
45
58
|
size: "small",
|
|
46
59
|
variant: "subtle",
|
|
47
|
-
onClick: r.disabled ? void 0 :
|
|
48
|
-
}, { className:
|
|
60
|
+
onClick: r.disabled ? void 0 : m
|
|
61
|
+
}, { className: v, ...y } = s?.(r.num, r) ?? {};
|
|
49
62
|
switch (r.type) {
|
|
50
63
|
case "PREV": return /* @__PURE__ */ l(n, {
|
|
51
|
-
...
|
|
64
|
+
..._,
|
|
52
65
|
as: "a",
|
|
53
66
|
rel: "prev",
|
|
54
67
|
href: r.disabled ? void 0 : i(r.num),
|
|
55
68
|
"aria-disabled": r.disabled || void 0,
|
|
56
|
-
"aria-label":
|
|
57
|
-
...
|
|
58
|
-
className: e(a.Pagination__controlItem,
|
|
59
|
-
onMouseEnter: () =>
|
|
60
|
-
onMouseLeave: () =>
|
|
61
|
-
onFocus: () =>
|
|
62
|
-
onBlur: () =>
|
|
69
|
+
"aria-label": f,
|
|
70
|
+
...y,
|
|
71
|
+
className: e(a.Pagination__controlItem, v),
|
|
72
|
+
onMouseEnter: () => g(!0),
|
|
73
|
+
onMouseLeave: () => g(!1),
|
|
74
|
+
onFocus: () => g(!0),
|
|
75
|
+
onBlur: () => g(!1),
|
|
63
76
|
children: /* @__PURE__ */ u("span", {
|
|
64
77
|
className: a.Pagination__controlContent,
|
|
65
78
|
children: [/* @__PURE__ */ l("span", {
|
|
@@ -67,71 +80,71 @@ var d = s(({ id: t, className: n, pageCount: s, currentPage: u, onPageChange: d,
|
|
|
67
80
|
children: /* @__PURE__ */ l(t, {
|
|
68
81
|
hidden: !0,
|
|
69
82
|
reverse: !0,
|
|
70
|
-
expanded: !r.disabled &&
|
|
83
|
+
expanded: !r.disabled && h,
|
|
71
84
|
className: a.Pagination__controlArrow
|
|
72
85
|
})
|
|
73
86
|
}), /* @__PURE__ */ l("span", {
|
|
74
87
|
className: a.Pagination__controlText,
|
|
75
|
-
children:
|
|
88
|
+
children: c
|
|
76
89
|
})]
|
|
77
90
|
})
|
|
78
91
|
});
|
|
79
92
|
case "NEXT": return /* @__PURE__ */ l(n, {
|
|
80
|
-
...
|
|
93
|
+
..._,
|
|
81
94
|
as: "a",
|
|
82
95
|
rel: "next",
|
|
83
96
|
href: r.disabled ? void 0 : i(r.num),
|
|
84
97
|
"aria-disabled": r.disabled || void 0,
|
|
85
|
-
"aria-label":
|
|
86
|
-
...
|
|
87
|
-
className: e(a.Pagination__controlItem,
|
|
88
|
-
onMouseEnter: () =>
|
|
89
|
-
onMouseLeave: () =>
|
|
90
|
-
onFocus: () =>
|
|
91
|
-
onBlur: () =>
|
|
98
|
+
"aria-label": p,
|
|
99
|
+
...y,
|
|
100
|
+
className: e(a.Pagination__controlItem, v),
|
|
101
|
+
onMouseEnter: () => g(!0),
|
|
102
|
+
onMouseLeave: () => g(!1),
|
|
103
|
+
onFocus: () => g(!0),
|
|
104
|
+
onBlur: () => g(!1),
|
|
92
105
|
children: /* @__PURE__ */ u("span", {
|
|
93
106
|
className: a.Pagination__controlContent,
|
|
94
107
|
children: [/* @__PURE__ */ l("span", {
|
|
95
108
|
className: a.Pagination__controlText,
|
|
96
|
-
children:
|
|
109
|
+
children: d
|
|
97
110
|
}), /* @__PURE__ */ l("span", {
|
|
98
111
|
className: e(a.Pagination__controlArrowWrapper, a["Pagination__controlArrowWrapper--next"]),
|
|
99
112
|
children: /* @__PURE__ */ l(t, {
|
|
100
113
|
hidden: !0,
|
|
101
|
-
expanded: !r.disabled &&
|
|
114
|
+
expanded: !r.disabled && h,
|
|
102
115
|
className: a.Pagination__controlArrow
|
|
103
116
|
})
|
|
104
117
|
})]
|
|
105
118
|
})
|
|
106
119
|
});
|
|
107
120
|
case "NUM": return /* @__PURE__ */ l(n, {
|
|
108
|
-
...
|
|
121
|
+
..._,
|
|
109
122
|
as: "a",
|
|
110
123
|
variant: r.selected ? "primary" : "subtle",
|
|
111
|
-
className: e(a.Pagination__pageItem,
|
|
124
|
+
className: e(a.Pagination__pageItem, v),
|
|
112
125
|
href: i(r.num),
|
|
113
126
|
"aria-label": `Page ${r.num}${r.precedesBreak ? "..." : ""}`,
|
|
114
127
|
"aria-current": r.selected ? "page" : void 0,
|
|
115
|
-
...
|
|
128
|
+
...y,
|
|
116
129
|
children: r.num
|
|
117
130
|
});
|
|
118
131
|
case "BREAK": return /* @__PURE__ */ l(n, {
|
|
119
|
-
...
|
|
132
|
+
..._,
|
|
120
133
|
as: "a",
|
|
121
|
-
className: e(a.Pagination__pageItem,
|
|
134
|
+
className: e(a.Pagination__pageItem, v),
|
|
122
135
|
variant: "subtle",
|
|
123
136
|
role: "presentation",
|
|
124
137
|
href: void 0,
|
|
125
138
|
onClick: void 0,
|
|
126
|
-
...
|
|
139
|
+
...y,
|
|
127
140
|
children: "…"
|
|
128
141
|
});
|
|
129
142
|
}
|
|
130
143
|
};
|
|
131
|
-
function
|
|
144
|
+
function m(e) {
|
|
132
145
|
return `#${e}`;
|
|
133
146
|
}
|
|
134
147
|
//#endregion
|
|
135
|
-
export {
|
|
148
|
+
export { f as Pagination };
|
|
136
149
|
|
|
137
150
|
//# sourceMappingURL=Pagination.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.js","names":[],"sources":["../../src/Pagination/Pagination.tsx"],"sourcesContent":["import React, {memo, useCallback} from 'react'\nimport {Button, useWindowSize} from '..'\n\nimport {clsx} from 'clsx'\n\nimport {ExpandableArrow} from '../ExpandableArrow'\nimport {buildPaginationModel, PaginationPageType} from './model'\n\n/** * Main Stylesheet (as a CSS Module) */\nimport styles from './Pagination.module.css'\n\nexport type PaginationProps = {\n /* The total number of pages */\n pageCount: number\n /* The current page number */\n currentPage: number\n /* Callback function for when the page changes */\n onPageChange?: (e: React.MouseEvent, n: number) => void\n /* Function to build the href for each page */\n hrefBuilder?: (n: number) => string\n /* Function to forward custom attributes for each pagination item */\n pageAttributesBuilder?: (n: number, page: PaginationPageType) => {[attributeName: string]: string}\n /* Defines how many pages are to be displayed on the left and right of the component */\n marginPageCount?: number\n /* Whether to show the page numbers */\n showPages?: boolean\n /* The number of pages to show on each side of the current page */\n surroundingPageCount?: number\n 'data-testid'?: string\n} & Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>\n\n/**\n * Use Pagination to display a sequence of links that allow navigation to discrete, related pages.\n * @see https://primer.style/brand/components/Pagination\n */\nexport const Pagination = memo(\n ({\n id,\n className,\n pageCount,\n currentPage,\n onPageChange,\n hrefBuilder = defaultHrefBuilder,\n pageAttributesBuilder,\n marginPageCount = 1,\n showPages = true,\n surroundingPageCount = 2,\n 'aria-label': ariaLabel,\n 'data-testid': testId,\n ...rest\n }: PaginationProps) => {\n // On mobile, limit the number of visible numbers\n const {width} = useWindowSize()\n if (width && width < 768) {\n marginPageCount = 1\n surroundingPageCount = 0\n }\n\n const navRef = React.useRef<HTMLElement>(null)\n\n const pageChange = useCallback(\n (n: number) => (e: React.MouseEvent) => {\n if (onPageChange) {\n onPageChange(e, n)\n }\n },\n [onPageChange],\n )\n\n const paginationItems = React.useMemo(() => {\n const model = buildPaginationModel(pageCount, currentPage, showPages, marginPageCount, surroundingPageCount)\n\n return model.map(page => {\n return (\n <PaginationItem\n key={`${page.type}-${page.num}`}\n page={page}\n hrefBuilder={hrefBuilder}\n pageAttributesBuilder={pageAttributesBuilder}\n onClick={pageChange(page.num)}\n />\n )\n })\n }, [\n pageCount,\n currentPage,\n showPages,\n marginPageCount,\n surroundingPageCount,\n hrefBuilder,\n pageAttributesBuilder,\n pageChange,\n ])\n\n return (\n <nav\n ref={navRef}\n id={id}\n className={clsx(styles.Pagination, className)}\n data-testid={testId}\n aria-label={ariaLabel || 'Pagination'}\n {...rest}\n >\n <div className={clsx(styles.Pagination__inner)}>{paginationItems}</div>\n </nav>\n )\n },\n)\n\ntype PaginationItemProps = {\n page: PaginationPageType\n hrefBuilder: (n: number) => string\n pageAttributesBuilder?: (n: number, page: PaginationPageType) => {[key: string]: string}\n onClick?: React.MouseEventHandler<HTMLAnchorElement>\n}\n\nconst PaginationItem = ({page, hrefBuilder, pageAttributesBuilder, onClick}: PaginationItemProps) => {\n const [isArrowExpanded, setIsArrowExpanded] = React.useState(false)\n\n const baseProps = {\n role: 'button',\n size: 'small' as const,\n variant: 'subtle' as const,\n onClick: page.disabled ? undefined : onClick,\n }\n\n const customProps = pageAttributesBuilder?.(page.num, page)\n const {className: customClassName, ...customAttributes} = customProps ?? {}\n\n switch (page.type) {\n case 'PREV': {\n return (\n <Button\n {...baseProps}\n as=\"a\"\n rel=\"prev\"\n href={page.disabled ? undefined : hrefBuilder(page.num)}\n aria-disabled={page.disabled || undefined}\n aria-label=\"Previous Page\"\n {...customAttributes}\n className={clsx(styles.Pagination__controlItem, customClassName)}\n onMouseEnter={() => setIsArrowExpanded(true)}\n onMouseLeave={() => setIsArrowExpanded(false)}\n onFocus={() => setIsArrowExpanded(true)}\n onBlur={() => setIsArrowExpanded(false)}\n >\n <span className={styles.Pagination__controlContent}>\n <span\n className={clsx(\n styles.Pagination__controlArrowWrapper,\n styles['Pagination__controlArrowWrapper--previous'],\n )}\n >\n <ExpandableArrow\n hidden\n reverse\n expanded={!page.disabled && isArrowExpanded}\n className={styles.Pagination__controlArrow}\n />\n </span>\n <span className={styles.Pagination__controlText}>Previous</span>\n </span>\n </Button>\n )\n }\n case 'NEXT': {\n return (\n <Button\n {...baseProps}\n as=\"a\"\n rel=\"next\"\n href={page.disabled ? undefined : hrefBuilder(page.num)}\n aria-disabled={page.disabled || undefined}\n aria-label=\"Next Page\"\n {...customAttributes}\n className={clsx(styles.Pagination__controlItem, customClassName)}\n onMouseEnter={() => setIsArrowExpanded(true)}\n onMouseLeave={() => setIsArrowExpanded(false)}\n onFocus={() => setIsArrowExpanded(true)}\n onBlur={() => setIsArrowExpanded(false)}\n >\n <span className={styles.Pagination__controlContent}>\n <span className={styles.Pagination__controlText}>Next</span>\n <span\n className={clsx(styles.Pagination__controlArrowWrapper, styles['Pagination__controlArrowWrapper--next'])}\n >\n <ExpandableArrow\n hidden\n expanded={!page.disabled && isArrowExpanded}\n className={styles.Pagination__controlArrow}\n />\n </span>\n </span>\n </Button>\n )\n }\n case 'NUM': {\n return (\n /**\n * Append \"...\" to the aria-label for pages that precede a break because screen readers will change the\n * tone the text is read in. This is a slightly nicer experience than skipping a bunch of numbers unexpectedly.\n */\n <Button\n {...baseProps}\n as=\"a\"\n variant={page.selected ? 'primary' : 'subtle'}\n className={clsx(styles.Pagination__pageItem, customClassName)}\n href={hrefBuilder(page.num)}\n aria-label={`Page ${page.num}${page.precedesBreak ? '...' : ''}`}\n aria-current={page.selected ? 'page' : undefined}\n {...customAttributes}\n >\n {page.num}\n </Button>\n )\n }\n case 'BREAK': {\n return (\n <Button\n {...baseProps}\n as=\"a\"\n className={clsx(styles.Pagination__pageItem, customClassName)}\n variant=\"subtle\"\n role=\"presentation\"\n href={undefined}\n onClick={undefined}\n {...customAttributes}\n >\n …\n </Button>\n )\n }\n }\n}\n\nfunction defaultHrefBuilder(pageNum: number) {\n return `#${pageNum}`\n}\n"],"mappings":";;;;;;;;;AAmCA,IAAa,IAAa,GACvB,EACC,OACA,cACA,cACA,gBACA,iBACA,iBAAc,GACd,0BACA,qBAAkB,GAClB,eAAY,IACZ,0BAAuB,GACvB,cAAc,GACd,eAAe,GACf,GAAG,QACkB;CAErB,IAAM,EAAC,aAAS,GAAe;AAC/B,CAAI,KAAS,IAAQ,QACnB,IAAkB,GAClB,IAAuB;CAGzB,IAAM,IAAS,EAAM,OAAoB,KAAK,EAExC,IAAa,GAChB,OAAe,MAAwB;AACtC,EAAI,KACF,EAAa,GAAG,EAAE;IAGtB,CAAC,EAAa,CACf,EAEK,IAAkB,EAAM,cACd,EAAqB,GAAW,GAAa,GAAW,GAAiB,EAEhF,CAAM,KAAI,MAEb,kBAAC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tsx"],"sourcesContent":["import React, {memo, useCallback} from 'react'\nimport {Button, useWindowSize} from '..'\n\nimport {clsx} from 'clsx'\n\nimport {ExpandableArrow} from '../ExpandableArrow'\nimport {buildPaginationModel, PaginationPageType} from './model'\n\n/** * Main Stylesheet (as a CSS Module) */\nimport styles from './Pagination.module.css'\n\nexport type PaginationProps = {\n /* The total number of pages */\n pageCount: number\n /* The current page number */\n currentPage: number\n /* Callback function for when the page changes */\n onPageChange?: (e: React.MouseEvent, n: number) => void\n /* Function to build the href for each page */\n hrefBuilder?: (n: number) => string\n /* Function to forward custom attributes for each pagination item */\n pageAttributesBuilder?: (n: number, page: PaginationPageType) => {[attributeName: string]: string}\n /* Defines how many pages are to be displayed on the left and right of the component */\n marginPageCount?: number\n /* Whether to show the page numbers */\n showPages?: boolean\n /* The number of pages to show on each side of the current page */\n surroundingPageCount?: number\n /* Custom text labels for the pagination controls. Use for localization. */\n labels?: {\n prev?: string\n next?: string\n prevAriaLabel?: string\n nextAriaLabel?: string\n }\n 'data-testid'?: string\n} & Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>\n\nconst defaultPaginationLabels = {\n prev: 'Previous',\n next: 'Next',\n prevAriaLabel: 'Previous Page',\n nextAriaLabel: 'Next Page',\n}\n\n/**\n * Use Pagination to display a sequence of links that allow navigation to discrete, related pages.\n * @see https://primer.style/brand/components/Pagination\n */\nexport const Pagination = memo(\n ({\n id,\n className,\n pageCount,\n currentPage,\n onPageChange,\n hrefBuilder = defaultHrefBuilder,\n pageAttributesBuilder,\n marginPageCount = 1,\n showPages = true,\n surroundingPageCount = 2,\n labels,\n 'aria-label': ariaLabel,\n 'data-testid': testId,\n ...rest\n }: PaginationProps) => {\n // On mobile, limit the number of visible numbers\n const {width} = useWindowSize()\n if (width && width < 768) {\n marginPageCount = 1\n surroundingPageCount = 0\n }\n\n const prevLabel = labels?.prev ?? defaultPaginationLabels.prev\n const nextLabel = labels?.next ?? defaultPaginationLabels.next\n const prevAriaLabel = labels?.prevAriaLabel ?? defaultPaginationLabels.prevAriaLabel\n const nextAriaLabel = labels?.nextAriaLabel ?? defaultPaginationLabels.nextAriaLabel\n\n const navRef = React.useRef<HTMLElement>(null)\n\n const pageChange = useCallback(\n (n: number) => (e: React.MouseEvent) => {\n if (onPageChange) {\n onPageChange(e, n)\n }\n },\n [onPageChange],\n )\n\n const paginationItems = React.useMemo(() => {\n const model = buildPaginationModel(pageCount, currentPage, showPages, marginPageCount, surroundingPageCount)\n\n return model.map(page => {\n return (\n <PaginationItem\n key={`${page.type}-${page.num}`}\n page={page}\n hrefBuilder={hrefBuilder}\n pageAttributesBuilder={pageAttributesBuilder}\n prevLabel={prevLabel}\n nextLabel={nextLabel}\n prevAriaLabel={prevAriaLabel}\n nextAriaLabel={nextAriaLabel}\n onClick={pageChange(page.num)}\n />\n )\n })\n }, [\n pageCount,\n currentPage,\n showPages,\n marginPageCount,\n surroundingPageCount,\n hrefBuilder,\n pageAttributesBuilder,\n prevLabel,\n nextLabel,\n prevAriaLabel,\n nextAriaLabel,\n pageChange,\n ])\n\n return (\n <nav\n ref={navRef}\n id={id}\n className={clsx(styles.Pagination, className)}\n data-testid={testId}\n aria-label={ariaLabel || 'Pagination'}\n {...rest}\n >\n <div className={clsx(styles.Pagination__inner)}>{paginationItems}</div>\n </nav>\n )\n },\n)\n\ntype PaginationItemProps = {\n page: PaginationPageType\n hrefBuilder: (n: number) => string\n pageAttributesBuilder?: (n: number, page: PaginationPageType) => {[key: string]: string}\n prevLabel: string\n nextLabel: string\n prevAriaLabel: string\n nextAriaLabel: string\n onClick?: React.MouseEventHandler<HTMLAnchorElement>\n}\n\nconst PaginationItem = ({\n page,\n hrefBuilder,\n pageAttributesBuilder,\n prevLabel,\n nextLabel,\n prevAriaLabel,\n nextAriaLabel,\n onClick,\n}: PaginationItemProps) => {\n const [isArrowExpanded, setIsArrowExpanded] = React.useState(false)\n\n const baseProps = {\n role: 'button',\n size: 'small' as const,\n variant: 'subtle' as const,\n onClick: page.disabled ? undefined : onClick,\n }\n\n const customProps = pageAttributesBuilder?.(page.num, page)\n const {className: customClassName, ...customAttributes} = customProps ?? {}\n\n switch (page.type) {\n case 'PREV': {\n return (\n <Button\n {...baseProps}\n as=\"a\"\n rel=\"prev\"\n href={page.disabled ? undefined : hrefBuilder(page.num)}\n aria-disabled={page.disabled || undefined}\n aria-label={prevAriaLabel}\n {...customAttributes}\n className={clsx(styles.Pagination__controlItem, customClassName)}\n onMouseEnter={() => setIsArrowExpanded(true)}\n onMouseLeave={() => setIsArrowExpanded(false)}\n onFocus={() => setIsArrowExpanded(true)}\n onBlur={() => setIsArrowExpanded(false)}\n >\n <span className={styles.Pagination__controlContent}>\n <span\n className={clsx(\n styles.Pagination__controlArrowWrapper,\n styles['Pagination__controlArrowWrapper--previous'],\n )}\n >\n <ExpandableArrow\n hidden\n reverse\n expanded={!page.disabled && isArrowExpanded}\n className={styles.Pagination__controlArrow}\n />\n </span>\n <span className={styles.Pagination__controlText}>{prevLabel}</span>\n </span>\n </Button>\n )\n }\n case 'NEXT': {\n return (\n <Button\n {...baseProps}\n as=\"a\"\n rel=\"next\"\n href={page.disabled ? undefined : hrefBuilder(page.num)}\n aria-disabled={page.disabled || undefined}\n aria-label={nextAriaLabel}\n {...customAttributes}\n className={clsx(styles.Pagination__controlItem, customClassName)}\n onMouseEnter={() => setIsArrowExpanded(true)}\n onMouseLeave={() => setIsArrowExpanded(false)}\n onFocus={() => setIsArrowExpanded(true)}\n onBlur={() => setIsArrowExpanded(false)}\n >\n <span className={styles.Pagination__controlContent}>\n <span className={styles.Pagination__controlText}>{nextLabel}</span>\n <span\n className={clsx(styles.Pagination__controlArrowWrapper, styles['Pagination__controlArrowWrapper--next'])}\n >\n <ExpandableArrow\n hidden\n expanded={!page.disabled && isArrowExpanded}\n className={styles.Pagination__controlArrow}\n />\n </span>\n </span>\n </Button>\n )\n }\n case 'NUM': {\n return (\n /**\n * Append \"...\" to the aria-label for pages that precede a break because screen readers will change the\n * tone the text is read in. This is a slightly nicer experience than skipping a bunch of numbers unexpectedly.\n */\n <Button\n {...baseProps}\n as=\"a\"\n variant={page.selected ? 'primary' : 'subtle'}\n className={clsx(styles.Pagination__pageItem, customClassName)}\n href={hrefBuilder(page.num)}\n aria-label={`Page ${page.num}${page.precedesBreak ? '...' : ''}`}\n aria-current={page.selected ? 'page' : undefined}\n {...customAttributes}\n >\n {page.num}\n </Button>\n )\n }\n case 'BREAK': {\n return (\n <Button\n {...baseProps}\n as=\"a\"\n className={clsx(styles.Pagination__pageItem, customClassName)}\n variant=\"subtle\"\n role=\"presentation\"\n href={undefined}\n onClick={undefined}\n {...customAttributes}\n >\n …\n </Button>\n )\n }\n }\n}\n\nfunction defaultHrefBuilder(pageNum: number) {\n return `#${pageNum}`\n}\n"],"mappings":";;;;;;;;;AAsCA,IAAM,IAA0B;CAC9B,MAAM;CACN,MAAM;CACN,eAAe;CACf,eAAe;CAChB,EAMY,IAAa,GACvB,EACC,OACA,cACA,cACA,gBACA,iBACA,iBAAc,GACd,0BACA,qBAAkB,GAClB,eAAY,IACZ,0BAAuB,GACvB,WACA,cAAc,GACd,eAAe,GACf,GAAG,QACkB;CAErB,IAAM,EAAC,aAAS,GAAe;AAC/B,CAAI,KAAS,IAAQ,QACnB,IAAkB,GAClB,IAAuB;CAGzB,IAAM,IAAY,GAAQ,QAAQ,EAAwB,MACpD,IAAY,GAAQ,QAAQ,EAAwB,MACpD,IAAgB,GAAQ,iBAAiB,EAAwB,eACjE,IAAgB,GAAQ,iBAAiB,EAAwB,eAEjE,IAAS,EAAM,OAAoB,KAAK,EAExC,IAAa,GAChB,OAAe,MAAwB;AACtC,EAAI,KACF,EAAa,GAAG,EAAE;IAGtB,CAAC,EAAa,CACf,EAEK,IAAkB,EAAM,cACd,EAAqB,GAAW,GAAa,GAAW,GAAiB,EAEhF,CAAM,KAAI,MAEb,kBAAC,GAAD;EAEQ;EACO;EACU;EACZ;EACA;EACI;EACA;EACf,SAAS,EAAW,EAAK,IAAI;EAC7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ages?: boolean;
|
|
13
13
|
surroundingPageCount?: number;
|
|
14
|
+
labels?: {
|
|
15
|
+
prev?: string;
|
|
16
|
+
next?: string;
|
|
17
|
+
prevAriaLabel?: string;
|
|
18
|
+
nextAriaLabel?: string;
|
|
19
|
+
};
|
|
14
20
|
'data-testid'?: string;
|
|
15
21
|
} & Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>;
|
|
16
22
|
/**
|
|
17
23
|
* Use Pagination to display a sequence of links that allow navigation to discrete, related pages.
|
|
18
24
|
* @see https://primer.style/brand/components/Pagination
|
|
19
25
|
*/
|
|
20
|
-
export declare const Pagination: React.MemoExoticComponent<({ id, className, pageCount, currentPage, onPageChange, hrefBuilder, pageAttributesBuilder, marginPageCount, showPages, surroundingPageCount, "aria-label": ariaLabel, "data-testid": testId, ...rest }: PaginationProps) => import("react/jsx-runtime").JSX.Element>;
|
|
26
|
+
export declare const Pagination: React.MemoExoticComponent<({ id, className, pageCount, currentPage, onPageChange, hrefBuilder, pageAttributesBuilder, marginPageCount, showPages, surroundingPageCount, labels, "aria-label": ariaLabel, "data-testid": testId, ...rest }: PaginationProps) => import("react/jsx-runtime").JSX.Element>;
|