This repository was archived by the owner on Jul 17, 2023. It is now read-only.
File tree 2 files changed +11
-4
lines changed 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import {
15
15
colorType ,
16
16
dimensionType ,
17
17
itemSpacingType ,
18
+ maxDimensionType ,
18
19
orderType ,
19
20
overflowType ,
20
21
radiusType ,
@@ -259,7 +260,7 @@ const propTypes = {
259
260
*
260
261
* For responsive behavior, pass an array with length up to 4, with a valid value for each element.
261
262
*/
262
- maxWidth : dimensionType ,
263
+ maxWidth : maxDimensionType ,
263
264
/**
264
265
* Controls the order in which the item appears in a flex container
265
266
*
Original file line number Diff line number Diff line change @@ -9,9 +9,7 @@ export { default as orderType } from './OrderType';
9
9
export { default as radiusType } from './RadiusType' ;
10
10
export { default as spacingType } from './SpacingType' ;
11
11
export { default as textSizeType } from './TextSizeType' ;
12
- export {
13
- default as boolRequiresOtherProp ,
14
- } from './BoolRequiresOtherProp' ;
12
+ export { default as boolRequiresOtherProp } from './BoolRequiresOtherProp' ;
15
13
export { default as requiresOtherProp } from './RequiresOtherProp' ;
16
14
17
15
export const colorType = PropTypes . oneOf ( [
@@ -150,12 +148,20 @@ const validDimensions = [
150
148
'100' ,
151
149
] ;
152
150
151
+ const validMaxDimensions = [ 'none' , ...validDimensions ] ;
152
+
153
153
export const dimensionType = PropTypes . oneOfType ( [
154
154
PropTypes . oneOf ( validDimensions ) ,
155
155
PropTypes . string ,
156
156
PropTypes . arrayOf ( PropTypes . oneOf ( validDimensions ) ) ,
157
157
] ) ;
158
158
159
+ export const maxDimensionType = PropTypes . oneOfType ( [
160
+ PropTypes . oneOf ( validMaxDimensions ) ,
161
+ PropTypes . string ,
162
+ PropTypes . arrayOf ( PropTypes . oneOf ( validMaxDimensions ) ) ,
163
+ ] ) ;
164
+
159
165
export const placementType = PropTypes . oneOf ( [
160
166
'auto' ,
161
167
'auto-start' ,
You can’t perform that action at this time.
0 commit comments