Skip to content

Commit 1cfd8d0

Browse files
Merge remote-tracking branch 'origin/dev' into fix/input-misalignment
2 parents e2456e1 + 81ed60e commit 1cfd8d0

File tree

393 files changed

+52383
-8311
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

393 files changed

+52383
-8311
lines changed

.all-contributorsrc

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10432,6 +10432,97 @@
1043210432
"doc",
1043310433
"bug"
1043410434
]
10435+
},
10436+
{
10437+
"login": "mteam88",
10438+
"name": "Matthew",
10439+
"avatar_url": "https://avatars.githubusercontent.com/u/84196639?v=4",
10440+
"profile": "https://mteam88.github.io",
10441+
"contributions": [
10442+
"bug",
10443+
"doc"
10444+
]
10445+
},
10446+
{
10447+
"login": "avalidurl",
10448+
"name": "gokhan",
10449+
"avatar_url": "https://avatars.githubusercontent.com/u/11991363?v=4",
10450+
"profile": "https://github.com/avalidurl",
10451+
"contributions": [
10452+
"bug"
10453+
]
10454+
},
10455+
{
10456+
"login": "0xadri",
10457+
"name": "Adri",
10458+
"avatar_url": "https://avatars.githubusercontent.com/u/738533?v=4",
10459+
"profile": "https://github.com/0xadri",
10460+
"contributions": [
10461+
"content"
10462+
]
10463+
},
10464+
{
10465+
"login": "DSherryD",
10466+
"name": "Sherry.Du",
10467+
"avatar_url": "https://avatars.githubusercontent.com/u/130898085?v=4",
10468+
"profile": "https://github.com/DSherryD",
10469+
"contributions": [
10470+
"content"
10471+
]
10472+
},
10473+
{
10474+
"login": "FrancescoXX",
10475+
"name": "Francesco Ciulla",
10476+
"avatar_url": "https://avatars.githubusercontent.com/u/18360871?v=4",
10477+
"profile": "http://francescociulla.com",
10478+
"contributions": [
10479+
"content"
10480+
]
10481+
},
10482+
{
10483+
"login": "blazingrome",
10484+
"name": "blazingrome",
10485+
"avatar_url": "https://avatars.githubusercontent.com/u/136898739?v=4",
10486+
"profile": "https://github.com/blazingrome",
10487+
"contributions": [
10488+
"content"
10489+
]
10490+
},
10491+
{
10492+
"login": "etan-status",
10493+
"name": "Etan Kissling",
10494+
"avatar_url": "https://avatars.githubusercontent.com/u/89844309?v=4",
10495+
"profile": "https://github.com/etan-status",
10496+
"contributions": [
10497+
"content"
10498+
]
10499+
},
10500+
{
10501+
"login": "kritik-sah",
10502+
"name": "kritik sah",
10503+
"avatar_url": "https://avatars.githubusercontent.com/u/57076429?v=4",
10504+
"profile": "https://linktr.ee/kritik",
10505+
"contributions": [
10506+
"bug"
10507+
]
10508+
},
10509+
{
10510+
"login": "Fuliggine",
10511+
"name": "Fuliggine",
10512+
"avatar_url": "https://avatars.githubusercontent.com/u/56844974?v=4",
10513+
"profile": "https://github.com/Fuliggine",
10514+
"contributions": [
10515+
"content"
10516+
]
10517+
},
10518+
{
10519+
"login": "Omsify",
10520+
"name": "Omsify",
10521+
"avatar_url": "https://avatars.githubusercontent.com/u/87442202?v=4",
10522+
"profile": "https://github.com/Omsify",
10523+
"contributions": [
10524+
"bug"
10525+
]
1043510526
}
1043610527
],
1043710528
"contributorsPerLine": 7,

.storybook/i18next.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const ns = [
1414
"common",
1515
"glossary",
1616
"page-about",
17+
"page-index",
1718
"page-upgrades",
1819
"page-developers-index",
1920
]

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ To use an existing function locally you don't need to do anything. Just check th
121121

