1
+ import * as CSS from 'csstype' ;
2
+ export type TLengthStyledSystem = string | 0 | number ;
1
3
export type ResponsiveValue < T > = T | Array < T | null > ;
2
4
3
- export type SpaceValue = number | string ;
4
-
5
5
/**
6
6
* Converts shorthand margin and padding props to margin and padding CSS declarations
7
7
*
@@ -11,37 +11,36 @@ export type SpaceValue = number | string;
11
11
* - String values are passed as raw CSS values.
12
12
* - Array values are converted into responsive values.
13
13
*/
14
- export type ResponsiveSpaceValue = ResponsiveValue < SpaceValue > ;
15
14
16
- export interface SpaceProps {
15
+ export interface SpaceProps < TLength = TLengthStyledSystem > {
17
16
/** Margin on top, left, bottom and right */
18
- m ?: ResponsiveSpaceValue ;
17
+ m ?: ResponsiveValue < CSS . MarginProperty < TLength > > ;
19
18
/** Margin for the top */
20
- mt ?: ResponsiveSpaceValue ;
19
+ mt ?: ResponsiveValue < CSS . MarginTopProperty < TLength > > ;
21
20
/** Margin for the right */
22
- mr ?: ResponsiveSpaceValue ;
21
+ mr ?: ResponsiveValue < CSS . MarginRightProperty < TLength > > ;
23
22
/** Margin for the bottom */
24
- mb ?: ResponsiveSpaceValue ;
23
+ mb ?: ResponsiveValue < CSS . MarginBottomProperty < TLength > > ;
25
24
/** Margin for the left */
26
- ml ?: ResponsiveSpaceValue ;
25
+ ml ?: ResponsiveValue < CSS . MarginLeftProperty < TLength > > ;
27
26
/** Margin for the left and right */
28
- mx ?: ResponsiveSpaceValue ;
27
+ mx ?: ResponsiveValue < CSS . PaddingProperty < TLength > > ;
29
28
/** Margin for the top and bottom */
30
- my ?: ResponsiveSpaceValue ;
29
+ my ?: ResponsiveValue < CSS . PaddingProperty < TLength > > ;
31
30
/** Padding on top, left, bottom and right */
32
- p ?: ResponsiveSpaceValue ;
31
+ p ?: ResponsiveValue < CSS . PaddingProperty < TLength > > ;
33
32
/** Padding for the top */
34
- pt ?: ResponsiveSpaceValue ;
33
+ pt ?: ResponsiveValue < CSS . PaddingTopProperty < TLength > > ;
35
34
/** Padding for the right */
36
- pr ?: ResponsiveSpaceValue ;
35
+ pr ?: ResponsiveValue < CSS . PaddingRightProperty < TLength > > ;
37
36
/** Padding for the bottom */
38
- pb ?: ResponsiveSpaceValue ;
37
+ pb ?: ResponsiveValue < CSS . PaddingBottomProperty < TLength > > ;
39
38
/** Padding for the left */
40
- pl ?: ResponsiveSpaceValue ;
39
+ pl ?: ResponsiveValue < CSS . PaddingLeftProperty < TLength > > ;
41
40
/** Padding for the left and right */
42
- px ?: ResponsiveSpaceValue ;
41
+ px ?: ResponsiveValue < CSS . PaddingProperty < TLength > > ;
43
42
/** Padding for the top and bottom */
44
- py ?: ResponsiveSpaceValue ;
43
+ py ?: ResponsiveValue < CSS . PaddingProperty < TLength > > ;
45
44
}
46
45
47
46
export function space ( ...args : any [ ] ) : any ;
0 commit comments