Skip to content

feat: Refactor Pagination component to use our styling API #3300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

RayRedGoose
Copy link
Contributor

Summary

Fixes: #3267

Pagination component has been refactored to use our new tokens and styling utilities. The React interface has not changed, but CSS variables are now used for dynamic properties.

Release Category

Components

Release Note

Pagination component has been refactored to use our new tokens and styling utilities. The React interface has not changed, but CSS variables are now used for dynamic properties.


Checklist

For the Reviewer

  • PR title is short and descriptive
  • PR summary describes the change (Fixes/Resolves linked correctly)
  • PR Release Notes describes additional information useful to call out in a release message or removed if not applicable
  • Breaking Changes provides useful information to upgrade to this code or removed if not applicable

Where Should the Reviewer Start?

Areas for Feedback? (optional)

  • Code
  • Documentation
  • Testing
  • Codemods

Testing Manually

Screenshots or GIFs (if applicable)

Thank You Gif (optional)

@RayRedGoose RayRedGoose requested a review from mannycarrera4 May 12, 2025 20:18
Copy link

cypress bot commented May 12, 2025

Workday/canvas-kit    Run #8891

Run Properties:  status check passed Passed #8891  •  git commit 54584b999a ℹ️: Merge 1e86333e559ce8b483a22515eae4657a4b79b6a9 into 27f7b4b0b968875921295a1640e0...
Project Workday/canvas-kit
Branch Review ISSUE3267-pagination-restyling
Run status status check passed Passed #8891
Run duration 02m 48s
Commit git commit 54584b999a ℹ️: Merge 1e86333e559ce8b483a22515eae4657a4b79b6a9 into 27f7b4b0b968875921295a1640e0...
Committer Raisa Primerova
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 21
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 936
View all changes introduced in this branch ↗︎
UI Coverage  21.27%
  Untested elements 1530  
  Tested elements 411  
Accessibility  99.29%
  Failed rules  6 critical   5 serious   0 moderate   2 minor
  Failed elements 97  

@mannycarrera4 mannycarrera4 changed the title feat: Refactor Pagination component to use stencils feat: Refactor Pagination component to styling API May 15, 2025
@mannycarrera4 mannycarrera4 changed the title feat: Refactor Pagination component to styling API feat: Refactor Pagination component to use our styling API May 20, 2025
@RayRedGoose RayRedGoose requested a review from Copilot May 22, 2025 15:49
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Refactors the Pagination component and its subcomponents to replace styled/Flex usage with the new createStencil and mergeStyles styling API, while preserving the existing React interface and behavior.

  • Replaced @workday/canvas-kit-react/common styled components and @workday/canvas-kit-react/layout Flex wrappers with createStencil + mergeStyles
  • Updated token imports to use @workday/canvas-tokens-web and removed Emotion-based styling
  • Added stencil definitions for all structural elements and updated the upgrade guide to reference the preview release

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
common/List.tsx Converted styled Flex to a stencil + mergeStyles on <ul> and <li>
Pagination/Pagination.tsx Replaced inline Flex nav container with stencil + mergeStyles
Pagination/PageList.tsx Switched Flex as="ol" to stencil + mergeStyles
Pagination/PageButton.tsx Replaced styled(BaseButton) with stencil + handleCsProp
Pagination/Nav.tsx Converted standalone nav to stencil + mergeStyles
Pagination/GoTo/TextInput.tsx Added stencil for sizing and wired through handleCsProp
Pagination/GoTo/Label.tsx Moved whiteSpace into a stencil via handleCsProp
Pagination/GoTo/Form.tsx Replaced Flex form wrapper with stencil + mergeStyles
Pagination/Controls.tsx Converted Flex controls wrapper to stencil + mergeStyles
Pagination/AdditionalDetails.tsx Replaced styled Flex and tokens with stencil + mergeStyles
docs/mdx/14.0-UPGRADE-GUIDE.mdx Added Pagination to the upgrade guide list
Comments suppressed due to low confidence (1)

modules/react/pagination/lib/Pagination/common/List.tsx:8

  • [nitpick] The stencil name paginationListItemStencil is misleading since it applies to the <ul> (the list) rather than a list item. Consider renaming to paginationListStencil for clarity.
export const paginationListItemStencil = createStencil({

@RayRedGoose RayRedGoose self-assigned this May 22, 2025
@RayRedGoose RayRedGoose added the ready for review Code is ready for review label May 22, 2025
@@ -11,6 +12,12 @@ export interface GoToLabelProps {
children?: (model: PaginationModel) => React.ReactNode | React.ReactNode;
}

export const paginationGoToLabelStencil = createStencil({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NB: Does SubText have a stencil? Do we want to extend it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's necessary, It used component and component already has that stencil styles

@@ -10,11 +11,25 @@ export type GoToTextInputProps = TextInputProps & {
value?: string | number;
};

export const paginationGoToTextInputStencil = createStencil({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, since this renders a TextInput, do we want to extend text input stencil?

Copy link
Contributor

@mannycarrera4 mannycarrera4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just had two questions about stencil extensions, otherwise everything looks good, thank you!

@RayRedGoose RayRedGoose added the approved Code has been reviewed and approved (ship it) label Jun 4, 2025
@mannycarrera4 mannycarrera4 removed the ready for review Code is ready for review label Jun 4, 2025
@alanbsmith alanbsmith enabled auto-merge (squash) June 5, 2025 13:39
@alanbsmith alanbsmith merged commit 9010391 into Workday:prerelease/major Jun 5, 2025
19 checks passed
@RayRedGoose RayRedGoose deleted the ISSUE3267-pagination-restyling branch June 5, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Code has been reviewed and approved (ship it) automerge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants