Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Supported Networks on Get Started page + visual improvements to search #600

Merged
merged 2 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
"eslint": "^8.56.0",
"eslint-plugin-mdx": "^2.3.4",
"husky": "^9.0.10",
"lint-staged": "^15.2.1",
"prettier": "^3.2.4",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"remark-frontmatter": "^5.0.0",
"remark-lint-first-heading-level": "^3.1.2",
"remark-lint-heading-increment": "^3.1.2",
"remark-lint-no-heading-punctuation": "^3.1.2",
"remark-lint-restrict-elements": "workspace:*",
"turbo": "^1.12.2",
"turbo": "^1.12.3",
"typescript": "^5.3.3"
},
"lint-staged": {
Expand Down
10 changes: 5 additions & 5 deletions packages/nextra-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@
"@radix-ui/react-collapsible": "^1.0.3",
"@radix-ui/react-visually-hidden": "^1.0.3",
"lodash": "^4.17.21",
"react-intersection-observer": "^9.6.0",
"react-intersection-observer": "^9.7.0",
"react-use": "^17.5.0"
},
"devDependencies": {
"@edgeandnode/gds": "^3.6.3",
"@edgeandnode/go": "^4.7.2",
"@edgeandnode/gds": "^3.8.0",
"@edgeandnode/go": "^4.9.0",
"@emotion/react": "^11.11.3",
"@types/lodash": "^4.14.202",
"@types/react": "^18.2.51",
"@types/react-dom": "^18.2.18",
"@types/react": "^18.2.55",
"@types/react-dom": "^18.2.19",
"next": "^14.1.0",
"next-seo": "^6.4.0",
"nextra": "^2.13.3",
Expand Down
47 changes: 37 additions & 10 deletions packages/nextra-theme/src/components/DocSearch.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { DocSearchModal, DocSearchProps, useDocSearchKeyboardEvents } from '@docsearch/react'
import { keyframes } from '@emotion/react'
import { useCallback, useRef, useState } from 'react'
import { createPortal } from 'react-dom'
import { Global } from 'theme-ui'
Expand All @@ -12,6 +13,7 @@ import {
FontSize,
FontWeight,
Icon,
LineHeight,
Link,
Opacity,
Responsive,
Expand All @@ -20,6 +22,11 @@ import {
useTheme,
} from '@edgeandnode/gds'

const animationFadeIn = keyframes({
from: { opacity: 0 },
to: { opacity: 1 },
})

export function DocSearch(props: DocSearchProps) {
const searchButtonRef = useRef<HTMLButtonElement>(null)
const [isOpen, setIsOpen] = useState(false)
Expand Down Expand Up @@ -153,30 +160,33 @@ export function DocSearch(props: DocSearchProps) {
'--docsearch-spacing': '0 !important',
'--docsearch-container-background': `${theme.colors!.Midnight88} !important`,
'--docsearch-modal-width': 'min(calc(100vw - 32px), 840px) !important',
'--docsearch-modal-background': '#292738 !important',
'--docsearch-modal-background': `${theme.colors!.Tooltip} !important`,
'--docsearch-modal-shadow': 'none !important',
'--docsearch-searchbox-height': '96px !important',
'--docsearch-searchbox-height': ['64px !important', null, '96px !important'],
'--docsearch-searchbox-focus-background': 'transparent !important',
'--docsearch-searchbox-shadow': 'none !important',
'--docsearch-hit-background': 'transparent !important',
'--docsearch-hit-color': `${theme.colors!.White88} !important`,
'--docsearch-hit-active-color': `${theme.colors!.White} !important`,
'--docsearch-highlight-color': `${theme.colors!.Purple} !important`,
},
'.DocSearch-Container': {
animation: `${animationFadeIn} 150ms ease-in-out`,
},
'.DocSearch-Modal': {
m: [null, null, '96px auto auto'],
border: buildBorder('White8'),
border: [null, null, 'White8'],
overflow: 'hidden',
cursor: 'default',
},
'.DocSearch-SearchBar': {
p: `0 ${Spacing['24px']}`,
p: [`0 ${Spacing['16px']}`, null, `0 ${Spacing['24px']}`],
'&::after': {
content: `''`,
zIndex: 100,
position: 'absolute',
left: Spacing['24px'],
right: Spacing['24px'],
left: [Spacing['16px'], null, Spacing['24px']],
right: [Spacing['16px'], null, Spacing['24px']],
bottom: '-1px',
borderBottom: buildBorder('White16'),
bg: 'var(--docsearch-modal-background)',
Expand All @@ -188,10 +198,15 @@ export function DocSearch(props: DocSearchProps) {
'.DocSearch-MagnifierLabel, .DocSearch-LoadingIndicator': {
color: 'white',
svg: {
width: '18px',
height: '18px',
width: '20px',
height: '20px',
},
},
'.DocSearch-Search-Icon': {
left: '3px',
color: 'transparent',
backgroundImage: `url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" style="fill: white;"><path fill-rule="evenodd" clip-rule="evenodd" d="M6.70768 1C9.85995 1 12.4154 3.55542 12.4154 6.70768C12.4154 8.08963 11.9242 9.35686 11.107 10.3444C11.3349 10.5734 11.6474 10.8859 12.0424 11.2809L12.4833 11.7218C13.1109 12.3494 13.8972 13.1357 14.8423 14.0808C15.0526 14.2911 15.0526 14.632 14.8423 14.8423C14.632 15.0526 14.2911 15.0526 14.0808 14.8423L10.3444 11.107C9.35686 11.9242 8.08963 12.4154 6.70768 12.4154C3.55542 12.4154 1 9.85995 1 6.70768C1 3.55542 3.55542 1 6.70768 1ZM6.70768 2.07692C4.15018 2.07692 2.07692 4.15018 2.07692 6.70768C2.07692 9.26518 4.15018 11.3384 6.70768 11.3384C9.26518 11.3384 11.3384 9.26518 11.3384 6.70768C11.3384 4.15018 9.26518 2.07692 6.70768 2.07692Z" /></svg>')`,
},
'.DocSearch-Input': {
p: `${Spacing['32px']} ${Spacing['16px']}`,
outline: 'none',
Expand Down Expand Up @@ -232,9 +247,10 @@ export function DocSearch(props: DocSearchProps) {
'.DocSearch-Hit-source': {
m: 0,
mb: Spacing['2px'],
p: `0 ${Spacing['16px']}`,
p: `${Spacing['8px']} ${Spacing['16px']}`,
fontWeight: FontWeight.MEDIUM,
fontSize: FontSize['12px'],
lineHeight: LineHeight.TIGHT,
textTransform: 'uppercase',
letterSpacing: '0.15em',
color: 'White32',
Expand Down Expand Up @@ -327,8 +343,19 @@ export function DocSearch(props: DocSearchProps) {
},
'.DocSearch-NoResults-Prefill-List': {
p: 0,
mt: Spacing['32px'],
mt: Spacing['48px'],
textAlign: 'center',
ul: {
display: 'flex',
flexDirection: 'column',
gap: Spacing['8px'],
li: {
listStyle: 'none',
},
},
},
'.DocSearch-Prefill': {
fontWeight: FontWeight.REGULAR,
},
}}
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/nextra-theme/src/layout/MDXLayoutOutline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const MDXLayoutOutline = () => {
<EditPageLink sx={{ mt: Spacing['4px'] }} />
{headings.length > 0 ? (
<>
<Divider sx={{ my: Spacing['24px'] }} />
<Divider sx={{ mt: '20px', mb: Spacing['24px'] }} />
<nav sx={{ paddingInlineEnd: '16px' }}>
<Text.C10 as="header" color="White64" sx={{ mb: Spacing['12px'] }}>
{t('global.pageSections')}
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.20240129.0",
"@types/react": "^18.2.51",
"@types/react": "^18.2.55",
"jest-image-snapshot": "^6.4.0",
"tsx": "^4.7.0",
"typescript": "^5.3.3",
"vitest": "^0.34.6",
"wrangler": "^3.26.0"
"wrangler": "^3.27.0"
}
}
Loading
Loading