-
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 13 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,5 @@ | ||
| --- | ||
| '@shopify/polaris-tokens': patch | ||
| --- | ||
|
|
||
| Refactored exported alias and scale types in `breakpoints`, `depth`, `font`, `motion`, `shape`, `spacing`, and `zIndex`. |
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,13 @@ | ||
| import {isKeyOf} from '../../src/utilities'; | ||
| import { | ||
| breakpoints, | ||
| breakpointsAlias, | ||
| } from '../../src/token-groups/breakpoints'; | ||
|
|
||
| describe('BreakpointsAlias', () => { | ||
| it('has a breakpoints token for each breakpoint alias', () => { | ||
| 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,10 @@ | ||
| import {isKeyOf} from '../../src/utilities'; | ||
| import {depth, depthShadowAlias} from '../../src/token-groups/depth'; | ||
|
|
||
| describe('DepthShadowAlias', () => { | ||
| it('has a depth token for each shadow alias', () => { | ||
| 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,31 @@ | ||
| import {isKeyOf} from '../../src/utilities'; | ||
| import { | ||
| font, | ||
| fontSizeScale, | ||
| fontLineHeightScale, | ||
| fontWeightAlias, | ||
| } from '../../src/token-groups/font'; | ||
|
|
||
| describe('FontSizeScale', () => { | ||
| it('has a font token for each font size scale', () => { | ||
| for (const sizeScale of fontSizeScale) { | ||
| expect(isKeyOf(font, `font-size-${sizeScale}`)).toBe(true); | ||
| } | ||
| }); | ||
| }); | ||
|
|
||
| describe('FontLineHeightScale', () => { | ||
| it('has a font token for each font line height scale', () => { | ||
| for (const lineHeightScale of fontLineHeightScale) { | ||
| expect(isKeyOf(font, `font-line-height-${lineHeightScale}`)).toBe(true); | ||
| } | ||
| }); | ||
| }); | ||
|
|
||
| describe('FontWeightAlias', () => { | ||
| it('has a font token for each font weight alias', () => { | ||
| 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,22 @@ | ||
| import {isKeyOf} from '../../src/utilities'; | ||
| import { | ||
| motion, | ||
| motionDurationScale, | ||
| motionKeyframesAlias, | ||
| } from '../../src/token-groups/motion'; | ||
|
|
||
| describe('MotionDurationScale', () => { | ||
| it('has a motion token for each duration scale', () => { | ||
| for (const scale of motionDurationScale) { | ||
| expect(isKeyOf(motion, `duration-${scale}`)).toBe(true); | ||
| } | ||
| }); | ||
| }); | ||
|
|
||
| describe('MotionKeyframesAlias', () => { | ||
| it('has a motion token for each keyframes alias', () => { | ||
| 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,22 @@ | ||
| import {isKeyOf} from '../../src/utilities'; | ||
| import { | ||
| shape, | ||
| shapeBorderRadiusScale, | ||
| shapeBorderRadiusAlias, | ||
| } from '../../src/token-groups/shape'; | ||
|
|
||
| describe('ShapeBorderRadiusScale', () => { | ||
| it('has a shape token for each border radius scale', () => { | ||
| for (const scale of shapeBorderRadiusScale) { | ||
| expect(isKeyOf(shape, `border-radius-${scale}`)).toBe(true); | ||
| } | ||
| }); | ||
| }); | ||
|
|
||
| describe('ShapeBorderRadiusAlias', () => { | ||
| it('has a shape token for each border radius alias', () => { | ||
| for (const alias of shapeBorderRadiusAlias) { | ||
| 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,10 @@ | ||
| import {isKeyOf} from '../../src/utilities'; | ||
| import {spacing, spacingSpaceScale} from '../../src/token-groups/spacing'; | ||
|
|
||
| describe('SpacingSpaceScale', () => { | ||
| it('has a space token for each spacing scale', () => { | ||
| for (const scale of spacingSpaceScale) { | ||
| 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,10 @@ | ||
| import {isKeyOf} from '../../src/utilities'; | ||
| import {zIndex, zIndexZScale} from '../../src/token-groups/zIndex'; | ||
|
|
||
| describe('ZIndexZScale', () => { | ||
| it('has a zIndex token for each z-index scale', () => { | ||
| 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.