gantri-components 2.35.0 → 2.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/box/box.adapters.d.ts +4 -0
- package/dist/components/box/box.types.d.ts +21 -16
- package/dist/components/line/index.d.ts +1 -0
- package/dist/components/line/line.d.ts +3 -0
- package/dist/components/line/line.presets.d.ts +2 -0
- package/dist/components/line/line.styles.d.ts +2 -0
- package/dist/components/line/line.types.d.ts +7 -0
- package/dist/components/typography/typography.types.d.ts +2 -16
- package/dist/global/constants.d.ts +96 -8
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/styles/theme.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DefaultTheme } from 'styled-components';
|
|
2
|
+
import { ExtractStyleFromResolutionAwarePropEntry } from '../../types/layout';
|
|
3
|
+
import { ElementSpacingProps } from './box.types';
|
|
4
|
+
export declare const extractStylePropEntriesFromSpacingProps: (spacingArgs: ElementSpacingProps, theme: DefaultTheme) => ExtractStyleFromResolutionAwarePropEntry[];
|
|
@@ -9,7 +9,7 @@ type DeprecatedSize = 's1' | 's2' | 's3' | 's4' | 's5' | 's6';
|
|
|
9
9
|
/**
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
|
-
export type BoxDimension = DeprecatedSize | '.5x' | 'x' | '2x' | '3x' | '4x' | '5x' | '6x' | '7x' | '8x' | '9x' | '10x' | '11x' | '12x' | '16x' | '24x' | 'unset' | null | `${number}px` | `${number}rem`;
|
|
12
|
+
export type BoxDimension = DeprecatedSize | '.5x' | 'x' | '2x' | '3x' | '4x' | '5x' | '6x' | '7x' | '8x' | '9x' | '10x' | '11x' | '12x' | '16x' | '18x' | '24x' | 'unset' | null | `${number}px` | `${number}rem` | `calc(${string})`;
|
|
13
13
|
type AllowedBoxDimension<T> = T extends BoxDimension ? T : never;
|
|
14
14
|
export interface ResolutionAwarePropBase<T> {
|
|
15
15
|
lg?: AllowedBoxDimension<T>;
|
|
@@ -20,33 +20,38 @@ export interface BaseProps extends Omit<HTMLAttributes<any>, 'hidden'> {
|
|
|
20
20
|
children?: any;
|
|
21
21
|
className?: string;
|
|
22
22
|
}
|
|
23
|
-
export interface
|
|
24
|
-
alignSelf?: ResolutionAwareProp<Property.AlignSelf>;
|
|
25
|
-
backgroundColor?: ResolutionAwareProp<Color>;
|
|
26
|
-
borderRadius?: ResolutionAwareProp<Property.BorderRadius>;
|
|
27
|
-
height?: ResolutionAwareProp<Property.Height>;
|
|
28
|
-
hidden?: ResolutionAwareProp<boolean>;
|
|
29
|
-
horizontalMargin?: ResolutionAwareProp<BoxDimension>;
|
|
23
|
+
export interface PaddingProps {
|
|
30
24
|
horizontalPadding?: ResolutionAwareProp<BoxDimension>;
|
|
31
|
-
|
|
25
|
+
padding?: ResolutionAwareProp<BoxDimension>;
|
|
26
|
+
paddingBottom?: ResolutionAwareProp<BoxDimension>;
|
|
27
|
+
paddingLeft?: ResolutionAwareProp<BoxDimension>;
|
|
28
|
+
paddingRight?: ResolutionAwareProp<BoxDimension>;
|
|
29
|
+
paddingTop?: ResolutionAwareProp<BoxDimension>;
|
|
30
|
+
verticalPadding?: ResolutionAwareProp<BoxDimension>;
|
|
31
|
+
}
|
|
32
|
+
export interface MarginProps {
|
|
33
|
+
horizontalMargin?: ResolutionAwareProp<BoxDimension>;
|
|
32
34
|
margin?: ResolutionAwareProp<BoxDimension>;
|
|
33
35
|
marginBottom?: ResolutionAwareProp<BoxDimension>;
|
|
34
36
|
marginLeft?: ResolutionAwareProp<BoxDimension>;
|
|
35
37
|
marginRight?: ResolutionAwareProp<BoxDimension>;
|
|
36
38
|
marginTop?: ResolutionAwareProp<BoxDimension>;
|
|
39
|
+
verticalMargin?: ResolutionAwareProp<BoxDimension>;
|
|
40
|
+
}
|
|
41
|
+
export type ElementSpacingProps = PaddingProps & MarginProps;
|
|
42
|
+
export interface BoxProps extends BaseProps, ElementSpacingProps {
|
|
43
|
+
alignSelf?: ResolutionAwareProp<Property.AlignSelf>;
|
|
44
|
+
backgroundColor?: ResolutionAwareProp<Color>;
|
|
45
|
+
borderRadius?: ResolutionAwareProp<Property.BorderRadius>;
|
|
46
|
+
height?: ResolutionAwareProp<Property.Height>;
|
|
47
|
+
hidden?: ResolutionAwareProp<boolean>;
|
|
48
|
+
justifySelf?: ResolutionAwareProp<Property.JustifySelf>;
|
|
37
49
|
maxHeight?: ResolutionAwareProp<Property.MaxHeight>;
|
|
38
50
|
maxWidth?: ResolutionAwareProp<string>;
|
|
39
51
|
minHeight?: ResolutionAwareProp<Property.MinHeight>;
|
|
40
52
|
minWidth?: ResolutionAwareProp<string>;
|
|
41
53
|
overflow?: Property.Overflow;
|
|
42
|
-
padding?: ResolutionAwareProp<BoxDimension>;
|
|
43
|
-
paddingBottom?: ResolutionAwareProp<BoxDimension>;
|
|
44
|
-
paddingLeft?: ResolutionAwareProp<BoxDimension>;
|
|
45
|
-
paddingRight?: ResolutionAwareProp<BoxDimension>;
|
|
46
|
-
paddingTop?: ResolutionAwareProp<BoxDimension>;
|
|
47
54
|
textAlign?: ResolutionAwareProp<string>;
|
|
48
|
-
verticalMargin?: ResolutionAwareProp<BoxDimension>;
|
|
49
|
-
verticalPadding?: ResolutionAwareProp<BoxDimension>;
|
|
50
55
|
width?: ResolutionAwareProp<string>;
|
|
51
56
|
}
|
|
52
57
|
export type PropsWithHidden<T> = T & {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './line';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DefaultTheme } from 'styled-components';
|
|
2
|
+
import { Property } from 'csstype';
|
|
3
|
+
import { MarginProps } from '../box/box.types';
|
|
4
|
+
export interface LineProps extends MarginProps {
|
|
5
|
+
color?: keyof DefaultTheme['colors']['dividers'];
|
|
6
|
+
height?: Property.Height;
|
|
7
|
+
}
|
|
@@ -2,12 +2,12 @@ import { Property } from 'csstype';
|
|
|
2
2
|
import { DefaultTheme } from 'styled-components';
|
|
3
3
|
import { AriaAttributes, CSSProperties } from 'react';
|
|
4
4
|
import { ResolutionAwareProp } from '../../types/resolution-aware-prop.type';
|
|
5
|
-
import {
|
|
5
|
+
import { ElementSpacingProps } from '../box/box.types';
|
|
6
6
|
export type TextAlign = 'string' | 'left' | 'center' | 'right' | 'unset';
|
|
7
7
|
export type TypographyColor = keyof DefaultTheme['colors']['typography'];
|
|
8
8
|
export type TextVariant = 'p0' | 'p1' | 'p2' | 'p3' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'hero' | string;
|
|
9
9
|
export type TextStyle = 'regular' | 'bold';
|
|
10
|
-
export interface TypographyProps extends Partial<TypographyDefaultProps>, AriaAttributes {
|
|
10
|
+
export interface TypographyProps extends Partial<TypographyDefaultProps>, AriaAttributes, ElementSpacingProps {
|
|
11
11
|
align?: ResolutionAwareProp<string>;
|
|
12
12
|
alignSelf?: ResolutionAwareProp<Property.AlignSelf>;
|
|
13
13
|
className?: string;
|
|
@@ -15,8 +15,6 @@ export interface TypographyProps extends Partial<TypographyDefaultProps>, AriaAt
|
|
|
15
15
|
fontSize?: ResolutionAwareProp<Property.Font>;
|
|
16
16
|
fontWeight?: Property.FontWeight;
|
|
17
17
|
hidden?: ResolutionAwareProp<boolean>;
|
|
18
|
-
horizontalMargin?: ResolutionAwareProp<BoxDimension>;
|
|
19
|
-
horizontalPadding?: ResolutionAwareProp<BoxDimension>;
|
|
20
18
|
htmlFor?: string;
|
|
21
19
|
htmlTag?: keyof HTMLElementTagNameMap;
|
|
22
20
|
htmlText?: string;
|
|
@@ -24,19 +22,9 @@ export interface TypographyProps extends Partial<TypographyDefaultProps>, AriaAt
|
|
|
24
22
|
justifySelf?: ResolutionAwareProp<Property.JustifySelf>;
|
|
25
23
|
letterSpacing?: ResolutionAwareProp<Property.LetterSpacing>;
|
|
26
24
|
lineHeight?: ResolutionAwareProp<Property.LineHeight>;
|
|
27
|
-
margin?: ResolutionAwareProp<BoxDimension>;
|
|
28
|
-
marginBottom?: ResolutionAwareProp<BoxDimension>;
|
|
29
|
-
marginLeft?: ResolutionAwareProp<BoxDimension>;
|
|
30
|
-
marginRight?: ResolutionAwareProp<BoxDimension>;
|
|
31
|
-
marginTop?: ResolutionAwareProp<BoxDimension>;
|
|
32
25
|
maxWidth?: ResolutionAwareProp<string>;
|
|
33
26
|
minWidth?: ResolutionAwareProp<string>;
|
|
34
27
|
onClick?: (event: any) => void;
|
|
35
|
-
padding?: ResolutionAwareProp<BoxDimension>;
|
|
36
|
-
paddingBottom?: ResolutionAwareProp<BoxDimension>;
|
|
37
|
-
paddingLeft?: ResolutionAwareProp<BoxDimension>;
|
|
38
|
-
paddingRight?: ResolutionAwareProp<BoxDimension>;
|
|
39
|
-
paddingTop?: ResolutionAwareProp<BoxDimension>;
|
|
40
28
|
style?: CSSProperties;
|
|
41
29
|
text?: string | number;
|
|
42
30
|
textShadow?: Property.TextShadow;
|
|
@@ -48,8 +36,6 @@ export interface TypographyProps extends Partial<TypographyDefaultProps>, AriaAt
|
|
|
48
36
|
* use `htmlTag` instead
|
|
49
37
|
* */
|
|
50
38
|
type?: keyof HTMLElementTagNameMap;
|
|
51
|
-
verticalMargin?: ResolutionAwareProp<BoxDimension>;
|
|
52
|
-
verticalPadding?: ResolutionAwareProp<BoxDimension>;
|
|
53
39
|
}
|
|
54
40
|
export interface TypographyDefaultProps {
|
|
55
41
|
color: TypographyColor;
|
|
@@ -4,14 +4,52 @@ export declare const storyBookSpacingArgType: {
|
|
|
4
4
|
};
|
|
5
5
|
options: string[];
|
|
6
6
|
};
|
|
7
|
-
export declare const
|
|
8
|
-
|
|
7
|
+
export declare const storyBookPaddingArgs: {
|
|
8
|
+
horizontalPadding: {
|
|
9
9
|
control: {
|
|
10
10
|
type: string;
|
|
11
11
|
};
|
|
12
12
|
options: string[];
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
padding: {
|
|
15
|
+
control: {
|
|
16
|
+
type: string;
|
|
17
|
+
};
|
|
18
|
+
options: string[];
|
|
19
|
+
};
|
|
20
|
+
paddingBottom: {
|
|
21
|
+
control: {
|
|
22
|
+
type: string;
|
|
23
|
+
};
|
|
24
|
+
options: string[];
|
|
25
|
+
};
|
|
26
|
+
paddingLeft: {
|
|
27
|
+
control: {
|
|
28
|
+
type: string;
|
|
29
|
+
};
|
|
30
|
+
options: string[];
|
|
31
|
+
};
|
|
32
|
+
paddingRight: {
|
|
33
|
+
control: {
|
|
34
|
+
type: string;
|
|
35
|
+
};
|
|
36
|
+
options: string[];
|
|
37
|
+
};
|
|
38
|
+
paddingTop: {
|
|
39
|
+
control: {
|
|
40
|
+
type: string;
|
|
41
|
+
};
|
|
42
|
+
options: string[];
|
|
43
|
+
};
|
|
44
|
+
verticalPadding: {
|
|
45
|
+
control: {
|
|
46
|
+
type: string;
|
|
47
|
+
};
|
|
48
|
+
options: string[];
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export declare const storyBookMarginArgs: {
|
|
52
|
+
horizontalMargin: {
|
|
15
53
|
control: {
|
|
16
54
|
type: string;
|
|
17
55
|
};
|
|
@@ -47,31 +85,45 @@ export declare const storyBookSpacingArgs: {
|
|
|
47
85
|
};
|
|
48
86
|
options: string[];
|
|
49
87
|
};
|
|
50
|
-
|
|
88
|
+
verticalMargin: {
|
|
51
89
|
control: {
|
|
52
90
|
type: string;
|
|
53
91
|
};
|
|
54
92
|
options: string[];
|
|
55
93
|
};
|
|
56
|
-
|
|
94
|
+
};
|
|
95
|
+
export declare const storyBookSpacingArgs: {
|
|
96
|
+
horizontalMargin: {
|
|
57
97
|
control: {
|
|
58
98
|
type: string;
|
|
59
99
|
};
|
|
60
100
|
options: string[];
|
|
61
101
|
};
|
|
62
|
-
|
|
102
|
+
margin: {
|
|
63
103
|
control: {
|
|
64
104
|
type: string;
|
|
65
105
|
};
|
|
66
106
|
options: string[];
|
|
67
107
|
};
|
|
68
|
-
|
|
108
|
+
marginBottom: {
|
|
69
109
|
control: {
|
|
70
110
|
type: string;
|
|
71
111
|
};
|
|
72
112
|
options: string[];
|
|
73
113
|
};
|
|
74
|
-
|
|
114
|
+
marginLeft: {
|
|
115
|
+
control: {
|
|
116
|
+
type: string;
|
|
117
|
+
};
|
|
118
|
+
options: string[];
|
|
119
|
+
};
|
|
120
|
+
marginRight: {
|
|
121
|
+
control: {
|
|
122
|
+
type: string;
|
|
123
|
+
};
|
|
124
|
+
options: string[];
|
|
125
|
+
};
|
|
126
|
+
marginTop: {
|
|
75
127
|
control: {
|
|
76
128
|
type: string;
|
|
77
129
|
};
|
|
@@ -83,6 +135,42 @@ export declare const storyBookSpacingArgs: {
|
|
|
83
135
|
};
|
|
84
136
|
options: string[];
|
|
85
137
|
};
|
|
138
|
+
horizontalPadding: {
|
|
139
|
+
control: {
|
|
140
|
+
type: string;
|
|
141
|
+
};
|
|
142
|
+
options: string[];
|
|
143
|
+
};
|
|
144
|
+
padding: {
|
|
145
|
+
control: {
|
|
146
|
+
type: string;
|
|
147
|
+
};
|
|
148
|
+
options: string[];
|
|
149
|
+
};
|
|
150
|
+
paddingBottom: {
|
|
151
|
+
control: {
|
|
152
|
+
type: string;
|
|
153
|
+
};
|
|
154
|
+
options: string[];
|
|
155
|
+
};
|
|
156
|
+
paddingLeft: {
|
|
157
|
+
control: {
|
|
158
|
+
type: string;
|
|
159
|
+
};
|
|
160
|
+
options: string[];
|
|
161
|
+
};
|
|
162
|
+
paddingRight: {
|
|
163
|
+
control: {
|
|
164
|
+
type: string;
|
|
165
|
+
};
|
|
166
|
+
options: string[];
|
|
167
|
+
};
|
|
168
|
+
paddingTop: {
|
|
169
|
+
control: {
|
|
170
|
+
type: string;
|
|
171
|
+
};
|
|
172
|
+
options: string[];
|
|
173
|
+
};
|
|
86
174
|
verticalPadding: {
|
|
87
175
|
control: {
|
|
88
176
|
type: string;
|