Skip to content

Commit

Permalink
feat(website): continue migration to TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
plouc committed Dec 27, 2021
1 parent 7a244d2 commit fe2652f
Show file tree
Hide file tree
Showing 150 changed files with 933 additions and 972 deletions.
8 changes: 0 additions & 8 deletions packages/bump/index.d.ts
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { AxisProps } from '@nivo/axes'
import { Component, MouseEvent } from 'react'
import { Dimensions, Box, Theme, MotionProps, SvgDefsAndFill, CssMixBlendMode } from '@nivo/core'
Expand Down
8 changes: 0 additions & 8 deletions packages/bump/src/area-bump/Area.js
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { memo } from 'react'
import PropTypes from 'prop-types'
import { useSpring, animated } from '@react-spring/web'
Expand Down
8 changes: 0 additions & 8 deletions packages/bump/src/area-bump/AreaBump.js
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { memo, useState, Fragment, useMemo } from 'react'
import { bindDefs, withContainer, useDimensions, SvgWrapper } from '@nivo/core'
import { Grid, Axes } from '@nivo/axes'
Expand Down
8 changes: 0 additions & 8 deletions packages/bump/src/area-bump/AreaTooltip.js
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { memo } from 'react'
import PropTypes from 'prop-types'
import { BasicTooltip } from '@nivo/tooltip'
Expand Down
8 changes: 0 additions & 8 deletions packages/bump/src/area-bump/AreasLabels.js
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { memo } from 'react'
import PropTypes from 'prop-types'
import { useSprings, animated } from '@react-spring/web'
Expand Down
8 changes: 0 additions & 8 deletions packages/bump/src/area-bump/ResponsiveAreaBump.js
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { ResponsiveWrapper } from '@nivo/core'
import AreaBump from './AreaBump'

Expand Down
8 changes: 0 additions & 8 deletions packages/bump/src/area-bump/compute.js
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { scalePoint, scaleLinear } from 'd3-scale'

