Skip to content

Commit

Permalink
cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
talentlessguy committed Jan 11, 2025
1 parent 54e02e1 commit 852489a
Show file tree
Hide file tree
Showing 10 changed files with 132 additions and 98 deletions.
2 changes: 1 addition & 1 deletion components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@vanilla-extract/sprinkles": "^1.6.3",
"clsx": "^2.1.1",
"react-transition-state": "^2.1.3",
"ts-pattern": "^5.5.0"
"ts-pattern": "^5.6.0"
},
"devDependencies": {
"@testing-library/dom": "^10.4.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import type { TransitionState } from 'react-transition-state'
import { useTransition } from 'react-transition-state'
import { useTransitionState } from 'react-transition-state'

import { Portal } from '../Portal/Portal'
import type { BoxProps } from '../Box/Box'
Expand Down Expand Up @@ -225,7 +225,7 @@ export const DynamicPopover: React.FC<DynamicPopoverProps> = ({

const isControlled = isOpen !== undefined

const [state, toggle] = useTransition({
const [state, toggle] = useTransitionState({
preEnter: true,
exit: true,
mountOnEnter: true,
Expand Down
4 changes: 2 additions & 2 deletions components/src/components/molecules/Backdrop/Backdrop.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import type { TransitionState } from 'react-transition-state'
import { useTransition } from 'react-transition-state'
import { useTransitionState } from 'react-transition-state'

import { Portal } from '../../atoms/Portal/Portal'

Expand Down Expand Up @@ -31,7 +31,7 @@ export const Backdrop: React.FC<BackdropProps> = ({
open,
renderCallback,
}) => {
const [state, toggle] = useTransition({
const [state, toggle] = useTransitionState({
timeout: {
enter: 50,
exit: 300,
Expand Down
4 changes: 2 additions & 2 deletions components/src/components/molecules/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as React from 'react'
import { useEffect } from 'react'

import type { TransitionState } from 'react-transition-state'
import { useTransition } from 'react-transition-state'
import { useTransitionState } from 'react-transition-state'

import { useDocumentEvent } from '@/src/hooks/useDocumentEvent'

Expand Down Expand Up @@ -693,7 +693,7 @@ export const Select = React.forwardRef<HTMLInputElement, SelectProps>(
maxInputSize,
)

const [state, toggle] = useTransition({
const [state, toggle] = useTransitionState({
timeout: {
enter: 0,
exit: 300,
Expand Down
8 changes: 2 additions & 6 deletions docs/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import { createVanillaExtractPlugin } from '@vanilla-extract/next-plugin'
import path from 'node:path'
const withVanillaExtract = createVanillaExtractPlugin({ identifiers: 'short' })
import nextMDX from '@next/mdx'
import { globSync } from 'node:fs'

const withMDX = nextMDX({
extension: /\.mdx?$/,
})
import { globSync } from 'node:fs'

const getComponentPaths = category =>
globSync(`./src/reference/mdx/${category}/*.docs.mdx`, {
Expand Down Expand Up @@ -55,4 +51,4 @@ const config = {
}

/** @type {import('next').NextConfig} */
export default withVanillaExtract(withMDX(config))
export default withVanillaExtract(config)
4 changes: 1 addition & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@
"ts-pattern": "^5.5.0"
},
"devDependencies": {
"@mdx-js/loader": "^1.6.22",
"@mdx-js/react": "^1.6.22",
"@next/mdx": "^12.0.1",
"@types/mdx-js__react": "^1.5.5",
"@types/node": "^22.9.0",
"@types/node": "^22.10.5",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.2.13",
"@types/webpack-env": "^1.18.5",
Expand Down
43 changes: 43 additions & 0 deletions docs/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import matter from 'gray-matter'
import type { MDXRemoteSerializeResult } from 'next-mdx-remote'
import { MDXRemote } from 'next-mdx-remote'
import { serialize } from 'next-mdx-remote/serialize'
import { readFileSync } from 'node:fs'
import { Header, Link } from '~/components'

const Home = ({ mdxSource }: { mdxSource: MDXRemoteSerializeResult }) => (
<>
<Header
description={(
<>
Design system for
{' '}
<Link href="https://ens.domains">ENS</Link>
{' '}
built with
{' '}
<Link href="https://reactjs.org/">React</Link>
.
</>
)}
title="ENS Design System (alpha)"
/>
<MDXRemote {...mdxSource} />
</>
)

export default Home

export const getStaticProps = async () => {
const source = readFileSync('./src/reference/index.mdx')

const { content, data } = matter(source)

const mdxSource = await serialize(content, {
scope: data,
})

return {
props: { mdxSource },
}
}
12 changes: 0 additions & 12 deletions docs/src/pages/index.mdx → docs/src/reference/index.mdx
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
import { Header, Link } from '~/components'

<Header
description={
<>
Design system for <Link href="https://ens.domains">ENS</Link> built with{' '}
<Link href="https://reactjs.org/">React</Link>.
</>
}
title="ENS Design System (alpha)"
/>

## Install

```bash
Expand Down
4 changes: 2 additions & 2 deletions docs/src/reference/mdx/atoms/RecordItem.docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ import { RecordItem } from '@ensdomains/thorin'

```tsx live=true
<Box display="flex" flexDirection="column" gap="4">
<RecordItem keyLabel="FLAME" keySublabel="Legacy" value="0xb794f5ea0ba39494ce839613fffba74279579268">
<RecordItem keyLabel="Label" keySublabel="Sublabel" value="0xb794f5ea0ba39494ce839613fffba74279579268">
0xb794f5ea0ba39494ce839613fffba74279579268
</RecordItem>
<RecordItem icon={FlameSVG} value="0xb794f5ea0ba39494ce839613fffba74279579268">
0xb794f5ea0ba39494ce839613fffba74279579268
</RecordItem>
<RecordItem inline keyLabel="FLAME_LEGACY" value="0xb794f5ea0ba39494ce839613fffba74279579268">
<RecordItem inline keyLabel="Label" value="0xb794f5ea0ba39494ce839613fffba74279579268">
0xb794...9268
</RecordItem>
<RecordItem icon={FlameSVG} inline value="0xb794f5ea0ba39494ce839613fffba74279579268">
Expand Down
Loading

0 comments on commit 852489a

Please sign in to comment.