@sproutsocial/racine 11.0.2-dependencies.0 → 11.0.2-dependencies.1

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.
Files changed (137) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/__flow__/Breadcrumb/index.js +2 -0
  3. package/__flow__/Collapsible/index.js +3 -0
  4. package/__flow__/Drawer/index.js +4 -0
  5. package/__flow__/EnumIconNames.js +1 -1
  6. package/__flow__/Fieldset/index.js +8 -2
  7. package/__flow__/Icon/index.js +5 -1
  8. package/__flow__/IconViewBoxes.js +1 -1
  9. package/__flow__/Menu/index.js +7 -0
  10. package/__flow__/Message/index.js +7 -0
  11. package/__flow__/Modal/index.js +5 -0
  12. package/__flow__/Popout/index.js +4 -1
  13. package/__flow__/SegmentedControl/index.js +2 -0
  14. package/__flow__/Table/index.js +6 -0
  15. package/__flow__/Text/index.js +8 -0
  16. package/__flow__/index.js +1 -0
  17. package/__flow__/systemProps/background.js +28 -0
  18. package/__flow__/systemProps/border.js +76 -0
  19. package/__flow__/systemProps/color.js +25 -0
  20. package/__flow__/systemProps/custom.js +23 -0
  21. package/__flow__/systemProps/flexbox.js +42 -0
  22. package/__flow__/systemProps/grid.js +43 -0
  23. package/__flow__/systemProps/index.js +17 -0
  24. package/__flow__/systemProps/layout.js +43 -0
  25. package/__flow__/systemProps/position.js +29 -0
  26. package/__flow__/systemProps/shadow.js +18 -0
  27. package/__flow__/systemProps/space.js +83 -0
  28. package/__flow__/systemProps/systemProps.js +55 -0
  29. package/__flow__/systemProps/tests/__snapshots__/background.test.js.snap +96 -0
  30. package/__flow__/systemProps/tests/__snapshots__/border.test.js.snap +469 -0
  31. package/__flow__/systemProps/tests/__snapshots__/color.test.js.snap +55 -0
  32. package/__flow__/systemProps/tests/__snapshots__/custom.test.js.snap +36 -0
  33. package/__flow__/systemProps/tests/__snapshots__/flexbox.test.js.snap +239 -0
  34. package/__flow__/systemProps/tests/__snapshots__/grid.test.js.snap +166 -0
  35. package/__flow__/systemProps/tests/__snapshots__/layout.test.js.snap +218 -0
  36. package/__flow__/systemProps/tests/__snapshots__/position.test.js.snap +115 -0
  37. package/__flow__/systemProps/tests/__snapshots__/shadow.test.js.snap +25 -0
  38. package/__flow__/systemProps/tests/__snapshots__/space.test.js.snap +39 -0
  39. package/__flow__/systemProps/tests/__snapshots__/typography.test.js.snap +166 -0
  40. package/__flow__/systemProps/tests/__snapshots__/variant.test.js.snap +17 -0
  41. package/__flow__/systemProps/tests/background.test.js +90 -0
  42. package/__flow__/systemProps/tests/border.test.js +299 -0
  43. package/__flow__/systemProps/tests/color.test.js +49 -0
  44. package/__flow__/systemProps/tests/custom.test.js +38 -0
  45. package/__flow__/systemProps/tests/flexbox.test.js +150 -0
  46. package/__flow__/systemProps/tests/grid.test.js +123 -0
  47. package/__flow__/systemProps/tests/layout.test.js +135 -0
  48. package/__flow__/systemProps/tests/position.test.js +78 -0
  49. package/__flow__/systemProps/tests/shadow.test.js +30 -0
  50. package/__flow__/systemProps/tests/space.test.js +32 -0
  51. package/__flow__/systemProps/tests/types.flow.js +55 -0
  52. package/__flow__/systemProps/tests/typography.test.js +93 -0
  53. package/__flow__/systemProps/tests/variant.test.js +25 -0
  54. package/__flow__/systemProps/types.flow.js +20 -0
  55. package/__flow__/systemProps/typography.js +34 -0
  56. package/__flow__/systemProps/variant.js +18 -0
  57. package/__flow__/themes/dark/theme.js +1 -0
  58. package/__flow__/themes/light/theme.js +1 -0
  59. package/bin/buildNpm.js +58 -0
  60. package/commonjs/Breadcrumb/index.js +1 -0
  61. package/commonjs/Collapsible/index.js +2 -0
  62. package/commonjs/Drawer/index.js +3 -0
  63. package/commonjs/Fieldset/index.js +6 -2
  64. package/commonjs/Icon/index.js +3 -1
  65. package/commonjs/IconViewBoxes.js +2 -0
  66. package/commonjs/Menu/index.js +6 -0
  67. package/commonjs/Message/index.js +13 -0
  68. package/commonjs/Modal/index.js +4 -0
  69. package/commonjs/Popout/index.js +5 -2
  70. package/commonjs/SegmentedControl/index.js +1 -0
  71. package/commonjs/Table/index.js +5 -0
  72. package/commonjs/Text/index.js +7 -0
  73. package/commonjs/include-icons.js +1 -1
  74. package/commonjs/index.js +78 -0
  75. package/commonjs/systemProps/background.js +9 -0
  76. package/commonjs/systemProps/border.js +9 -0
  77. package/commonjs/systemProps/color.js +9 -0
  78. package/commonjs/systemProps/custom.js +12 -0
  79. package/commonjs/systemProps/flexbox.js +9 -0
  80. package/commonjs/systemProps/grid.js +9 -0
  81. package/commonjs/systemProps/index.js +115 -0
  82. package/commonjs/systemProps/layout.js +9 -0
  83. package/commonjs/systemProps/position.js +9 -0
  84. package/commonjs/systemProps/shadow.js +9 -0
  85. package/commonjs/systemProps/space.js +10 -0
  86. package/commonjs/systemProps/systemProps.js +33 -0
  87. package/commonjs/systemProps/tests/types.flow.js +46 -0
  88. package/commonjs/systemProps/types.flow.js +1 -0
  89. package/commonjs/systemProps/typography.js +9 -0
  90. package/commonjs/systemProps/variant.js +12 -0
  91. package/commonjs/themes/dark/theme.js +1 -0
  92. package/commonjs/themes/light/theme.js +1 -0
  93. package/dist/iconList.js +1 -1
  94. package/dist/icons.svg +1 -1
  95. package/dist/themes/dark/dark.scss +1 -0
  96. package/dist/themes/light/light.scss +1 -0
  97. package/icons/address-card-outline.svg +3 -0
  98. package/icons/deconstructed-negative-sentiment.svg +1 -1
  99. package/icons/deconstructed-neutral-sentiment.svg +1 -1
  100. package/icons/deconstructed-positive-sentiment.svg +1 -1
  101. package/icons/magic-wand.svg +3 -0
  102. package/icons/whatsapp.svg +5 -5
  103. package/includeIcons.js +1 -1
  104. package/lib/Breadcrumb/index.js +1 -0
  105. package/lib/Collapsible/index.js +2 -0
  106. package/lib/Drawer/index.js +3 -0
  107. package/lib/Fieldset/index.js +6 -2
  108. package/lib/Icon/index.js +3 -1
  109. package/lib/IconViewBoxes.js +2 -0
  110. package/lib/Menu/index.js +6 -0
  111. package/lib/Message/index.js +13 -0
  112. package/lib/Modal/index.js +4 -0
  113. package/lib/Popout/index.js +5 -2
  114. package/lib/SegmentedControl/index.js +1 -0
  115. package/lib/Table/index.js +5 -0
  116. package/lib/Text/index.js +7 -0
  117. package/lib/include-icons.js +1 -1
  118. package/lib/index.js +1 -0
  119. package/lib/systemProps/background.js +2 -0
  120. package/lib/systemProps/border.js +2 -0
  121. package/lib/systemProps/color.js +2 -0
  122. package/lib/systemProps/custom.js +5 -0
  123. package/lib/systemProps/flexbox.js +2 -0
  124. package/lib/systemProps/grid.js +2 -0
  125. package/lib/systemProps/index.js +14 -0
  126. package/lib/systemProps/layout.js +2 -0
  127. package/lib/systemProps/position.js +2 -0
  128. package/lib/systemProps/shadow.js +2 -0
  129. package/lib/systemProps/space.js +3 -0
  130. package/lib/systemProps/systemProps.js +14 -0
  131. package/lib/systemProps/tests/types.flow.js +44 -0
  132. package/lib/systemProps/types.flow.js +0 -0
  133. package/lib/systemProps/typography.js +2 -0
  134. package/lib/systemProps/variant.js +5 -0
  135. package/lib/themes/dark/theme.js +1 -0
  136. package/lib/themes/light/theme.js +1 -0
  137. package/package.json +15 -3
@@ -0,0 +1,38 @@
1
+ // @flow strict-local
2
+ import React from "react";
3
+ import styled from "styled-components";
4
+ import { render } from "../../utils/react-testing-library";
5
+ import type { TypeTheme } from "../../types/theme.flow";
6
+ import { customSystemProps, type TypeCustomSystemProps } from "../custom";
7
+
8
+ describe("custom system props", () => {
9
+ const Component = styled<TypeCustomSystemProps, TypeTheme, "div">("div")`
10
+ ${customSystemProps}
11
+ `;
12
+
13
+ test("cursor", () => {
14
+ const { container } = render(
15
+ <>
16
+ <Component cursor="string" />
17
+ </>
18
+ );
19
+ expect(container).toMatchSnapshot();
20
+ });
21
+
22
+ test("whiteSpace", () => {
23
+ const { container } = render(
24
+ <>
25
+ <Component whiteSpace="nowrap" />
26
+ <Component
27
+ // $FlowExpectedError
28
+ whiteSpace="string"
29
+ />
30
+ <Component
31
+ // not sure why is this not erroring
32
+ whiteSpace={["string"]}
33
+ />
34
+ </>
35
+ );
36
+ expect(container).toMatchSnapshot();
37
+ });
38
+ });
@@ -0,0 +1,150 @@
1
+ // @flow strict-local
2
+ import React from "react";
3
+ import styled from "styled-components";
4
+ import { render } from "../../utils/react-testing-library";
5
+ import type { TypeTheme } from "../../types/theme.flow";
6
+ import { flexboxSystemProps, type TypeFlexboxSystemProps } from "../flexbox";
7
+
8
+ describe("flexbox system props", () => {
9
+ const Component = styled<TypeFlexboxSystemProps, TypeTheme, "div">("div")`
10
+ ${flexboxSystemProps}
11
+ `;
12
+
13
+ test("alignItems", () => {
14
+ const { container } = render(
15
+ <>
16
+ <Component alignItems="string" />
17
+ </>
18
+ );
19
+ expect(container).toMatchSnapshot();
20
+ });
21
+
22
+ test("alignContent", () => {
23
+ const { container } = render(
24
+ <>
25
+ <Component alignContent="string" />
26
+ </>
27
+ );
28
+ expect(container).toMatchSnapshot();
29
+ });
30
+
31
+ test("justifyItems", () => {
32
+ const { container } = render(
33
+ <>
34
+ <Component justifyItems="string" />
35
+ </>
36
+ );
37
+ expect(container).toMatchSnapshot();
38
+ });
39
+
40
+ test("justifyContent", () => {
41
+ const { container } = render(
42
+ <>
43
+ <Component justifyContent="string" />
44
+ </>
45
+ );
46
+ expect(container).toMatchSnapshot();
47
+ });
48
+
49
+ test("flexWrap", () => {
50
+ const { container } = render(
51
+ <>
52
+ <Component flexWrap="wrap" />
53
+ <Component
54
+ // $FlowExpectedError
55
+ flexWrap="string"
56
+ />
57
+ </>
58
+ );
59
+ expect(container).toMatchSnapshot();
60
+ });
61
+
62
+ test("flexDirection", () => {
63
+ const { container } = render(
64
+ <>
65
+ <Component flexDirection="column" />
66
+ <Component
67
+ // $FlowExpectedError
68
+ flexDirection="string"
69
+ />
70
+ </>
71
+ );
72
+ expect(container).toMatchSnapshot();
73
+ });
74
+
75
+ test("flex", () => {
76
+ const { container } = render(
77
+ <>
78
+ <Component flex="string" />
79
+ <Component flex={1} />
80
+ </>
81
+ );
82
+ expect(container).toMatchSnapshot();
83
+ });
84
+
85
+ test("flexGrow", () => {
86
+ const { container } = render(
87
+ <>
88
+ <Component flexGrow={1} />
89
+ <Component
90
+ // $FlowExpectedError
91
+ flexGrow="string"
92
+ />
93
+ </>
94
+ );
95
+ expect(container).toMatchSnapshot();
96
+ });
97
+
98
+ test("flexShrink", () => {
99
+ const { container } = render(
100
+ <>
101
+ <Component flexShrink={1} />
102
+ <Component
103
+ // $FlowExpectedError
104
+ flexShrink="string"
105
+ />
106
+ </>
107
+ );
108
+ expect(container).toMatchSnapshot();
109
+ });
110
+
111
+ test("flexBasis", () => {
112
+ const { container } = render(
113
+ <>
114
+ <Component flexBasis="string" />
115
+ </>
116
+ );
117
+ expect(container).toMatchSnapshot();
118
+ });
119
+
120
+ test("justifySelf", () => {
121
+ const { container } = render(
122
+ <>
123
+ <Component justifySelf="string" />
124
+ </>
125
+ );
126
+ expect(container).toMatchSnapshot();
127
+ });
128
+
129
+ test("alignSelf", () => {
130
+ const { container } = render(
131
+ <>
132
+ <Component alignSelf="string" />
133
+ </>
134
+ );
135
+ expect(container).toMatchSnapshot();
136
+ });
137
+
138
+ test("order", () => {
139
+ const { container } = render(
140
+ <>
141
+ <Component order={1} />
142
+ <Component
143
+ // $FlowExpectedError
144
+ order="string"
145
+ />
146
+ </>
147
+ );
148
+ expect(container).toMatchSnapshot();
149
+ });
150
+ });
@@ -0,0 +1,123 @@
1
+ // @flow strict-local
2
+ import React from "react";
3
+ import styled from "styled-components";
4
+ import { render } from "../../utils/react-testing-library";
5
+ import type { TypeTheme } from "../../types/theme.flow";
6
+ import { gridSystemProps, type TypeGridSystemProps } from "../grid";
7
+
8
+ describe("grid system props", () => {
9
+ const Component = styled<TypeGridSystemProps, TypeTheme, "div">("div")`
10
+ ${gridSystemProps}
11
+ `;
12
+
13
+ test("gridArea", () => {
14
+ const { container } = render(
15
+ <>
16
+ <Component gridArea="string" />
17
+ <Component gridArea={1} />
18
+ </>
19
+ );
20
+ expect(container).toMatchSnapshot();
21
+ });
22
+
23
+ test("gridAutoColumns", () => {
24
+ const { container } = render(
25
+ <>
26
+ <Component gridAutoColumns="string" />
27
+ </>
28
+ );
29
+ expect(container).toMatchSnapshot();
30
+ });
31
+
32
+ test("gridAutoFlow", () => {
33
+ const { container } = render(
34
+ <>
35
+ <Component gridAutoFlow="string" />
36
+ </>
37
+ );
38
+ expect(container).toMatchSnapshot();
39
+ });
40
+
41
+ test("gridAutoRows", () => {
42
+ const { container } = render(
43
+ <>
44
+ <Component gridAutoRows="string" />
45
+ </>
46
+ );
47
+ expect(container).toMatchSnapshot();
48
+ });
49
+
50
+ test("gridColumn", () => {
51
+ const { container } = render(
52
+ <>
53
+ <Component gridColumn="string" />
54
+ <Component gridColumn={1} />
55
+ </>
56
+ );
57
+ expect(container).toMatchSnapshot();
58
+ });
59
+
60
+ test("gridColumnGap", () => {
61
+ const { container } = render(
62
+ <>
63
+ <Component gridColumnGap="string" />
64
+ </>
65
+ );
66
+ expect(container).toMatchSnapshot();
67
+ });
68
+
69
+ test("gridGap", () => {
70
+ const { container } = render(
71
+ <>
72
+ <Component gridGap="string" />
73
+ </>
74
+ );
75
+ expect(container).toMatchSnapshot();
76
+ });
77
+
78
+ test("gridRow", () => {
79
+ const { container } = render(
80
+ <>
81
+ <Component gridRow="string" />
82
+ <Component gridRow={1} />
83
+ </>
84
+ );
85
+ expect(container).toMatchSnapshot();
86
+ });
87
+
88
+ test("gridRowGap", () => {
89
+ const { container } = render(
90
+ <>
91
+ <Component gridRowGap="string" />
92
+ </>
93
+ );
94
+ expect(container).toMatchSnapshot();
95
+ });
96
+
97
+ test("gridTemplateAreas", () => {
98
+ const { container } = render(
99
+ <>
100
+ <Component gridTemplateAreas="string" />
101
+ </>
102
+ );
103
+ expect(container).toMatchSnapshot();
104
+ });
105
+
106
+ test("gridTemplateColumns", () => {
107
+ const { container } = render(
108
+ <>
109
+ <Component gridTemplateColumns="string" />
110
+ </>
111
+ );
112
+ expect(container).toMatchSnapshot();
113
+ });
114
+
115
+ test("gridTemplateRows", () => {
116
+ const { container } = render(
117
+ <>
118
+ <Component gridTemplateRows="string" />
119
+ </>
120
+ );
121
+ expect(container).toMatchSnapshot();
122
+ });
123
+ });
@@ -0,0 +1,135 @@
1
+ // @flow strict-local
2
+ import React from "react";
3
+ import styled from "styled-components";
4
+ import { render } from "../../utils/react-testing-library";
5
+ import type { TypeTheme } from "../../types/theme.flow";
6
+ import { layoutSystemProps, type TypeLayoutSystemProps } from "../layout";
7
+
8
+ describe("layout system props", () => {
9
+ const Component = styled<TypeLayoutSystemProps, TypeTheme, "div">("div")`
10
+ ${layoutSystemProps}
11
+ `;
12
+
13
+ test("display", () => {
14
+ const { container } = render(
15
+ <>
16
+ <Component display="string" />
17
+ </>
18
+ );
19
+ expect(container).toMatchSnapshot();
20
+ });
21
+
22
+ test("height", () => {
23
+ const { container } = render(
24
+ <>
25
+ <Component height="string" />
26
+ <Component height={1} />
27
+ </>
28
+ );
29
+ expect(container).toMatchSnapshot();
30
+ });
31
+
32
+ test("maxHeight", () => {
33
+ const { container } = render(
34
+ <>
35
+ <Component maxHeight="string" />
36
+ <Component maxHeight={1} />
37
+ </>
38
+ );
39
+ expect(container).toMatchSnapshot();
40
+ });
41
+
42
+ test("maxWidth", () => {
43
+ const { container } = render(
44
+ <>
45
+ <Component maxWidth="string" />
46
+ <Component maxWidth={1} />
47
+ </>
48
+ );
49
+ expect(container).toMatchSnapshot();
50
+ });
51
+
52
+ test("minHeight", () => {
53
+ const { container } = render(
54
+ <>
55
+ <Component minHeight="string" />
56
+ <Component minHeight={1} />
57
+ </>
58
+ );
59
+ expect(container).toMatchSnapshot();
60
+ });
61
+
62
+ test("minWidth", () => {
63
+ const { container } = render(
64
+ <>
65
+ <Component minWidth="string" />
66
+ <Component minWidth={1} />
67
+ </>
68
+ );
69
+ expect(container).toMatchSnapshot();
70
+ });
71
+
72
+ test("overflow", () => {
73
+ const { container } = render(
74
+ <>
75
+ <Component overflow="string" />
76
+ </>
77
+ );
78
+ expect(container).toMatchSnapshot();
79
+ });
80
+
81
+ test("overflowX", () => {
82
+ const { container } = render(
83
+ <>
84
+ <Component overflowX="hidden" />
85
+ <Component
86
+ // $FlowExpectedError
87
+ overflowX="string"
88
+ />
89
+ </>
90
+ );
91
+ expect(container).toMatchSnapshot();
92
+ });
93
+
94
+ test("overflowY", () => {
95
+ const { container } = render(
96
+ <>
97
+ <Component overflowY="scroll" />
98
+ <Component
99
+ // $FlowExpectedError
100
+ overflowY="string"
101
+ />
102
+ </>
103
+ );
104
+ expect(container).toMatchSnapshot();
105
+ });
106
+
107
+ test("size", () => {
108
+ const { container } = render(
109
+ <>
110
+ <Component size="string" />
111
+ <Component size={1} />
112
+ </>
113
+ );
114
+ expect(container).toMatchSnapshot();
115
+ });
116
+
117
+ test("verticalAlign", () => {
118
+ const { container } = render(
119
+ <>
120
+ <Component verticalAlign="string" />
121
+ </>
122
+ );
123
+ expect(container).toMatchSnapshot();
124
+ });
125
+
126
+ test("width", () => {
127
+ const { container } = render(
128
+ <>
129
+ <Component width="string" />
130
+ <Component width={1} />
131
+ </>
132
+ );
133
+ expect(container).toMatchSnapshot();
134
+ });
135
+ });
@@ -0,0 +1,78 @@
1
+ // @flow strict-local
2
+ import React from "react";
3
+ import styled from "styled-components";
4
+ import { render } from "../../utils/react-testing-library";
5
+ import type { TypeTheme } from "../../types/theme.flow";
6
+ import { positionSystemProps, type TypePositionSystemProps } from "../position";
7
+
8
+ describe("position system props", () => {
9
+ const Component = styled<TypePositionSystemProps, TypeTheme, "div">("div")`
10
+ ${positionSystemProps}
11
+ `;
12
+
13
+ test("position", () => {
14
+ const { container } = render(
15
+ <>
16
+ <Component position="absolute" />
17
+ <Component
18
+ // $FlowExpectedError
19
+ position="string"
20
+ />
21
+ </>
22
+ );
23
+ expect(container).toMatchSnapshot();
24
+ });
25
+
26
+ test("bottom", () => {
27
+ const { container } = render(
28
+ <>
29
+ <Component bottom="string" />
30
+ <Component bottom={1} />
31
+ </>
32
+ );
33
+ expect(container).toMatchSnapshot();
34
+ });
35
+
36
+ test("left", () => {
37
+ const { container } = render(
38
+ <>
39
+ <Component left="string" />
40
+ <Component left={1} />
41
+ </>
42
+ );
43
+ expect(container).toMatchSnapshot();
44
+ });
45
+
46
+ test("right", () => {
47
+ const { container } = render(
48
+ <>
49
+ <Component right="string" />
50
+ <Component right={1} />
51
+ </>
52
+ );
53
+ expect(container).toMatchSnapshot();
54
+ });
55
+
56
+ test("top", () => {
57
+ const { container } = render(
58
+ <>
59
+ <Component top="string" />
60
+ <Component top={1} />
61
+ </>
62
+ );
63
+ expect(container).toMatchSnapshot();
64
+ });
65
+
66
+ test("zIndex", () => {
67
+ const { container } = render(
68
+ <>
69
+ <Component zIndex={1} />
70
+ <Component
71
+ // $FlowExpectedError
72
+ zIndex="string"
73
+ />
74
+ </>
75
+ );
76
+ expect(container).toMatchSnapshot();
77
+ });
78
+ });
@@ -0,0 +1,30 @@
1
+ // @flow strict-local
2
+ import React from "react";
3
+ import styled from "styled-components";
4
+ import { render } from "../../utils/react-testing-library";
5
+ import type { TypeTheme } from "../../types/theme.flow";
6
+ import { shadowSystemProps, type TypeShadowSystemProps } from "../shadow";
7
+
8
+ describe("shadow system props", () => {
9
+ const Component = styled<TypeShadowSystemProps, TypeTheme, "div">("div")`
10
+ ${shadowSystemProps}
11
+ `;
12
+
13
+ test("boxShadow", () => {
14
+ const { container } = render(
15
+ <>
16
+ <Component boxShadow="string" />
17
+ </>
18
+ );
19
+ expect(container).toMatchSnapshot();
20
+ });
21
+
22
+ test("textShadow", () => {
23
+ const { container } = render(
24
+ <>
25
+ <Component textShadow="string" />
26
+ </>
27
+ );
28
+ expect(container).toMatchSnapshot();
29
+ });
30
+ });
@@ -0,0 +1,32 @@
1
+ // @flow strict-local
2
+ import React from "react";
3
+ import styled from "styled-components";
4
+ import { render } from "../../utils/react-testing-library";
5
+ import type { TypeTheme } from "../../types/theme.flow";
6
+ import { spaceSystemProps, type TypeSpaceSystemProps } from "../space";
7
+
8
+ describe("space system props", () => {
9
+ const Component = styled<TypeSpaceSystemProps, TypeTheme, "div">("div")`
10
+ ${spaceSystemProps}
11
+ `;
12
+
13
+ test("margin", () => {
14
+ const { container } = render(
15
+ <>
16
+ <Component margin="string" />
17
+ <Component margin={1} />
18
+ </>
19
+ );
20
+ expect(container).toMatchSnapshot();
21
+ });
22
+
23
+ test("padding", () => {
24
+ const { container } = render(
25
+ <>
26
+ <Component padding="string" />
27
+ <Component padding={1} />
28
+ </>
29
+ );
30
+ expect(container).toMatchSnapshot();
31
+ });
32
+ });
@@ -0,0 +1,55 @@
1
+ // @flow strict
2
+
3
+ import type {
4
+ TypeResponsiveSystemProp,
5
+ TypeBaseSystemProp,
6
+ TypeResponsiveBaseSystemProp,
7
+ } from "../types.flow.js";
8
+
9
+ /**
10
+ * All system props should be responsive but accepting a tuple of length 1-5.
11
+ */
12
+ type TypeTestResponsiveSystemProp = TypeResponsiveSystemProp<"a">;
13
+ ("a": TypeTestResponsiveSystemProp);
14
+ (["a"]: TypeTestResponsiveSystemProp);
15
+ (["a", "a"]: TypeTestResponsiveSystemProp);
16
+ (["a", "a", "a"]: TypeTestResponsiveSystemProp);
17
+ (["a", "a", "a", "a"]: TypeTestResponsiveSystemProp);
18
+ (["a", "a", "a", "a", "a"]: TypeTestResponsiveSystemProp);
19
+ // $FlowExpectedError
20
+ (["a", "a", "a", "a", "a", "a"]: TypeTestResponsiveSystemProp);
21
+ // $FlowExpectedError
22
+ (["b"]: TypeTestResponsiveSystemProp);
23
+ // $FlowExpectedError
24
+ ([null]: TypeTestResponsiveSystemProp);
25
+
26
+ /**
27
+ * All system props should accept "base" values: boolean, null, and undefined.
28
+ */
29
+ type TypeTestBaseSystemProp = TypeBaseSystemProp<"a">;
30
+ ("a": TypeTestBaseSystemProp);
31
+ (true: TypeTestBaseSystemProp);
32
+ (false: TypeTestBaseSystemProp);
33
+ (null: TypeTestBaseSystemProp);
34
+ (undefined: TypeTestBaseSystemProp);
35
+
36
+ /**
37
+ * All system props should be responsive and allow "base" values.
38
+ */
39
+ type TypeTestResponsiveBaseSystemProp = TypeResponsiveBaseSystemProp<"a" | "b">;
40
+ ("a": TypeTestResponsiveBaseSystemProp);
41
+ ("b": TypeTestResponsiveBaseSystemProp);
42
+ (true: TypeTestResponsiveBaseSystemProp);
43
+ (false: TypeTestResponsiveBaseSystemProp);
44
+ (null: TypeTestResponsiveBaseSystemProp);
45
+ (undefined: TypeTestResponsiveBaseSystemProp);
46
+ (["a", null, undefined, false, "b"]: TypeTestResponsiveBaseSystemProp);
47
+ (["a"]: TypeTestResponsiveBaseSystemProp);
48
+ // $FlowExpectedError
49
+ ("c": TypeTestResponsiveBaseSystemProp);
50
+ // $FlowExpectedError
51
+ (1: TypeTestResponsiveBaseSystemProp);
52
+ // $FlowExpectedError
53
+ ({}: TypeTestResponsiveBaseSystemProp);
54
+ // $FlowExpectedError
55
+ ([]: TypeTestResponsiveBaseSystemProp);