@sproutsocial/racine 11.0.2 → 11.1.2-badge-update.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 +18 -0
- package/__flow__/Badge/constants.js +48 -0
- package/__flow__/Badge/index.js +58 -32
- package/__flow__/Badge/index.stories.js +29 -42
- package/__flow__/Badge/index.test.js +34 -32
- package/__flow__/Badge/styles.js +22 -42
- package/__flow__/EnumIconNames.js +1 -1
- package/__flow__/IconViewBoxes.js +1 -1
- 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/literal-colors.js +2 -0
- package/__flow__/themes/light/theme.js +1 -0
- package/__flow__/types/theme.colors.flow.js +27 -0
- package/bin/buildNpm.js +58 -0
- package/commonjs/Avatar/index.js +7 -4
- package/commonjs/Badge/constants.js +43 -0
- package/commonjs/Badge/index.js +42 -38
- package/commonjs/Badge/styles.js +16 -32
- package/commonjs/Banner/index.js +3 -1
- package/commonjs/Banner/styles.js +1 -1
- package/commonjs/Box/styles.js +1 -1
- package/commonjs/Breadcrumb/index.js +5 -2
- package/commonjs/Button/index.js +3 -1
- package/commonjs/Card/index.js +3 -1
- package/commonjs/Card/styles.js +3 -3
- package/commonjs/CharacterCounter/index.js +3 -1
- package/commonjs/CharacterCounter/styles.js +1 -1
- package/commonjs/ChartLegend/index.js +3 -1
- package/commonjs/ChartLegend/styles.js +3 -3
- package/commonjs/Checkbox/index.js +3 -1
- package/commonjs/Checkbox/styles.js +1 -1
- package/commonjs/Collapsible/index.js +5 -2
- package/commonjs/DatePicker/DateRangePicker.js +3 -1
- package/commonjs/DatePicker/SingleDatePicker.js +3 -1
- package/commonjs/DatePicker/StatefulDateRangePicker.js +3 -1
- package/commonjs/DatePicker/StatefulSingleDatePicker.js +3 -1
- package/commonjs/DatePicker/common.js +1 -1
- package/commonjs/DatePicker/styles.js +2 -6
- package/commonjs/Drawer/SlideTransition.js +3 -1
- package/commonjs/Drawer/index.js +9 -4
- package/commonjs/Drawer/styles.js +2 -2
- package/commonjs/EmptyState/index.js +3 -1
- package/commonjs/Fieldset/index.js +7 -3
- package/commonjs/FormField/index.js +3 -1
- package/commonjs/Icon/index.js +5 -2
- package/commonjs/Icon/styles.js +1 -1
- package/commonjs/IconViewBoxes.js +1 -0
- package/commonjs/Image/index.js +3 -1
- package/commonjs/Image/styles.js +1 -1
- package/commonjs/Indicator/index.js +3 -1
- package/commonjs/Input/index.js +3 -1
- package/commonjs/Input/styles.js +2 -2
- package/commonjs/KeyboardKey/index.js +3 -1
- package/commonjs/Label/index.js +4 -2
- package/commonjs/Link/index.js +3 -1
- package/commonjs/Link/styles.js +1 -1
- package/commonjs/Listbox/index.js +7 -4
- package/commonjs/Loader/index.js +3 -1
- package/commonjs/Loader/styles.js +2 -2
- package/commonjs/LoaderButton/index.js +3 -1
- package/commonjs/Menu/constants.js +1 -1
- package/commonjs/Menu/descendants.js +10 -7
- package/commonjs/Menu/hooks.js +1 -1
- package/commonjs/Menu/index.js +22 -16
- package/commonjs/Menu/styles.js +2 -2
- package/commonjs/Message/index.js +3 -1
- package/commonjs/Message/styles.js +1 -1
- package/commonjs/Modal/index.js +7 -3
- package/commonjs/Modal/styles.js +4 -6
- package/commonjs/Numeral/constants.js +1 -1
- package/commonjs/Numeral/index.js +3 -1
- package/commonjs/Numeral/styles.js +3 -3
- package/commonjs/OverflowList/styles.js +1 -1
- package/commonjs/Popout/index.js +7 -3
- package/commonjs/Popout/styles.js +1 -1
- package/commonjs/Radio/index.js +3 -1
- package/commonjs/Radio/styles.js +4 -4
- package/commonjs/SegmentedControl/index.js +5 -2
- package/commonjs/Select/index.js +3 -1
- package/commonjs/Stack/index.js +3 -1
- package/commonjs/Switch/index.js +3 -1
- package/commonjs/Switch/styles.js +1 -1
- package/commonjs/Table/index.js +10 -5
- package/commonjs/TableCell/index.js +3 -1
- package/commonjs/TableHeaderCell/index.js +3 -1
- package/commonjs/TableRowAccordion/index.js +3 -1
- package/commonjs/Tabs/index.js +5 -2
- package/commonjs/Tabs/styles.js +4 -4
- package/commonjs/Text/index.js +3 -1
- package/commonjs/Text/styles.js +1 -1
- package/commonjs/Textarea/index.js +3 -1
- package/commonjs/Toast/index.js +15 -15
- package/commonjs/Toast/styles.js +4 -7
- package/commonjs/ToggleHint/index.js +3 -1
- package/commonjs/Token/index.js +3 -1
- package/commonjs/Token/styles.js +1 -1
- package/commonjs/TokenInput/index.js +3 -1
- package/commonjs/Tooltip/index.js +5 -2
- package/commonjs/Tooltip/styles.js +1 -1
- package/commonjs/VisuallyHidden/index.js +1 -1
- package/commonjs/include-icons.js +1 -1
- package/commonjs/index.js +79 -1
- 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/decorative-palettes.js +1 -1
- package/commonjs/themes/dark/theme.js +1 -1
- package/commonjs/themes/light/decorative-palettes.js +1 -1
- package/commonjs/themes/light/literal-colors.js +4 -2
- package/commonjs/themes/light/theme.js +1 -1
- package/commonjs/types/theme.colors.flow.js +2 -0
- package/commonjs/utils/hooks.js +3 -2
- package/commonjs/utils/mixins.js +1 -1
- package/commonjs/utils/system-props.js +1 -1
- package/dist/iconList.js +1 -1
- package/dist/icons.svg +1 -1
- package/dist/themes/dark/dark.scss +9 -7
- package/dist/themes/light/light.scss +99 -97
- package/icons/power-up-outline.svg +3 -0
- package/includeIcons.js +1 -1
- package/lib/Avatar/index.js +7 -4
- package/lib/Badge/constants.js +38 -0
- package/lib/Badge/index.js +39 -38
- package/lib/Badge/styles.js +13 -28
- package/lib/Banner/index.js +3 -1
- package/lib/Banner/styles.js +1 -1
- package/lib/Box/styles.js +1 -1
- package/lib/Breadcrumb/index.js +5 -2
- package/lib/Button/index.js +3 -1
- package/lib/Card/index.js +3 -1
- package/lib/Card/styles.js +2 -2
- package/lib/CharacterCounter/index.js +3 -1
- package/lib/CharacterCounter/styles.js +1 -1
- package/lib/ChartLegend/index.js +3 -1
- package/lib/ChartLegend/styles.js +3 -3
- package/lib/Checkbox/index.js +3 -1
- package/lib/Collapsible/index.js +5 -2
- package/lib/DatePicker/DateRangePicker.js +3 -1
- package/lib/DatePicker/SingleDatePicker.js +3 -1
- package/lib/DatePicker/StatefulDateRangePicker.js +3 -1
- package/lib/DatePicker/StatefulSingleDatePicker.js +3 -1
- package/lib/DatePicker/styles.js +2 -6
- package/lib/Drawer/SlideTransition.js +3 -1
- package/lib/Drawer/index.js +9 -4
- package/lib/Drawer/styles.js +2 -2
- package/lib/EmptyState/index.js +3 -1
- package/lib/Fieldset/index.js +7 -3
- package/lib/FormField/index.js +3 -1
- package/lib/Icon/index.js +5 -2
- package/lib/Icon/styles.js +1 -1
- package/lib/IconViewBoxes.js +1 -0
- package/lib/Image/index.js +3 -1
- package/lib/Image/styles.js +1 -1
- package/lib/Indicator/index.js +3 -1
- package/lib/Input/index.js +3 -1
- package/lib/Input/styles.js +2 -2
- package/lib/KeyboardKey/index.js +3 -1
- package/lib/Label/index.js +4 -2
- package/lib/Link/index.js +3 -1
- package/lib/Link/styles.js +1 -1
- package/lib/Listbox/index.js +6 -3
- package/lib/Loader/index.js +3 -1
- package/lib/Loader/styles.js +2 -2
- package/lib/LoaderButton/index.js +3 -1
- package/lib/Menu/descendants.js +5 -2
- package/lib/Menu/index.js +20 -16
- package/lib/Menu/styles.js +2 -2
- package/lib/Message/index.js +3 -1
- package/lib/Modal/index.js +7 -3
- package/lib/Modal/styles.js +3 -5
- package/lib/Numeral/index.js +3 -1
- package/lib/Numeral/styles.js +2 -2
- package/lib/OverflowList/styles.js +1 -1
- package/lib/Popout/index.js +7 -3
- package/lib/Popout/styles.js +1 -1
- package/lib/Radio/index.js +3 -1
- package/lib/Radio/styles.js +4 -4
- package/lib/SegmentedControl/index.js +5 -2
- package/lib/Select/index.js +3 -1
- package/lib/Stack/index.js +3 -1
- package/lib/Switch/index.js +3 -1
- package/lib/Switch/styles.js +1 -1
- package/lib/Table/index.js +9 -4
- package/lib/TableCell/index.js +3 -1
- package/lib/TableHeaderCell/index.js +3 -1
- package/lib/TableRowAccordion/index.js +3 -1
- package/lib/Tabs/index.js +5 -2
- package/lib/Tabs/styles.js +3 -3
- package/lib/Text/index.js +3 -1
- package/lib/Text/styles.js +1 -1
- package/lib/Textarea/index.js +3 -1
- package/lib/Toast/index.js +14 -14
- package/lib/Toast/styles.js +3 -7
- package/lib/ToggleHint/index.js +3 -1
- package/lib/Token/index.js +3 -1
- package/lib/Token/styles.js +1 -1
- package/lib/TokenInput/index.js +3 -1
- package/lib/Tooltip/index.js +5 -2
- package/lib/Tooltip/styles.js +1 -1
- package/lib/VisuallyHidden/index.js +1 -1
- package/lib/include-icons.js +1 -1
- 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/light/literal-colors.js +4 -2
- package/lib/types/theme.colors.flow.js +2 -1
- 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);
|