Skip to content

Transition tokens transformer #1213

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
merged 4 commits into from
Apr 25, 2025
Merged

Transition tokens transformer #1213

merged 4 commits into from
Apr 25, 2025

Conversation

lukasoppermann
Copy link
Contributor

Summary

This Pr adds transformation logic for transitions

@lukasoppermann lukasoppermann added the skip changeset Apply to PRs that should not result in a version bump. label Apr 23, 2025
@lukasoppermann lukasoppermann self-assigned this Apr 23, 2025
@Copilot Copilot AI review requested due to automatic review settings April 23, 2025 13:03
@lukasoppermann lukasoppermann requested review from a team as code owners April 23, 2025 13:03
@lukasoppermann lukasoppermann requested a review from jonrohan April 23, 2025 13:03
Copy link

changeset-bot bot commented Apr 23, 2025

⚠️ No Changeset found

Latest commit: bf4f95a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@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

This PR adds transformation logic for transition tokens by introducing a new transform function to convert transition tokens into corresponding CSS strings.

  • Added a new transform (transitionToCss) and accompanying tests
  • Updated schemas, filters, and platform registration to support transition tokens
  • Included tests for both valid and invalid token cases

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/transformers/transitionToCss.ts New transformer converting transition tokens to CSS transition strings
src/transformers/transitionToCss.test.ts Tests covering transformation logic including edge cases
src/transformers/index.ts Exported the new transitionToCss transform
src/test-utilities/getMockToken.ts Updated type annotation for getMockToken
src/schemas/validTokenType.ts Added 'transition' as a valid token type
src/schemas/transitionTokenSchema.test.ts Schema tests for transition tokens
src/schemas/transitionToken.ts Defined the transition token schema
src/schemas/designToken.ts Included transitionToken in design token registry
src/primerStyleDictionary.ts Registered transitionToCss transform
src/platforms/css.ts Added CSS application for the new transition transform
src/filters/isTransition.ts Defined filter to detect transition tokens
src/filters/isTransition.test.ts Unit tests for transition token filter
src/filters/index.ts Exported the new isTransition filter

Copy link
Contributor

@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

This PR introduces transformation logic to convert transition tokens into CSS transition strings. Key changes include:

  • Adding a new transformer (transitionToCss) for handling transition tokens.
  • Updating token schemas and tests to support the new transition token type.
  • Registering the new transition transform in both the Style Dictionary and CSS platform.

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/transformers/transitionToCss.ts Implements transformation to generate CSS transition strings
src/transformers/transitionToCss.test.ts Adds tests validating correct transformation of transition tokens
src/transformers/index.ts Exports the new transition transformer
src/transformers/cubicBezierToCss.ts Updates cubicBezier transformation to support usage by transitions
src/test-utilities/getMockToken.ts Enhances type-safety in the test token utility
src/schemas/validTokenType.ts Adds "transition" as a valid token type
src/schemas/transitionTokenSchema.test.ts Provides comprehensive tests for transition token validation
src/schemas/transitionToken.ts Defines the schema for transition tokens
src/schemas/designToken.ts Registers transition token within the design token schema
src/primerStyleDictionary.ts Registers transitionToCss transform in the Style Dictionary
src/platforms/css.ts Includes the transition transformation in the CSS platform build
src/filters/isTransition.ts Implements a filter to identify transition tokens
src/filters/isTransition.test.ts Adds tests to verify the correct behavior of the isTransition filter
src/filters/index.ts Updates exports to include the new isTransition filter

@lukasoppermann lukasoppermann changed the base branch from main to next April 24, 2025 15:17
@lukasoppermann lukasoppermann disabled auto-merge April 24, 2025 15:17
@lukasoppermann lukasoppermann changed the base branch from next to main April 25, 2025 15:38
@lukasoppermann lukasoppermann merged commit 4c689d2 into main Apr 25, 2025
27 checks passed
@lukasoppermann lukasoppermann deleted the motion-tokens branch April 25, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip changeset Apply to PRs that should not result in a version bump.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants