Skip to content

Commit

Permalink
feat(colors): Moralis 2.0 update (#824)
Browse files Browse the repository at this point in the history
* feat(colors): Moralis 2.0 update

* feat(colors): final updates
  • Loading branch information
billgil authored Oct 12, 2022
1 parent 838cc48 commit 3544609
Show file tree
Hide file tree
Showing 118 changed files with 1,478 additions and 1,416 deletions.
8 changes: 8 additions & 0 deletions .changeset/curly-adults-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@web3uikit/core': minor
'@web3uikit/styles': minor
'@web3uikit/web3': minor
'@web3uikit/web3api': minor
---

updated color system
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ type TStyleProps = Pick<{{ getInterface name }}, 'state' | 'hasUnderline' | 'bgC
// CSS Props should be sorted alphabetically
// //////////////////
const greenColor = css`
color: ${color.green};
color: ${color.mint40};
`;
const redColor = css`
color: ${color.red};
color: ${color.red40};
`;

// //////////////////
// Styled Components
// CSS Props should be sorted alphabetically
// //////////////////
const SectionStyled = styled.section<TStyleProps>`
border-bottom: 5px solid ${color.green};
border-top: 5px solid ${color.yellow};
border-bottom: 5px solid ${color.mint40};
border-top: 5px solid ${color.yellow50};
padding: 12px 24px;
background-color: ${(p) => p.bgColor && color[p.bgColor]};
`;
Expand Down
12 changes: 6 additions & 6 deletions .plop/plop-templates/with-code-examples/{{ name }}.test.tsx.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ test('Renders Default component', () => {

const styles = heading && getComputedStyle(heading);
const colorHex = styles && rgbToHex(styles.color).toUpperCase();
expect(colorHex).toBe(color.green);
expect(colorHex).toBe(color.mint40);

const text = screen.getByTestId(testText);
expect(text).not.toBeNull();
Expand Down Expand Up @@ -85,7 +85,7 @@ test('changes UI onClick of the button', () => {

const styles = headingElement && getComputedStyle(headingElement);
const colorHex = styles && rgbToHex(styles.color).toUpperCase();
expect(colorHex).toBe(color.red);
expect(colorHex).toBe(color.red40);
});

// Test Story 3: InitializeRed
Expand All @@ -110,7 +110,7 @@ test('Renders InitializeRed', () => {

const styles = heading && getComputedStyle(heading);
const colorHex = styles && rgbToHex(styles.color).toUpperCase();
expect(colorHex).toBe(color.red);
expect(colorHex).toBe(color.red40);

const text = screen.getByTestId(testText);
expect(text).not.toBeNull();
Expand Down Expand Up @@ -142,7 +142,7 @@ test('changes UI onClick of the button', () => {

const styles = headingElement && getComputedStyle(headingElement);
const colorHex = styles && rgbToHex(styles.color).toUpperCase();
expect(colorHex).toBe(color.green);
expect(colorHex).toBe(color.mint40);
});

// Test Story 4: UnderLinedText
Expand All @@ -167,7 +167,7 @@ test('Renders UnderLinedText', () => {

const styles = heading && getComputedStyle(heading);
const colorHex = styles && rgbToHex(styles.color).toUpperCase();
expect(colorHex).toBe(color.green);
expect(colorHex).toBe(color.mint40);

const text = screen.getByTestId(testText);
expect(text).not.toBeNull();
Expand Down Expand Up @@ -198,5 +198,5 @@ test('changes UI onClick of the button', () => {

const styles = headingElement && getComputedStyle(headingElement);
const colorHex = styles && rgbToHex(styles.color).toUpperCase();
expect(colorHex).toBe(color.red);
expect(colorHex).toBe(color.red40);
});
4 changes: 2 additions & 2 deletions .plop/plop-templates/with-code-examples/{{ name }}.tsx.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ const {{ name }}: React.FC<{{ getInterface name }}> = ({
</TitleStyled>
<SpanStyled>
{compState?<Checkmark
fill={color.green}
fill={color.mint40}
fontSize={30}
/>:<Cross
fill={color.red}
fill={color.red40}
fontSize={30}/>}
<HeadingStyled state={compState} data-testid="test-heading">
{compState === 'greenLight' ? textOn : textOff}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/IconsGallery/IconGallery.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const StyledDivIcon = styled.div`
border-radius: 20px;
transition: all 0.1s linear;
&:hover {
background-color: ${color.blueCloud};
background-color: ${color.aero10};
}
`;

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/IconsGallery/IconGallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const IconsGallery = () => {
key={Icon.name.slice(3)}
onClick={() => handleClick(Icon.name.slice(3), 'info')}
>
<Icon fontSize={30} color={color.black} />
<Icon fontSize={30} color={color.blue70} />
</StyledDivIcon>
);
});
Expand Down
114 changes: 57 additions & 57 deletions packages/core/src/lib/Accordion/Accordion.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,87 +8,87 @@ import type { AccordionProps } from './types';
type TStyleProps = Pick<AccordionProps, 'theme'>;

const getThemeColor = (theme: string) => {
switch (theme) {
case 'blue':
return color.blue;
case 'red':
return color.red;
case 'green':
return color.green;
case 'yellow':
return color.yellow;
default:
return color.blue;
}
switch (theme) {
case 'blue':
return color.navy40;
case 'red':
return color.red40;
case 'green':
return color.mint40;
case 'yellow':
return color.yellow50;
default:
return color.navy40;
}
};

const SectionStyled = styled.section<TStyleProps>`
background-color: ${color.white};
border: 1px solid ${(p) => getThemeColor(p.theme)};
border-radius: 20px;
opacity: 0%;
overflow: hidden;
transition-delay: 0.3s;
transition: opacity 0.3s ease-out;
background-color: ${color.white};
border: 1px solid ${(p) => getThemeColor(p.theme)};
border-radius: 20px;
opacity: 0%;
overflow: hidden;
transition-delay: 0.3s;
transition: opacity 0.3s ease-out;
`;

const HeaderStyled = styled.header`
display: flex;
cursor: pointer;
flex-wrap: wrap;
justify-content: space-between;
padding: 8px 12px;
display: flex;
cursor: pointer;
flex-wrap: wrap;
justify-content: space-between;
padding: 8px 12px;
&:hover {
background-color: ${color.paleBlue2};
}
&:hover {
background-color: ${color.navy20};
}
`;

const H4Styled = styled.h4`
${resetCSS}
${fonts.heading}
${resetCSS}
${fonts.heading}
${fonts.h4}
line-height: 1;
padding: 8px 0;
padding: 8px 0;
`;

const DivStyled = styled.div`
align-items: center;
display: flex;
justify-content: center;
align-items: center;
display: flex;
justify-content: center;
p {
${resetCSS}
${fonts.text}
p {
${resetCSS}
${fonts.text}
margin: 0 6px;
min-width: 100px;
text-align: right;
}
min-width: 100px;
text-align: right;
}
svg {
margin: 0 6px;
min-width: 18px;
}
svg {
margin: 0 6px;
min-width: 18px;
}
div {
margin: 0 6px;
}
div {
margin: 0 6px;
}
&:last-of-type {
margin-left: auto;
}
&:last-of-type {
margin-left: auto;
}
`;

const DivStyledContent = styled.div`
overflow: hidden;
transition: max-height 0.3s ease-out;
overflow: hidden;
transition: max-height 0.3s ease-out;
`;

export default {
DivStyled,
DivStyledContent,
H4Styled,
HeaderStyled,
SectionStyled,
getThemeColor
DivStyled,
DivStyledContent,
H4Styled,
HeaderStyled,
SectionStyled,
getThemeColor,
};
4 changes: 2 additions & 2 deletions packages/core/src/lib/Accordion/Accordion.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ test('Renders colors', () => {
render(<Default />);
const element = screen.getByTestId(testId);
const styles = element && getComputedStyle(element);
expect(styles.border).toBe(`1px solid ${color.blue}`.toLowerCase());
expect(styles.border).toBe(`1px solid ${color.navy40}`.toLowerCase());
});

test('Renders theme colors', () => {
render(<ThemeColor />);
const element = screen.getByTestId(testId);
const styles = element && getComputedStyle(element);
expect(styles.border).toBe(`1px solid ${color.green}`.toLowerCase());
expect(styles.border).toBe(`1px solid ${color.mint40}`.toLowerCase());
});

test('Renders HasSubtitle', () => {
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/lib/Badge/Badge.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ type TStyleProps = Pick<BadgeProps, 'state'>;
const getBackgroundColor = (type: colorState) => {
switch (type) {
case 'danger':
return color.red;
return color.red40;
case 'success':
return color.green;
return color.mint40;
case 'warning':
return color.yellow;
return color.yellow50;
default:
return color.blue;
return color.navy40;
}
};

Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/lib/Badge/Badge.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test('Renders Danger', () => {
const styles = element && getComputedStyle(element);
const backgroundColorHex =
styles && rgbToHex(styles.backgroundColor).toUpperCase();
expect(backgroundColorHex).toBe(color.red);
expect(backgroundColorHex).toBe(color.red40);

const text = screen.getByTestId(testText);
expect(text).not.toBeNull();
Expand All @@ -38,7 +38,7 @@ test('Renders Normal', () => {
const styles = element && getComputedStyle(element);
const backgroundColorHex =
styles && rgbToHex(styles.backgroundColor).toUpperCase();
expect(backgroundColorHex).toBe(color.blue);
expect(backgroundColorHex).toBe(color.navy40);

const text = screen.getByTestId(testText);
expect(text).not.toBeNull();
Expand All @@ -55,7 +55,7 @@ test('Renders Success', () => {
const styles = element && getComputedStyle(element);
const backgroundColorHex =
styles && rgbToHex(styles.backgroundColor).toUpperCase();
expect(backgroundColorHex).toBe(color.green);
expect(backgroundColorHex).toBe(color.mint40);

const text = screen.getByTestId(testText);
expect(text).not.toBeNull();
Expand All @@ -72,7 +72,7 @@ test('Renders Warning', () => {
const styles = element && getComputedStyle(element);
const backgroundColorHex =
styles && rgbToHex(styles.backgroundColor).toUpperCase();
expect(backgroundColorHex).toBe(color.yellow);
expect(backgroundColorHex).toBe(color.yellow50);

const text = screen.getByTestId(testText);
expect(text).not.toBeNull();
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/lib/BannerStrip/BannerStrip.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import { BannerStripProps } from './types';
const getBackgroundColor = (type: string) => {
switch (type) {
case 'success':
return color.green;
return color.mint40;
case 'warning':
return color.yellow;
return color.yellow50;
case 'error':
return color.red;
return color.red40;
default:
return color.blue;
return color.navy40;
}
};

Expand Down
10 changes: 5 additions & 5 deletions packages/core/src/lib/BannerStrip/BannerStrip.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test('Renders Standard', () => {
const styles = element && getComputedStyle(element);
const backgroundColorHex =
styles && rgbToHex(styles.backgroundColor).toUpperCase();
expect(backgroundColorHex).toBe(color.blue);
expect(backgroundColorHex).toBe(color.navy40);
});

test('Renders Standard with Button', () => {
Expand All @@ -34,7 +34,7 @@ test('Renders Standard with Button', () => {
const styles = element && getComputedStyle(element);
const backgroundColorHex =
styles && rgbToHex(styles.backgroundColor).toUpperCase();
expect(backgroundColorHex).toBe(color.blue);
expect(backgroundColorHex).toBe(color.navy40);
});

test('Renders Warning', () => {
Expand All @@ -48,7 +48,7 @@ test('Renders Warning', () => {
const styles = element && getComputedStyle(element);
const backgroundColorHex =
styles && rgbToHex(styles.backgroundColor).toUpperCase();
expect(backgroundColorHex).toBe(color.yellow);
expect(backgroundColorHex).toBe(color.yellow50);
});

test('Renders Error', () => {
Expand All @@ -62,7 +62,7 @@ test('Renders Error', () => {
const styles = element && getComputedStyle(element);
const backgroundColorHex =
styles && rgbToHex(styles.backgroundColor).toUpperCase();
expect(backgroundColorHex).toBe(color.red);
expect(backgroundColorHex).toBe(color.red40);
});

test('Renders Success', () => {
Expand All @@ -76,5 +76,5 @@ test('Renders Success', () => {
const styles = element && getComputedStyle(element);
const backgroundColorHex =
styles && rgbToHex(styles.backgroundColor).toUpperCase();
expect(backgroundColorHex).toBe(color.green);
expect(backgroundColorHex).toBe(color.mint40);
});
Loading

0 comments on commit 3544609

Please sign in to comment.