-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Refactor exported alias and scale types in polaris-tokens
#7385
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
Changes from 9 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
dfdb447
[Layout foundations] Export `isKeyOf` util from polaris-migrator
laurkim 6f31bc1
[Layout foundations] Update `SpacingSpaceScale` type
laurkim 5bce8ae
[Layout foundations] Update `ShapeBorderRadiusScale` and `ShapeBorder…
laurkim decc8ea
[Layout foundations] Update `BreakpointsAlias` type
laurkim 0f95362
[Layout foundations] Update `DepthShadowAlias` type
laurkim eafdf86
[Layout foundations] Update `FontSizeScale`, `FontLineHeightScale`, a…
laurkim d442631
[Layout foundations] Update `MotionDurationScale` and `MotionKeyframe…
laurkim 72a48d5
[Layout foundations] Update `ZIndezZScale` type
laurkim 7693d8d
Add changeset
laurkim 715a457
[Layout foundations] Add `isKeyOf` as local util
laurkim 572ed95
Update changeset
laurkim ef837dc
[Layout foundations] Update name spacing for `shape` and `spacing` types
laurkim 8abccf7
[Layout foundations] Update test descriptions
laurkim a0e4532
Update order of zIndex scale type
laurkim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| '@shopify/polaris-tokens': patch | ||
| '@shopify/polaris-migrator': minor | ||
| --- | ||
|
|
||
| Refactored exported alias and scale types in `breakpoints`, `depth`, `font`, `motion`, `shape`, `spacing`, and `zIndex`. | ||
| Added `isKeyOf` to exports from `polaris-migrator` package. |
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import {isKeyOf} from '@shopify/polaris-migrator'; | ||
|
|
||
| import { | ||
| breakpoints, | ||
| breakpointsAlias, | ||
| } from '../../src/token-groups/breakpoints'; | ||
|
|
||
| describe('BreakpointsAlias', () => { | ||
| it('extracts the breakpoint alias from the breakpoints token', () => { | ||
| for (const alias of breakpointsAlias) { | ||
| expect(isKeyOf(breakpoints, `breakpoints-${alias}`)).toBe(true); | ||
| } | ||
| }); | ||
| }); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import {isKeyOf} from '@shopify/polaris-migrator'; | ||
|
|
||
| import {depth, depthShadowAlias} from '../../src/token-groups/depth'; | ||
|
|
||
| describe('DepthShadowAlias', () => { | ||
| it('extracts the depth alias from the depth token', () => { | ||
| for (const alias of depthShadowAlias) { | ||
| expect(isKeyOf(depth, `shadow-${alias}`)).toBe(true); | ||
| } | ||
| }); | ||
| }); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import {isKeyOf} from '@shopify/polaris-migrator'; | ||
|
|
||
| import { | ||
| font, | ||
| fontSizeScale, | ||
| fontLineHeightScale, | ||
| fontWeightAlias, | ||
| } from '../../src/token-groups/font'; | ||
|
|
||
| describe('FontSizeScale', () => { | ||
| it('extracts the font size scale from the font token', () => { | ||
| for (const sizeScale of fontSizeScale) { | ||
| expect(isKeyOf(font, `font-size-${sizeScale}`)).toBe(true); | ||
| } | ||
| }); | ||
| }); | ||
|
|
||
| describe('FontLineHeightScale', () => { | ||
| it('extracts the font line height scale from the font token', () => { | ||
| for (const lineHeightScale of fontLineHeightScale) { | ||
| expect(isKeyOf(font, `font-line-height-${lineHeightScale}`)).toBe(true); | ||
| } | ||
| }); | ||
| }); | ||
|
|
||
| describe('FontWeightAlias', () => { | ||
| it('extracts the font weight alias from the font token', () => { | ||
| for (const alias of fontWeightAlias) { | ||
| expect(isKeyOf(font, `font-weight-${alias}`)).toBe(true); | ||
| } | ||
| }); | ||
| }); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import {isKeyOf} from '@shopify/polaris-migrator'; | ||
|
|
||
| import { | ||
| motion, | ||
| motionDurationScale, | ||
| motionKeyframesAlias, | ||
| } from '../../src/token-groups/motion'; | ||
|
|
||
| describe('MotionDurationScale', () => { | ||
| it('extracts the motion duration scale from the motion token', () => { | ||
| for (const scale of motionDurationScale) { | ||
| expect(isKeyOf(motion, `duration-${scale}`)).toBe(true); | ||
| } | ||
| }); | ||
| }); | ||
|
|
||
| describe('MotionKeyframesAlias', () => { | ||
| it('extracts the motion keyframe alias from the motion token', () => { | ||
| for (const alias of motionKeyframesAlias) { | ||
| expect(isKeyOf(motion, `keyframes-${alias}`)).toBe(true); | ||
| } | ||
| }); | ||
| }); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import {isKeyOf} from '@shopify/polaris-migrator'; | ||
|
|
||
| import { | ||
| shape, | ||
| borderRadiusScale, | ||
| borderRadiusAlias, | ||
| } from '../../src/token-groups/shape'; | ||
|
|
||
| describe('ShapeBorderRadiusScale', () => { | ||
| it('extracts the border radius scale from the shape token', () => { | ||
| for (const scale of borderRadiusScale) { | ||
| expect(isKeyOf(shape, `border-radius-${scale}`)).toBe(true); | ||
| } | ||
| }); | ||
| }); | ||
|
|
||
| describe('ShapeBorderRadiusAlias', () => { | ||
| it('extracts the border radius alias from the shape token', () => { | ||
| for (const alias of borderRadiusAlias) { | ||
| expect(isKeyOf(shape, `border-radius-${alias}`)).toBe(true); | ||
| } | ||
| }); | ||
| }); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import {isKeyOf} from '@shopify/polaris-migrator'; | ||
|
|
||
| import {spacing, spaceScale} from '../../src/token-groups/spacing'; | ||
|
|
||
| describe('SpacingSpaceScale', () => { | ||
| it('extracts the spacing scale from the spacing token', () => { | ||
| for (const scale of spaceScale) { | ||
| expect(isKeyOf(spacing, `space-${scale}`)).toBe(true); | ||
| } | ||
| }); | ||
| }); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import {isKeyOf} from '@shopify/polaris-migrator'; | ||
|
|
||
| import {zIndex, zIndexZScale} from '../../src/token-groups/zIndex'; | ||
|
|
||
| describe('ZIndexZScale', () => { | ||
| it('extracts the z-index scale from the zIndex token', () => { | ||
| for (const scale of zIndexZScale) { | ||
| expect(isKeyOf(zIndex, `z-${scale}`)).toBe(true); | ||
| } | ||
| }); | ||
| }); |
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.
Uh oh!
There was an error while loading. Please reload this page.