feat(tokens): add zIndex as a global design token#3357
Open
starboyvarun wants to merge 1 commit intorazorpay:masterfrom
Open
feat(tokens): add zIndex as a global design token#3357starboyvarun wants to merge 1 commit intorazorpay:masterfrom
starboyvarun wants to merge 1 commit intorazorpay:masterfrom
Conversation
- Add zIndex.ts to src/tokens/global/ with semantic layer names (hide, base, sticky, overlay, drawer, dropdown, popover) - Export ZIndex type from global token index - Add zIndex field to ThemeTokens type so it is overridable via createTheme() - Add zIndex to bladeTheme default token values - Update componentZIndices utility to reference token values instead of hardcoded numbers - Remove resolved TODO: Tokenize zIndex values comments from Popover, TourPopover, Tooltip
🦋 Changeset detectedLatest commit: 3021d8e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Contributor
|
✅ PR title follows Conventional Commits specification. |
|
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. Latest deployment of this branch, based on commit 3021d8e:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Description
Adds
zIndexas a first-class global design token in the Blade token system, resolving TODOs that have been present across Popover, Tooltip, and SpotlightPopoverTour components.Previously, z-index values lived as hardcoded numbers in
utils/componentZIndices.tswith a top-level comment// TODO: Move these properly to tokens at some point. Four component files each had their own// TODO: Tokenize zIndex valuescomment. This PR resolves all of them.Changes
packages/blade/src/tokens/global/zIndex.ts— defines semantic z-index layers (hide,base,sticky,overlay,drawer,dropdown,popover) with JSDoc comments, following the same pattern asspacing.tsandmotion.tstokens/global/index.ts— exports the newZIndextype andzIndexconstant alongside all other global tokenstokens/theme/theme.ts— addszIndex: ZIndextoThemeTokens, making it overridable viacreateTheme()tokens/theme/bladeTheme.ts— includeszIndexin the default Blade theme objectutils/componentZIndices.ts— removes hardcoded numbers, now reads from thezIndextoken (fully backward-compatible; no existing imports need to change)// TODO: Tokenize zIndex valuescomments fromPopover.web.tsx,Popover.native.tsx,TourPopover.web.tsx,Tooltip.native.tsxAdditional Information
The values are completely unchanged — this is a pure architectural refactor. All existing component imports of
componentZIndicescontinue to work without any modification.After this change, consumers who need custom z-index layering (e.g. white-label integrations) can override via
createTheme({ zIndex: { popover: 2000 } }).Component Checklist