@@ -22,7 +22,7 @@ import useUnmount from 'react-use/lib/useUnmount';
2222import { DEFAULT_COLOR } from './constants' ;
2323import { getDataMinMax , getStepValue , isValidColor } from './utils' ;
2424import { TooltipWrapper , useDebouncedValue } from '../index' ;
25- import { ColorStop } from './types' ;
25+ import { ColorStop , CustomPaletteParams } from './types' ;
2626
2727const idGeneratorFn = htmlIdGenerator ( ) ;
2828
@@ -43,19 +43,15 @@ function shouldSortStops(colorStops: Array<{ color: string; stop: string | numbe
4343export interface CustomStopsProps {
4444 colorStops : ColorStop [ ] ;
4545 onChange : ( colorStops : ColorStop [ ] ) => void ;
46- rangeType : 'number' | 'percent' ;
4746 dataBounds : { min : number ; max : number } ;
48- reverse ?: boolean ;
49- palette ?: string ;
47+ paletteConfiguration : CustomPaletteParams | undefined ;
5048 'data-test-prefix' : string ;
5149}
5250export const CustomStops = ( {
5351 colorStops,
5452 onChange,
55- rangeType ,
53+ paletteConfiguration ,
5654 dataBounds,
57- reverse,
58- palette,
5955 [ 'data-test-prefix' ] : dataTestPrefix ,
6056} : CustomStopsProps ) => {
6157 const onChangeWithValidation = useCallback (
@@ -76,7 +72,7 @@ export const CustomStops = ({
7672 id : idGeneratorFn ( ) ,
7773 } ) ) ;
7874 // eslint-disable-next-line react-hooks/exhaustive-deps
79- } , [ palette , reverse ] ) ;
75+ } , [ paletteConfiguration ?. name , paletteConfiguration ?. reverse , paletteConfiguration ?. rangeType ] ) ;
8076
8177 const { inputValue : localColorStops , handleInputChange : setLocalColorStops } = useDebouncedValue ( {
8278 onChange : onChangeWithValidation ,
@@ -101,6 +97,8 @@ export const CustomStops = ({
10197 }
10298 } ) ;
10399
100+ const rangeType = paletteConfiguration ?. rangeType || 'percent' ;
101+
104102 return (
105103 < >
106104 { sortedReason ? (
0 commit comments