feat(Pagination): add Pagination component aligned with Cyber skin#1555
Open
AlexandraGallipoliRodrigues wants to merge 23 commits into
Open
feat(Pagination): add Pagination component aligned with Cyber skin#1555AlexandraGallipoliRodrigues wants to merge 23 commits into
AlexandraGallipoliRodrigues wants to merge 23 commits into
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
Paginationcomponent to mistica-web, designed for the Cyber project but built against the standard skin contract so it works across all skins. Implements the Figma anatomy, types, behaviour, animation and "Compact View" specs.Ticket: WEB-2441
What's included
Component
Paginationwith controlled and uncontrolled modes (currentPage/defaultPage+onChange).hideNavigationControlsandhidePageListallow rendering only the page list or only the navigation arrows.dynamicCountcontrols the size of the middle visible window;showEllipsistoggles truncation.mode="iconOnly"renders the navigation buttons as chevrons only, even on desktop.disableddisables all interactive elements.getPaginationItems()helper exported for unit tests / consumers that need the resolved item list.Styling
::before) inside a 32×48 (mobile) / 32×32 (desktop) interactive container. The Figma "Interaction Area" spec calls for 48×48 on mobile, but a literal 48px width breaks the layout on a 375px screen for the denser1 … N N+1 N+2 … LASTconfigurations. The component instead satisfies WCAG 2.2 Target Size (Minimum) via the spacing exception: 32px buttons with a 4px gap leave 36px between centers, enough to inscribe non-overlapping 24px touch circles around every interactive element. A long-form comment inpagination.css.tsdocuments this trade-off.neutralLowbackground atscale(1.06)(32 → ~34px). Pressed usesbackgroundContainerPressed. Current page usesbrandLow+textActivatedtext, scale 1.0. Duration 0.2sease-in-out, matching the Figma "Animation" spec.textLink. After the Cyber skin overhaul (master merge)textLink → palette.brand = #0066FF, so the labels render in the blue specified by the Figma without changes to the skin contract.IconChevronLeftRegular/IconChevronRightRegularatsize={20}to match the Figma weight and dimensions.mediumweight to match the Figma typography.hidePageListis set, the container gap becomes 16px to honour the "Previous and Next only" Figma layout.Accessibility
<nav aria-label>landmark with a localised default ("Paginación" / "Pagination" / "Paginierung" / "Paginação").aria-current="page"on the active page (rendered as a non-interactive span, not a button).aria-hidden="true"on the…ellipsis.src/text-tokens.tsx:paginationLabelpaginationPrevPagepaginationNextPagepaginationGoToPage(with1$splaceholder)aria-label,navLeftLabel,navRightLabelprops or via the theme'stextsoverrides, following the same pattern asCarousel.Tooling
playroom/snippets.tsx(Pagination,Pagination iconOnly).playroom/themes.tsxasCommunity_Cyber/Community_Cyber_iOS(light + iOS), so they group visually under theCommunity_prefix in the flat theme selector.src/__stories__/pagination-story.tsx.src/__tests__/pagination-test.tsx(nav landmark, single-page no-render, page click, Next click, disabled, controlled mode + 3getPaginationItemsedge cases).src/__screenshot_tests__/pagination-screenshot-test.tsxcovering 8 scenarios × 2 viewports (Default, FirstPage, LastPage, WithEllipsis, NavOnlyResponsive, PagesOnly, IconOnlyControls, NextChapterLink).Screenshots / verification
Run
yarn playroom, switch to the Cyber skin in the selector, and load thePaginationsnippet. Verify:brandLow) with dark-blue text.Test plan
yarn jest src/__tests__/pagination-test.tsxpasses (9 tests).yarn tsc --noEmitclean.A11y tests
IOS-a11y-test.MP4
Android-a11y-test.mp4
🤖 Generated with Claude Code