export const computeSeries = ({ data, width, height, align, spacing, xPadding }) => {
Expand Down
8 changes: 0 additions & 8 deletions packages/bump/src/area-bump/hooks.js
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { createElement, useMemo, useCallback } from 'react'
import { area as d3Area, curveBasis, curveLinear } from 'd3-shape'
import { useTheme } from '@nivo/core'
Expand Down
8 changes: 0 additions & 8 deletions packages/bump/src/area-bump/index.js
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
export { default as AreaBump } from './AreaBump'
export { default as ResponsiveAreaBump } from './ResponsiveAreaBump'
export * from './props'
8 changes: 0 additions & 8 deletions packages/bump/src/area-bump/props.js
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import PropTypes from 'prop-types'
import { motionPropTypes, blendModePropType } from '@nivo/core'
import { ordinalColorsPropType, inheritedColorPropType } from '@nivo/colors'
Expand Down
8 changes: 0 additions & 8 deletions packages/bump/src/bump/Bump.js
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { createElement, memo, useMemo, useState, Fragment } from 'react'
import { withContainer, useDimensions, SvgWrapper } from '@nivo/core'
import { Grid, Axes } from '@nivo/axes'
Expand Down
8 changes: 0 additions & 8 deletions packages/bump/src/bump/Line.js
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { memo } from 'react'
import PropTypes from 'prop-types'
import { useSpring, animated } from '@react-spring/web'
Expand Down
8 changes: 0 additions & 8 deletions packages/bump/src/bump/LineTooltip.js
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { memo } from 'react'
import PropTypes from 'prop-types'
import { BasicTooltip } from '@nivo/tooltip'
Expand Down
8 changes: 0 additions & 8 deletions packages/bump/src/bump/LinesLabels.js
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { memo } from 'react'
import PropTypes from 'prop-types'
import { useSprings, animated } from '@react-spring/web'
Expand Down
8 changes: 0 additions & 8 deletions packages/bump/src/bump/Point.js
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { memo } from 'react'
import PropTypes from 'prop-types'
import { useSpring, animated, to } from '@react-spring/web'
Expand Down
8 changes: 0 additions & 8 deletions packages/bump/src/bump/Points.js
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { createElement, memo } from 'react'
import PropTypes from 'prop-types'

Expand Down
8 changes: 0 additions & 8 deletions packages/bump/src/bump/ResponsiveBump.js
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { ResponsiveWrapper } from '@nivo/core'
import Bump from './Bump'

Expand Down
8 changes: 0 additions & 8 deletions packages/bump/src/bump/compute.js
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { scalePoint } from 'd3-scale'

export const computeSeries = ({ width, height, data, xPadding, xOuterPadding, yOuterPadding }) => {
Expand Down
8 changes: 0 additions & 8 deletions packages/bump/src/bump/hooks.js
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { createElement, useMemo, useCallback } from 'react'
import { line as d3Line, curveBasis, curveLinear } from 'd3-shape'
import { useTheme } from '@nivo/core'
Expand Down
8 changes: 0 additions & 8 deletions packages/bump/src/bump/index.js
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
export { default as Bump } from './Bump'
export { default as ResponsiveBump } from './ResponsiveBump'
export * from './props'
8 changes: 0 additions & 8 deletions packages/bump/src/bump/props.js
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import PropTypes from 'prop-types'
import { motionPropTypes } from '@nivo/core'
import { ordinalColorsPropType, inheritedColorPropType } from '@nivo/colors'
Expand Down
8 changes: 0 additions & 8 deletions packages/bump/src/index.js
@@ -1,10 +1,2 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
export * from './bump'
export * from './area-bump'
31 changes: 25 additions & 6 deletions packages/core/index.d.ts
Expand Up @@ -247,6 +247,10 @@ declare module '@nivo/core' {

export function useAnimatedPath(path: string): Interpolation<string>

// ------------------------------------------------------------------------
// Patterns & Gradients
// ------------------------------------------------------------------------

export type GradientColor = {
offset: number
color: string
Expand Down Expand Up @@ -283,10 +287,20 @@ declare module '@nivo/core' {
padding?: number
stagger?: boolean
}
export function patternDotsDef(
id: string,
options?: Omit<PatternDotsDef, 'id' | 'type'>
): PatternDotsDef
export function PatternDots(props: Omit<PatternDotsDef, 'type'>): JSX.Element

export type PatternSquaresDef = Omit<PatternDotsDef, 'type'> & {
type: 'patternSquares'
}
export function patternSquaresDef(
id: string,
options?: Omit<PatternSquaresDef, 'id' | 'type'>
): PatternSquaresDef
export function PatternSquares(props: Omit<PatternSquaresDef, 'type'>): JSX.Element

export type PatternLinesDef = {
id: string
Expand All @@ -297,13 +311,24 @@ declare module '@nivo/core' {
color?: string
lineWidth?: number
}
export function patternLinesDef(
id: string,
options?: Omit<PatternLinesDef, 'id' | 'type'>
): PatternLinesDef
export function PatternLines(props: Omit<PatternLinesDef, 'type'>): JSX.Element

export type Def = LinearGradientDef | PatternDotsDef | PatternSquaresDef | PatternLinesDef

export type DefsProps = {
defs: Def[]
}

export function Defs(props: DefsProps): JSX.Element

// ------------------------------------------------------------------------
// Motion
// ------------------------------------------------------------------------

export const defaultAnimate = true
export const defaultMotionStiffness = 90
export const defaultMotionDamping = 15
Expand All @@ -324,12 +349,6 @@ declare module '@nivo/core' {
}
export const defaultMargin: DefaultMargin

export function PatternLines(props: Omit<PatternLinesDef, 'type'>): JSX.Element
export function PatternSquares(props: Omit<PatternSquaresDef, 'type'>): JSX.Element
export function PatternDots(props: Omit<PatternDotsDef, 'type'>): JSX.Element

export function Defs(props: DefsProps): JSX.Element

export function degreesToRadians(degrees: number): number
export function radiansToDegrees(radians: number): number
export function absoluteAngleDegrees(degrees: number): number
Expand Down
8 changes: 0 additions & 8 deletions packages/core/src/components/defs/patterns/PatternDots.js
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { memo } from 'react'
import PropTypes from 'prop-types'

Expand Down
8 changes: 0 additions & 8 deletions packages/core/src/components/defs/patterns/PatternLines.js
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { memo } from 'react'
import PropTypes from 'prop-types'
import { degreesToRadians } from '../../../lib/polar'
Expand Down
8 changes: 0 additions & 8 deletions packages/core/src/components/defs/patterns/PatternSquares.js
@@ -1,11 +1,3 @@
/*
* This file is part of the nivo project.
*
* Copyright 2016-present, Raphaël Benitte.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { memo } from 'react'
import PropTypes from 'prop-types'

Expand Down
5 changes: 1 addition & 4 deletions website/gatsby-config.js
Expand Up @@ -25,10 +25,7 @@ module.exports = {
`gatsby-plugin-image`,
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-plugin-styled-components`,
options: {},
},
`gatsby-plugin-styled-components`,
{
resolve: `gatsby-plugin-manifest`,
options: {
Expand Down
5 changes: 2 additions & 3 deletions website/package.json
Expand Up @@ -35,7 +35,7 @@
"@nivo/waffle": "0.75.0",
"@types/react-helmet": "^6.1.4",
"@types/styled-components": "^5.1.18",
"babel-plugin-styled-components": "^1.13.2",
"babel-plugin-styled-components": "^2.0.2",
"dedent-js": "^1.0.1",
"gatsby": "^4.4.0",
"gatsby-image": "^3.11.0",
Expand All @@ -54,8 +54,7 @@
"react-icons": "^4.3.1",
"react-markdown": "^7.1.1",
"react-select": "^4.3.1",
"styled-components": "^5.3.3",
"url-search-params": "^1.1.0"
"styled-components": "^5.3.3"
},
"scripts": {
"build": "gatsby build",
Expand Down

0 comments on commit fe2652f

Please sign in to comment.