Skip to content

Commit 395fd5a

Browse files
authored
Merge pull request #10588 from ethereum/staging
Deploy v7.15.0
2 parents e7fa40a + 5e008a0 commit 395fd5a

File tree

346 files changed

+18539
-5372
lines changed

Some content is hidden

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

346 files changed

+18539
-5372
lines changed

.storybook/preview.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ window.___navigate = (pathname) => {
2828

2929
export const parameters = {
3030
actions: { argTypesRegex: "^on[A-Z].*" },
31+
backgrounds: {
32+
disable: true,
33+
},
3134
controls: {
3235
matchers: {
3336
color: /(background|color)$/i,

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.14.2",
3+
"version": "7.15.0",
44
"description": "Website of ethereum.org",
55
"main": "index.js",
66
"repository": "[email protected]:ethereum/ethereum-org-website.git",

plugins/gatsby-remark-fix-static-urls/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const fs = require("fs")
12
const path = require("path")
23
const visitWithParents = require("unist-util-visit-parents")
34
const isRelativeUrl = require("is-relative-url")
@@ -39,7 +40,10 @@ module.exports = ({ markdownNode, markdownAST }) => {
3940
return
4041
}
4142

42-
node.url = path.join(relativePath, node.url)
43+
// only modify the paths for those files doesn't exist in the current folder
44+
if (!fs.existsSync(path.join(fileAbsoluteDir, node.url))) {
45+
node.url = path.join(relativePath, node.url)
46+
}
4347
}
4448
})
4549

redirects.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,6 @@
255255
"fromPath": "/upgrades",
256256
"toPath": "/en/roadmap"
257257
},
258-
{
259-
"fromPath": "/quizzes",
260-
"toPath": "/en/quizzes/"
261-
},
262258
{
263259
"fromPath": "/*/upgrades",
264260
"toPath": "/:splat/roadmap"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export const Button = defineStyleConfig({
113113
baseStyle,
114114
sizes: defineMergeStyles(defaultSizes, {
115115
md: {
116-
h: "42px",
116+
h: 10.5,
117117
},
118118
}),
119119
variants: {
Lines changed: 31 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,45 @@
11
import { createMultiStyleConfigHelpers, defineStyle } from "@chakra-ui/react"
22
import { checkboxAnatomy } from "@chakra-ui/anatomy"
3-
import { checkboxDefaultTheme, defineMergeStyles } from "./components.utils"
3+
import {
4+
checkboxDefaultTheme,
5+
commonInputTriggerStyles,
6+
defineMergeStyles,
7+
} from "./components.utils"
48

5-
const { baseStyle: defaultBaseStyle } = checkboxDefaultTheme
9+
const { sizes: defaultSizes } = checkboxDefaultTheme
610

711
const { definePartsStyle, defineMultiStyleConfig } =
812
createMultiStyleConfigHelpers(checkboxAnatomy.keys)
913

10-
const baseStyleControl = defineStyle((props) =>
11-
defineMergeStyles(defaultBaseStyle?.(props).control, {
12-
bg: "background.base",
13-
_checked: {
14-
bg: "primary400",
15-
_hover: {
16-
bg: "primary400",
17-
borderColor: "primary600",
18-
},
19-
borderColor: "black50",
20-
},
21-
border: "1px",
22-
borderColor: "black50",
23-
borderRadius: "3px",
24-
transition: "all 150ms",
25-
_focusVisible: {
26-
boxShadow: "none",
27-
},
28-
_hover: {
29-
boxShadow: "tableItemBoxShadow",
30-
border: "1px",
31-
borderStyle: "solid",
32-
borderColor: "primary600",
33-
transition: "transform 0.1s",
34-
transform: "scale(1.02)",
35-
},
36-
})
14+
const { commonContainerProps, commonControlProps, commonLabelProps } =
15+
commonInputTriggerStyles
16+
17+
const checkboxMdSize = defaultSizes?.md
18+
19+
const baseStyleControl = defineMergeStyles(
20+
checkboxMdSize?.control,
21+
commonControlProps,
22+
{
23+
boxSize: "var(--checkbox-size)", // Comes from default theme
24+
borderRadius: "sm",
25+
}
3726
)
3827

39-
const sizes = {
40-
md: defineStyle({
41-
control: {
42-
h: "1.5rem",
43-
w: "1.5rem",
44-
},
45-
icon: {
46-
fontSize: "md",
47-
},
48-
}),
49-
}
28+
const baseStyleLabel = defineStyle({ ...commonLabelProps })
29+
30+
const baseStyleContainer = defineStyle({ ...commonContainerProps })
31+
32+
const baseStyleIcon = defineStyle({
33+
boxSize: 2,
34+
})
5035

51-
const variantAlignTop = definePartsStyle({
52-
control: {
53-
mt: "0.25rem",
54-
},
36+
const baseStyle = definePartsStyle({
37+
container: baseStyleContainer,
38+
control: baseStyleControl,
39+
label: baseStyleLabel,
40+
icon: baseStyleIcon,
5541
})
5642

5743
export const Checkbox = defineMultiStyleConfig({
58-
baseStyle: definePartsStyle((props) => ({
59-
...defaultBaseStyle?.(props),
60-
control: baseStyleControl(props),
61-
})),
62-
sizes,
63-
variants: {
64-
// TODO: remove this variant
65-
alignTop: variantAlignTop,
66-
},
67-
defaultProps: {
68-
size: "md",
69-
},
44+
baseStyle,
7045
})
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
import { inputAnatomy } from "@chakra-ui/anatomy"
2+
import {
3+
createMultiStyleConfigHelpers,
4+
defineStyle,
5+
} from "@chakra-ui/styled-system"
6+
import { defineMergeStyles, inputDefaultTheme } from "./components.utils"
7+
8+
const { defineMultiStyleConfig, definePartsStyle } =
9+
createMultiStyleConfigHelpers(inputAnatomy.keys)
10+
11+
const baseStyle = definePartsStyle((props) => {
12+
const {
13+
focusBorderColor: fc = "primaryHover",
14+
errorBorderColor: ec = "errorOutline",
15+
} = props
16+
17+
return defineMergeStyles(
18+
inputDefaultTheme.baseStyle,
19+
inputDefaultTheme.variants?.outline(props),
20+
{
21+
field: {
22+
borderColor: "currentColor",
23+
borderRadius: "base",
24+
outline: "3px solid transparent",
25+
lineHeight: 1,
26+
_placeholder: {
27+
color: "disabled",
28+
opacity: 1,
29+
},
30+
_focusVisible: {
31+
outlineColor: fc,
32+
outlineOffset: "-1px",
33+
borderColor: "transparent",
34+
boxShadow: "none",
35+
},
36+
_hover: null, // override default
37+
_groupHover: {
38+
borderColor: "primary.hover",
39+
},
40+
_invalid: {
41+
borderColor: ec,
42+
boxShadow: "none",
43+
},
44+
_disabled: {
45+
borderColor: "disabled",
46+
opacity: 1,
47+
},
48+
"&:not(:disabled)": {
49+
_active: {
50+
bg: "background.highlight",
51+
borderColor: "primary.highContrast",
52+
},
53+
},
54+
},
55+
element: {
56+
fontSize: "2xl",
57+
transitionProperty: "common",
58+
transitionDuration: "normal",
59+
_groupHover: {
60+
color: "primary.hover",
61+
},
62+
_peerFocusVisible: {
63+
color: fc,
64+
_peerInvalid: {
65+
color: ec,
66+
},
67+
_peerDisabled: {
68+
color: "disabled",
69+
},
70+
},
71+
_peerDisabled: {
72+
color: "disabled",
73+
},
74+
"[data-peer]:not(:disabled):active ~ &": {
75+
color: "primary.dark",
76+
_dark: {
77+
color: "primary.highContrast",
78+
},
79+
},
80+
},
81+
}
82+
)
83+
})
84+
85+
const size = {
86+
md: defineStyle({
87+
h: 10.5,
88+
px: 2,
89+
}),
90+
sm: defineStyle({
91+
h: 8,
92+
px: 1,
93+
}),
94+
}
95+
96+
const sizes = {
97+
md: definePartsStyle({
98+
field: size.md,
99+
element: size.md,
100+
}),
101+
sm: definePartsStyle({
102+
field: { ...size.sm, fontSize: "sm" },
103+
element: {
104+
...size.sm,
105+
fontSize: "xl",
106+
},
107+
}),
108+
}
109+
110+
export const Input = defineMultiStyleConfig({
111+
baseStyle,
112+
sizes,
113+
defaultProps: {
114+
variant: "outline",
115+
size: "md",
116+
},
117+
})
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import {
2+
createMultiStyleConfigHelpers,
3+
cssVar,
4+
defineStyle,
5+
} from "@chakra-ui/react"
6+
import { radioAnatomy } from "@chakra-ui/anatomy"
7+
import {
8+
commonInputTriggerStyles,
9+
defineMergeStyles,
10+
radioDefaultTheme,
11+
} from "./components.utils"
12+
13+
const { defineMultiStyleConfig, definePartsStyle } =
14+
createMultiStyleConfigHelpers(radioAnatomy.keys)
15+
16+
export const $radioDisableColor = cssVar("radio-disable-color")
17+
18+
const { commonContainerProps, commonControlProps, commonLabelProps } =
19+
commonInputTriggerStyles
20+
21+
const baseStyleContainer = defineStyle({ ...commonContainerProps })
22+
23+
const baseStyleControl = defineMergeStyles(
24+
radioDefaultTheme.baseStyle?.({} as never).control,
25+
commonControlProps,
26+
{
27+
boxSize: 4,
28+
fontSize: "md",
29+
"*:hover > &": {
30+
outlineOffset: "-1px",
31+
},
32+
_checked: {
33+
_before: {
34+
// Force half the size, as '50%' value not reliable.
35+
boxSize: 2,
36+
},
37+
},
38+
}
39+
)
40+
41+
const baseStyleLabel = defineStyle({ ...commonLabelProps })
42+
43+
const baseStyle = definePartsStyle({
44+
container: baseStyleContainer,
45+
control: baseStyleControl,
46+
label: baseStyleLabel,
47+
})
48+
49+
export const Radio = defineMultiStyleConfig({
50+
baseStyle,
51+
})

0 commit comments

Comments
 (0)