Skip to content

Commit 7627c4b

Browse files
authored
Update dependencies (#574)
1 parent 7830fda commit 7627c4b

16 files changed

+1602
-1751
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"devDependencies": {
2424
"@edgeandnode/eslint-config": "^2.0.3",
2525
"eslint": "^8.56.0",
26-
"eslint-plugin-mdx": "^2.2.0",
26+
"eslint-plugin-mdx": "^2.3.2",
2727
"husky": "^8.0.3",
2828
"lint-staged": "^15.2.0",
2929
"prettier": "^3.1.1",
@@ -33,7 +33,7 @@
3333
"remark-lint-heading-increment": "^3.1.2",
3434
"remark-lint-no-heading-punctuation": "^3.1.2",
3535
"remark-lint-restrict-elements": "workspace:*",
36-
"turbo": "^1.11.2",
36+
"turbo": "^1.11.3",
3737
"typescript": "^5.3.3"
3838
},
3939
"lint-staged": {

packages/nextra-theme/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"typecheck": "tsc --noEmit"
2626
},
2727
"peerDependencies": {
28-
"@edgeandnode/gds": "3.0.0-global-header-1703180036960-6b16dd059ed284aceacf266e91ef74c6e7a1ee3b",
29-
"@edgeandnode/go": "4.0.0-global-header-1703180036960-6b16dd059ed284aceacf266e91ef74c6e7a1ee3b",
28+
"@edgeandnode/gds": "3.0.0-global-header-1704926172780-5df793a0095123eacaf0e9c364758f71bbc99e44",
29+
"@edgeandnode/go": "4.0.0-global-header-1704926172780-5df793a0095123eacaf0e9c364758f71bbc99e44",
3030
"@emotion/react": "^11.11",
3131
"next": "^13",
3232
"next-seo": "^6",
@@ -43,11 +43,11 @@
4343
"react-use": "^17.4.2"
4444
},
4545
"devDependencies": {
46-
"@edgeandnode/gds": "3.0.0-global-header-1703180036960-6b16dd059ed284aceacf266e91ef74c6e7a1ee3b",
47-
"@edgeandnode/go": "4.0.0-global-header-1703180036960-6b16dd059ed284aceacf266e91ef74c6e7a1ee3b",
48-
"@emotion/react": "^11.11.1",
46+
"@edgeandnode/gds": "3.0.0-global-header-1704926172780-5df793a0095123eacaf0e9c364758f71bbc99e44",
47+
"@edgeandnode/go": "4.0.0-global-header-1704926172780-5df793a0095123eacaf0e9c364758f71bbc99e44",
48+
"@emotion/react": "^11.11.3",
4949
"@types/lodash": "^4.14.202",
50-
"@types/react": "^18.2.45",
50+
"@types/react": "^18.2.47",
5151
"@types/react-dom": "^18.2.18",
5252
"next": "^14.0.4",
5353
"next-seo": "^6.4.0",
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,12 @@
11
import { HTMLAttributes, useContext } from 'react'
22

3-
import {
4-
BorderRadius,
5-
buildTransition,
6-
ButtonOrLink,
7-
Flex,
8-
Icon,
9-
Opacity,
10-
Spacing,
11-
Text,
12-
useI18n,
13-
} from '@edgeandnode/gds'
3+
import { Icon, Link, useI18n } from '@edgeandnode/gds'
144

155
import { NavContext } from '@/layout/NavContext'
166

177
export type EditPageLinkProps = {
188
mobile?: boolean
19-
} & Omit<HTMLAttributes<HTMLElement>, 'children'>
9+
} & Omit<HTMLAttributes<HTMLElement>, 'color' | 'children'>
2010

2111
export const EditPageLink = ({ mobile = false, ...props }: EditPageLinkProps) => {
2212
const { t } = useI18n<any>()
@@ -30,31 +20,9 @@ export const EditPageLink = ({ mobile = false, ...props }: EditPageLinkProps) =>
3020
fileLocale && ['en', '[locale]'].includes(fileLocale) ? fileLocale : 'en'
3121
}/${filePathSegments.join('/')}`
3222
return (
33-
<ButtonOrLink
34-
href={path}
35-
target="_blank"
36-
sx={{
37-
display: 'block',
38-
py: Spacing['4px'],
39-
borderRadius: BorderRadius.S,
40-
'&:hover': { color: 'White' },
41-
transition: buildTransition(),
42-
}}
43-
{...props}
44-
>
45-
<Flex.Row as="span" align="center" gap={Spacing['8px']}>
46-
<Icon.LogoGitHub title="" />
47-
<Text weight="SEMIBOLD" size={mobile ? '16px' : '14px'}>
48-
{t('global.editPage')}
49-
</Text>
50-
<Icon.ExternalLink
51-
sx={{
52-
opacity: Opacity['0%'],
53-
'a:hover &': { opacity: Opacity['32%'] },
54-
transition: buildTransition('OPACITY'),
55-
}}
56-
/>
57-
</Flex.Row>
58-
</ButtonOrLink>
23+
<Link href={path} target="_blank" size={mobile ? '16px' : '14px'} {...props}>
24+
<Icon.LogoGitHub title="" />
25+
{t('global.editPage')}
26+
</Link>
5927
)
6028
}

packages/nextra-theme/src/components/Link.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { AnchorHTMLAttributes } from 'react'
22

33
import { Link } from '@edgeandnode/gds'
44

5-
export type LinkInlineProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'type'>
5+
export type LinkInlineProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'color' | 'type'>
66

77
export const LinkInline = (props: LinkInlineProps) => {
88
return <Link.Inline href="#" {...props} />

packages/nextra-theme/src/components/NavTree.tsx

+17-14
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ import { SxProp } from 'theme-ui'
55

66
import {
77
buildTransition,
8-
ButtonOrLink,
9-
ButtonOrLinkProps,
108
Divider,
119
Flex,
1210
Icon,
1311
IconProps,
12+
Link,
1413
Spacing,
1514
Text,
1615
TextProps,
@@ -30,12 +29,13 @@ const animationCollapse = keyframes({
3029
export type NavTreeProps = HTMLAttributes<HTMLElement> & {
3130
textProps?: TextProps
3231
}
33-
export type NavTreeItemProps = HTMLAttributes<HTMLElement> &
34-
Pick<AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'target'> & {
35-
active?: boolean
36-
linkProps?: HTMLAttributes<HTMLElement> & SxProp
37-
diamondProps?: Partial<IconProps> & SxProp
38-
}
32+
export type NavTreeItemProps = HTMLAttributes<HTMLElement> & {
33+
href: NonNullable<AnchorHTMLAttributes<HTMLAnchorElement>['href']>
34+
target?: AnchorHTMLAttributes<HTMLAnchorElement>['target']
35+
active?: boolean
36+
linkProps?: HTMLAttributes<HTMLElement> & SxProp
37+
diamondProps?: Partial<IconProps> & SxProp
38+
}
3939
export type NavTreeGroupProps = HTMLAttributes<HTMLElement> & {
4040
active?: boolean
4141
}
@@ -69,7 +69,7 @@ const NavTreeItem = ({
6969
const { sx: diamondSx, ...diamondOtherProps } = diamondProps
7070
return (
7171
<li {...props}>
72-
<ButtonOrLink
72+
<Link.Unstyled
7373
href={href}
7474
target={target}
7575
sx={{
@@ -100,7 +100,7 @@ const NavTreeItem = ({
100100
{...diamondOtherProps}
101101
/>
102102
) : null}
103-
</ButtonOrLink>
103+
</Link.Unstyled>
104104
</li>
105105
)
106106
}
@@ -125,7 +125,7 @@ const NavTreeGroup = ({ active = false, children, ...props }: NavTreeGroupProps)
125125

126126
const NavTreeGroupHeading = ({ children, buttonProps = {}, ...props }: NavTreeGroupHeadingProps) => {
127127
const { sx: buttonSx, ...buttonOtherProps } = buttonProps
128-
const context = useContext(NavTreeGroupContext)
128+
const { open, active } = useContext(NavTreeGroupContext)
129129
const { t } = useI18n<any>()
130130

131131
return (
@@ -135,7 +135,7 @@ const NavTreeGroupHeading = ({ children, buttonProps = {}, ...props }: NavTreeGr
135135
width: '100%',
136136
paddingInline: Spacing['24px'],
137137
py: Spacing['12px'],
138-
color: context.open || context.active ? 'White88' : 'White64',
138+
color: open || active ? 'White88' : 'White64',
139139
'&:hover': { color: 'White' },
140140
transition: buildTransition('COLORS'),
141141
...buttonSx,
@@ -148,12 +148,15 @@ const NavTreeGroupHeading = ({ children, buttonProps = {}, ...props }: NavTreeGr
148148
as="span"
149149
sx={{
150150
flexShrink: 0,
151-
transform: context.open ? 'rotate(90deg)' : 'rotate(0deg)',
152151
transition: buildTransition('TRANSFORM'),
152+
transform: open ? 'rotate(90deg)' : 'rotate(0deg)',
153+
'&:dir(rtl)': {
154+
transform: open ? 'rotate(-90deg)' : 'rotate(0deg)',
155+
},
153156
}}
154157
>
155158
<Icon.CaretRight
156-
title={context.open ? t('global.collapse') : t('global.expand')}
159+
title={open ? t('global.collapse') : t('global.expand')}
157160
size={['16px', null, null, '14px']}
158161
/>
159162
</Flex.Column>

packages/nextra-theme/src/layout/MDXLayoutNav.tsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import { Fragment, PropsWithChildren, useContext, useEffect, useState } from 're
88
import {
99
BorderRadius,
1010
buildTransition,
11-
ButtonOrLink,
1211
Flex,
1312
Icon,
13+
Link,
1414
NestedStrings,
1515
Spacing,
1616
Text,
@@ -99,8 +99,11 @@ const MobileWrapper = ({ title, children }: PropsWithChildren<{ title?: string }
9999
as="span"
100100
sx={{
101101
flexShrink: 0,
102-
transform: open ? 'rotate(90deg)' : 'rotate(0deg)',
103102
transition: buildTransition('TRANSFORM'),
103+
transform: open ? 'rotate(90deg)' : 'rotate(0deg)',
104+
'&:dir(rtl)': {
105+
transform: open ? 'rotate(-90deg)' : 'rotate(0deg)',
106+
},
104107
}}
105108
>
106109
<Icon.CaretRight title={open ? t('global.collapse') : t('global.expand')} />
@@ -127,7 +130,7 @@ const MobileWrapper = ({ title, children }: PropsWithChildren<{ title?: string }
127130
}
128131

129132
const DocSearchHit = ({ hit, children }: PropsWithChildren<{ hit: { url: string } }>) => (
130-
<ButtonOrLink href={removeBasePathFromUrl(hit.url)}>{children}</ButtonOrLink>
133+
<Link.Unstyled href={removeBasePathFromUrl(hit.url)}>{children}</Link.Unstyled>
131134
)
132135

133136
export const MDXLayoutNav = ({ mobile = false }: { mobile?: boolean }) => {

packages/nextra-theme/src/layout/MDXLayoutOutline.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useContext, useEffect, useState } from 'react'
22

3-
import { buildTransition, ButtonOrLink, Divider, Flex, Spacing, Text, useI18n } from '@edgeandnode/gds'
3+
import { buildTransition, Divider, Flex, Link, Spacing, Text, useI18n } from '@edgeandnode/gds'
44

55
import { EditPageLink } from '@/components'
66
import { DocumentContext } from '@/layout'
@@ -44,7 +44,7 @@ export const MDXLayoutOutline = () => {
4444
}
4545
return (
4646
<li key={outlineItemIndex}>
47-
<ButtonOrLink
47+
<Link.Unstyled
4848
href={`#${heading.id}`}
4949
sx={{
5050
display: 'block',
@@ -56,7 +56,7 @@ export const MDXLayoutOutline = () => {
5656
}}
5757
>
5858
{heading.value}
59-
</ButtonOrLink>
59+
</Link.Unstyled>
6060
</li>
6161
)
6262
})}