122122
To create a new function, you will need to create two files:
123123

124-
- One in `src/lambdas` where the logic will live. These are the ones that will be deployed to Netlify. These functions follow [this format](https://docs.netlify.com/functions/build-with-javascript/#synchronous-function-format).
124+
- One in `src/lambda` where the logic will live. These are the ones that will be deployed to Netlify. These functions follow [this format](https://docs.netlify.com/functions/build-with-javascript/#synchronous-function-format).
125125
- One in `src/api` that will be just a wrapper around the previous one in order to be compatible with Gatsby functions. More on the [Gatbsy docs](https://www.gatsbyjs.com/docs/reference/functions/getting-started/) for the format they follow.
126126

127127
Typically, you will develop and test functions in the Gatsby context, by running `yarn start`.
@@ -1631,6 +1631,18 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
16311631
<tr>
16321632
<td align="center" valign="top" width="14.28%"><a href="https://github.com/LadyDhaga"><img src="https://avatars.githubusercontent.com/u/106376368?v=4?s=100" width="100px;" alt="chinaman123"/><br /><sub><b>chinaman123</b></sub></a><br /><a href="#ideas-LadyDhaga" title="Ideas, Planning, & Feedback">🤔</a></td>
16331633
<td align="center" valign="top" width="14.28%"><a href="http://t.me/mevsinternet"><img src="https://avatars.githubusercontent.com/u/32142853?v=4?s=100" width="100px;" alt="Alex"/><br /><sub><b>Alex</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=z0rats" title="Documentation">📖</a> <a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3Az0rats" title="Bug reports">🐛</a></td>
1634+
<td align="center" valign="top" width="14.28%"><a href="https://mteam88.github.io"><img src="https://avatars.githubusercontent.com/u/84196639?v=4?s=100" width="100px;" alt="Matthew"/><br /><sub><b>Matthew</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3Amteam88" title="Bug reports">🐛</a> <a href="https://github.com/ethereum/ethereum-org-website/commits?author=mteam88" title="Documentation">📖</a></td>
1635+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/avalidurl"><img src="https://avatars.githubusercontent.com/u/11991363?v=4?s=100" width="100px;" alt="gokhan"/><br /><sub><b>gokhan</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3Aavalidurl" title="Bug reports">🐛</a></td>
1636+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/0xadri"><img src="https://avatars.githubusercontent.com/u/738533?v=4?s=100" width="100px;" alt="Adri"/><br /><sub><b>Adri</b></sub></a><br /><a href="#content-0xadri" title="Content">🖋</a></td>
1637+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/DSherryD"><img src="https://avatars.githubusercontent.com/u/130898085?v=4?s=100" width="100px;" alt="Sherry.Du"/><br /><sub><b>Sherry.Du</b></sub></a><br /><a href="#content-DSherryD" title="Content">🖋</a></td>
1638+
<td align="center" valign="top" width="14.28%"><a href="http://francescociulla.com"><img src="https://avatars.githubusercontent.com/u/18360871?v=4?s=100" width="100px;" alt="Francesco Ciulla"/><br /><sub><b>Francesco Ciulla</b></sub></a><br /><a href="#content-FrancescoXX" title="Content">🖋</a></td>
1639+
</tr>
1640+
<tr>
1641+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/blazingrome"><img src="https://avatars.githubusercontent.com/u/136898739?v=4?s=100" width="100px;" alt="blazingrome"/><br /><sub><b>blazingrome</b></sub></a><br /><a href="#content-blazingrome" title="Content">🖋</a></td>
1642+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/etan-status"><img src="https://avatars.githubusercontent.com/u/89844309?v=4?s=100" width="100px;" alt="Etan Kissling"/><br /><sub><b>Etan Kissling</b></sub></a><br /><a href="#content-etan-status" title="Content">🖋</a></td>
1643+
<td align="center" valign="top" width="14.28%"><a href="https://linktr.ee/kritik"><img src="https://avatars.githubusercontent.com/u/57076429?v=4?s=100" width="100px;" alt="kritik sah"/><br /><sub><b>kritik sah</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3Akritik-sah" title="Bug reports">🐛</a></td>
1644+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Fuliggine"><img src="https://avatars.githubusercontent.com/u/56844974?v=4?s=100" width="100px;" alt="Fuliggine"/><br /><sub><b>Fuliggine</b></sub></a><br /><a href="#content-Fuliggine" title="Content">🖋</a></td>
1645+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Omsify"><img src="https://avatars.githubusercontent.com/u/87442202?v=4?s=100" width="100px;" alt="Omsify"/><br /><sub><b>Omsify</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3AOmsify" title="Bug reports">🐛</a></td>
16341646
</tr>
16351647
</tbody>
16361648
</table>

docs/ds-implementation.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# DS implementation guide
2+
3+
This is a reference for implementing the new Design System components and styles defined in a public [Figma file](https://www.figma.com/file/NrNxGjBL0Yl1PrNrOT8G2B/ethereum.org-Design-System).
4+
5+
This is part of our [Design System implementation epic](https://github.com/ethereum/ethereum-org-website/issues/9546). Currently we are implementing the v1, check the remaining tasks [here](https://github.com/ethereum/ethereum-org-website/issues/9548).
6+
7+
## Basics
8+
9+
- Use Chakra tokens for spacing, sizes, and breakpoints. [Chakra theme docs](https://chakra-ui.com/docs/styled-system/theme)
10+
- For colors use the semantic tokens defined in [this file](https://github.com/ethereum/ethereum-org-website/blob/dev/src/@chakra-ui/gatsby-plugin/semanticTokens.ts). These tokens will match the color variables used in the DS Figma file
11+
- Use as many Chakra components and utils as possible
12+
- Read the [Best Practices doc](https://github.com/ethereum/ethereum-org-website/blob/dev/docs/best-practices.md) for more examples and info
13+
14+
**IMPORTANT**
15+
Follow the new component directory structure:
16+
17+
```markdown
18+
src/
19+
└── components/
20+
└── ComponentA/
21+
├── index.tsx
22+
├── ComponentA.stories.tsx
23+
└── // Any other files as applicable (utils, child components, useHook, etc.)
24+
```
25+
26+
## Components creation/modification from the DS
27+
28+
If you are implementing:
29+
30+
- A base component (a component that already exists in the [Chakra components list](https://chakra-ui.com/docs/components/), for example, the button or inputs)
31+
- Try to avoid creating a new component file `/ComponentA/index.tsx` if there is no additional or custom logic we need to add to them
32+
- Create a theme file to override the default Chakra styles with the DS specs. See examples under the [Chakra theme folder](https://github.com/ethereum/ethereum-org-website/blob/dev/src/@chakra-ui/gatsby-plugin/components/)
33+
- Create a `.stories.tsx` file under `src/components/BaseStories`
34+
- A new custom component (e.g. the PageHero)
35+
- Use as many Chakra components as possible
36+
- Avoid implementing previous implementation details or styles if Chakra offers a solution for that
37+
38+
## Stories
39+
40+
As defined in the new directory structure, each created or adapted component must have a story attached to it.
41+
42+
- Follow the [Applying Storybook documentation](https://github.com/ethereum/ethereum-org-website/blob/dev/docs/applying-storybook.md)
43+
- Follow the [proposed Storybook structure](https://www.figma.com/file/Ne3iAassyfAcJ0AlgqioAP/DS-to-storybook-structure)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ethereum-org-website",
3-
"version": "7.19.2",
3+
"version": "7.21.0",
44
"description": "Website of ethereum.org",
55
"main": "index.js",
66
"repository": "[email protected]:ethereum/ethereum-org-website.git",

src/@chakra-ui/gatsby-plugin/components/Badge.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const baseStyle = defineMergeStyles(defaultBaseStyle, {
1010
fontWeight: "initial",
1111
py: 1,
1212
px: 2,
13+
lineHeight: "1.6rem",
1314
textTransform: "uppercase",
1415
})
1516

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { defineStyle, defineStyleConfig } from "@chakra-ui/react"
2+
import { headingDefaultTheme } from "./components.utils"
3+
4+
const { sizes: defaultSizes } = headingDefaultTheme
5+
6+
const lineHeightScale = {
7+
"4xl": "6xs",
8+
"3xl": ["5xs", null, "6xs"],
9+
"2xl": ["5xs", null, "4xs"],
10+
xl: ["3xs", null, "2xs"],
11+
lg: ["3xs", null, "2xs"],
12+
md: "xs",
13+
sm: "base",
14+
xs: "base",
15+
}
16+
17+
/*
18+
* Instead of rewriting the entire sizes object, take the existing value from the
19+
* default theme and replace the lineHeight values.
20+
*/
21+
const sizes = Object.entries(defaultSizes || {}).reduceRight(
22+
(acc, [key, value]) => {
23+
return {
24+
...acc,
25+
[key]: defineStyle({
26+
...value,
27+
lineHeight: lineHeightScale[key],
28+
}),
29+
}
30+
},
31+
{
32+
...defaultSizes,
33+
}
34+
)
35+
36+
export const Heading = defineStyleConfig({
37+
...headingDefaultTheme,
38+
sizes,
39+
})

src/@chakra-ui/gatsby-plugin/components/Link.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { defineStyleConfig } from "@chakra-ui/react"
2+
import components from "."
23
import { defineMergeStyles, linkDefaultTheme } from "./components.utils"
4+
import { Text } from "./Text"
35

46
export const Link = defineStyleConfig({
57
baseStyle: defineMergeStyles(linkDefaultTheme.baseStyle, {
@@ -22,4 +24,5 @@ export const Link = defineStyleConfig({
2224
},
2325
},
2426
}),
27+
sizes: Text.sizes,
2528
})

src/@chakra-ui/gatsby-plugin/components/Table.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const baseStyle = defineMergeStyles(
2020
definePartsStyle({
2121
table: {
2222
[$bgColor.variable]: "colors.background.highlight",
23-
minW: "556px",
2423
},
2524
th: {
2625
borderBottom: "1px",
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { defineStyle, defineStyleConfig } from "@chakra-ui/react"
2+
3+
const sizes = {
4+
"6xl": defineStyle({
5+
fontSize: "6xl",
6+
lineHeight: "4xs",
7+
}),
8+
"5xl": defineStyle({
9+
fontSize: "5xl",
10+
lineHeight: "4xs",
11+
}),
12+
"4xl": defineStyle({
13+
fontSize: "4xl",
14+
lineHeight: "sm",
15+
}),
16+
"3xl": defineStyle({
17+
fontSize: "3xl",
18+
lineHeight: "sm",
19+
}),
20+
"2xl": defineStyle({
21+
fontSize: "2xl",
22+
lineHeight: "sm",
23+
}),
24+
xl: defineStyle({
25+
fontSize: "xl",
26+
lineHeight: "sm",
27+
}),
28+
lg: defineStyle({
29+
fontSize: "lg",
30+
lineHeight: "base",
31+
}),
32+
md: defineStyle({
33+
fontSize: "md",
34+
lineHeight: "base",
35+
}),
36+
sm: defineStyle({
37+
fontSize: "sm",
38+
lineHeight: "base",
39+
}),
40+
xs: defineStyle({
41+
fontSize: "xs",
42+
lineHeight: "base",
43+
}),
44+
}
45+
46+
export const Text = defineStyleConfig({
47+
sizes,
48+
})

0 commit comments

Comments
 (0)