From da32f2d92d18d449edcf4455324bb8178ed1dddd Mon Sep 17 00:00:00 2001 From: chad1008 <13856531+chad1008@users.noreply.github.com> Date: Tue, 20 Jun 2023 09:40:56 -0400 Subject: [PATCH] simplify deprecation flow --- .../range-control/styles/range-control-styles.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/components/src/range-control/styles/range-control-styles.ts b/packages/components/src/range-control/styles/range-control-styles.ts index 055a4619a0a1c..642f5ee694e13 100644 --- a/packages/components/src/range-control/styles/range-control-styles.ts +++ b/packages/components/src/range-control/styles/range-control-styles.ts @@ -23,20 +23,15 @@ import type { import type { NumberControlProps } from '../../number-control/types'; const rangeHeightValue = 30; -const rangeHeightValueNext = 40; const railHeight = 4; const rangeHeight = () => css( { height: rangeHeightValue, minHeight: rangeHeightValue } ); const thumbSize = 12; -const rootMinHeight = ( { +const deprecatedHeight = ( { __next40pxDefaultSize, }: Pick< RangeControlProps, '__next40pxDefaultSize' > ) => - css( { - minHeight: __next40pxDefaultSize - ? rangeHeightValueNext - : rangeHeightValue, - } ); + ! __next40pxDefaultSize && css( { minHeight: rangeHeightValue } ); type RootProps = Pick< RangeControlProps, '__next40pxDefaultSize' >; export const Root = styled.div< RootProps >` @@ -48,9 +43,9 @@ export const Root = styled.div< RootProps >` position: relative; touch-action: none; width: 100%; - + min-height: 40px; /* TODO: remove after removing the __next40pxDefaultSize prop */ - ${ rootMinHeight } + ${ deprecatedHeight }; `; const wrapperColor = ( { color = COLORS.ui.borderFocus }: WrapperProps ) =>