Commit 6fec45f 1 parent da32f2d commit 6fec45f Copy full SHA for 6fec45f
File tree 2 files changed +4
-17
lines changed
packages/components/src/range-control
2 files changed +4
-17
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ import {
37
37
38
38
import type { RangeControlProps } from './types' ;
39
39
import type { WordPressComponentProps } from '../ui/context' ;
40
+ import { space } from '../ui/utils/space' ;
40
41
41
42
const noop = ( ) => { } ;
42
43
@@ -313,6 +314,9 @@ function UnforwardedRangeControl(
313
314
? '__unstable-large'
314
315
: 'default'
315
316
}
317
+ __unstableInputWidth = {
318
+ __next40pxDefaultSize ? space ( 20 ) : space ( 16 )
319
+ }
316
320
step = { step }
317
321
// @ts -expect-error TODO: Investigate if the `null` value is necessary
318
322
value = { inputSliderValue }
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ import type {
20
20
WrapperProps ,
21
21
RangeControlProps ,
22
22
} from '../types' ;
23
- import type { NumberControlProps } from '../../number-control/types' ;
24
23
25
24
const rangeHeightValue = 30 ;
26
25
const railHeight = 4 ;
@@ -301,28 +300,12 @@ export const Tooltip = styled.span< TooltipProps >`
301
300
) }
302
301
` ;
303
302
304
- const inputNumberWidth = ( {
305
- size = 'default' ,
306
- } : {
307
- size : Exclude < Pick < NumberControlProps , 'size' > [ 'size' ] , 'small' > ;
308
- } ) => {
309
- const sizes = {
310
- default : space ( 16 ) ,
311
- '__unstable-large' : space ( 20 ) ,
312
- } ;
313
-
314
- return css `
315
- width: ${ sizes [ size ?? 'default' ] } ;
316
- ` ;
317
- } ;
318
-
319
303
// @todo : Refactor RangeControl with latest HStack configuration
320
304
// @wordpress /components/ui/hstack.
321
305
export const InputNumber = styled ( NumberControl ) `
322
306
display: inline-block;
323
307
font-size: 13px;
324
308
margin-top: 0;
325
- ${ inputNumberWidth } ;
326
309
327
310
input[type='number']& {
328
311
${ rangeHeight } ;
You can’t perform that action at this time.
0 commit comments