diff --git a/Makefile b/Makefile index 18e41824b..dc3b63752 100644 --- a/Makefile +++ b/Makefile @@ -159,6 +159,9 @@ pkgs-build: pkgs-types ##@1 packages build all packages pkgs-types: ##@1 packages build all package types @pnpm tsc --build ./tsconfig.monorepo.json +pkgs-types-clean: ##@1 packages clean all package types + @pnpm tsc --build --clean ./tsconfig.monorepo.json + pkg-types-%: ##@1 packages generate types for a specific package @if [ "$${SKIP_TYPES}" != "TRUE" ]; \ then \ diff --git a/packages/annotations/src/props.ts b/packages/annotations/src/props.ts index 5d6c4e5e3..307ec705f 100644 --- a/packages/annotations/src/props.ts +++ b/packages/annotations/src/props.ts @@ -3,6 +3,4 @@ export const defaultProps = { noteWidth: 120, noteTextOffset: 8, animate: true, - motionStiffness: 90, - motionDamping: 13, } diff --git a/packages/bar/src/types.ts b/packages/bar/src/types.ts index b89c61b44..8644bff6c 100644 --- a/packages/bar/src/types.ts +++ b/packages/bar/src/types.ts @@ -6,7 +6,7 @@ import { CartesianMarkerProps, Dimensions, Margin, - ModernMotionProps, + MotionProps, PropertyAccessor, SvgDefsAndFill, Theme, @@ -266,7 +266,7 @@ export type BarSvgProps = Partial & SvgDefsAndFill> & Dimensions & - ModernMotionProps & + MotionProps & Partial<{ axisBottom: AxisProps | null axisLeft: AxisProps | null diff --git a/packages/boxplot/src/types.ts b/packages/boxplot/src/types.ts index c089f1d05..0961bf483 100644 --- a/packages/boxplot/src/types.ts +++ b/packages/boxplot/src/types.ts @@ -6,7 +6,7 @@ import { CartesianMarkerProps, Dimensions, Margin, - ModernMotionProps, + MotionProps, PropertyAccessor, SvgDefsAndFill, Theme, @@ -244,7 +244,7 @@ export type BoxPlotSvgProps = Partial & SvgDefsAndFill & Dimensions & - ModernMotionProps & + MotionProps & Partial<{ axisBottom: AxisProps | null axisLeft: AxisProps | null diff --git a/packages/bullet/src/types.ts b/packages/bullet/src/types.ts index d8946e89d..f3493298b 100644 --- a/packages/bullet/src/types.ts +++ b/packages/bullet/src/types.ts @@ -1,5 +1,5 @@ import * as React from 'react' -import { Box, Dimensions, Theme, Colors, ModernMotionProps } from '@nivo/core' +import { Box, Dimensions, Theme, Colors, MotionProps } from '@nivo/core' import { InheritedColorConfig } from '@nivo/colors' import { ScaleLinear } from '@nivo/scales' import { SpringValues } from '@react-spring/web' @@ -91,7 +91,7 @@ export type BulletHandlers = { export type BulletSvgProps = Partial & Dimensions & BulletHandlers & - ModernMotionProps & { + MotionProps & { data: Datum[] } @@ -200,7 +200,7 @@ export type BulletItemProps = Omit< > & BulletHandlers & EnhancedDatum & - ModernMotionProps & + MotionProps & Point & { measureHeight: number markerHeight: number diff --git a/packages/bump/src/area-bump/defaults.ts b/packages/bump/src/area-bump/defaults.ts index 7872f49a3..5e23ddf59 100644 --- a/packages/bump/src/area-bump/defaults.ts +++ b/packages/bump/src/area-bump/defaults.ts @@ -1,4 +1,4 @@ -import { ModernMotionProps, SvgDefsAndFill } from '@nivo/core' +import { MotionProps, SvgDefsAndFill } from '@nivo/core' import { AreaBumpCommonProps, AreaBumpComputedSerie, DefaultAreaBumpDatum } from './types' import { AreaTooltip } from './AreaTooltip' @@ -54,7 +54,7 @@ const commonDefaultProps: Omit< export const areaBumpSvgDefaultProps: typeof commonDefaultProps & SvgDefsAndFill>> & { animate: boolean - motionConfig: ModernMotionProps['motionConfig'] + motionConfig: MotionProps['motionConfig'] } = { ...commonDefaultProps, defs: [], diff --git a/packages/bump/src/area-bump/types.ts b/packages/bump/src/area-bump/types.ts index c17cbda87..ebe646e28 100644 --- a/packages/bump/src/area-bump/types.ts +++ b/packages/bump/src/area-bump/types.ts @@ -4,7 +4,7 @@ import { Box, Theme, Dimensions, - ModernMotionProps, + MotionProps, CssMixBlendMode, SvgDefsAndFill, } from '@nivo/core' @@ -188,4 +188,4 @@ export type AreaBumpSvgProps< AreaBumpDataProps & SvgDefsAndFill> & Dimensions & - ModernMotionProps + MotionProps diff --git a/packages/bump/src/bump/defaults.ts b/packages/bump/src/bump/defaults.ts index 6bd6e071c..4b7625ead 100644 --- a/packages/bump/src/bump/defaults.ts +++ b/packages/bump/src/bump/defaults.ts @@ -1,4 +1,4 @@ -import { ModernMotionProps } from '@nivo/core' +import { MotionProps } from '@nivo/core' import { LineTooltip } from './LineTooltip' import { Point } from './Point' import { BumpCommonProps, BumpPointComponent, DefaultBumpDatum } from './types' @@ -61,7 +61,7 @@ const commonDefaultProps: Omit< export const bumpSvgDefaultProps: typeof commonDefaultProps & { pointComponent: BumpPointComponent> animate: boolean - motionConfig: ModernMotionProps['motionConfig'] + motionConfig: MotionProps['motionConfig'] } = { ...commonDefaultProps, pointComponent: Point, diff --git a/packages/bump/src/bump/types.ts b/packages/bump/src/bump/types.ts index 29f1ccd1a..b9f86443a 100644 --- a/packages/bump/src/bump/types.ts +++ b/packages/bump/src/bump/types.ts @@ -1,6 +1,6 @@ import { FunctionComponent, MouseEvent } from 'react' import { Line as D3Line } from 'd3-shape' -import { Theme, Box, Dimensions, ModernMotionProps } from '@nivo/core' +import { Theme, Box, Dimensions, MotionProps } from '@nivo/core' import { OrdinalColorScaleConfig, InheritedColorConfig } from '@nivo/colors' import { AxisProps } from '@nivo/axes' import { ScalePoint } from '@nivo/scales' @@ -181,4 +181,4 @@ export type BumpSvgProps & { pointComponent?: BumpPointComponent } & Dimensions & - ModernMotionProps + MotionProps diff --git a/packages/chord/src/types.ts b/packages/chord/src/types.ts index 23801c5c7..7dafb931c 100644 --- a/packages/chord/src/types.ts +++ b/packages/chord/src/types.ts @@ -5,7 +5,7 @@ import { Box, Theme, Dimensions, - ModernMotionProps, + MotionProps, CssMixBlendMode, PropertyAccessor, ValueFormat, @@ -150,7 +150,7 @@ export type ChordCommonProps = { ariaLabel: AriaAttributes['aria-label'] ariaLabelledBy: AriaAttributes['aria-labelledby'] ariaDescribedBy: AriaAttributes['aria-describedby'] -} & Required +} & Required export type ChordSvgProps = Partial & ChordDataProps & diff --git a/packages/circle-packing/src/types.ts b/packages/circle-packing/src/types.ts index 6f5449d87..1e1334de7 100644 --- a/packages/circle-packing/src/types.ts +++ b/packages/circle-packing/src/types.ts @@ -2,7 +2,7 @@ import * as React from 'react' import { Interpolation, SpringValue } from '@react-spring/web' import { Box, - ModernMotionProps, + MotionProps, Theme, PropertyAccessor, ValueFormat, @@ -82,7 +82,7 @@ export interface CirclePackingCommonProps { tooltip: (props: ComputedDatum) => JSX.Element zoomedId?: string | null animate: boolean - motionConfig: ModernMotionProps['motionConfig'] + motionConfig: MotionProps['motionConfig'] role: string renderWrapper?: boolean } diff --git a/packages/core/index.d.ts b/packages/core/index.d.ts index 0303a4af5..69304e826 100644 --- a/packages/core/index.d.ts +++ b/packages/core/index.d.ts @@ -196,12 +196,6 @@ export function useTheme(): CompleteTheme export function usePartialTheme(theme?: Theme): CompleteTheme export type MotionProps = Partial<{ - animate: boolean - motionDamping: number - motionStiffness: number -}> - -export type ModernMotionProps = Partial<{ animate: boolean motionConfig: string | SpringConfig }> @@ -209,10 +203,6 @@ export type ModernMotionProps = Partial<{ export function useMotionConfig(): { animate: boolean config: SpringConfig - springConfig: { - stiffness: number - damping: number - } } export type SvgFillMatcher = (datum: T) => boolean @@ -343,13 +333,9 @@ export function Defs(props: DefsProps): JSX.Element // ------------------------------------------------------------------------ export const defaultAnimate = true -export const defaultMotionStiffness = 90 -export const defaultMotionDamping = 15 type MotionDefaultProps = { animate: true - stiffness: 90 - damping: 15 config: 'default' } export const motionDefaultProps: MotionDefaultProps @@ -409,8 +395,6 @@ interface ContainerProps { renderWrapper?: boolean isInteractive?: boolean animate?: boolean - motionStiffness?: number - motionDamping?: number motionConfig?: string | SpringConfig } type ContainerType = (props: React.PropsWithChildren) => JSX.Element diff --git a/packages/core/src/components/Container.js b/packages/core/src/components/Container.js index 68c7226f0..025cf8fbf 100644 --- a/packages/core/src/components/Container.js +++ b/packages/core/src/components/Container.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 { useRef } from 'react' import PropTypes from 'prop-types' import { TooltipProvider, Tooltip } from '@nivo/tooltip' @@ -23,20 +15,13 @@ export const Container = ({ renderWrapper = true, isInteractive = true, animate, - motionStiffness, - motionDamping, motionConfig, }) => { const container = useRef(null) return ( - + {/* we should not render the div element if using the HTTP API */} { const container = useRef(null) @@ -58,12 +48,7 @@ export const LegacyContainer = ({ return ( - + {/* we should not render the div element if using the HTTP API */} @@ -87,7 +72,5 @@ LegacyContainer.propTypes = { renderWrapper: PropTypes.bool, theme: PropTypes.object.isRequired, animate: PropTypes.bool.isRequired, - motionStiffness: PropTypes.number, - motionDamping: PropTypes.number, motionConfig: PropTypes.string, } diff --git a/packages/core/src/defaults/index.js b/packages/core/src/defaults/index.js index 5a445c3f3..2fdd2967c 100644 --- a/packages/core/src/defaults/index.js +++ b/packages/core/src/defaults/index.js @@ -1,19 +1,9 @@ -/* - * 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 { scaleOrdinal } from 'd3-scale' import { schemeSet3 } from 'd3-scale-chromatic' import { nivoCategoricalColors } from '../lib/colors' // motion export const defaultAnimate = true -export const defaultMotionStiffness = 90 -export const defaultMotionDamping = 15 // colors export const defaultCategoricalColors = nivoCategoricalColors diff --git a/packages/core/src/hocs/withContainer.js b/packages/core/src/hocs/withContainer.js index 7ce40e3f7..020ca31ac 100644 --- a/packages/core/src/hocs/withContainer.js +++ b/packages/core/src/hocs/withContainer.js @@ -14,15 +14,7 @@ export const withContainer = WrappedComponent => { return class extends Component { render() { // eslint-disable-next-line react/prop-types - const { - theme, - renderWrapper, - animate, - motionStiffness, - motionDamping, - motionConfig, - ...childProps - } = this.props + const { theme, renderWrapper, animate, motionConfig, ...childProps } = this.props return ( { renderWrapper={renderWrapper} isInteractive={childProps.isInteractive} animate={animate} - motionStiffness={motionStiffness} - motionDamping={motionDamping} motionConfig={motionConfig} > diff --git a/packages/core/src/motion/context.js b/packages/core/src/motion/context.js index 85047fb54..e5c4c7606 100644 --- a/packages/core/src/motion/context.js +++ b/packages/core/src/motion/context.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 { createContext, useMemo } from 'react' import { isString } from 'lodash' import PropTypes from 'prop-types' @@ -13,28 +5,21 @@ import { config as presets } from '@react-spring/web' export const motionConfigContext = createContext() -/** - * For now we're supporting both react-motion and react-spring, - * however, react-motion will be gradually replaced by react-spring. - */ -export const MotionConfigProvider = ({ children, animate, stiffness, damping, config }) => { +export const MotionConfigProvider = ({ children, animate, config }) => { const value = useMemo(() => { const reactSpringConfig = isString(config) ? presets[config] : config return { animate, - springConfig: { stiffness, damping }, config: reactSpringConfig, } - }, [animate, stiffness, damping, config]) + }, [animate, config]) return {children} } export const motionPropTypes = { animate: PropTypes.bool, - motionStiffness: PropTypes.number, - motionDamping: PropTypes.number, motionConfig: PropTypes.oneOfType([ PropTypes.oneOf(Object.keys(presets)), PropTypes.shape({ @@ -53,15 +38,11 @@ export const motionPropTypes = { MotionConfigProvider.propTypes = { children: PropTypes.node.isRequired, animate: motionPropTypes.animate, - stiffness: motionPropTypes.motionStiffness, - damping: motionPropTypes.motionDamping, config: motionPropTypes.motionConfig, } export const motionDefaultProps = { animate: true, - stiffness: 90, - damping: 15, config: 'default', } diff --git a/packages/funnel/src/types.ts b/packages/funnel/src/types.ts index 831c8e8f0..1c4b35cab 100644 --- a/packages/funnel/src/types.ts +++ b/packages/funnel/src/types.ts @@ -1,6 +1,6 @@ import { AriaAttributes, FunctionComponent, MouseEvent } from 'react' import { Area, Line } from 'd3-shape' -import { Box, Theme, Dimensions, ModernMotionProps, ValueFormat } from '@nivo/core' +import { Box, Theme, Dimensions, MotionProps, ValueFormat } from '@nivo/core' import { InheritedColorConfig, OrdinalColorScaleConfig } from '@nivo/colors' import { AnnotationMatcher } from '@nivo/annotations' import { PartTooltipProps } from './PartTooltip' @@ -132,4 +132,4 @@ export interface FunnelCommonProps { export type FunnelSvgProps = Partial> & FunnelDataProps & Dimensions & - ModernMotionProps + MotionProps diff --git a/packages/heatmap/src/types.ts b/packages/heatmap/src/types.ts index 4bf4481a8..4a50850fb 100644 --- a/packages/heatmap/src/types.ts +++ b/packages/heatmap/src/types.ts @@ -5,7 +5,7 @@ import { Theme, CompleteTheme, Dimensions, - ModernMotionProps, + MotionProps, PropertyAccessor, ValueFormat, } from '@nivo/core' @@ -169,7 +169,7 @@ export type HeatMapCommonProps = { ariaLabel: AriaAttributes['aria-label'] ariaLabelledBy: AriaAttributes['aria-labelledby'] ariaDescribedBy: AriaAttributes['aria-describedby'] -} & Required +} & Required export type HeatMapSvgProps = Partial< HeatMapCommonProps diff --git a/packages/line/index.d.ts b/packages/line/index.d.ts index b34764d94..864ee191b 100644 --- a/packages/line/index.d.ts +++ b/packages/line/index.d.ts @@ -11,7 +11,7 @@ import { Dimensions, Box, Theme, - ModernMotionProps, + MotionProps, CartesianMarkerProps, SvgDefsAndFill, ValueFormat, @@ -201,7 +201,7 @@ export interface LineProps { legends?: LegendProps[] } -export interface LineSvgProps extends LineProps, ModernMotionProps, SvgDefsAndFill { +export interface LineSvgProps extends LineProps, MotionProps, SvgDefsAndFill { enablePointLabel?: boolean pointLabel?: string | AccessorFunc pointLabelYOffset?: number diff --git a/packages/marimekko/src/types.ts b/packages/marimekko/src/types.ts index 9cd1d157b..80da75b25 100644 --- a/packages/marimekko/src/types.ts +++ b/packages/marimekko/src/types.ts @@ -7,7 +7,7 @@ import { stackOffsetWiggle, } from 'd3-shape' import { ScaleLinear } from '@nivo/scales' -import { Box, Dimensions, Theme, SvgDefsAndFill, ModernMotionProps, ValueFormat } from '@nivo/core' +import { Box, Dimensions, Theme, SvgDefsAndFill, MotionProps, ValueFormat } from '@nivo/core' import { AxisProps } from '@nivo/axes' import { OrdinalColorScaleConfig, InheritedColorConfig } from '@nivo/colors' import { LegendProps } from '@nivo/legends' @@ -160,7 +160,7 @@ export type MouseEventHandlers = Partial<{ export type SvgProps = DataProps & Dimensions & Partial> & - ModernMotionProps & + MotionProps & SvgDefsAndFill> & MouseEventHandlers & { layers?: Layer[] diff --git a/packages/network/src/types.ts b/packages/network/src/types.ts index af7415fa6..c9010e8ad 100644 --- a/packages/network/src/types.ts +++ b/packages/network/src/types.ts @@ -1,6 +1,6 @@ import { AriaAttributes, MouseEvent, FunctionComponent } from 'react' import { AnimatedProps } from '@react-spring/web' -import { Box, Theme, Dimensions, ModernMotionProps, CssMixBlendMode } from '@nivo/core' +import { Box, Theme, Dimensions, MotionProps, CssMixBlendMode } from '@nivo/core' import { InheritedColorConfig } from '@nivo/colors' import { AnnotationMatcher } from '@nivo/annotations' @@ -171,7 +171,7 @@ export type NetworkCommonProps = ariaLabel: AriaAttributes['aria-label'] ariaLabelledBy: AriaAttributes['aria-labelledby'] ariaDescribedBy: AriaAttributes['aria-describedby'] -} & Required +} & Required export type NetworkSvgProps = Partial< NetworkCommonProps diff --git a/packages/pie/src/types.ts b/packages/pie/src/types.ts index f99d3349b..2fb75d4a4 100644 --- a/packages/pie/src/types.ts +++ b/packages/pie/src/types.ts @@ -4,7 +4,7 @@ import { Dimensions, Theme, SvgDefsAndFill, - ModernMotionProps, + MotionProps, ValueFormat, PropertyAccessor, } from '@nivo/core' @@ -139,7 +139,7 @@ export type PieSvgProps = DataProps & PieHandlers & { layers?: PieLayer[] animate?: boolean - motionConfig?: ModernMotionProps['motionConfig'] + motionConfig?: MotionProps['motionConfig'] transitionMode?: ArcTransitionMode } & PieSvgCustomComponents @@ -150,7 +150,7 @@ export type CompletePieSvgProps = DataProps & PieHandlers & { layers: PieLayer[] animate: boolean - motionConfig: ModernMotionProps['motionConfig'] + motionConfig: MotionProps['motionConfig'] transitionMode: ArcTransitionMode } & PieSvgCustomComponents diff --git a/packages/radar/src/types.ts b/packages/radar/src/types.ts index 356de32c6..4205593b0 100644 --- a/packages/radar/src/types.ts +++ b/packages/radar/src/types.ts @@ -5,7 +5,7 @@ import { Theme, CssMixBlendMode, Dimensions, - ModernMotionProps, + MotionProps, PropertyAccessor, ValueFormat, ClosedCurveFactoryId, @@ -143,7 +143,7 @@ export interface RadarSvgFillMatcherDatum> { export type RadarSvgProps> = Partial> & RadarDataProps & Dimensions & - ModernMotionProps & + MotionProps & SvgDefsAndFill> export type BoundLegendProps = Required> & Omit diff --git a/packages/radial-bar/src/types.ts b/packages/radial-bar/src/types.ts index 81d40df7d..e8e195f17 100644 --- a/packages/radial-bar/src/types.ts +++ b/packages/radial-bar/src/types.ts @@ -3,7 +3,7 @@ import { Theme, Box, Dimensions, - ModernMotionProps, + MotionProps, PropertyAccessor, ValueFormat, SvgDefsAndFill, @@ -124,5 +124,5 @@ export type RadialBarSvgProps = Parti > & RadialBarDataProps & Dimensions & - ModernMotionProps & + MotionProps & SvgDefsAndFill diff --git a/packages/sankey/src/types.ts b/packages/sankey/src/types.ts index 3e2348b7e..d3633d646 100644 --- a/packages/sankey/src/types.ts +++ b/packages/sankey/src/types.ts @@ -5,7 +5,7 @@ import { Theme, CssMixBlendMode, Dimensions, - ModernMotionProps, + MotionProps, PropertyAccessor, ValueFormat, } from '@nivo/core' @@ -161,4 +161,4 @@ export type SankeySvgProps = Parti > & SankeyDataProps & Dimensions & - ModernMotionProps + MotionProps diff --git a/packages/scatterplot/src/types.ts b/packages/scatterplot/src/types.ts index f64835273..83ecf71c8 100644 --- a/packages/scatterplot/src/types.ts +++ b/packages/scatterplot/src/types.ts @@ -5,7 +5,7 @@ import { Box, Theme, ValueFormat, - ModernMotionProps, + MotionProps, CssMixBlendMode, CartesianMarkerProps, PropertyAccessor, @@ -158,7 +158,7 @@ export type ScatterPlotSvgProps = Partial< > & ScatterPlotDataProps & Dimensions & - ModernMotionProps & { + MotionProps & { blendMode?: CssMixBlendMode layers?: (ScatterPlotLayerId | ScatterPlotCustomSvgLayer)[] nodeComponent?: ScatterPlotNode diff --git a/packages/stream/src/types.ts b/packages/stream/src/types.ts index b3e2badd6..5549ca06d 100644 --- a/packages/stream/src/types.ts +++ b/packages/stream/src/types.ts @@ -2,7 +2,7 @@ import { FunctionComponent, AriaAttributes } from 'react' import { Box, Dimensions, - ModernMotionProps, + MotionProps, Theme, PropertyAccessor, StackOrder, @@ -145,4 +145,4 @@ export type StreamSvgProps = Partial & SvgDefsAndFill & Dimensions & - ModernMotionProps + MotionProps diff --git a/packages/sunburst/src/types.ts b/packages/sunburst/src/types.ts index 159b25186..45110da66 100644 --- a/packages/sunburst/src/types.ts +++ b/packages/sunburst/src/types.ts @@ -5,7 +5,7 @@ import { Box, ValueFormat, SvgDefsAndFill, - ModernMotionProps, + MotionProps, PropertyAccessor, } from '@nivo/core' @@ -79,7 +79,7 @@ export type SunburstCommonProps = { isInteractive: boolean tooltip: (props: ComputedDatum) => JSX.Element animate: boolean - motionConfig: ModernMotionProps['motionConfig'] + motionConfig: MotionProps['motionConfig'] } & ArcLabelsProps> export type MouseHandler = ( diff --git a/packages/swarmplot/src/types.ts b/packages/swarmplot/src/types.ts index 0b4521a83..5ceb5528a 100644 --- a/packages/swarmplot/src/types.ts +++ b/packages/swarmplot/src/types.ts @@ -1,7 +1,7 @@ import * as React from 'react' import { Interpolation, SpringValue } from '@react-spring/web' import { ForceX, ForceY, ForceCollide } from 'd3-force' -import { PropertyAccessor, ValueFormat, Theme, ModernMotionProps, Box, Margin } from '@nivo/core' +import { PropertyAccessor, ValueFormat, Theme, MotionProps, Box, Margin } from '@nivo/core' import { InheritedColorConfig, OrdinalColorScaleConfig } from '@nivo/colors' import { AxisProps, CanvasAxisProps } from '@nivo/axes' import { ScaleLinear, ScaleLinearSpec, ScaleTime, ScaleTimeSpec, TicksSpec } from '@nivo/scales' @@ -127,7 +127,7 @@ export type SwarmPlotCommonProps = { ScaleLinear | ScaleTime | ScaleOrdinal >[] animate: boolean - motionConfig: ModernMotionProps['motionConfig'] + motionConfig: MotionProps['motionConfig'] role: string renderWrapper?: boolean } diff --git a/packages/treemap/src/types.ts b/packages/treemap/src/types.ts index c6dcbfd87..49491502a 100644 --- a/packages/treemap/src/types.ts +++ b/packages/treemap/src/types.ts @@ -6,7 +6,7 @@ import { Theme, ValueFormat, PropertyAccessor, - ModernMotionProps, + MotionProps, SvgDefsAndFill, } from '@nivo/core' import { InheritedColorConfig, OrdinalColorScaleConfig, DatumIdentityAccessor } from '@nivo/colors' @@ -169,7 +169,7 @@ export type TreeMapCommonProps = { ariaLabel: AriaAttributes['aria-label'] ariaLabelledBy: AriaAttributes['aria-labelledby'] ariaDescribedBy: AriaAttributes['aria-describedby'] -} & ModernMotionProps +} & MotionProps export type TreeMapSvgProps = Partial> & TreeMapDataProps & diff --git a/packages/waffle/src/types.ts b/packages/waffle/src/types.ts index d75f16b7b..3b7aeb36a 100644 --- a/packages/waffle/src/types.ts +++ b/packages/waffle/src/types.ts @@ -1,6 +1,6 @@ import { AriaAttributes, FunctionComponent, MouseEvent } from 'react' import { SpringValues } from '@react-spring/web' -import { Box, Dimensions, Theme, SvgDefsAndFill, ModernMotionProps, ValueFormat } from '@nivo/core' +import { Box, Dimensions, Theme, SvgDefsAndFill, MotionProps, ValueFormat } from '@nivo/core' import { InheritedColorConfig, OrdinalColorScaleConfig } from '@nivo/colors' import { LegendProps } from '@nivo/legends' import { Vertex, GridCell, GridFillDirection } from '@nivo/grid' @@ -95,7 +95,7 @@ export type TooltipComponent = FunctionComponent extends ModernMotionProps { +export interface CommonProps extends MotionProps { hiddenIds: D['id'][] margin: Box valueFormat?: ValueFormat diff --git a/storybook/stories/line/Line.stories.tsx b/storybook/stories/line/Line.stories.tsx index 4b39debed..7a392de97 100644 --- a/storybook/stories/line/Line.stories.tsx +++ b/storybook/stories/line/Line.stories.tsx @@ -413,8 +413,6 @@ class RealTimeChartComponent extends Component { enableGridX={true} curve="monotoneX" animate={false} - motionStiffness={120} - motionDamping={50} isInteractive={false} enableSlices={false} useMesh={true} diff --git a/website/src/lib/componentProperties.ts b/website/src/lib/componentProperties.ts index 8636f7ff5..3433c7f91 100644 --- a/website/src/lib/componentProperties.ts +++ b/website/src/lib/componentProperties.ts @@ -1,5 +1,5 @@ import uniq from 'lodash/uniq' -import { defaultAnimate, defaultMotionStiffness, defaultMotionDamping } from '@nivo/core' +import { defaultAnimate } from '@nivo/core' import { Flavor, ChartProperty } from '../types' export const themeProperty = (flavors: Flavor[]): ChartProperty => ({ diff --git a/website/src/pages/bump/index.tsx b/website/src/pages/bump/index.tsx index ec93445d2..b7acfe686 100644 --- a/website/src/pages/bump/index.tsx +++ b/website/src/pages/bump/index.tsx @@ -3,7 +3,7 @@ import range from 'lodash/range' import shuffle from 'lodash/shuffle' import { graphql, useStaticQuery } from 'gatsby' import { ResponsiveBump, bumpSvgDefaultProps as defaults, BumpCommonProps } from '@nivo/bump' -import { ModernMotionProps } from '@nivo/core' +import { MotionProps } from '@nivo/core' import { AxisProps } from '@nivo/axes' import { ComponentTemplate } from '../../components/components/ComponentTemplate' import meta from '../../data/components/bump/meta.yml' @@ -45,7 +45,7 @@ type Props = Omit< BumpCommonProps, 'theme' | 'onMouseEnter' | 'onMouseMove' | 'onMouseLeave' | 'onClick' | 'renderWrapper' > & - ModernMotionProps + MotionProps type UnmappedProps = Omit & { axisTop: AxisProps & { enable: boolean }