Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

add back docsearch

Joshen Lim544532355549
diff --git a/apps/temp-docs/components/Navigation/DocSearch.tsx b/apps/temp-docs/components/Navigation/DocSearch.tsx
new file mode 100644
index 00000000000..535034083e5
--- /dev/null
+++ b/apps/temp-docs/components/Navigation/DocSearch.tsx
@@ -0,0 +1,209 @@
+import { useState, useCallback, useRef, createContext, useContext, useEffect } from 'react'
+import { createPortal } from 'react-dom'
+import Link from 'next/link'
+import Head from 'next/head'
+import { useRouter } from 'next/router'
+import { DocSearchModal } from '@docsearch/react'
+import clsx from 'clsx'
+import { useActionKey } from '~/hooks/useActionKey'
+
+const INDEX_NAME = 'dev_docs'
+const API_KEY = process.env.NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY
+const APP_ID = process.env.NEXT_PUBLIC_ALGOLIA_APP_ID
+
+const SearchContext = createContext(null)
+
+export function SearchProvider({ children }: any) {
+ const router = useRouter()
+ const [isOpen, setIsOpen] = useState(false)
+ const [initialQuery, setInitialQuery] = useState(null)
+
+ const onOpen = useCallback(() => {
+ setIsOpen(true)
+ }, [setIsOpen])
+
+ const onClose = useCallback(() => {
+ setIsOpen(false)
+ }, [setIsOpen])
+
+ const onInput = useCallback(
+ (e) => {
+ setIsOpen(true)
+ setInitialQuery(e.key)
+ },
+ [setIsOpen, setInitialQuery]
+ )
+
+ useDocSearchKeyboardEvents({
+ isOpen,
+ onOpen,
+ onClose,
+ // @ts-ignore
+ onInput,
+ })
+
+ return (
+ <>
+ <Head>
+ <link rel="preconnect" href={`https://${APP_ID}-dsn.algolia.net`} crossOrigin="true" />
+ </Head>
+ <SearchContext.Provider
+ // @ts-ignore
+ value={{
+ isOpen,
+ onOpen,
+ onClose,
+ onInput,
+ }}
+ >
+ {children}
+ </SearchContext.Provider>
+ {isOpen &&
+ createPortal(
+ <DocSearchModal
+ // @ts-ignore
+ initialQuery={initialQuery}
+ initialScrollY={window.scrollY}
+ // searchParameters={{
+ // facetFilters: 'version:v3',
+ // distinct: 1,
+ // }}
+ placeholder="Search documentation"
+ onClose={onClose}
+ indexName={INDEX_NAME}
+ apiKey={API_KEY}
+ appId={APP_ID}
+ // @ts-ignore
+ navigator={{
+ navigate({ suggestionUrl }) {
+ setIsOpen(false)
+ router.push(suggestionUrl)
+ },
+ }}
+ hitComponent={Hit}
+ transformItems={(items) => {
+ return items.map((item, index) => {
+ // We transform the absolute URL into a relative URL to
+ // leverage Next's preloading.
+ const a = document.createElement('a')
+ a.href = item.url
+
+ const hash = a.hash === '#content-wrapper' ? '' : a.hash
+
+ return {
+ ...item,
+ url: `${a.pathname}${hash}`,
+ __is_result: () => true,
+ __is_parent: () => item.type === 'lvl1' && items.length > 1 && index === 0,
+ __is_child: () =>
+ item.type !== 'lvl1' &&
+ items.length > 1 &&
+ items[0].type === 'lvl1' &&
+ index !== 0,
+ __is_first: () => index === 1,
+ __is_last: () => index === items.length - 1 && index !== 0,
+ }
+ })
+ }}
+ />,
+ document.body
+ )}
+ </>
+ )
+}
+
+// @ts-ignore
+function Hit({ hit, children }) {
+ return (
+ <Link href={hit.url}>
+ <a
+ className={clsx({
+ 'DocSearch-Hit--Result': hit.__is_result?.(),
+ 'DocSearch-Hit--Parent': hit.__is_parent?.(),
+ 'DocSearch-Hit--FirstChild': hit.__is_first?.(),
+ 'DocSearch-Hit--LastChild': hit.__is_last?.(),
+ 'DocSearch-Hit--Child': hit.__is_child?.(),
+ })}
+ >
+ {children}
+ </a>
+ </Link>
+ )
+}
+
+// @ts-ignore
+export function SearchButton({ children, ...props }) {
+ let searchButtonRef = useRef()
+ let actionKey = useActionKey()
+ // @ts-ignore
+ let { onOpen, onInput } = useContext(SearchContext)
+
+ useEffect(() => {
+ // @ts-ignore
+ function onKeyDown(event) {
+ if (searchButtonRef && searchButtonRef.current === document.activeElement && onInput) {
+ if (/[a-zA-Z0-9]/.test(String.fromCharCode(event.keyCode))) {
+ onInput(event)
+ }
+ }
+ }
+ window.addEventListener('keydown', onKeyDown)
+ return () => {
+ window.removeEventListener('keydown', onKeyDown)
+ }
+ }, [onInput, searchButtonRef])
+
+ return (
+ // @ts-ignore
+ <button type="button" ref={searchButtonRef} onClick={onOpen} {...props}>
+ {typeof children === 'function' ? children({ actionKey }) : children}
+ </button>
+ )
+}
+
+// @ts-ignore
+function useDocSearchKeyboardEvents({ isOpen, onOpen, onClose }) {
+ useEffect(() => {
+ // @ts-ignore
+ function onKeyDown(event) {
+ function open() {
+ // We check that no other DocSearch modal is showing before opening
+ // another one.
+ if (!document.body.classList.contains('DocSearch--active')) {
+ onOpen()
+ }
+ }
+
+ if (
+ (event.keyCode === 27 && isOpen) ||
+ (event.key === 'k' && (event.metaKey || event.ctrlKey)) ||
+ (!isEditingContent(event) && event.key === '/' && !isOpen)
+ ) {
+ event.preventDefault()
+
+ if (isOpen) {
+ onClose()
+ } else if (!document.body.classList.contains('DocSearch--active')) {
+ open()
+ }
+ }
+ }
+
+ window.addEventListener('keydown', onKeyDown)
+ return () => {
+ window.removeEventListener('keydown', onKeyDown)
+ }
+ }, [isOpen, onOpen, onClose])
+}
+
+// @ts-ignore
+function isEditingContent(event) {
+ let element = event.target
+ let tagName = element.tagName
+ return (
+ element.isContentEditable ||
+ tagName === 'INPUT' ||
+ tagName === 'SELECT' ||
+ tagName === 'TEXTAREA'
+ )
+}
diff --git a/apps/temp-docs/components/Navigation/Search.tsx b/apps/temp-docs/components/Navigation/Search.tsx
index c12e188f0f2..1dcf0092f44 100644
--- a/apps/temp-docs/components/Navigation/Search.tsx
+++ b/apps/temp-docs/components/Navigation/Search.tsx
@@ -4,7 +4,7 @@ import { createElement, FC, useEffect, useRef, Fragment } from 'react'
import algoliasearch from 'algoliasearch/lite'
import { autocomplete, getAlgoliaResults } from '@algolia/autocomplete-js'
import { createLocalStorageRecentSearchesPlugin } from '@algolia/autocomplete-plugin-recent-searches'
-import Link from 'next/link'
+import { useRouter } from 'next/router'
const searchClient = algoliasearch(
process.env.NEXT_PUBLIC_ALGOLIA_APP_ID,
@@ -40,6 +40,7 @@ interface Props {}
const Search: FC<Props> = ({}) => {
const searchRef = useRef(null)
+ const router = useRouter()
useEffect(() => {
if (!searchRef.current) {
@@ -62,6 +63,14 @@ const Search: FC<Props> = ({}) => {
root
)
},
+ navigator: {
+ navigate({ itemUrl }) {
+ router.push(itemUrl)
+ },
+ },
+ onSelect({ item, setQuery, setIsOpen, refresh }) {
+ console.log('onSelect', item.url)
+ },
// @ts-ignore
getSources({ query }) {
return [
@@ -70,34 +79,37 @@ const Search: FC<Props> = ({}) => {
templates: {
item({ item, components }) {
return (
- <Link href={item.url as string}>
- <a className="aa-ItemLink truncate flex justify-between space-x-4">
- <div className="aa-ItemContent w-full">
- <div className="aa-ItemTitle flex items-center space-x-1">
- {item.category && (
- <p
- className={`${
- ['cli', 'api'].includes(item.category as string)
- ? 'uppercase'
- : 'capitalize'
- }`}
- >
- {item.category}
- {item.version ? ` (${item.version})` : ''}:
- </p>
- )}
- <p>
- <components.Highlight hit={item} attribute="title" />
+ // <Link href={item.url as string}>
+ <a
+ href={item.url as string}
+ className="aa-ItemLink truncate flex justify-between space-x-4"
+ >
+ <div className="aa-ItemContent w-full">
+ <div className="aa-ItemTitle flex items-center space-x-1">
+ {item.category && (
+ <p
+ className={`${
+ ['cli', 'api'].includes(item.category as string)
+ ? 'uppercase'
+ : 'capitalize'
+ }`}
+ >
+ {item.category}
+ {item.version ? ` (${item.version})` : ''}:
</p>
- </div>
- <p className="aa-ItemContentSubtitle">{item.description}</p>
+ )}
+ <p>
+ <components.Highlight hit={item} attribute="title" />
+ </p>
</div>
- {/* [Joshen] Thinking of adding some meta tags here like where the doc is from, what version etc */}
- {/* <div>
+ <p className="aa-ItemContentSubtitle">{item.description}</p>
+ </div>
+ {/* [Joshen] Thinking of adding some meta tags here like where the doc is from, what version etc */}
+ {/* <div>
<Badge color="gray">{item.source}</Badge>
</div> */}
- </a>
- </Link>
+ </a>
+ // </Link>
)
},
},
@@ -116,7 +128,6 @@ const Search: FC<Props> = ({}) => {
],
})
},
- onSelect({ item, setQuery, setIsOpen, refresh }) {},
},
]
},
diff --git a/apps/temp-docs/pages/_app.tsx b/apps/temp-docs/pages/_app.tsx
index a8c3175949b..0e5b07903fa 100644
--- a/apps/temp-docs/pages/_app.tsx
+++ b/apps/temp-docs/pages/_app.tsx
@@ -1,14 +1,18 @@
import React from 'react'
import type { AppProps } from 'next/app'
import { ThemeProvider } from '../components/Providers'
+import { SearchProvider } from '~/components/Navigation/DocSearch'
import '../styles/main.scss'
+import '../styles/docsearch.scss'
import '../styles/algolia-search.scss'
import '../styles/prism-okaidia.scss'
function MyApp({ Component, pageProps }: AppProps) {
return (
<ThemeProvider>
- <Component {...pageProps} />
+ <SearchProvider>
+ <Component {...pageProps} />
+ </SearchProvider>
</ThemeProvider>
)
}
diff --git a/apps/temp-docs/scripts/build-search.js b/apps/temp-docs/scripts/build-search.js
index ffc5a853dd5..3adf56a0012 100644
--- a/apps/temp-docs/scripts/build-search.js
+++ b/apps/temp-docs/scripts/build-search.js
@@ -63,7 +63,7 @@ async function walk(dir) {
const { id, title, description } = data
const url = (slug.includes('/generated') ? slug.replace('/generated', '') : slug)
- .replace('docs', '')
+ .replace('docs', '/docs')
.replace(/\.mdx$/, '')
const source = slug.includes('/reference') ? 'reference' : 'guide'
const object = {
@@ -74,6 +74,11 @@ async function walk(dir) {
url,
source,
content,
+ type: 'lvl1',
+ hierarchy: {
+ lvl0: 'Core Concepts',
+ lvl1: title,
+ },
}
if (slug.includes('/reference')) {
diff --git a/apps/temp-docs/styles/docsearch.scss b/apps/temp-docs/styles/docsearch.scss
new file mode 100644
index 00000000000..6ae9773850b
--- /dev/null
+++ b/apps/temp-docs/styles/docsearch.scss
@@ -0,0 +1,513 @@
+/* search modal */
+
+.DocSearch--active {
+ @apply overflow-hidden #{!important};
+}
+
+.DocSearch-Container {
+ background: rgba(0, 0, 0, 0.3);
+ @apply fixed top-0 left-0 z-[200] flex h-screen w-screen flex-col p-4 backdrop-blur-sm sm:p-6 md:p-[10vh] lg:p-[12vh];
+}
+
+.DocSearch-LoadingIndicator svg {
+ @apply hidden;
+}
+
+.DocSearch-LoadingIndicator {
+ display: none;
+ width: 1.5rem;
+ height: 1.5rem;
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='12' cy='12' r='9' stroke-width='2' stroke='%23cffafe' /%3E%3Cpath d='M3,12a9,9 0 1,0 18,0a9,9 0 1,0 -18,0' stroke-width='2' stroke='%2306b6d4' stroke-dasharray='56.5486677646' stroke-dashoffset='37.6991118431' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
+ background-size: 100% 100%;
+}
+
+.DocSearch-Container--Stalled .DocSearch-LoadingIndicator {
+ @apply block;
+}
+
+.DocSearch-Modal {
+ @apply dark:bg-scale-200 bg-scale-100;
+ margin: 0 auto;
+ width: 100%;
+ max-width: 47.375rem;
+ display: flex;
+ flex-direction: column;
+ min-height: 0;
+ border-radius: theme('borderRadius.lg');
+ box-shadow: theme('boxShadow.lg');
+}
+
+.DocSearch-SearchBar {
+ z-index: 1;
+ padding: 0 1rem;
+ @apply border-scale-400 relative flex flex-none items-center border-b;
+}
+
+.DocSearch-Form {
+ @apply flex min-w-0 flex-auto items-center;
+}
+
+.DocSearch-Dropdown-Container {
+ @apply pb-6;
+}
+
+.DocSearch-Dropdown {
+ @apply flex-auto overflow-auto;
+}
+
+.DocSearch-Hit--Result {
+ @apply relative mx-6;
+}
+
+.DocSearch-Hit--Result.DocSearch-Hit--Child {
+ @apply ml-12;
+}
+
+.DocSearch-Hit--Result.DocSearch-Hit--Child::before {
+ content: '';
+ position: absolute;
+ top: -0.25rem;
+ bottom: -0.25rem;
+ left: -1rem;
+ width: 1px;
+ background: theme('colors.scale.400');
+
+ // @apply dark:bg-slate-700;
+}
+
+.DocSearch-Hit > a {
+ position: relative;
+ font-size: 0.875rem;
+ // border-bottom: 1px solid theme('colors.slate.100');
+
+ // @apply dark:border-slate-200;
+}
+
+.DocSearch-Hit--Result {
+ // @apply border-b-0 #{!important};
+}
+
+.DocSearch-MagnifierLabel {
+ @apply h-6 w-6 flex-none;
+ background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m19 19-3.5-3.5' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='11' cy='11' r='6' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
+
+ .dark & {
+ background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m19 19-3.5-3.5' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='11' cy='11' r='6' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
+ }
+}
+
+.DocSearch-MagnifierLabel svg {
+ display: none;
+}
+
+.DocSearch-Container--Stalled .DocSearch-MagnifierLabel {
+ display: none;
+}
+
+.DocSearch-Input {
+ @apply text-scale-1200 placeholder-scale-900;
+ appearance: none;
+ background: transparent;
+ height: 3.5rem;
+ font-size: 1rem;
+ margin-left: 0.75rem;
+ margin-right: 1rem;
+ flex: auto;
+ min-width: 0;
+ border: none;
+}
+
+@screen sm {
+ .DocSearch-Input {
+ font-size: 0.875rem;
+ }
+}
+
+.DocSearch-Input:focus {
+ outline: 2px dotted transparent;
+}
+
+.DocSearch-Input::-webkit-search-cancel-button,
+.DocSearch-Input::-webkit-search-decoration,
+.DocSearch-Input::-webkit-search-results-button,
+.DocSearch-Input::-webkit-search-results-decoration {
+ display: none;
+}
+
+.DocSearch-Reset {
+ display: none;
+}
+
+.DocSearch-Cancel {
+ appearance: none;
+ flex: none;
+ font-size: 0;
+ border-radius: 0.375rem;
+ padding: 0.25rem 0.375rem;
+ @apply ring-scale-900 hover:ring-scale-900 dark:bg-scale-600 shadow-sm ring-1 hover:shadow dark:ring-0;
+ width: 1.75rem;
+ height: 1.5rem;
+ /* esc */
+ background-image: url("data:image/svg+xml,%3Csvg width='16' height='7' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M.506 6h3.931V4.986H1.736v-1.39h2.488V2.583H1.736V1.196h2.69V.182H.506V6ZM8.56 1.855h1.18C9.721.818 8.87.102 7.574.102c-1.276 0-2.21.705-2.205 1.762-.003.858.602 1.35 1.585 1.585l.634.159c.633.153.986.335.988.727-.002.426-.406.716-1.03.716-.64 0-1.1-.295-1.14-.878h-1.19c.03 1.259.931 1.91 2.343 1.91 1.42 0 2.256-.68 2.259-1.745-.003-.969-.733-1.483-1.744-1.71l-.523-.125c-.506-.117-.93-.304-.92-.722 0-.375.332-.65.934-.65.588 0 .949.267.994.724ZM15.78 2.219C15.618.875 14.6.102 13.254.102c-1.537 0-2.71 1.086-2.71 2.989 0 1.898 1.153 2.989 2.71 2.989 1.492 0 2.392-.992 2.526-2.063l-1.244-.006c-.117.623-.606.98-1.262.98-.883 0-1.483-.656-1.483-1.9 0-1.21.591-1.9 1.492-1.9.673 0 1.159.389 1.253 1.028h1.244Z' fill='%23334155'/%3E%3C/svg%3E");
+ background-position: center;
+ background-repeat: no-repeat;
+ background-size: 57.1428571429% auto;
+
+ .dark & {
+ background-image: url("data:image/svg+xml,%3Csvg width='16' height='7' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M.506 6h3.931V4.986H1.736v-1.39h2.488V2.583H1.736V1.196h2.69V.182H.506V6ZM8.56 1.855h1.18C9.721.818 8.87.102 7.574.102c-1.276 0-2.21.705-2.205 1.762-.003.858.602 1.35 1.585 1.585l.634.159c.633.153.986.335.988.727-.002.426-.406.716-1.03.716-.64 0-1.1-.295-1.14-.878h-1.19c.03 1.259.931 1.91 2.343 1.91 1.42 0 2.256-.68 2.259-1.745-.003-.969-.733-1.483-1.744-1.71l-.523-.125c-.506-.117-.93-.304-.92-.722 0-.375.332-.65.934-.65.588 0 .949.267.994.724ZM15.78 2.219C15.618.875 14.6.102 13.254.102c-1.537 0-2.71 1.086-2.71 2.989 0 1.898 1.153 2.989 2.71 2.989 1.492 0 2.392-.992 2.526-2.063l-1.244-.006c-.117.623-.606.98-1.262.98-.883 0-1.483-.656-1.483-1.9 0-1.21.591-1.9 1.492-1.9.673 0 1.159.389 1.253 1.028h1.244Z' fill='%2394a3b8'/%3E%3C/svg%3E");
+ }
+}
+
+.DocSearch-Reset svg {
+ display: none;
+}
+
+.DocSearch-Hit-source {
+ line-height: 1.5rem;
+ font-weight: 400;
+ color: theme('colors.scale.900');
+ padding-top: 2.5rem;
+ margin: 0 1.5rem 1rem;
+}
+
+.DocSearch-Hits:first-child .DocSearch-Hit-source {
+ padding-top: 1.5rem;
+}
+
+.DocSearch-Hit-Container {
+ display: flex;
+ align-items: center;
+}
+
+.DocSearch-Hit-Tree {
+ display: none;
+}
+
+.DocSearch-Hit-icon {
+ display: none;
+}
+
+.DocSearch-Hit--Result .DocSearch-Hit-icon {
+ display: block;
+ flex: none;
+ margin-right: 1rem;
+ width: 1.5rem;
+ height: 1.5rem;
+ border-radius: theme('borderRadius.md');
+ /* hash icon */
+ background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.75 1v10M8.25 1v10M1 3.75h10M1 8.25h10' stroke='%2394A3B8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
+ background-repeat: no-repeat;
+ background-position: center center;
+
+ @apply ring-scale-300 bg-white shadow-sm ring-1 dark:bg-slate-700 dark:ring-0;
+}
+
+.DocSearch-Hit--Parent .DocSearch-Hit-icon {
+ /* book icon */
+ background-image: url("data:image/svg+xml,%3Csvg width='14' height='10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M3.5 0c1.093 0 2.117.27 3 .743V10a6.344 6.344 0 0 0-3-.743c-1.093 0-2.617.27-3.5.743V.743C.883.27 2.407 0 3.5 0Z' fill='%23BAE6FD'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M10.5 0c1.093 0 2.617.27 3.5.743V10c-.883-.473-2.407-.743-3.5-.743s-2.117.27-3 .743V.743a6.344 6.344 0 0 1 3-.743Z' fill='%2338BDF8'/%3E%3C/svg%3E");
+}
+
+.DocSearch-Hit-icon svg {
+ display: none;
+}
+
+.DocSearch-Hit-content-wrapper {
+ flex: auto;
+ display: flex;
+ flex-direction: column-reverse;
+ min-width: 0;
+ z-index: 1;
+}
+
+.DocSearch-Hit-path {
+ align-self: flex-start;
+ font-size: 0.75rem;
+ line-height: 1.5rem;
+ font-weight: 400;
+ color: theme('colors.scale.1100');
+ border-radius: 999px;
+ padding: 0 0.75rem;
+ @apply bg-scale-300 dark:bg-scale-500;
+}
+
+.DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-icon {
+ // @apply bg-transparent shadow-none ring-1 ring-white/30 dark:ring-white/20;
+ // background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.75 1v10M8.25 1v10M1 3.75h10M1 8.25h10' stroke='%23fff' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
+}
+
+.DocSearch-Hit[aria-selected='true'] .DocSearch-Hit--Parent .DocSearch-Hit-icon {
+ /* book icon */
+ // background-image: url("data:image/svg+xml,%3Csvg width='14' height='10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M3.5 0c1.093 0 2.117.27 3 .743V10a6.344 6.344 0 0 0-3-.743c-1.093 0-2.617.27-3.5.743V.743C.883.27 2.407 0 3.5 0Z' fill='%23fff'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M10.5 0c1.093 0 2.617.27 3.5.743V10c-.883-.473-2.407-.743-3.5-.743s-2.117.27-3 .743V.743a6.344 6.344 0 0 1 3-.743Z' fill='%23fff'/%3E%3C/svg%3E");
+}
+
+.DocSearch-Hit-title {
+ @apply text-scale-1100 dark:text-scale-1100 truncate leading-6;
+}
+
+.DocSearch-Hit-title + .DocSearch-Hit-path {
+ @apply mb-1;
+}
+
+.DocSearch-Hit-action {
+ @apply ml-3.5 flex-none;
+}
+
+.DocSearch-Hit--Result {
+ .DocSearch-Hit-action svg {
+ @apply hidden;
+ }
+
+ .DocSearch-Hit-action {
+ // @apply h-6 w-6;
+ // background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m11 9 3 3-3 3' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
+ }
+
+ [aria-selected='true'] & .DocSearch-Hit-action {
+ // background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m11 9 3 3-3 3' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
+ }
+
+ .DocSearch-Hit[aria-selected='true'] & .DocSearch-Hit-path {
+ // @apply bg-scale-400 dark:bg-scale-400;
+ }
+
+ .DocSearch-Hit[aria-selected='true'] & .DocSearch-Hit-title {
+ // @apply text-white;
+ }
+}
+
+.DocSearch-Hit-action-button {
+ @apply flex;
+}
+
+.DocSearch-Hit-action + .DocSearch-Hit-action {
+ @apply ml-2;
+}
+
+.DocSearch-Hit-action path {
+ stroke-width: 2px;
+ stroke: #71717a;
+}
+
+.DocSearch-Hit[aria-selected='true'] .DocSearch-Hit-action path {
+ stroke: white;
+}
+
+.DocSearch-Hit > a {
+ @apply block py-4 px-6;
+}
+
+.DocSearch-Hit--Result {
+ @apply py-3 px-4 #{!important};
+}
+
+.DocSearch-Hit {
+ @apply relative;
+}
+
+.DocSearch-Hit:first-child > a {
+ // @apply border-t border-slate-100 dark:border-slate-200;
+}
+
+.DocSearch-Hit--Result {
+ // @apply border-t-0 #{!important};
+}
+
+.DocSearch-Hit + .DocSearch-Hit .DocSearch-Hit--Result {
+ @apply mt-2;
+}
+
+.DocSearch-Hit--Result {
+ @apply dark:bg-scale-300 border-scale-400 rounded-lg border bg-white transition-all;
+}
+
+.DocSearch-Hit[aria-selected='true'] > a {
+ @apply bg-slate-50 dark:bg-slate-700;
+}
+
+.DocSearch-Hit[aria-selected='true'] .DocSearch-Hit--Result {
+ @apply bg-scale-200 dark:bg-scale-600;
+}
+
+.DocSearch-Hit--FirstChild::before {
+ @apply top-0 #{!important};
+}
+
+.DocSearch-Hit--LastChild::before {
+ @apply bottom-0 #{!important};
+}
+
+.DocSearch-Hits mark {
+ background: none;
+ @apply text-scale-1200 border-scale-900 border-b-2 font-semibold;
+}
+
+.DocSearch-Hit-path mark {
+ @apply border-0;
+}
+
+.DocSearch-Hit[aria-selected='true'] mark {
+ @apply text-scale-1200;
+ border-bottom-color: currentColor;
+}
+
+.DocSearch-Footer {
+ @apply flex flex-none justify-end border-t border-slate-100 py-4 px-6 dark:border-slate-200;
+}
+
+.DocSearch-Commands {
+ @apply hidden;
+}
+
+.DocSearch-Logo a {
+ @apply text-scale-900 flex items-center text-xs font-medium;
+}
+
+.DocSearch-Logo svg {
+ @apply text-scale-900 ml-3 text-[#5468ff];
+}
+
+.DocSearch-Hit--deleting,
+.DocSearch-Hit--favoriting {
+ opacity: 0;
+ transition: all 250ms linear;
+}
+
+.DocSearch-NoResults .DocSearch-Screen-Icon {
+ @apply hidden;
+}
+
+.DocSearch-Title {
+ @apply mb-10 text-lg leading-6;
+}
+
+.DocSearch-Title strong {
+ @apply text-slate-1200 dark:text-scale-1200 font-normal;
+}
+
+.DocSearch-StartScreen .DocSearch-Help {
+ @apply py-16 px-6 text-center text-slate-400;
+}
+
+.DocSearch-NoResults {
+ @apply px-4 pt-10 pb-8;
+}
+
+.DocSearch-NoResults .DocSearch-Title {
+ text-align: center;
+ color: theme('colors.scale.1100');
+}
+
+.DocSearch-NoResults-Prefill-List .DocSearch-Help {
+ @apply text-scale-900 dark:text-scale-200 mb-3 text-sm leading-6;
+}
+
+.DocSearch-NoResults-Prefill-List ul {
+ @apply border-scale-300 dark:border-scale-400 dark:bg-scale-300 overflow-hidden rounded-lg border bg-white;
+}
+
+.DocSearch-NoResults-Prefill-List button {
+ padding: 0.5rem 0.75rem;
+ display: block;
+ width: 100%;
+ text-align: left;
+ font-size: theme('fontSize.sm');
+ line-height: theme('lineHeight.6');
+ background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m11 9 3 3-3 3' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
+ background-repeat: no-repeat;
+ background-position: right 0.75rem center;
+
+ @apply text-scale-900 hover:text-slate-1200 dark:bg-scale-300 hover:bg-scale-200 dark:hover:bg-scale-400 bg-white;
+}
+
+.DocSearch-NoResults-Prefill-List li + li button {
+ @apply border-scale-300 border-t dark:border-slate-400;
+}
+
+.DocSearch-NoResults-Prefill-List + .DocSearch-Help {
+ @apply mt-3 text-xs leading-6;
+}
+
+.DocSearch-NoResults-Prefill-List + .DocSearch-Help a {
+ @apply text-scale-900 dark:text-scale-900 font-semibold;
+}
+
+.DocSearch-Hit-action [data-cy] {
+ width: 1.5rem;
+ height: 1.5rem;
+}
+
+.DocSearch-Hit-action [data-cy] svg {
+ display: none;
+}
+
+.DocSearch-Hit-action [data-cy='fav-recent'] {
+ background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12 5 2 5h5l-4 4 2 5-5-3-5 3 2-5-4-4h5l2-5Z' stroke='%23CBD5E1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
+
+ .dark & {
+ background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12 5 2 5h5l-4 4 2 5-5-3-5 3 2-5-4-4h5l2-5Z' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
+ }
+}
+
+.DocSearch-Hit-action [data-cy='fav-recent']:hover {
+ background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12 5 2 5h5l-4 4 2 5-5-3-5 3 2-5-4-4h5l2-5Z' stroke='%230ea5e9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
+}
+
+.DocSearch-Hit-action [data-cy='remove-recent'] {
+ background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17 7 7 17M7 7l10 10' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
+
+ .dark & {
+ background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17 7 7 17M7 7l10 10' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
+ }
+}
+
+.DocSearch-Hit-action [data-cy='remove-recent']:hover {
+ background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17 7 7 17M7 7l10 10' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
+
+ .dark & {
+ background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17 7 7 17M7 7l10 10' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
+ }
+}
+
+.DocSearch-Hit-action [data-cy='remove-fav']::before {
+ @apply pointer-events-none absolute inset-0 bg-sky-50 content-[''] dark:bg-slate-700;
+}
+
+.DocSearch-Hit[aria-selected='true'] [data-cy='remove-fav']::before {
+ @apply bg-sky-100 dark:bg-slate-700;
+}
+
+.DocSearch-Hit-action [data-cy='remove-fav']::after {
+ content: '';
+ position: absolute;
+ pointer-events: none;
+ width: calc(4.5rem + 1px);
+ height: 1.5rem;
+ margin-left: calc(-3rem - 1px);
+ background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12 5 2 5h5l-4 4 2 5-5-3-5 3 2-5-4-4h5l2-5Z' fill='%230EA5E9' stroke='%230EA5E9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
+ url("data:image/svg+xml,%3Csvg width='1' height='1' fill='%23e2e8f0' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1' height='1'/%3E%3C/svg%3E"),
+ url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17 7 7 17M7 7l10 10' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
+ background-repeat: no-repeat, repeat-y, no-repeat;
+ background-position: left, center, right;
+
+ .dark & {
+ background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12 5 2 5h5l-4 4 2 5-5-3-5 3 2-5-4-4h5l2-5Z' fill='%230EA5E9' stroke='%230EA5E9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
+ url("data:image/svg+xml,%3Csvg width='1' height='1' fill='%23e2e8f0' opacity='0.05' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1' height='1'/%3E%3C/svg%3E"),
+ url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17 7 7 17M7 7l10 10' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
+ }
+}
+
+.DocSearch-Hit-action [data-cy='remove-fav']:hover::after {
+ background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12 5 2 5h5l-4 4 2 5-5-3-5 3 2-5-4-4h5l2-5Z' fill='%230EA5E9' stroke='%230EA5E9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
+ url("data:image/svg+xml,%3Csvg width='1' height='1' fill='%23e2e8f0' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1' height='1'/%3E%3C/svg%3E"),
+ url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17 7 7 17M7 7l10 10' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
+
+ .dark & {
+ background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12 5 2 5h5l-4 4 2 5-5-3-5 3 2-5-4-4h5l2-5Z' fill='%230EA5E9' stroke='%230EA5E9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
+ url("data:image/svg+xml,%3Csvg width='1' height='1' fill='%23e2e8f0' opacity='0.05' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1' height='1'/%3E%3C/svg%3E"),
+ url("data:image/svg+xml,%3Csvg width='24' height='24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17 7 7 17M7 7l10 10' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
+ }
+}
+
+.DocSearch-Hit-action + .DocSearch-Hit-action {
+ // @apply ml-3 border-l border-slate-200 pl-3 dark:border-slate-200;
+}
\ No newline at end of file