@sproutsocial/racine 11.0.2-beta.0 → 11.1.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/CHANGELOG.md +13 -0
- package/__flow__/index.js +1 -0
- package/__flow__/systemProps/background.js +28 -0
- package/__flow__/systemProps/border.js +76 -0
- package/__flow__/systemProps/color.js +25 -0
- package/__flow__/systemProps/custom.js +23 -0
- package/__flow__/systemProps/flexbox.js +42 -0
- package/__flow__/systemProps/grid.js +43 -0
- package/__flow__/systemProps/index.js +17 -0
- package/__flow__/systemProps/layout.js +43 -0
- package/__flow__/systemProps/position.js +29 -0
- package/__flow__/systemProps/shadow.js +18 -0
- package/__flow__/systemProps/space.js +83 -0
- package/__flow__/systemProps/systemProps.js +55 -0
- package/__flow__/systemProps/tests/__snapshots__/background.test.js.snap +96 -0
- package/__flow__/systemProps/tests/__snapshots__/border.test.js.snap +469 -0
- package/__flow__/systemProps/tests/__snapshots__/color.test.js.snap +55 -0
- package/__flow__/systemProps/tests/__snapshots__/custom.test.js.snap +36 -0
- package/__flow__/systemProps/tests/__snapshots__/flexbox.test.js.snap +239 -0
- package/__flow__/systemProps/tests/__snapshots__/grid.test.js.snap +166 -0
- package/__flow__/systemProps/tests/__snapshots__/layout.test.js.snap +218 -0
- package/__flow__/systemProps/tests/__snapshots__/position.test.js.snap +115 -0
- package/__flow__/systemProps/tests/__snapshots__/shadow.test.js.snap +25 -0
- package/__flow__/systemProps/tests/__snapshots__/space.test.js.snap +39 -0
- package/__flow__/systemProps/tests/__snapshots__/typography.test.js.snap +166 -0
- package/__flow__/systemProps/tests/__snapshots__/variant.test.js.snap +17 -0
- package/__flow__/systemProps/tests/background.test.js +90 -0
- package/__flow__/systemProps/tests/border.test.js +299 -0
- package/__flow__/systemProps/tests/color.test.js +49 -0
- package/__flow__/systemProps/tests/custom.test.js +38 -0
- package/__flow__/systemProps/tests/flexbox.test.js +150 -0
- package/__flow__/systemProps/tests/grid.test.js +123 -0
- package/__flow__/systemProps/tests/layout.test.js +135 -0
- package/__flow__/systemProps/tests/position.test.js +78 -0
- package/__flow__/systemProps/tests/shadow.test.js +30 -0
- package/__flow__/systemProps/tests/space.test.js +32 -0
- package/__flow__/systemProps/tests/types.flow.js +55 -0
- package/__flow__/systemProps/tests/typography.test.js +93 -0
- package/__flow__/systemProps/tests/variant.test.js +25 -0
- package/__flow__/systemProps/types.flow.js +20 -0
- package/__flow__/systemProps/typography.js +34 -0
- package/__flow__/systemProps/variant.js +18 -0
- package/__flow__/themes/dark/theme.js +1 -0
- package/__flow__/themes/light/theme.js +1 -0
- package/commonjs/index.js +78 -0
- package/commonjs/systemProps/background.js +9 -0
- package/commonjs/systemProps/border.js +9 -0
- package/commonjs/systemProps/color.js +9 -0
- package/commonjs/systemProps/custom.js +12 -0
- package/commonjs/systemProps/flexbox.js +9 -0
- package/commonjs/systemProps/grid.js +9 -0
- package/commonjs/systemProps/index.js +115 -0
- package/commonjs/systemProps/layout.js +9 -0
- package/commonjs/systemProps/position.js +9 -0
- package/commonjs/systemProps/shadow.js +9 -0
- package/commonjs/systemProps/space.js +10 -0
- package/commonjs/systemProps/systemProps.js +33 -0
- package/commonjs/systemProps/tests/types.flow.js +46 -0
- package/commonjs/systemProps/types.flow.js +1 -0
- package/commonjs/systemProps/typography.js +9 -0
- package/commonjs/systemProps/variant.js +12 -0
- package/commonjs/themes/dark/theme.js +1 -0
- package/commonjs/themes/light/theme.js +1 -0
- package/dist/themes/dark/dark.scss +1 -0
- package/dist/themes/light/light.scss +1 -0
- package/lib/index.js +1 -0
- package/lib/systemProps/background.js +2 -0
- package/lib/systemProps/border.js +2 -0
- package/lib/systemProps/color.js +2 -0
- package/lib/systemProps/custom.js +5 -0
- package/lib/systemProps/flexbox.js +2 -0
- package/lib/systemProps/grid.js +2 -0
- package/lib/systemProps/index.js +14 -0
- package/lib/systemProps/layout.js +2 -0
- package/lib/systemProps/position.js +2 -0
- package/lib/systemProps/shadow.js +2 -0
- package/lib/systemProps/space.js +3 -0
- package/lib/systemProps/systemProps.js +14 -0
- package/lib/systemProps/tests/types.flow.js +44 -0
- package/lib/systemProps/types.flow.js +0 -0
- package/lib/systemProps/typography.js +2 -0
- package/lib/systemProps/variant.js +5 -0
- package/lib/themes/dark/theme.js +1 -0
- package/lib/themes/light/theme.js +1 -0
- package/package.json +12 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 11.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 03d1f1a: Export system props
|
|
8
|
+
|
|
9
|
+
## 11.0.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- f3b0741: Add icon.applied to theme file
|
|
14
|
+
- 521ee2b: Ensure subcomponents have proper displayName attributes
|
|
15
|
+
|
|
3
16
|
## 11.0.1
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/__flow__/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
export type { EnumIconNames } from "./EnumIconNames";
|
|
3
3
|
export type { TypeTheme } from "./types/theme.flow";
|
|
4
|
+
export * from "./systemProps";
|
|
4
5
|
export { visuallyHidden, focusRing, disabled } from "./utils/mixins";
|
|
5
6
|
export { useSelect, useMultiselect, useTextContent } from "./utils/hooks";
|
|
6
7
|
export { default as theme } from "./themes/light/theme";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// @flow strict-local
|
|
2
|
+
|
|
3
|
+
import { background } from "styled-system";
|
|
4
|
+
import type {
|
|
5
|
+
BackgroundImageProperty,
|
|
6
|
+
BackgroundPositionProperty,
|
|
7
|
+
BackgroundProperty,
|
|
8
|
+
BackgroundRepeatProperty,
|
|
9
|
+
BackgroundSizeProperty,
|
|
10
|
+
} from "csstype";
|
|
11
|
+
|
|
12
|
+
import type {
|
|
13
|
+
StyledSystemStyleFn,
|
|
14
|
+
TypeResponsiveBaseSystemProp,
|
|
15
|
+
} from "./types.flow.js";
|
|
16
|
+
|
|
17
|
+
// https://styled-system.com/table#background
|
|
18
|
+
|
|
19
|
+
export type TypeBackgroundSystemProps = $ReadOnly<{|
|
|
20
|
+
background?: TypeResponsiveBaseSystemProp<BackgroundProperty<void>>,
|
|
21
|
+
backgroundImage?: TypeResponsiveBaseSystemProp<BackgroundImageProperty>,
|
|
22
|
+
backgroundSize?: TypeResponsiveBaseSystemProp<BackgroundSizeProperty<void>>,
|
|
23
|
+
// eslint-disable-next-line prettier/prettier
|
|
24
|
+
backgroundPosition?: TypeResponsiveBaseSystemProp<BackgroundPositionProperty<void>>,
|
|
25
|
+
backgroundRepeat?: TypeResponsiveBaseSystemProp<BackgroundRepeatProperty>,
|
|
26
|
+
|}>;
|
|
27
|
+
|
|
28
|
+
export const backgroundSystemProps: StyledSystemStyleFn = background;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// @flow strict-local
|
|
2
|
+
|
|
3
|
+
import { border } from "styled-system";
|
|
4
|
+
import type {
|
|
5
|
+
BorderBottomColorProperty,
|
|
6
|
+
BorderBottomLeftRadiusProperty,
|
|
7
|
+
BorderBottomProperty,
|
|
8
|
+
BorderBottomRightRadiusProperty,
|
|
9
|
+
BorderBottomStyleProperty,
|
|
10
|
+
BorderBottomWidthProperty,
|
|
11
|
+
BorderColorProperty,
|
|
12
|
+
BorderLeftColorProperty,
|
|
13
|
+
BorderLeftProperty,
|
|
14
|
+
BorderLeftStyleProperty,
|
|
15
|
+
BorderLeftWidthProperty,
|
|
16
|
+
BorderProperty,
|
|
17
|
+
BorderRadiusProperty,
|
|
18
|
+
BorderRightColorProperty,
|
|
19
|
+
BorderRightProperty,
|
|
20
|
+
BorderRightStyleProperty,
|
|
21
|
+
BorderRightWidthProperty,
|
|
22
|
+
BorderStyleProperty,
|
|
23
|
+
BorderTopColorProperty,
|
|
24
|
+
BorderTopLeftRadiusProperty,
|
|
25
|
+
BorderTopProperty,
|
|
26
|
+
BorderTopRightRadiusProperty,
|
|
27
|
+
BorderTopStyleProperty,
|
|
28
|
+
BorderTopWidthProperty,
|
|
29
|
+
BorderWidthProperty,
|
|
30
|
+
} from "csstype";
|
|
31
|
+
|
|
32
|
+
import type {
|
|
33
|
+
StyledSystemStyleFn,
|
|
34
|
+
TypeResponsiveBaseSystemProp,
|
|
35
|
+
} from "./types.flow.js";
|
|
36
|
+
|
|
37
|
+
// https://styled-system.com/table#border
|
|
38
|
+
|
|
39
|
+
export type TypeBorderSystemProps = $ReadOnly<{|
|
|
40
|
+
border?: TypeResponsiveBaseSystemProp<BorderProperty<number>>,
|
|
41
|
+
borderBottom?: TypeResponsiveBaseSystemProp<BorderBottomProperty<number>>,
|
|
42
|
+
borderBottomColor?: TypeResponsiveBaseSystemProp<BorderBottomColorProperty>,
|
|
43
|
+
// eslint-disable-next-line prettier/prettier
|
|
44
|
+
borderBottomLeftRadius?: TypeResponsiveBaseSystemProp<BorderBottomLeftRadiusProperty<number>>,
|
|
45
|
+
// eslint-disable-next-line prettier/prettier
|
|
46
|
+
borderBottomRightRadius?: TypeResponsiveBaseSystemProp<BorderBottomRightRadiusProperty<number>>,
|
|
47
|
+
borderBottomStyle?: TypeResponsiveBaseSystemProp<BorderBottomStyleProperty>,
|
|
48
|
+
// eslint-disable-next-line prettier/prettier
|
|
49
|
+
borderBottomWidth?: TypeResponsiveBaseSystemProp<BorderBottomWidthProperty<number>>,
|
|
50
|
+
borderColor?: TypeResponsiveBaseSystemProp<BorderColorProperty>,
|
|
51
|
+
borderLeft?: TypeResponsiveBaseSystemProp<BorderLeftProperty<number>>,
|
|
52
|
+
borderLeftColor?: TypeResponsiveBaseSystemProp<BorderLeftColorProperty>,
|
|
53
|
+
borderLeftStyle?: TypeResponsiveBaseSystemProp<BorderLeftStyleProperty>,
|
|
54
|
+
// eslint-disable-next-line prettier/prettier
|
|
55
|
+
borderLeftWidth?: TypeResponsiveBaseSystemProp<BorderLeftWidthProperty<number>>,
|
|
56
|
+
borderRadius?: TypeResponsiveBaseSystemProp<BorderRadiusProperty<number>>,
|
|
57
|
+
borderRight?: TypeResponsiveBaseSystemProp<BorderRightProperty<number>>,
|
|
58
|
+
borderRightColor?: TypeResponsiveBaseSystemProp<BorderRightColorProperty>,
|
|
59
|
+
borderRightStyle?: TypeResponsiveBaseSystemProp<BorderRightStyleProperty>,
|
|
60
|
+
// eslint-disable-next-line prettier/prettier
|
|
61
|
+
borderRightWidth?: TypeResponsiveBaseSystemProp<BorderRightWidthProperty<number>>,
|
|
62
|
+
borderStyle?: TypeResponsiveBaseSystemProp<BorderStyleProperty>,
|
|
63
|
+
borderTop?: TypeResponsiveBaseSystemProp<BorderTopProperty<number>>,
|
|
64
|
+
borderTopColor?: TypeResponsiveBaseSystemProp<BorderTopColorProperty>,
|
|
65
|
+
// eslint-disable-next-line prettier/prettier
|
|
66
|
+
borderTopLeftRadius?: TypeResponsiveBaseSystemProp<BorderTopLeftRadiusProperty<number>>,
|
|
67
|
+
// eslint-disable-next-line prettier/prettier
|
|
68
|
+
borderTopRightRadius?: TypeResponsiveBaseSystemProp<BorderTopRightRadiusProperty<number>>,
|
|
69
|
+
borderTopStyle?: TypeResponsiveBaseSystemProp<BorderTopStyleProperty>,
|
|
70
|
+
borderTopWidth?: TypeResponsiveBaseSystemProp<BorderTopWidthProperty<number>>,
|
|
71
|
+
borderWidth?: TypeResponsiveBaseSystemProp<BorderWidthProperty<number>>,
|
|
72
|
+
borderX?: TypeResponsiveBaseSystemProp<BorderLeftProperty<number>>,
|
|
73
|
+
borderY?: TypeResponsiveBaseSystemProp<BorderTopProperty<number>>,
|
|
74
|
+
|}>;
|
|
75
|
+
|
|
76
|
+
export const borderSystemProps: StyledSystemStyleFn = border;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// @flow strict-local
|
|
2
|
+
|
|
3
|
+
import { color } from "styled-system";
|
|
4
|
+
import type {
|
|
5
|
+
BackgroundColorProperty,
|
|
6
|
+
ColorProperty,
|
|
7
|
+
OpacityProperty,
|
|
8
|
+
} from "csstype";
|
|
9
|
+
|
|
10
|
+
import type {
|
|
11
|
+
StyledSystemStyleFn,
|
|
12
|
+
TypeResponsiveBaseSystemProp,
|
|
13
|
+
} from "./types.flow.js";
|
|
14
|
+
|
|
15
|
+
// https://styled-system.com/table#color
|
|
16
|
+
|
|
17
|
+
type TypeBackgroundColorSystemProp = TypeResponsiveBaseSystemProp<BackgroundColorProperty>;
|
|
18
|
+
export type TypeColorSystemProps = $ReadOnly<{|
|
|
19
|
+
backgroundColor?: TypeBackgroundColorSystemProp,
|
|
20
|
+
bg?: TypeBackgroundColorSystemProp,
|
|
21
|
+
color?: TypeResponsiveBaseSystemProp<ColorProperty>,
|
|
22
|
+
opacity?: TypeResponsiveBaseSystemProp<OpacityProperty>,
|
|
23
|
+
|}>;
|
|
24
|
+
|
|
25
|
+
export const colorSystemProps: StyledSystemStyleFn = color;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// @flow strict-local
|
|
2
|
+
|
|
3
|
+
import { compose, system } from "styled-system";
|
|
4
|
+
import type { CursorProperty, WhiteSpaceProperty } from "csstype";
|
|
5
|
+
|
|
6
|
+
import type {
|
|
7
|
+
StyledSystemStyleFn,
|
|
8
|
+
TypeResponsiveBaseSystemProp,
|
|
9
|
+
} from "./types.flow.js";
|
|
10
|
+
|
|
11
|
+
// https://styled-system.com/custom-props
|
|
12
|
+
|
|
13
|
+
export type TypeCustomSystemProps = $ReadOnly<{|
|
|
14
|
+
cursor?: TypeResponsiveBaseSystemProp<CursorProperty>,
|
|
15
|
+
whiteSpace?: TypeResponsiveBaseSystemProp<WhiteSpaceProperty>,
|
|
16
|
+
|}>;
|
|
17
|
+
|
|
18
|
+
export const customSystemProps: StyledSystemStyleFn = compose(
|
|
19
|
+
system({
|
|
20
|
+
cursor: true,
|
|
21
|
+
whiteSpace: true,
|
|
22
|
+
})
|
|
23
|
+
);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// @flow strict-local
|
|
2
|
+
|
|
3
|
+
import { flexbox } from "styled-system";
|
|
4
|
+
import type {
|
|
5
|
+
AlignItemsProperty,
|
|
6
|
+
AlignContentProperty,
|
|
7
|
+
JustifyContentProperty,
|
|
8
|
+
JustifyItemsProperty,
|
|
9
|
+
FlexWrapProperty,
|
|
10
|
+
FlexDirectionProperty,
|
|
11
|
+
FlexProperty,
|
|
12
|
+
FlexBasisProperty,
|
|
13
|
+
JustifySelfProperty,
|
|
14
|
+
AlignSelfProperty,
|
|
15
|
+
Globals,
|
|
16
|
+
} from "csstype";
|
|
17
|
+
|
|
18
|
+
import type {
|
|
19
|
+
StyledSystemStyleFn,
|
|
20
|
+
TypeResponsiveBaseSystemProp,
|
|
21
|
+
} from "./types.flow.js";
|
|
22
|
+
|
|
23
|
+
// https://styled-system.com/table#flexbox
|
|
24
|
+
|
|
25
|
+
type TypeGlobalsNumber = Globals | number;
|
|
26
|
+
export type TypeFlexboxSystemProps = $ReadOnly<{|
|
|
27
|
+
alignItems?: TypeResponsiveBaseSystemProp<AlignItemsProperty>,
|
|
28
|
+
alignContent?: TypeResponsiveBaseSystemProp<AlignContentProperty>,
|
|
29
|
+
justifyItems?: TypeResponsiveBaseSystemProp<JustifyContentProperty>,
|
|
30
|
+
justifyContent?: TypeResponsiveBaseSystemProp<JustifyItemsProperty>,
|
|
31
|
+
flexWrap?: TypeResponsiveBaseSystemProp<FlexWrapProperty>,
|
|
32
|
+
flexDirection?: TypeResponsiveBaseSystemProp<FlexDirectionProperty>,
|
|
33
|
+
flex?: TypeResponsiveBaseSystemProp<FlexProperty<void>>,
|
|
34
|
+
flexGrow?: TypeResponsiveBaseSystemProp<TypeGlobalsNumber>,
|
|
35
|
+
flexShrink?: TypeResponsiveBaseSystemProp<TypeGlobalsNumber>,
|
|
36
|
+
flexBasis?: TypeResponsiveBaseSystemProp<FlexBasisProperty<void>>,
|
|
37
|
+
justifySelf?: TypeResponsiveBaseSystemProp<JustifySelfProperty>,
|
|
38
|
+
alignSelf?: TypeResponsiveBaseSystemProp<AlignSelfProperty>,
|
|
39
|
+
order?: TypeResponsiveBaseSystemProp<TypeGlobalsNumber>,
|
|
40
|
+
|}>;
|
|
41
|
+
|
|
42
|
+
export const flexboxSystemProps: StyledSystemStyleFn = flexbox;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// @flow strict-local
|
|
2
|
+
|
|
3
|
+
import { grid } from "styled-system";
|
|
4
|
+
import type {
|
|
5
|
+
GridAreaProperty,
|
|
6
|
+
GridAutoColumnsProperty,
|
|
7
|
+
GridAutoFlowProperty,
|
|
8
|
+
GridAutoRowsProperty,
|
|
9
|
+
GridColumnProperty,
|
|
10
|
+
GridColumnGapProperty,
|
|
11
|
+
GridGapProperty,
|
|
12
|
+
GridRowProperty,
|
|
13
|
+
GridRowGapProperty,
|
|
14
|
+
GridTemplateAreasProperty,
|
|
15
|
+
GridTemplateColumnsProperty,
|
|
16
|
+
GridTemplateRowsProperty,
|
|
17
|
+
} from "csstype";
|
|
18
|
+
|
|
19
|
+
import type {
|
|
20
|
+
StyledSystemStyleFn,
|
|
21
|
+
TypeResponsiveBaseSystemProp,
|
|
22
|
+
} from "./types.flow.js";
|
|
23
|
+
|
|
24
|
+
// https://styled-system.com/table#grid-layout
|
|
25
|
+
|
|
26
|
+
export type TypeGridSystemProps = $ReadOnly<{|
|
|
27
|
+
gridArea?: TypeResponsiveBaseSystemProp<GridAreaProperty>,
|
|
28
|
+
gridAutoColumns?: TypeResponsiveBaseSystemProp<GridAutoColumnsProperty<void>>,
|
|
29
|
+
gridAutoFlow?: TypeResponsiveBaseSystemProp<GridAutoFlowProperty>,
|
|
30
|
+
gridAutoRows?: TypeResponsiveBaseSystemProp<GridAutoRowsProperty<void>>,
|
|
31
|
+
gridColumn?: TypeResponsiveBaseSystemProp<GridColumnProperty>,
|
|
32
|
+
gridColumnGap?: TypeResponsiveBaseSystemProp<GridColumnGapProperty<void>>,
|
|
33
|
+
gridGap?: TypeResponsiveBaseSystemProp<GridGapProperty<void>>,
|
|
34
|
+
gridRow?: TypeResponsiveBaseSystemProp<GridRowProperty>,
|
|
35
|
+
gridRowGap?: TypeResponsiveBaseSystemProp<GridRowGapProperty<void>>,
|
|
36
|
+
gridTemplateAreas?: TypeResponsiveBaseSystemProp<GridTemplateAreasProperty>,
|
|
37
|
+
// eslint-disable-next-line prettier/prettier
|
|
38
|
+
gridTemplateColumns?: TypeResponsiveBaseSystemProp<GridTemplateColumnsProperty<void>>,
|
|
39
|
+
// eslint-disable-next-line prettier/prettier
|
|
40
|
+
gridTemplateRows?: TypeResponsiveBaseSystemProp<GridTemplateRowsProperty<void>>,
|
|
41
|
+
|}>;
|
|
42
|
+
|
|
43
|
+
export const gridSystemProps: StyledSystemStyleFn = grid;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @flow strict-local
|
|
2
|
+
|
|
3
|
+
export * from "./types.flow.js";
|
|
4
|
+
|
|
5
|
+
export * from "./background";
|
|
6
|
+
export * from "./border";
|
|
7
|
+
export * from "./color";
|
|
8
|
+
export * from "./custom";
|
|
9
|
+
export * from "./flexbox";
|
|
10
|
+
export * from "./grid";
|
|
11
|
+
export * from "./layout";
|
|
12
|
+
export * from "./position";
|
|
13
|
+
export * from "./shadow";
|
|
14
|
+
export * from "./space";
|
|
15
|
+
export * from "./systemProps";
|
|
16
|
+
export * from "./typography";
|
|
17
|
+
export * from "./variant";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// @flow strict-local
|
|
2
|
+
|
|
3
|
+
import { layout } from "styled-system";
|
|
4
|
+
import type {
|
|
5
|
+
DisplayProperty,
|
|
6
|
+
HeightProperty,
|
|
7
|
+
MaxHeightProperty,
|
|
8
|
+
MaxWidthProperty,
|
|
9
|
+
MinHeightProperty,
|
|
10
|
+
MinWidthProperty,
|
|
11
|
+
OverflowProperty,
|
|
12
|
+
OverflowXProperty,
|
|
13
|
+
OverflowYProperty,
|
|
14
|
+
VerticalAlignProperty,
|
|
15
|
+
WidthProperty,
|
|
16
|
+
} from "csstype";
|
|
17
|
+
|
|
18
|
+
import type {
|
|
19
|
+
StyledSystemStyleFn,
|
|
20
|
+
TypeResponsiveBaseSystemProp,
|
|
21
|
+
} from "./types.flow.js";
|
|
22
|
+
|
|
23
|
+
// https://styled-system.com/table#layout
|
|
24
|
+
|
|
25
|
+
type TypeHeightProp = HeightProperty<number>;
|
|
26
|
+
type TypeWidthProp = WidthProperty<number>;
|
|
27
|
+
|
|
28
|
+
export type TypeLayoutSystemProps = $ReadOnly<{|
|
|
29
|
+
display?: TypeResponsiveBaseSystemProp<DisplayProperty>,
|
|
30
|
+
height?: TypeResponsiveBaseSystemProp<TypeHeightProp>,
|
|
31
|
+
maxHeight?: TypeResponsiveBaseSystemProp<MaxHeightProperty<number>>,
|
|
32
|
+
maxWidth?: TypeResponsiveBaseSystemProp<MaxWidthProperty<number>>,
|
|
33
|
+
minHeight?: TypeResponsiveBaseSystemProp<MinHeightProperty<number>>,
|
|
34
|
+
minWidth?: TypeResponsiveBaseSystemProp<MinWidthProperty<number>>,
|
|
35
|
+
overflow?: TypeResponsiveBaseSystemProp<OverflowProperty>,
|
|
36
|
+
overflowX?: TypeResponsiveBaseSystemProp<OverflowXProperty>,
|
|
37
|
+
overflowY?: TypeResponsiveBaseSystemProp<OverflowYProperty>,
|
|
38
|
+
size?: TypeResponsiveBaseSystemProp<TypeHeightProp & TypeWidthProp>,
|
|
39
|
+
verticalAlign?: TypeResponsiveBaseSystemProp<VerticalAlignProperty<void>>,
|
|
40
|
+
width?: TypeResponsiveBaseSystemProp<TypeWidthProp>,
|
|
41
|
+
|}>;
|
|
42
|
+
|
|
43
|
+
export const layoutSystemProps: StyledSystemStyleFn = layout;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// @flow strict-local
|
|
2
|
+
|
|
3
|
+
import { position } from "styled-system";
|
|
4
|
+
import type {
|
|
5
|
+
BottomProperty,
|
|
6
|
+
LeftProperty,
|
|
7
|
+
PositionProperty,
|
|
8
|
+
RightProperty,
|
|
9
|
+
TopProperty,
|
|
10
|
+
ZIndexProperty,
|
|
11
|
+
} from "csstype";
|
|
12
|
+
|
|
13
|
+
import type {
|
|
14
|
+
StyledSystemStyleFn,
|
|
15
|
+
TypeResponsiveBaseSystemProp,
|
|
16
|
+
} from "./types.flow.js";
|
|
17
|
+
|
|
18
|
+
// https://styled-system.com/table#position
|
|
19
|
+
|
|
20
|
+
export type TypePositionSystemProps = $ReadOnly<{|
|
|
21
|
+
bottom?: TypeResponsiveBaseSystemProp<BottomProperty<number>>,
|
|
22
|
+
left?: TypeResponsiveBaseSystemProp<LeftProperty<number>>,
|
|
23
|
+
position?: TypeResponsiveBaseSystemProp<PositionProperty>,
|
|
24
|
+
right?: TypeResponsiveBaseSystemProp<RightProperty<number>>,
|
|
25
|
+
top?: TypeResponsiveBaseSystemProp<TopProperty<number>>,
|
|
26
|
+
zIndex?: TypeResponsiveBaseSystemProp<ZIndexProperty>,
|
|
27
|
+
|}>;
|
|
28
|
+
|
|
29
|
+
export const positionSystemProps: StyledSystemStyleFn = position;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// @flow strict-local
|
|
2
|
+
|
|
3
|
+
import { shadow } from "styled-system";
|
|
4
|
+
import type { BoxShadowProperty, TextShadowProperty } from "csstype";
|
|
5
|
+
|
|
6
|
+
import type {
|
|
7
|
+
StyledSystemStyleFn,
|
|
8
|
+
TypeResponsiveBaseSystemProp,
|
|
9
|
+
} from "./types.flow.js";
|
|
10
|
+
|
|
11
|
+
// https://styled-system.com/table#shadow
|
|
12
|
+
|
|
13
|
+
export type TypeShadowSystemProps = $ReadOnly<{|
|
|
14
|
+
boxShadow?: TypeResponsiveBaseSystemProp<BoxShadowProperty>,
|
|
15
|
+
textShadow?: TypeResponsiveBaseSystemProp<TextShadowProperty>,
|
|
16
|
+
|}>;
|
|
17
|
+
|
|
18
|
+
export const shadowSystemProps: StyledSystemStyleFn = shadow;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/* eslint-disable prettier/prettier */
|
|
2
|
+
// @flow strict-local
|
|
3
|
+
|
|
4
|
+
import { space } from "styled-system";
|
|
5
|
+
import type {
|
|
6
|
+
MarginProperty,
|
|
7
|
+
MarginBottomProperty,
|
|
8
|
+
MarginLeftProperty,
|
|
9
|
+
MarginRightProperty,
|
|
10
|
+
MarginTopProperty,
|
|
11
|
+
PaddingProperty,
|
|
12
|
+
PaddingBottomProperty,
|
|
13
|
+
PaddingLeftProperty,
|
|
14
|
+
PaddingRightProperty,
|
|
15
|
+
PaddingTopProperty,
|
|
16
|
+
} from "csstype";
|
|
17
|
+
|
|
18
|
+
import type {
|
|
19
|
+
StyledSystemStyleFn,
|
|
20
|
+
TypeResponsiveBaseSystemProp,
|
|
21
|
+
} from "./types.flow.js";
|
|
22
|
+
|
|
23
|
+
// https://styled-system.com/table#space
|
|
24
|
+
|
|
25
|
+
type TypeMarginSystemProp = TypeResponsiveBaseSystemProp<MarginProperty<number>>;
|
|
26
|
+
type TypeMarginBottomSystemProp = TypeResponsiveBaseSystemProp<MarginBottomProperty<number>>;
|
|
27
|
+
type TypeMarginLeftSystemProp = TypeResponsiveBaseSystemProp<MarginLeftProperty<number>>;
|
|
28
|
+
type TypeMarginRightSystemProp = TypeResponsiveBaseSystemProp<MarginRightProperty<number>>;
|
|
29
|
+
type TypeMarginTopSystemProp = TypeResponsiveBaseSystemProp<MarginTopProperty<number>>;
|
|
30
|
+
type TypeMarginXSystemProp = TypeResponsiveBaseSystemProp<MarginLeftProperty<number> & MarginRightProperty<number>>;
|
|
31
|
+
type TypeMarginYSystemProp = TypeResponsiveBaseSystemProp<MarginBottomProperty<number> & MarginTopProperty<number>>;
|
|
32
|
+
|
|
33
|
+
type TypePaddingSystemProp = TypeResponsiveBaseSystemProp<PaddingProperty<number>>;
|
|
34
|
+
type TypePaddingBottomSystemProp = TypeResponsiveBaseSystemProp<PaddingBottomProperty<number>>;
|
|
35
|
+
type TypePaddingLeftSystemProp = TypeResponsiveBaseSystemProp<PaddingLeftProperty<number>>;
|
|
36
|
+
type TypePaddingRightSystemProp = TypeResponsiveBaseSystemProp<PaddingRightProperty<number>>;
|
|
37
|
+
type TypePaddingTopSystemProp = TypeResponsiveBaseSystemProp<PaddingTopProperty<number>>;
|
|
38
|
+
type TypePaddingXSystemProp = TypeResponsiveBaseSystemProp<PaddingLeftProperty<number> & PaddingRightProperty<number>>;
|
|
39
|
+
type TypePaddingYSystemProp = TypeResponsiveBaseSystemProp<PaddingBottomProperty<number> & PaddingTopProperty<number>>;
|
|
40
|
+
|
|
41
|
+
export type TypeSpaceSystemProps = $ReadOnly<{|
|
|
42
|
+
// margin longhand
|
|
43
|
+
margin?: TypeMarginSystemProp,
|
|
44
|
+
marginBottom?: TypeMarginBottomSystemProp,
|
|
45
|
+
marginLeft?: TypeMarginLeftSystemProp,
|
|
46
|
+
marginRight?: TypeMarginRightSystemProp,
|
|
47
|
+
marginTop?: TypeMarginTopSystemProp,
|
|
48
|
+
// eslint-disable-next-line prettier/prettier
|
|
49
|
+
marginX?: TypeMarginXSystemProp,
|
|
50
|
+
// eslint-disable-next-line prettier/prettier
|
|
51
|
+
marginY?: TypeMarginYSystemProp,
|
|
52
|
+
|
|
53
|
+
// margin shorthand
|
|
54
|
+
m?: TypeMarginSystemProp,
|
|
55
|
+
mb?: TypeMarginBottomSystemProp,
|
|
56
|
+
ml?: TypeMarginLeftSystemProp,
|
|
57
|
+
mr?: TypeMarginRightSystemProp,
|
|
58
|
+
mt?: TypeMarginTopSystemProp,
|
|
59
|
+
mx?: TypeMarginXSystemProp,
|
|
60
|
+
my?: TypeMarginYSystemProp,
|
|
61
|
+
|
|
62
|
+
// padding longhand
|
|
63
|
+
padding?: TypePaddingSystemProp,
|
|
64
|
+
paddingBottom?: TypePaddingBottomSystemProp,
|
|
65
|
+
paddingLeft?: TypePaddingLeftSystemProp,
|
|
66
|
+
paddingRight?: TypePaddingRightSystemProp,
|
|
67
|
+
paddingTop?: TypePaddingTopSystemProp,
|
|
68
|
+
// eslint-disable-next-line prettier/prettier
|
|
69
|
+
paddingX?: TypePaddingXSystemProp,
|
|
70
|
+
// eslint-disable-next-line prettier/prettier
|
|
71
|
+
paddingY?: TypePaddingYSystemProp,
|
|
72
|
+
|
|
73
|
+
// padding shorthand
|
|
74
|
+
p?: TypePaddingSystemProp,
|
|
75
|
+
pb?: TypePaddingBottomSystemProp,
|
|
76
|
+
pl?: TypePaddingLeftSystemProp,
|
|
77
|
+
pr?: TypePaddingRightSystemProp,
|
|
78
|
+
pt?: TypePaddingTopSystemProp,
|
|
79
|
+
px?: TypePaddingXSystemProp,
|
|
80
|
+
py?: TypePaddingYSystemProp,
|
|
81
|
+
|}>;
|
|
82
|
+
|
|
83
|
+
export const spaceSystemProps: StyledSystemStyleFn = space;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// @flow strict-local
|
|
2
|
+
import { compose } from "styled-system";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
backgroundSystemProps,
|
|
6
|
+
type TypeBackgroundSystemProps,
|
|
7
|
+
} from "./background";
|
|
8
|
+
import { borderSystemProps, type TypeBorderSystemProps } from "./border";
|
|
9
|
+
import { colorSystemProps, type TypeColorSystemProps } from "./color";
|
|
10
|
+
import { customSystemProps, type TypeCustomSystemProps } from "./custom";
|
|
11
|
+
import { flexboxSystemProps, type TypeFlexboxSystemProps } from "./flexbox";
|
|
12
|
+
import { gridSystemProps, type TypeGridSystemProps } from "./grid";
|
|
13
|
+
import { layoutSystemProps, type TypeLayoutSystemProps } from "./layout";
|
|
14
|
+
import { positionSystemProps, type TypePositionSystemProps } from "./position";
|
|
15
|
+
import { shadowSystemProps, type TypeShadowSystemProps } from "./shadow";
|
|
16
|
+
import { spaceSystemProps, type TypeSpaceSystemProps } from "./space";
|
|
17
|
+
import {
|
|
18
|
+
typographySystemProps,
|
|
19
|
+
type TypeTypographySystemProps,
|
|
20
|
+
} from "./typography";
|
|
21
|
+
import { variantSystemProps, type TypeVariantSystemProps } from "./variant";
|
|
22
|
+
|
|
23
|
+
import type { StyledSystemStyleFn } from "./types.flow.js";
|
|
24
|
+
|
|
25
|
+
export type TypeSystemProps = $ReadOnly<{|
|
|
26
|
+
...TypeCustomSystemProps,
|
|
27
|
+
...TypeVariantSystemProps,
|
|
28
|
+
|
|
29
|
+
...TypeBackgroundSystemProps,
|
|
30
|
+
...TypeBorderSystemProps,
|
|
31
|
+
...TypeColorSystemProps,
|
|
32
|
+
...TypeFlexboxSystemProps,
|
|
33
|
+
...TypeGridSystemProps,
|
|
34
|
+
...TypeLayoutSystemProps,
|
|
35
|
+
...TypePositionSystemProps,
|
|
36
|
+
...TypeShadowSystemProps,
|
|
37
|
+
...TypeSpaceSystemProps,
|
|
38
|
+
...TypeTypographySystemProps,
|
|
39
|
+
|}>;
|
|
40
|
+
|
|
41
|
+
export const systemProps: StyledSystemStyleFn = compose(
|
|
42
|
+
customSystemProps,
|
|
43
|
+
variantSystemProps,
|
|
44
|
+
|
|
45
|
+
backgroundSystemProps,
|
|
46
|
+
borderSystemProps,
|
|
47
|
+
colorSystemProps,
|
|
48
|
+
flexboxSystemProps,
|
|
49
|
+
gridSystemProps,
|
|
50
|
+
layoutSystemProps,
|
|
51
|
+
positionSystemProps,
|
|
52
|
+
shadowSystemProps,
|
|
53
|
+
spaceSystemProps,
|
|
54
|
+
typographySystemProps
|
|
55
|
+
);
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`background system props background 1`] = `
|
|
4
|
+
.c0 {
|
|
5
|
+
background: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.c1 {
|
|
9
|
+
background: 1px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
<div>
|
|
13
|
+
<div
|
|
14
|
+
class="c0"
|
|
15
|
+
/>
|
|
16
|
+
<div
|
|
17
|
+
class="c1"
|
|
18
|
+
/>
|
|
19
|
+
</div>
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
exports[`background system props backgroundImage 1`] = `
|
|
23
|
+
.c0 {
|
|
24
|
+
background-image: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.c1 {
|
|
28
|
+
background-image: 1px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
<div>
|
|
32
|
+
<div
|
|
33
|
+
class="c0"
|
|
34
|
+
/>
|
|
35
|
+
<div
|
|
36
|
+
class="c1"
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
exports[`background system props backgroundPosition 1`] = `
|
|
42
|
+
.c0 {
|
|
43
|
+
background-position: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.c1 {
|
|
47
|
+
background-position: 1px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
<div>
|
|
51
|
+
<div
|
|
52
|
+
class="c0"
|
|
53
|
+
/>
|
|
54
|
+
<div
|
|
55
|
+
class="c1"
|
|
56
|
+
/>
|
|
57
|
+
</div>
|
|
58
|
+
`;
|
|
59
|
+
|
|
60
|
+
exports[`background system props backgroundRepeat 1`] = `
|
|
61
|
+
.c0 {
|
|
62
|
+
background-repeat: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.c1 {
|
|
66
|
+
background-repeat: 1px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
<div>
|
|
70
|
+
<div
|
|
71
|
+
class="c0"
|
|
72
|
+
/>
|
|
73
|
+
<div
|
|
74
|
+
class="c1"
|
|
75
|
+
/>
|
|
76
|
+
</div>
|
|
77
|
+
`;
|
|
78
|
+
|
|
79
|
+
exports[`background system props backgroundSize 1`] = `
|
|
80
|
+
.c0 {
|
|
81
|
+
background-size: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.c1 {
|
|
85
|
+
background-size: 1px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
<div>
|
|
89
|
+
<div
|
|
90
|
+
class="c0"
|
|
91
|
+
/>
|
|
92
|
+
<div
|
|
93
|
+
class="c1"
|
|
94
|
+
/>
|
|
95
|
+
</div>
|
|
96
|
+
`;
|