Skip to content

fix(tokens): use existing border.radius.large and motion.easing.linear tokens instead of hardcoded values#3360

Open
starboyvarun wants to merge 1 commit intorazorpay:masterfrom
starboyvarun:fix/resolve-hardcoded-motion-and-radius-tokens
Open

fix(tokens): use existing border.radius.large and motion.easing.linear tokens instead of hardcoded values#3360
starboyvarun wants to merge 1 commit intorazorpay:masterfrom
starboyvarun:fix/resolve-hardcoded-motion-and-radius-tokens

Conversation

@starboyvarun
Copy link
Copy Markdown

Summary

Two components had TODO comments and hardcoded values for tokens that already existed in the design system.

BottomSheet (BottomSheet.native.tsx, getBottomSheetGrabHandleStyles.ts):

  • Used theme.spacing[5] (20px) as a workaround for a 16px border radius with a // TODO: we do not have 16px radius token comment
  • theme.border.radius.large (= 16px) already existed in packages/blade/src/tokens/global/border.ts
  • Replaced the spacing workaround with the correct semantic token

ProgressBar (ProgressBarFilled.web.tsx):

  • BoxWithIndeterminateAnimation used a hardcoded 'linear' string for the CSS animation easing with a // TODO: Add this in motion tokens comment
  • theme.motion.easing.linear already existed (makeBezier(0,0,0,0)) in the motion tokens
  • Added motionEasing to the styled-component's Pick type so it can receive the prop, and replaced the hardcoded string with castWebType(getIn(theme.motion, motionEasing))

Changes

  • packages/blade/src/components/BottomSheet/BottomSheet.native.tsx — replace spacing[5] with border.radius.large and remove TODO
  • packages/blade/src/components/BottomSheet/getBottomSheetGrabHandleStyles.ts — same radius fix for the grab handle
  • packages/blade/src/components/ProgressBar/ProgressBarFilled.web.tsx — thread motionEasing through the styled-component and read it from the token

Testing

  • BottomSheet: border radius visually unchanged (both values resolve to 16px), but now tracks the design token
  • ProgressBar: indeterminate animation easing unchanged (CSS cubic-bezier(0,0,0,0)linear), but now tracks the token

…xisting tokens

BottomSheet was using spacing[5] (20px workaround) for 16px border radius
instead of the already-present border.radius.large token. ProgressBar's
indeterminate animation used a hardcoded 'linear' string instead of
motion.easing.linear from the token system.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 29, 2026

🦋 Changeset detected

Latest commit: 97fc5f1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@razorpay/blade Patch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions
Copy link
Copy Markdown
Contributor

✅ PR title follows Conventional Commits specification.

@codesandbox-ci
Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant