@@ -33,6 +33,7 @@ const propTypes = forbidExtraProps({
33
33
openDirection : openDirectionShape ,
34
34
showCaret : PropTypes . bool ,
35
35
verticalSpacing : nonNegativeInteger ,
36
+ small : PropTypes . bool ,
36
37
37
38
onChange : PropTypes . func ,
38
39
onFocus : PropTypes . func ,
@@ -57,6 +58,7 @@ const defaultProps = {
57
58
openDirection : OPEN_DOWN ,
58
59
showCaret : false ,
59
60
verticalSpacing : DEFAULT_VERTICAL_SPACING ,
61
+ small : false ,
60
62
61
63
onChange ( ) { } ,
62
64
onFocus ( ) { } ,
@@ -169,6 +171,7 @@ class DateInput extends React.Component {
169
171
readOnly,
170
172
openDirection,
171
173
verticalSpacing,
174
+ small,
172
175
styles,
173
176
theme : { reactDates } ,
174
177
} = this . props ;
@@ -178,16 +181,13 @@ class DateInput extends React.Component {
178
181
179
182
const withFang = showCaret && focused ;
180
183
181
- const {
182
- font : { input : { lineHeight } } ,
183
- spacing : { inputPadding, displayTextPaddingVertical } ,
184
- } = reactDates ;
185
- const inputHeight = getInputHeight ( { lineHeight, inputPadding, displayTextPaddingVertical } ) ;
184
+ const inputHeight = getInputHeight ( reactDates , small ) ;
186
185
187
186
return (
188
187
< div
189
188
{ ...css (
190
189
styles . DateInput ,
190
+ small && styles . DateInput__small ,
191
191
withFang && styles . DateInput__withFang ,
192
192
disabled && styles . DateInput__disabled ,
193
193
withFang && openDirection === OPEN_DOWN && styles . DateInput__openDown ,
@@ -197,6 +197,7 @@ class DateInput extends React.Component {
197
197
< input
198
198
{ ...css (
199
199
styles . DateInput_input ,
200
+ small && styles . DateInput_input__small ,
200
201
readOnly && styles . DateInput_input__readOnly ,
201
202
focused && styles . DateInput_input__focused ,
202
203
disabled && styles . DateInput_input__disabled ,
@@ -262,20 +263,19 @@ export default withStyles(({
262
263
} ,
263
264
} ) => ( {
264
265
DateInput : {
265
- fontWeight : 200 ,
266
- fontSize : font . input . size ,
267
- lineHeight : font . input . lineHeight ,
268
- color : color . placeholderText ,
269
266
margin : 0 ,
270
267
padding : spacing . inputPadding ,
271
-
272
268
background : color . background ,
273
269
position : 'relative' ,
274
270
display : 'inline-block' ,
275
271
width : sizing . inputWidth ,
276
272
verticalAlign : 'middle' ,
277
273
} ,
278
274
275
+ DateInput__small : {
276
+ width : sizing . inputWidth_small ,
277
+ } ,
278
+
279
279
DateInput__disabled : {
280
280
background : color . disabled ,
281
281
color : color . textDisabled ,
@@ -284,17 +284,32 @@ export default withStyles(({
284
284
DateInput_input : {
285
285
fontWeight : 200 ,
286
286
fontSize : font . input . size ,
287
+ lineHeight : font . input . lineHeight ,
287
288
color : color . text ,
288
289
backgroundColor : color . background ,
289
290
width : '100%' ,
290
291
padding : `${ spacing . displayTextPaddingVertical } px ${ spacing . displayTextPaddingHorizontal } px` ,
292
+ paddingTop : spacing . displayTextPaddingTop ,
293
+ paddingBottom : spacing . displayTextPaddingBottom ,
294
+ paddingLeft : spacing . displayTextPaddingLeft ,
295
+ paddingRight : spacing . displayTextPaddingRight ,
291
296
border : border . input . border ,
292
297
borderTop : border . input . borderTop ,
293
298
borderRight : border . input . borderRight ,
294
299
borderBottom : border . input . borderBottom ,
295
300
borderLeft : border . input . borderLeft ,
296
301
} ,
297
302
303
+ DateInput_input__small : {
304
+ fontSize : font . input . size_small ,
305
+ lineHeight : font . input . lineHeight_small ,
306
+ padding : `${ spacing . displayTextPaddingVertical_small } px ${ spacing . displayTextPaddingHorizontal_small } px` ,
307
+ paddingTop : spacing . displayTextPaddingTop_small ,
308
+ paddingBottom : spacing . displayTextPaddingBottom_small ,
309
+ paddingLeft : spacing . displayTextPaddingLeft_small ,
310
+ paddingRight : spacing . displayTextPaddingRight_small ,
311
+ } ,
312
+
298
313
DateInput_input__readOnly : {
299
314
userSelect : 'none' ,
300
315
} ,
0 commit comments