Skip to content

Commit

Permalink
Update dependencies (#574)
Browse files Browse the repository at this point in the history
  • Loading branch information
benface authored Jan 11, 2024
1 parent 7830fda commit 7627c4b
Show file tree
Hide file tree
Showing 16 changed files with 1,602 additions and 1,751 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"devDependencies": {
"@edgeandnode/eslint-config": "^2.0.3",
"eslint": "^8.56.0",
"eslint-plugin-mdx": "^2.2.0",
"eslint-plugin-mdx": "^2.3.2",
"husky": "^8.0.3",
"lint-staged": "^15.2.0",
"prettier": "^3.1.1",
Expand All @@ -33,7 +33,7 @@
"remark-lint-heading-increment": "^3.1.2",
"remark-lint-no-heading-punctuation": "^3.1.2",
"remark-lint-restrict-elements": "workspace:*",
"turbo": "^1.11.2",
"turbo": "^1.11.3",
"typescript": "^5.3.3"
},
"lint-staged": {
Expand Down
12 changes: 6 additions & 6 deletions packages/nextra-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"typecheck": "tsc --noEmit"
},
"peerDependencies": {
"@edgeandnode/gds": "3.0.0-global-header-1703180036960-6b16dd059ed284aceacf266e91ef74c6e7a1ee3b",
"@edgeandnode/go": "4.0.0-global-header-1703180036960-6b16dd059ed284aceacf266e91ef74c6e7a1ee3b",
"@edgeandnode/gds": "3.0.0-global-header-1704926172780-5df793a0095123eacaf0e9c364758f71bbc99e44",
"@edgeandnode/go": "4.0.0-global-header-1704926172780-5df793a0095123eacaf0e9c364758f71bbc99e44",
"@emotion/react": "^11.11",
"next": "^13",
"next-seo": "^6",
Expand All @@ -43,11 +43,11 @@
"react-use": "^17.4.2"
},
"devDependencies": {
"@edgeandnode/gds": "3.0.0-global-header-1703180036960-6b16dd059ed284aceacf266e91ef74c6e7a1ee3b",
"@edgeandnode/go": "4.0.0-global-header-1703180036960-6b16dd059ed284aceacf266e91ef74c6e7a1ee3b",
"@emotion/react": "^11.11.1",
"@edgeandnode/gds": "3.0.0-global-header-1704926172780-5df793a0095123eacaf0e9c364758f71bbc99e44",
"@edgeandnode/go": "4.0.0-global-header-1704926172780-5df793a0095123eacaf0e9c364758f71bbc99e44",
"@emotion/react": "^11.11.3",
"@types/lodash": "^4.14.202",
"@types/react": "^18.2.45",
"@types/react": "^18.2.47",
"@types/react-dom": "^18.2.18",
"next": "^14.0.4",
"next-seo": "^6.4.0",
Expand Down
44 changes: 6 additions & 38 deletions packages/nextra-theme/src/components/EditPageLink.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
import { HTMLAttributes, useContext } from 'react'

import {
BorderRadius,
buildTransition,
ButtonOrLink,
Flex,
Icon,
Opacity,
Spacing,
Text,
useI18n,
} from '@edgeandnode/gds'
import { Icon, Link, useI18n } from '@edgeandnode/gds'

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

export type EditPageLinkProps = {
mobile?: boolean
} & Omit<HTMLAttributes<HTMLElement>, 'children'>
} & Omit<HTMLAttributes<HTMLElement>, 'color' | 'children'>

export const EditPageLink = ({ mobile = false, ...props }: EditPageLinkProps) => {
const { t } = useI18n<any>()
Expand All @@ -30,31 +20,9 @@ export const EditPageLink = ({ mobile = false, ...props }: EditPageLinkProps) =>
fileLocale && ['en', '[locale]'].includes(fileLocale) ? fileLocale : 'en'
}/${filePathSegments.join('/')}`
return (
<ButtonOrLink
href={path}
target="_blank"
sx={{
display: 'block',
py: Spacing['4px'],
borderRadius: BorderRadius.S,
'&:hover': { color: 'White' },
transition: buildTransition(),
}}
{...props}
>
<Flex.Row as="span" align="center" gap={Spacing['8px']}>
<Icon.LogoGitHub title="" />
<Text weight="SEMIBOLD" size={mobile ? '16px' : '14px'}>
{t('global.editPage')}
</Text>
<Icon.ExternalLink
sx={{
opacity: Opacity['0%'],
'a:hover &': { opacity: Opacity['32%'] },
transition: buildTransition('OPACITY'),
}}
/>
</Flex.Row>
</ButtonOrLink>
<Link href={path} target="_blank" size={mobile ? '16px' : '14px'} {...props}>
<Icon.LogoGitHub title="" />
{t('global.editPage')}
</Link>
)
}
2 changes: 1 addition & 1 deletion packages/nextra-theme/src/components/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AnchorHTMLAttributes } from 'react'

import { Link } from '@edgeandnode/gds'

export type LinkInlineProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'type'>
export type LinkInlineProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'color' | 'type'>

export const LinkInline = (props: LinkInlineProps) => {
return <Link.Inline href="#" {...props} />
Expand Down
31 changes: 17 additions & 14 deletions packages/nextra-theme/src/components/NavTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import { SxProp } from 'theme-ui'

import {
buildTransition,
ButtonOrLink,
ButtonOrLinkProps,
Divider,
Flex,
Icon,
IconProps,
Link,
Spacing,
Text,
TextProps,
Expand All @@ -30,12 +29,13 @@ const animationCollapse = keyframes({
export type NavTreeProps = HTMLAttributes<HTMLElement> & {
textProps?: TextProps
}
export type NavTreeItemProps = HTMLAttributes<HTMLElement> &
Pick<AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'target'> & {
active?: boolean
linkProps?: HTMLAttributes<HTMLElement> & SxProp
diamondProps?: Partial<IconProps> & SxProp
}
export type NavTreeItemProps = HTMLAttributes<HTMLElement> & {
href: NonNullable<AnchorHTMLAttributes<HTMLAnchorElement>['href']>
target?: AnchorHTMLAttributes<HTMLAnchorElement>['target']
active?: boolean
linkProps?: HTMLAttributes<HTMLElement> & SxProp
diamondProps?: Partial<IconProps> & SxProp
}
export type NavTreeGroupProps = HTMLAttributes<HTMLElement> & {
active?: boolean
}
Expand Down Expand Up @@ -69,7 +69,7 @@ const NavTreeItem = ({
const { sx: diamondSx, ...diamondOtherProps } = diamondProps
return (
<li {...props}>
<ButtonOrLink
<Link.Unstyled
href={href}
target={target}
sx={{
Expand Down Expand Up @@ -100,7 +100,7 @@ const NavTreeItem = ({
{...diamondOtherProps}
/>
) : null}
</ButtonOrLink>
</Link.Unstyled>
</li>
)
}
Expand All @@ -125,7 +125,7 @@ const NavTreeGroup = ({ active = false, children, ...props }: NavTreeGroupProps)

const NavTreeGroupHeading = ({ children, buttonProps = {}, ...props }: NavTreeGroupHeadingProps) => {
const { sx: buttonSx, ...buttonOtherProps } = buttonProps
const context = useContext(NavTreeGroupContext)
const { open, active } = useContext(NavTreeGroupContext)
const { t } = useI18n<any>()

return (
Expand All @@ -135,7 +135,7 @@ const NavTreeGroupHeading = ({ children, buttonProps = {}, ...props }: NavTreeGr
width: '100%',
paddingInline: Spacing['24px'],
py: Spacing['12px'],
color: context.open || context.active ? 'White88' : 'White64',
color: open || active ? 'White88' : 'White64',
'&:hover': { color: 'White' },
transition: buildTransition('COLORS'),
...buttonSx,
Expand All @@ -148,12 +148,15 @@ const NavTreeGroupHeading = ({ children, buttonProps = {}, ...props }: NavTreeGr
as="span"
sx={{
flexShrink: 0,
transform: context.open ? 'rotate(90deg)' : 'rotate(0deg)',
transition: buildTransition('TRANSFORM'),
transform: open ? 'rotate(90deg)' : 'rotate(0deg)',
'&:dir(rtl)': {
transform: open ? 'rotate(-90deg)' : 'rotate(0deg)',
},
}}
>
<Icon.CaretRight
title={context.open ? t('global.collapse') : t('global.expand')}
title={open ? t('global.collapse') : t('global.expand')}
size={['16px', null, null, '14px']}
/>
</Flex.Column>
Expand Down
9 changes: 6 additions & 3 deletions packages/nextra-theme/src/layout/MDXLayoutNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import { Fragment, PropsWithChildren, useContext, useEffect, useState } from 're
import {
BorderRadius,
buildTransition,
ButtonOrLink,
Flex,
Icon,
Link,
NestedStrings,
Spacing,
Text,
Expand Down Expand Up @@ -99,8 +99,11 @@ const MobileWrapper = ({ title, children }: PropsWithChildren<{ title?: string }
as="span"
sx={{
flexShrink: 0,
transform: open ? 'rotate(90deg)' : 'rotate(0deg)',
transition: buildTransition('TRANSFORM'),
transform: open ? 'rotate(90deg)' : 'rotate(0deg)',
'&:dir(rtl)': {
transform: open ? 'rotate(-90deg)' : 'rotate(0deg)',
},
}}
>
<Icon.CaretRight title={open ? t('global.collapse') : t('global.expand')} />
Expand All @@ -127,7 +130,7 @@ const MobileWrapper = ({ title, children }: PropsWithChildren<{ title?: string }
}

const DocSearchHit = ({ hit, children }: PropsWithChildren<{ hit: { url: string } }>) => (
<ButtonOrLink href={removeBasePathFromUrl(hit.url)}>{children}</ButtonOrLink>
<Link.Unstyled href={removeBasePathFromUrl(hit.url)}>{children}</Link.Unstyled>
)

export const MDXLayoutNav = ({ mobile = false }: { mobile?: boolean }) => {
Expand Down
6 changes: 3 additions & 3 deletions packages/nextra-theme/src/layout/MDXLayoutOutline.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useContext, useEffect, useState } from 'react'

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

import { EditPageLink } from '@/components'
import { DocumentContext } from '@/layout'
Expand Down Expand Up @@ -44,7 +44,7 @@ export const MDXLayoutOutline = () => {
}
return (
<li key={outlineItemIndex}>
<ButtonOrLink
<Link.Unstyled
href={`#${heading.id}`}
sx={{
display: 'block',
Expand All @@ -56,7 +56,7 @@ export const MDXLayoutOutline = () => {
}}
>
{heading.value}
</ButtonOrLink>
</Link.Unstyled>
</li>
)
})}
Expand Down
10 changes: 5 additions & 5 deletions packages/nextra-theme/src/layout/MDXLayoutPagination.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useContext } from 'react'

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

