Skip to content
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

1166 introduce color modifiers #1498

Merged
merged 46 commits into from Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
dd71404
create color token form
swordEdge Dec 19, 2022
fecc1c4
complete color tokenform ui
swordEdge Dec 19, 2022
eee15f6
add extension property to singleGenericToken
swordEdge Dec 20, 2022
3098d06
add modifier to internalEditToken
swordEdge Dec 21, 2022
3c95b4c
introduce mixModifier
swordEdge Dec 21, 2022
24c517c
change color by modifies
swordEdge Dec 21, 2022
29c77c7
save extension to the token
swordEdge Dec 21, 2022
e8b4053
refactor modifyColor function
swordEdge Dec 21, 2022
a3b9325
resolve mix value
swordEdge Dec 21, 2022
4d24ad0
validate the color token
swordEdge Dec 21, 2022
8bbdee2
remove modify
swordEdge Dec 21, 2022
f367a8b
use colorjs instead chorma
swordEdge Dec 23, 2022
df1b268
mix color
swordEdge Dec 23, 2022
a7952d1
make cssColor
swordEdge Dec 23, 2022
953fdbe
calculate modified value when getAliasValue
swordEdge Dec 27, 2022
00133c6
fix error in tokenHelper
swordEdge Dec 28, 2022
fdc592b
remove console
swordEdge Dec 28, 2022
3435e16
set inGamut false
swordEdge Dec 28, 2022
bb5ae55
fix error
swordEdge Dec 28, 2022
6d45741
code review
swordEdge Dec 28, 2022
e96c9f1
fix double calculating modify value
swordEdge Dec 28, 2022
8703abf
fix displayValue
swordEdge Dec 29, 2022
37fcc3c
remove extension on resolvedToken
swordEdge Dec 29, 2022
0e3eb3d
add tokenState test coverage
swordEdge Dec 29, 2022
f971e3a
add test coverage
swordEdge Dec 29, 2022
4ebd0a7
Merge branch 'next' of https://github.com/six7/figma-tokens into 1166…
swordEdge Dec 29, 2022
5c20ed9
resolve code review
swordEdge Dec 30, 2022
e8b3db6
test color.js
swordEdge Jan 4, 2023
bdaa8e9
fixes import
six7 Jan 5, 2023
b37f99f
Update src/utils/convertModifiedColorToHex.ts
six7 Jan 5, 2023
2d2c17b
remove declaration
six7 Jan 5, 2023
981ee2f
resolve merge conflict
swordEdge Jan 5, 2023
021b537
fix test error
swordEdge Jan 5, 2023
9699dd3
add convertModifiedColorToHex test coverage
swordEdge Jan 5, 2023
cdd9398
add modifyColor test
swordEdge Jan 5, 2023
a5fcbdd
save value as number
swordEdge Jan 6, 2023
fdb3547
improve color token tooltip content value
swordEdge Jan 7, 2023
da9a86b
convert tailwind to stitch
swordEdge Jan 7, 2023
be1d2a7
fix test coverage
swordEdge Jan 7, 2023
9a47dfd
resolve code review
swordEdge Jan 9, 2023
4040af8
add test coverage
swordEdge Jan 9, 2023
e2cedf8
Merge branch 'next' of https://github.com/six7/figma-tokens into 1166…
swordEdge Jan 10, 2023
5b80235
fix colorPickerTrigger error & convert input type
swordEdge Jan 10, 2023
c2c43d9
fix test coverage
swordEdge Jan 10, 2023
a143db4
resolve merge conflict
swordEdge Jan 11, 2023
7768485
append extension property
swordEdge Jan 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion babel.config.js
@@ -1,6 +1,6 @@
module.exports = {
presets: ['@babel/preset-env', '@babel/preset-typescript', '@babel/preset-react'],
plugins: ['@babel/proposal-class-properties', '@babel/proposal-object-rest-spread', "@babel/transform-typescript"],
plugins: ['@babel/proposal-class-properties', '@babel/proposal-object-rest-spread', "@babel/transform-typescript", "@babel/plugin-proposal-private-methods"],
env: {
test: {
presets: [
Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/tokens.spec.js
Expand Up @@ -508,15 +508,15 @@ describe('TokenListing', () => {
value: 'composition.regular',
});
cy.get('[data-cy=composition-token-dropdown]').click();
cy.get('[data-cy=property-dropdown-menu-element-sizing]').click();
cy.get('[data-cy=item-dropdown-menu-element-sizing]').click();
fillInput({
input: 'value',
value: '$sizing.xs',
});
cy.get('[data-cy=button-style-add-multiple]').click();

cy.get('[data-cy=composition-token-dropdown]').eq(1).click();
cy.get('[data-cy=property-dropdown-menu-element-opacity]').click();
cy.get('[data-cy=item-dropdown-menu-element-opacity]').click();
fillInputNth({
input: 'value',
value: '$opacity.30',
Expand All @@ -525,7 +525,7 @@ describe('TokenListing', () => {

cy.get('[data-cy=button-style-add-multiple]').click();
cy.get('[data-cy=composition-token-dropdown]').eq(2).click();
cy.get('[data-cy=property-dropdown-menu-element-fontSizes]').click();
cy.get('[data-cy=item-dropdown-menu-element-fontSizes]').click();
fillInputNth({
input: 'value',
value: '$font-size.4',
Expand Down
5 changes: 5 additions & 0 deletions package.json
Expand Up @@ -41,6 +41,8 @@
"@sentry/react": "^6.2.5",
"@stitches/react": "^1.2.8",
"@storybook/addon-postcss": "^2.0.0",
"@types/chroma-js": "^2.1.4",
"@types/color": "^3.0.3",
"@types/file-saver": "^2.0.5",
"@welldone-software/why-did-you-render": "^6.2.3",
"autoprefixer": "^10.2.5",
Expand All @@ -49,7 +51,9 @@
"bitbucket": "^2.7.0",
"buffer": "^6.0.3",
"case": "^1.6.3",
"chroma-js": "^2.4.2",
"classnames": "^2.3.1",
"colorjs.io": "^0.4.2",
"color2k": "^2.0.1",
"core-js": "^3.9.1",
"cypress-react-selector": "^2.3.6",
Expand Down Expand Up @@ -111,6 +115,7 @@
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/plugin-proposal-private-methods": "^7.18.6",
"@babel/preset-env": "^7.12.16",
"@babel/preset-react": "^7.12.13",
"@babel/preset-typescript": "^7.12.16",
Expand Down
26 changes: 26 additions & 0 deletions src/app/components/ColorPickerTrigger.tsx
@@ -0,0 +1,26 @@
import React from 'react';
import { styled } from '@/stitches.config';

const TriggerButton = styled('button', {
width: '$5',
height: '$5',
borderRadius: '$2',
border: '1px solid $borderMuted',
cursor: 'pointer',
fontSize: 0,
});

type Props = {
onClick?: () => void;
background: string | undefined;
};

export const ColorPickerTrigger: React.FC<Props> = ({
onClick, background,
}) => (
<TriggerButton
type="button"
css={{ background }}
onClick={onClick}
/>
);