Skip to content

Commit 4490e9e

Browse files
authored
Merge branch 'dev' into style-guide-patches
2 parents d3b3b40 + b9fd160 commit 4490e9e

File tree

1,074 files changed

+53543
-14605
lines changed

Some content is hidden

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

1,074 files changed

+53543
-14605
lines changed

.github/ISSUE_TEMPLATE/suggest_staking_product.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,18 @@ body:
166166
- type: textarea
167167
id: staking_product_signing_keys
168168
attributes:
169-
label: If listing as staking-as-a-service, who holds the signing keys, and withdrawal keys?
169+
label: If listing as staking-as-a-service, who has access to the signing keys?
170170
description: What keys does the user maintain access to? What keys does the service gain access to?
171+
- type: textarea
172+
id: staking_product_withdrawal_credentials
173+
attributes:
174+
label: If a pooled staking service or SaaS provider, what type of withdrawal credentials are being utilized / who holds the withdrawal keys?
175+
description: Are withdrawal credentials utilizing `0x01` type credentials that point to an execution layer address? If so, is this an account chosen by the user, or a pre-determined smart contract?
171176
- type: textarea
172177
id: staking_product_supermajority
173178
attributes:
174-
label: If a pooled staking service, what percent of node operators are running a super-majority consensus layer client?
175-
description: As of last edit, Prysm is the consensus layer client being run by a super-majority of the node operators, which is dangerous for the network. If there is currently a super-majority and this data is known, please list it here with a link to evidence.
179+
label: If a pooled staking service or SaaS provider, what percent of node operators are running a super-majority client?
180+
description: As of last edit, Prysm and Lighthouse are the consensus clients being run by >75% of the node operators, and Geth is the execution client being run by >60% of node operators. This presents risks to the network. If there is currently a super-majority and this data is known, please list it here with a link to evidence.
176181
- type: textarea
177182
id: staking_product_consensus_layer_client_support
178183
attributes:

docs/applying-storybook.md

Lines changed: 61 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ It's as easy as running `yarn storybook` to boot up a dedicated localhost to see
1818

1919
## Setting up a component's stories
2020

21-
A Storybook "story" is an instance of a component in a certain state or with certain parameters applied to show an alternative version of the component.
21+
> 🚨 NOTE: This project has version 7, which is currently still in beta. The following documentation outlines preferences in setup as it relates to this version. You can refer to the [7.0 beta docs](https://storybook.js.org/docs/7.0/react/) if you need any additional details
2222
23-
Each component will only need one file containing all the stories, and should follow the naming convention of the component.
23+
A Storybook "story" is an instance of a component in a certain state or with certain parameters applied to show an alternative version of the component.
2424

25-
So for the component `ExpandableCard.tsx`, the stories file will be named `ExpandableCard.stories.tsx`.
25+
Each component will only need one file containing all the stories.
2626

2727
The stories file will reside with each component. So the base folder structure in `src` will look like this:
2828

@@ -40,45 +40,60 @@ The initial structure of each story file will look something like this (in types
4040
```tsx
4141
import ComponentA from "."
4242

43-
export default {
44-
title: "ComponentA", // Generates the nav structure in the Storybook server
45-
} as ComponentMeta<typeof ComponentA>
43+
type ComponentAType = typeof ComponentA
44+
45+
const meta: Meta<ComponentAType> {
46+
title: "ComponentA",
47+
component: ComponentA
48+
}
4649

47-
export const Basic = () => <ComponentA />
50+
export default meta
51+
type Story = StoryObj<ComponentAType>;
52+
53+
export const Basic: Story = {
54+
render: () => <ComponentA />
55+
}
4856
```
4957

50-
Should the component accept props on all or some renders, a template can be created.
58+
**Note**: with the `title` option, we write this based on the groupings set by the Design System. Groupings are declared with forward slashes. (i.e. `Atoms / Form / Input`). See the Storybook docs for details on [Naming conventions](https://storybook.js.org/docs/7.0/react/writing-stories/naming-components-and-hierarchy)
59+
60+
We will maintain this structure for every story file, regardless of simplicity.
61+
62+
Should the component accept props on all or some renders, you can provide an `args` prop for each story and supply the necessary data. And if there is children, use the `render` prop to pass the args and supply children elements.
5163

5264
Let's say for a `Button` component with different style variants...
5365

5466
```tsx
5567
import Button from "."
5668

57-
export default {
69+
type ButtonType = typeof Button
70+
71+
const meta: Meta<ButtonType> {
5872
title: "Button",
59-
} as ComponentMeta<typeof Button>
73+
component: Button
74+
}
6075

61-
const Template: ComponentStory<typeof Button> = (args) => (
62-
<ComponentA {...args} />
63-
)
76+
export default meta
77+
type Story = StoryObj<ButtonType>;
6478

65-
export const Solid = Template.bind({})
66-
Solid.args = {
67-
variant: "solid",
68-
children: "A Button", // Assuming the `children` prop takes text content only
79+
export const Solid: Story = {
80+
render: (args) => <Button {...args}>A Button</Button>,
81+
args: {
82+
variant: 'solid',
83+
}
6984
}
70-
71-
export const Outline = Template.bind({})
72-
Outline.args = {
73-
variant: "outline",
74-
children: "A Button", // Assuming the `children` prop takes text content only
85+
export const Outline: Story = {
86+
render: (args) => <Button {...args}>A Button</Button>,
87+
args: {
88+
variant: 'outline',
89+
}
7590
}
7691

7792
/**
7893
* For practical purposes, if you are displaying different "variants",
7994
* they should be shown under one story, so they can be seen side-by-side in the GUI
8095
* for reviewers to easily compare.
81-
* This can be done for various sizes or other like alterations
96+
* This can also be done for various sizes or other like alterations
8297
*/
8398

8499
// Assuming `solid` is the default variant in the Chakra theme config
@@ -91,4 +106,27 @@ export const Variants = () => (
91106
)
92107
```
93108

109+
If only one story is provided for a component, the name of the exported object should match the name in the `title` meta option. (If the title is `Atoms / Form / Button` then the object should be named `Button`) This will hoist the display name up to the parent level in the Storybook dashboard's sidebar.
110+
94111
As you go and make adjustments to the component itself or it's variant styles, Storybook will hot reload and those changes will appear in the stories that emphasize them.
112+
113+
## Storybook Dashboard
114+
115+
The dashboard where you view each story has a number of different addons available to check the story thoroughly.
116+
117+
Outlined below are each area going from left to right in the selections.
118+
119+
| Sidebar above the preview | Dashboard below the preview |
120+
| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
121+
| 1. Rerender preview | 1. Controls - allows you to interact with a component’s args (inputs) dynamically. Experiment with alternate configurations of the component to discover edge cases. See [Controls addon docs](https://storybook.js.org/docs/7.0/react/essentials/controls) |
122+
| 2. Zoom In | 2. Actions (if applicable) - help you verify interactions produce the correct outputs via callbacks. See [Actions addon docs](https://storybook.js.org/docs/7.0/react/essentials/actions) |
123+
| 3. Zoom Out | 3. Interactions (if applicable) - In conjunction with the `play` function in a story object, this section allows you to simulate user interactions after the story renders. See [Interactions addon docs](https://storybook.js.org/docs/7.0/react/essentials/interactions) |
124+
| 4. Reset Zoom | 4. Accessibility provides visual A11y results for each story.<br><br>**NOTE**: To check accessibility for light and dark mode, you will need to toggle the mode, then rerender the preview to update the results. |
125+
| 5. Change background |
126+
| 6. Apply grid to preview |
127+
| 7. Change viewport size |
128+
| 8. Enable measuring of elements on hover |
129+
| 9. Apply element outlines to preview |
130+
| 10. A11y Visualization Simulator |
131+
| 11. Set layout direction (left or right) |
132+
| 12. Toggle color mode |

gatsby-node.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,13 @@ export const createPages: GatsbyNode<any, Context>["createPages"] = async ({
210210
edges {
211211
node {
212212
fields {
213-
isOutdated
214213
slug
215214
relativePath
216215
}
217216
frontmatter {
218217
lang
219218
template
219+
isOutdated
220220
}
221221
}
222222
}
@@ -314,7 +314,7 @@ export const createPages: GatsbyNode<any, Context>["createPages"] = async ({
314314
language,
315315
languagesToFetch: [language],
316316
slug,
317-
isOutdated: !!node.fields.isOutdated,
317+
isOutdated: !!node.frontmatter?.isOutdated,
318318
isDefaultLang: language === defaultLanguage,
319319
relativePath,
320320
// gatsby i18n plugin

gatsby-ssr.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Implement Gatsby's SSR (Server Side Rendering) APIs in this file.
3+
*
4+
* See: https://www.gatsbyjs.org/docs/ssr-apis/
5+
*/
6+
7+
import React from "react"
8+
9+
import type { RenderBodyArgs } from "gatsby"
10+
11+
export const onRenderBody = ({ setHeadComponents }: RenderBodyArgs) => {
12+
setHeadComponents([
13+
<link
14+
rel="preload"
15+
href="/fonts/Inter-Regular.woff2"
16+
as="font"
17+
type="font/woff2"
18+
crossOrigin="anonymous"
19+
key="interFont"
20+
/>,
21+
])
22+
}

i18n/config.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@
127127
"langDir": "ltr",
128128
"dateFormat": "MM/DD/YYYY"
129129
},
130+
{
131+
"code": "he",
132+
"hrefLang": "he",
133+
"name": "Hebrew",
134+
"localName": "עִבְרִית",
135+
"langDir": "rtl",
136+
"dateFormat": "MM/DD/YYYY"
137+
},
130138
{
131139
"code": "hi",
132140
"hrefLang": "hi",
@@ -383,6 +391,14 @@
383391
"langDir": "ltr",
384392
"dateFormat": "MM/DD/YYYY"
385393
},
394+
{
395+
"code": "ur-in",
396+
"hrefLang": "ur-in",
397+
"name": "Urdu (India)",
398+
"localName": "اردو",
399+
"langDir": "rtl",
400+
"dateFormat": "MM/DD/YYYY"
401+
},
386402
{
387403
"code": "uz",
388404
"hrefLang": "uz",

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.7.0",
3+
"version": "7.8.0",
44
"description": "Website of ethereum.org",
55
"main": "index.js",
66
"repository": "git@github.com:ethereum/ethereum-org-website.git",

redirects.json

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,17 +216,61 @@
216216
"toPath": "/en/roadmap/danksharding/"
217217
},
218218
{
219-
"fromPath": "/*/eth2/staking/",
220-
"toPath": "/:splat/staking/"
219+
"fromPath": "/upgrades/merge",
220+
"toPath": "/en/roadmap/merge/"
221221
},
222222
{
223-
"fromPath": "/*/eth2/vision/",
224-
"toPath": "/:splat/roadmap/vision/"
223+
"fromPath": "/*/upgrades/merge",
224+
"toPath": "/:splat/roadmap/merge/"
225+
},
226+
{
227+
"fromPath": "/upgrades/merge/issuance",
228+
"toPath": "/en/roadmap/merge/issuance"
229+
},
230+
{
231+
"fromPath": "/*/upgrades/merge/issuance",
232+
"toPath": "/:splat/roadmap/merge/issuance"
233+
},
234+
{
235+
"fromPath": "/upgrades/beacon-chain",
236+
"toPath": "/en/roadmap/beacon-chain"
237+
},
238+
{
239+
"fromPath": "/*/upgrades/beacon-chain",
240+
"toPath": "/:splat/roadmap/beacon-chain"
241+
},
242+
{
243+
"fromPath": "/upgrades/vision/",
244+
"toPath": "/en/roadmap/vision/"
225245
},
226246
{
227247
"fromPath": "/*/upgrades/vision/",
228248
"toPath": "/:splat/roadmap/vision/"
229249
},
250+
{
251+
"fromPath": "/upgrades",
252+
"toPath": "/en/roadmap"
253+
},
254+
{
255+
"fromPath": "/*/upgrades",
256+
"toPath": "/:splat/roadmap"
257+
},
258+
{
259+
"fromPath": "/upgrades/get-involved",
260+
"toPath": "/contributing"
261+
},
262+
{
263+
"fromPath": "/*/upgrades/get-involved",
264+
"toPath": "/:splat/contributing"
265+
},
266+
{
267+
"fromPath": "/*/eth2/staking/",
268+
"toPath": "/:splat/staking/"
269+
},
270+
{
271+
"fromPath": "/*/eth2/vision/",
272+
"toPath": "/:splat/roadmap/vision/"
273+
},
230274
{
231275
"fromPath": "/*/eth2/get-involved/",
232276
"toPath": "/:splat/upgrades/get-involved/"
Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
1-
import { ComponentStyleConfig, SystemStyleObject } from "@chakra-ui/react"
1+
import { defineStyle, defineStyleConfig } from "@chakra-ui/react"
2+
import { badgeDefaultTheme, defineMergeStyles } from "./components.utils"
23

3-
const variantSecondary: SystemStyleObject = {
4+
const { baseStyle: defaultBaseStyle } = badgeDefaultTheme
5+
6+
const baseStyle = defineMergeStyles(defaultBaseStyle, {
7+
borderRadius: "base",
8+
border: "1px solid",
9+
borderColor: "transparent",
10+
fontWeight: "initial",
11+
py: 1,
12+
px: 2,
13+
textTransform: "uppercase",
14+
})
15+
16+
const variantSecondary = defineStyle({
417
borderColor: "primary100",
518
color: "text",
6-
}
19+
})
720

8-
const variantSolid: SystemStyleObject = {
21+
const variantSolid = defineStyle({
922
color: "black300",
1023
background: "primary100",
11-
}
24+
})
1225

13-
export const Badge: ComponentStyleConfig = {
14-
baseStyle: {
15-
borderRadius: "base",
16-
border: "1px solid",
17-
borderColor: "transparent",
18-
fontWeight: "initial",
19-
py: 1,
20-
px: 2,
21-
textTransform: "uppercase",
22-
},
26+
export const Badge = defineStyleConfig({
27+
baseStyle,
2328
variants: {
2429
solid: variantSolid,
2530
secondary: variantSecondary,
@@ -33,7 +38,6 @@ export const Badge: ComponentStyleConfig = {
3338
},
3439
},
3540
defaultProps: {
36-
// Remove the default from Chakra
3741
variant: "solid",
3842
},
39-
}
43+
})

0 commit comments

Comments
 (0)