Skip to content

Commit

Permalink
nextra package rename
Browse files Browse the repository at this point in the history
  • Loading branch information
szabinakov committed Feb 8, 2024
1 parent a83df79 commit 6b408dd
Show file tree
Hide file tree
Showing 18 changed files with 48 additions and 40 deletions.
2 changes: 1 addition & 1 deletion packages/nextra-theme-docs/src/components/404.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMounted } from '@charisma-ai/nextra/hooks'
import { useRouter } from 'next/router'
import { useMounted } from 'nextra/hooks'
import type { ReactElement } from 'react'
import { useConfig } from '../contexts'
import { getGitIssueUrl, renderComponent } from '../utils'
Expand Down
2 changes: 1 addition & 1 deletion packages/nextra-theme-docs/src/components/500.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMounted } from '@charisma-ai/nextra/hooks'
import { useRouter } from 'next/router'
import { useMounted } from 'nextra/hooks'
import type { ReactElement } from 'react'
import { useConfig } from '../contexts'
import { getGitIssueUrl, renderComponent } from '../utils'
Expand Down
2 changes: 1 addition & 1 deletion packages/nextra-theme-docs/src/components/back-to-top.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ArrowRightIcon } from '@charisma-ai/nextra/icons'
import cn from 'clsx'
import { ArrowRightIcon } from 'nextra/icons'
import type { ReactElement } from 'react'
import { useEffect, useRef } from 'react'

