Skip to content

Commit da32f2d

Browse files
committed
simplify deprecation flow
1 parent 24190be commit da32f2d

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

packages/components/src/range-control/styles/range-control-styles.ts

+4-9
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,15 @@ import type {
2323
import type { NumberControlProps } from '../../number-control/types';
2424

2525
const rangeHeightValue = 30;
26-
const rangeHeightValueNext = 40;
2726
const railHeight = 4;
2827
const rangeHeight = () =>
2928
css( { height: rangeHeightValue, minHeight: rangeHeightValue } );
3029
const thumbSize = 12;
3130

32-
const rootMinHeight = ( {
31+
const deprecatedHeight = ( {
3332
__next40pxDefaultSize,
3433
}: Pick< RangeControlProps, '__next40pxDefaultSize' > ) =>
35-
css( {
36-
minHeight: __next40pxDefaultSize
37-
? rangeHeightValueNext
38-
: rangeHeightValue,
39-
} );
34+
! __next40pxDefaultSize && css( { minHeight: rangeHeightValue } );
4035

4136
type RootProps = Pick< RangeControlProps, '__next40pxDefaultSize' >;
4237
export const Root = styled.div< RootProps >`
@@ -48,9 +43,9 @@ export const Root = styled.div< RootProps >`
4843
position: relative;
4944
touch-action: none;
5045
width: 100%;
51-
46+
min-height: 40px;
5247
/* TODO: remove after removing the __next40pxDefaultSize prop */
53-
${ rootMinHeight }
48+
${ deprecatedHeight };
5449
`;
5550

5651
const wrapperColor = ( { color = COLORS.ui.borderFocus }: WrapperProps ) =>

0 commit comments

Comments
 (0)