packages/nextra-theme/src/layout/MDXLayoutPagination.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useContext } from 'react'
22

3-
import { buildTransition, ButtonOrLink, Divider, Flex, Icon, Spacing, Text, useI18n } from '@edgeandnode/gds'
3+
import { buildTransition, Divider, Flex, Icon, Link, Spacing, Text, useI18n } from '@edgeandnode/gds'
44

55
import { NavContext } from '@/layout'
66

@@ -19,7 +19,7 @@ export const MDXLayoutPagination = () => {
1919
<Flex.Row justify="space-between" sx={{ my: Spacing['32px'] }}>
2020
<div>
2121
{prev ? (
22-
<ButtonOrLink
22+
<Link.Unstyled
2323
href={prev.route}
2424
sx={{
2525
display: 'block',
@@ -52,12 +52,12 @@ export const MDXLayoutPagination = () => {
5252
{prev.title}
5353
</Text>
5454
</Flex.Column>
55-
</ButtonOrLink>
55+
</Link.Unstyled>
5656
) : null}
5757
</div>
5858
<div>
5959
{next ? (
60-
<ButtonOrLink
60+
<Link.Unstyled
6161
href={next.route}
6262
sx={{
6363
display: 'block',
@@ -90,7 +90,7 @@ export const MDXLayoutPagination = () => {
9090
{next.title}
9191
</Text>
9292
</Flex.Column>
93-
</ButtonOrLink>
93+
</Link.Unstyled>
9494
) : null}
9595
</div>
9696
</Flex.Row>

packages/og-image/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
},
1818
"devDependencies": {
1919
"@cloudflare/workers-types": "^4.20231218.0",
20-
"@types/react": "^18.2.45",
20+
"@types/react": "^18.2.47",
2121
"jest-image-snapshot": "^6.4.0",
2222
"tsx": "^4.7.0",
2323
"typescript": "^5.3.3",
2424
"vitest": "^0.34.6",
25-
"wrangler": "^3.22.1"
25+
"wrangler": "^3.22.4"
2626
}
2727
}

0 commit comments

Comments
 (0)