Expand Down
2 changes: 1 addition & 1 deletion packages/nextra-theme-docs/src/components/banner.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { XIcon } from '@charisma-ai/nextra/icons'
import cn from 'clsx'
import { XIcon } from 'nextra/icons'
import type { ReactElement } from 'react'
import { useConfig } from '../contexts'
import { renderComponent } from '../utils'
Expand Down
4 changes: 2 additions & 2 deletions packages/nextra-theme-docs/src/components/breadcrumb.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ArrowRightIcon } from '@charisma-ai/nextra/icons'
import type { Item } from '@charisma-ai/nextra/normalize-pages'
import cn from 'clsx'
import { ArrowRightIcon } from 'nextra/icons'
import type { Item } from 'nextra/normalize-pages'
import type { ReactElement } from 'react'
import { Fragment } from 'react'
import { Anchor } from './anchor'
Expand Down
2 changes: 1 addition & 1 deletion packages/nextra-theme-docs/src/components/head.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useMounted } from '@charisma-ai/nextra/hooks'
import type { NextSeoProps } from 'next-seo'
import { NextSeo } from 'next-seo'
import { useTheme } from 'next-themes'
import NextHead from 'next/head'
import { useMounted } from 'nextra/hooks'
import type { ReactElement } from 'react'
import { useConfig } from '../contexts'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GlobeIcon } from '@charisma-ai/nextra/icons'
import { addBasePath } from 'next/dist/client/add-base-path'
import { useRouter } from 'next/router'
import { GlobeIcon } from 'nextra/icons'
import type { ReactElement } from 'react'
import { useConfig } from '../contexts'
import { Select } from './select'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Item as NormalItem } from '@charisma-ai/nextra/normalize-pages'
import { matchSorter } from 'match-sorter'
import type { Item as NormalItem } from 'nextra/normalize-pages'
import type { ReactElement } from 'react'
import { useMemo, useState } from 'react'
import type { SearchResult } from '../types'
Expand Down
4 changes: 2 additions & 2 deletions packages/nextra-theme-docs/src/components/nav-links.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ArrowRightIcon } from '@charisma-ai/nextra/icons'
import type { Item } from '@charisma-ai/nextra/normalize-pages'
import cn from 'clsx'
import { ArrowRightIcon } from 'nextra/icons'
import type { Item } from 'nextra/normalize-pages'
import type { ReactElement } from 'react'
import { useConfig } from '../contexts'
import type { DocsThemeConfig } from '../index'
Expand Down
10 changes: 7 additions & 3 deletions packages/nextra-theme-docs/src/components/navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { useFSRoute } from '@charisma-ai/nextra/hooks'
import { ArrowRightIcon, MenuIcon } from '@charisma-ai/nextra/icons'
import type {
Item,
MenuItem,
PageItem
} from '@charisma-ai/nextra/normalize-pages'
import { Menu, Transition } from '@headlessui/react'
import cn from 'clsx'
import { useFSRoute } from 'nextra/hooks'
import { ArrowRightIcon, MenuIcon } from 'nextra/icons'
import type { Item, MenuItem, PageItem } from 'nextra/normalize-pages'
import type { ReactElement, ReactNode } from 'react'
import { useConfig, useMenu } from '../contexts'
import { renderComponent } from '../utils'
Expand Down
4 changes: 2 additions & 2 deletions packages/nextra-theme-docs/src/components/search.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useMounted } from '@charisma-ai/nextra/hooks'
import { InformationCircleIcon, SpinnerIcon } from '@charisma-ai/nextra/icons'
import { Transition } from '@headlessui/react'
import cn from 'clsx'
import { useRouter } from 'next/router'
import { useMounted } from 'nextra/hooks'
import { InformationCircleIcon, SpinnerIcon } from 'nextra/icons'
import type { CompositionEvent, KeyboardEvent, ReactElement } from 'react'
import { Fragment, useCallback, useEffect, useRef, useState } from 'react'
import { useConfig, useMenu } from '../contexts'
Expand Down
4 changes: 2 additions & 2 deletions packages/nextra-theme-docs/src/components/select.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useMounted } from '@charisma-ai/nextra/hooks'
import { CheckIcon } from '@charisma-ai/nextra/icons'
import { Listbox, Transition } from '@headlessui/react'
import cn from 'clsx'
import { useMounted } from 'nextra/hooks'
import { CheckIcon } from 'nextra/icons'
import type { ReactElement, ReactNode } from 'react'
import { createPortal } from 'react-dom'
import { usePopper } from '../utils'
Expand Down
18 changes: 11 additions & 7 deletions packages/nextra-theme-docs/src/components/sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import type { Heading } from '@charisma-ai/nextra'
import { useFSRoute, useMounted } from '@charisma-ai/nextra/hooks'
import { ArrowRightIcon, ExpandIcon } from '@charisma-ai/nextra/icons'
import type {
Item,
MenuItem,
PageItem
} from '@charisma-ai/nextra/normalize-pages'
import cn from 'clsx'
import { useRouter } from 'next/router'
import type { Heading } from 'nextra'
import { useFSRoute, useMounted } from 'nextra/hooks'
import { ArrowRightIcon, ExpandIcon } from 'nextra/icons'
import type { Item, MenuItem, PageItem } from 'nextra/normalize-pages'
import type { ReactElement } from 'react'
import {
createContext,
Expand Down Expand Up @@ -45,12 +49,12 @@ const classes = {
),
inactive: cn(
'nx-text-gray-500 hover:nx-bg-gray-100 hover:nx-text-gray-900',
'dark:hover:nx-bg-primary-100/5 dark:hover:nx-text-gray-50',
'dark:nx-text-neutral-400 dark:hover:nx-bg-primary-100/5 dark:hover:nx-text-gray-50',
'contrast-more:nx-text-gray-900 contrast-more:dark:nx-text-gray-50',
'contrast-more:nx-border-transparent contrast-more:hover:nx-border-gray-900 contrast-more:dark:hover:nx-border-gray-50'
),
active: cn(
'nx-bg-primary-100 nx-font-semibold nx-text-primary-800 dark:nx-bg-primary-400/10 dark:nx-text-[rgb(56_239_125)]',
'nx-bg-primary-100 nx-font-semibold nx-text-primary-800 dark:nx-bg-primary-400/10 dark:nx-text-primary-600',
'contrast-more:nx-border-primary-500 contrast-more:dark:nx-border-primary-500'
),
list: cn('nx-flex nx-flex-col nx-gap-1'),
Expand Down Expand Up @@ -470,7 +474,7 @@ export function Sidebar({
'nx-bg-white dark:nx-bg-dark', // when banner is showed, sidebar links can be behind menu, set bg color as body bg color
'nx-mx-4 nx-py-4 nx-shadow-[0_-12px_16px_#fff]',
'nx-flex nx-items-center nx-gap-2',
'dark:nx-border-neutral-800 dark:nx-shadow-[0_-12px_16px_rgb(32_38_44)]',
'dark:nx-border-neutral-800 dark:nx-shadow-[0_-12px_16px_#111]',
'contrast-more:nx-border-neutral-400 contrast-more:nx-shadow-none contrast-more:dark:nx-shadow-none',
showSidebar
? cn(hasI18n && 'nx-justify-end', 'nx-border-t')
Expand Down
4 changes: 2 additions & 2 deletions packages/nextra-theme-docs/src/components/theme-switch.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMounted } from '@charisma-ai/nextra/hooks'
import { MoonIcon, SunIcon } from '@charisma-ai/nextra/icons'
import { useTheme } from 'next-themes'
import { useMounted } from 'nextra/hooks'
import { MoonIcon, SunIcon } from 'nextra/icons'
import type { ReactElement } from 'react'
import { z } from 'zod'
import { useConfig } from '../contexts'
Expand Down
4 changes: 2 additions & 2 deletions packages/nextra-theme-docs/src/constants.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint sort-keys: error */
import { DiscordIcon, GitHubIcon } from '@charisma-ai/nextra/icons'
import type { Item } from '@charisma-ai/nextra/normalize-pages'
import type { NextSeoProps } from 'next-seo'
import { useRouter } from 'next/router'
import { DiscordIcon, GitHubIcon } from 'nextra/icons'
import type { Item } from 'nextra/normalize-pages'
import type { FC, ReactNode } from 'react'
import { isValidElement } from 'react'
import { z } from 'zod'
Expand Down
4 changes: 2 additions & 2 deletions packages/nextra-theme-docs/src/contexts/config.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { FrontMatter, PageMapItem, PageOpts } from '@charisma-ai/nextra'
import { metaSchema } from '@charisma-ai/nextra/normalize-pages'
import { ThemeProvider } from 'next-themes'
import type { FrontMatter, PageMapItem, PageOpts } from 'nextra'
import { metaSchema } from 'nextra/normalize-pages'
import type { ReactElement, ReactNode } from 'react'
import { createContext, useContext, useState } from 'react'
import type { ZodError } from 'zod'
Expand Down
14 changes: 7 additions & 7 deletions packages/nextra-theme-docs/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import type { NextraThemeLayoutProps, PageOpts } from '@charisma-ai/nextra'
import { useRouter } from 'next/router'
import type { NextraThemeLayoutProps, PageOpts } from 'nextra'
import type { ReactElement, ReactNode } from 'react'
import { useMemo } from 'react'
import 'focus-visible'
import { useFSRoute, useMounted } from '@charisma-ai/nextra/hooks'
import { MDXProvider } from '@charisma-ai/nextra/mdx'
import cn from 'clsx'
import { useFSRoute, useMounted } from 'nextra/hooks'
import { MDXProvider } from 'nextra/mdx'
import './polyfill'
import type { PageTheme } from 'nextra/normalize-pages'
import { normalizePages } from 'nextra/normalize-pages'
import type { PageTheme } from '@charisma-ai/nextra/normalize-pages'
import { normalizePages } from '@charisma-ai/nextra/normalize-pages'
import {
Banner,
Breadcrumb,
Expand Down Expand Up @@ -252,7 +252,7 @@ export default function Layout({
}

export { useConfig, PartialDocsThemeConfig as DocsThemeConfig }
export { useMDXComponents } from 'nextra/mdx'
export { useMDXComponents } from '@charisma-ai/nextra/mdx'
export {
Callout,
Steps,
Expand All @@ -261,7 +261,7 @@ export {
Cards,
Card,
FileTree
} from 'nextra/components'
} from '@charisma-ai/nextra/components'
export { useTheme } from 'next-themes'
export { Link } from './mdx-components'
export {
Expand Down
4 changes: 2 additions & 2 deletions packages/nextra-theme-docs/src/mdx-components.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Code, Pre, Table, Td, Th, Tr } from '@charisma-ai/nextra/components'
import type { Components } from '@charisma-ai/nextra/mdx'
import cn from 'clsx'
import { Code, Pre, Table, Td, Th, Tr } from 'nextra/components'
import type { Components } from 'nextra/mdx'
import type { ComponentProps, ReactElement, ReactNode } from 'react'
import { Children, cloneElement, useEffect, useRef, useState } from 'react'
import { Anchor, Collapse } from './components'
Expand Down

0 comments on commit 6b408dd

Please sign in to comment.