From 6a8e6342f047190317de5e48f80571fb311f79ee Mon Sep 17 00:00:00 2001 From: Adi Dahiya Date: Tue, 30 May 2023 17:23:59 -0400 Subject: [PATCH] [core] feat: add SliderBaseProps replacement for I-prefixed interface --- packages/core/src/components/slider/multiSlider.tsx | 8 ++++++-- packages/core/src/components/slider/rangeSlider.tsx | 4 ++-- packages/core/src/components/slider/slider.tsx | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/core/src/components/slider/multiSlider.tsx b/packages/core/src/components/slider/multiSlider.tsx index a2d8eeb159..8a17426b66 100644 --- a/packages/core/src/components/slider/multiSlider.tsx +++ b/packages/core/src/components/slider/multiSlider.tsx @@ -32,6 +32,10 @@ import { argMin, fillValues, formatPercentage } from "./sliderUtils"; const MultiSliderHandle: React.FC = () => null; MultiSliderHandle.displayName = `${DISPLAYNAME_PREFIX}.MultiSliderHandle`; +// eslint-disable-next-line deprecation/deprecation +export type SliderBaseProps = ISliderBaseProps; + +/** @deprecated use SliderBaseProps */ export interface ISliderBaseProps extends Props, IntentProps { children?: React.ReactNode; @@ -116,7 +120,7 @@ export interface ISliderBaseProps extends Props, IntentProps { // eslint-disable-next-line deprecation/deprecation export type MultiSliderProps = IMultiSliderProps; /** @deprecated use MultiSliderProps */ -export interface IMultiSliderProps extends ISliderBaseProps { +export interface IMultiSliderProps extends SliderBaseProps { /** Default intent of a track segment, used only if no handle specifies `intentBefore/After`. */ defaultTrackIntent?: Intent; @@ -141,7 +145,7 @@ export interface ISliderState { * @see https://blueprintjs.com/docs/#core/components/sliders.multi-slider */ export class MultiSlider extends AbstractPureComponent2 { - public static defaultSliderProps: ISliderBaseProps = { + public static defaultSliderProps: SliderBaseProps = { disabled: false, max: 10, min: 0, diff --git a/packages/core/src/components/slider/rangeSlider.tsx b/packages/core/src/components/slider/rangeSlider.tsx index 17c904fbf2..a43babd7d9 100644 --- a/packages/core/src/components/slider/rangeSlider.tsx +++ b/packages/core/src/components/slider/rangeSlider.tsx @@ -20,7 +20,7 @@ import { AbstractPureComponent2, Intent } from "../../common"; import * as Errors from "../../common/errors"; import { DISPLAYNAME_PREFIX } from "../../common/props"; import { HandleHtmlProps } from "./handleProps"; -import { ISliderBaseProps, MultiSlider } from "./multiSlider"; +import { MultiSlider, SliderBaseProps } from "./multiSlider"; export type NumberRange = [number, number]; @@ -32,7 +32,7 @@ enum RangeIndex { // eslint-disable-next-line deprecation/deprecation export type RangeSliderProps = IRangeSliderProps; /** @deprecated use RangeSliderProps */ -export interface IRangeSliderProps extends ISliderBaseProps { +export interface IRangeSliderProps extends SliderBaseProps { /** * Range value of slider. Handles will be rendered at each position in the range. * diff --git a/packages/core/src/components/slider/slider.tsx b/packages/core/src/components/slider/slider.tsx index 21c526e553..4f4f536c20 100644 --- a/packages/core/src/components/slider/slider.tsx +++ b/packages/core/src/components/slider/slider.tsx @@ -19,12 +19,12 @@ import * as React from "react"; import { AbstractPureComponent2, Intent } from "../../common"; import { DISPLAYNAME_PREFIX } from "../../common/props"; import { HandleHtmlProps } from "./handleProps"; -import { ISliderBaseProps, MultiSlider } from "./multiSlider"; +import { MultiSlider, SliderBaseProps } from "./multiSlider"; // eslint-disable-next-line deprecation/deprecation export type SliderProps = ISliderProps; /** @deprecated use SliderProps */ -export interface ISliderProps extends ISliderBaseProps { +export interface ISliderProps extends SliderBaseProps { /** * Initial value of the slider. This determines the other end of the * track fill: from `initialValue` to `value`.