import { NavContext } from '@/layout'

Expand All @@ -19,7 +19,7 @@ export const MDXLayoutPagination = () => {
<Flex.Row justify="space-between" sx={{ my: Spacing['32px'] }}>
<div>
{prev ? (
<ButtonOrLink
<Link.Unstyled
href={prev.route}
sx={{
display: 'block',
Expand Down Expand Up @@ -52,12 +52,12 @@ export const MDXLayoutPagination = () => {
{prev.title}
</Text>
</Flex.Column>
</ButtonOrLink>
</Link.Unstyled>
) : null}
</div>
<div>
{next ? (
<ButtonOrLink
<Link.Unstyled
href={next.route}
sx={{
display: 'block',
Expand Down Expand Up @@ -90,7 +90,7 @@ export const MDXLayoutPagination = () => {
{next.title}
</Text>
</Flex.Column>
</ButtonOrLink>
</Link.Unstyled>
) : null}
</div>
</Flex.Row>
Expand Down
4 changes: 2 additions & 2 deletions packages/og-image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20231218.0",
"@types/react": "^18.2.45",
"@types/react": "^18.2.47",
"jest-image-snapshot": "^6.4.0",
"tsx": "^4.7.0",
"typescript": "^5.3.3",
"vitest": "^0.34.6",
"wrangler": "^3.22.1"
"wrangler": "^3.22.4"
}
}
Loading

0 comments on commit 7627c4b

Please sign in to comment.