@sproutsocial/racine 11.0.1 → 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.
- package/CHANGELOG.md +7 -0
- package/__flow__/Avatar/index.test.js +0 -5
- package/__flow__/Badge/index.test.js +0 -5
- package/__flow__/Breadcrumb/index.js +2 -0
- package/__flow__/Button/index.stories.js +51 -67
- package/__flow__/CharacterCounter/index.test.js +0 -8
- package/__flow__/ChartLegend/index.test.js +0 -37
- package/__flow__/Collapsible/index.js +3 -0
- package/__flow__/Drawer/index.js +4 -0
- package/__flow__/EmptyState/index.test.js +1 -3
- package/__flow__/EnumIconNames.js +1 -1
- package/__flow__/Fieldset/index.js +8 -2
- package/__flow__/Icon/index.js +5 -1
- package/__flow__/IconViewBoxes.js +1 -1
- package/__flow__/Link/index.test.js +0 -10
- package/__flow__/Loader/index.test.js +0 -14
- package/__flow__/Menu/__snapshots__/index.test.js.snap +2 -2
- package/__flow__/Menu/index.js +7 -0
- package/__flow__/Message/index.js +7 -0
- package/__flow__/Modal/index.js +5 -0
- package/__flow__/Modal/index.test.js +0 -19
- package/__flow__/Popout/index.js +4 -1
- package/__flow__/SegmentedControl/index.js +2 -0
- package/__flow__/Table/index.js +6 -0
- package/__flow__/Text/index.js +8 -0
- package/__flow__/Text/index.test.js +0 -39
- 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/bin/buildNpm.js +58 -0
- package/commonjs/Breadcrumb/index.js +1 -0
- package/commonjs/Collapsible/index.js +2 -0
- package/commonjs/Drawer/index.js +3 -0
- package/commonjs/Fieldset/index.js +6 -2
- package/commonjs/Icon/index.js +3 -1
- package/commonjs/IconViewBoxes.js +2 -0
- package/commonjs/Menu/index.js +6 -0
- package/commonjs/Message/index.js +13 -0
- package/commonjs/Modal/index.js +4 -0
- package/commonjs/Popout/index.js +5 -2
- package/commonjs/SegmentedControl/index.js +1 -0
- package/commonjs/Table/index.js +5 -0
- package/commonjs/Text/index.js +7 -0
- package/commonjs/include-icons.js +1 -1
- 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/iconList.js +1 -1
- package/dist/icons.svg +1 -1
- package/dist/themes/dark/dark.scss +1 -0
- package/dist/themes/light/light.scss +1 -0
- package/icons/address-card-outline.svg +3 -0
- package/icons/deconstructed-negative-sentiment.svg +1 -1
- package/icons/deconstructed-neutral-sentiment.svg +1 -1
- package/icons/deconstructed-positive-sentiment.svg +1 -1
- package/icons/magic-wand.svg +3 -0
- package/icons/whatsapp.svg +5 -5
- package/includeIcons.js +1 -1
- package/lib/Breadcrumb/index.js +1 -0
- package/lib/Collapsible/index.js +2 -0
- package/lib/Drawer/index.js +3 -0
- package/lib/Fieldset/index.js +6 -2
- package/lib/Icon/index.js +3 -1
- package/lib/IconViewBoxes.js +2 -0
- package/lib/Menu/index.js +6 -0
- package/lib/Message/index.js +13 -0
- package/lib/Modal/index.js +4 -0
- package/lib/Popout/index.js +5 -2
- package/lib/SegmentedControl/index.js +1 -0
- package/lib/Table/index.js +5 -0
- package/lib/Text/index.js +7 -0
- 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/dark/theme.js +1 -0
- package/lib/themes/light/theme.js +1 -0
- package/package.json +34 -17
|
@@ -92,6 +92,7 @@ Message.Body = (props) => (
|
|
|
92
92
|
)}
|
|
93
93
|
</MessageContext.Consumer>
|
|
94
94
|
);
|
|
95
|
+
Message.Body.displayName = "Message.Body";
|
|
95
96
|
|
|
96
97
|
Message.Header = (props) => (
|
|
97
98
|
<MessageContext.Consumer>
|
|
@@ -100,6 +101,7 @@ Message.Header = (props) => (
|
|
|
100
101
|
)}
|
|
101
102
|
</MessageContext.Consumer>
|
|
102
103
|
);
|
|
104
|
+
Message.Header.displayName = "Message.Header";
|
|
103
105
|
|
|
104
106
|
Message.Footer = (props) => (
|
|
105
107
|
<MessageContext.Consumer>
|
|
@@ -113,6 +115,7 @@ Message.Footer = (props) => (
|
|
|
113
115
|
)}
|
|
114
116
|
</MessageContext.Consumer>
|
|
115
117
|
);
|
|
118
|
+
Message.Footer.displayName = "Message.Footer";
|
|
116
119
|
|
|
117
120
|
Message.Meta = (props) => (
|
|
118
121
|
<MessageContext.Consumer>
|
|
@@ -126,16 +129,19 @@ Message.Meta = (props) => (
|
|
|
126
129
|
)}
|
|
127
130
|
</MessageContext.Consumer>
|
|
128
131
|
);
|
|
132
|
+
Message.Meta.displayName = "Message.Meta";
|
|
129
133
|
|
|
130
134
|
Message.Button = (props: TypeButtonProps) => (
|
|
131
135
|
<Button {...props} appearance={props.appearance || "pill"} />
|
|
132
136
|
);
|
|
137
|
+
Message.Button.displayName = "Message.Button";
|
|
133
138
|
|
|
134
139
|
Message.Avatar = (props: TypeAvatarProps) => (
|
|
135
140
|
<MessageContext.Consumer>
|
|
136
141
|
{({ density }) => <Avatar size={avatarSizeMap(density)} {...props} />}
|
|
137
142
|
</MessageContext.Consumer>
|
|
138
143
|
);
|
|
144
|
+
Message.Avatar.displayName = "Message.Avatar";
|
|
139
145
|
|
|
140
146
|
Message.Checkbox = (props: TypeCheckboxProps) => (
|
|
141
147
|
<MessageContext.Consumer>
|
|
@@ -145,6 +151,7 @@ Message.Checkbox = (props: TypeCheckboxProps) => (
|
|
|
145
151
|
)}
|
|
146
152
|
</MessageContext.Consumer>
|
|
147
153
|
);
|
|
154
|
+
Message.Checkbox.displayName = "Message.Checkbox";
|
|
148
155
|
|
|
149
156
|
Message.Context = MessageContext;
|
|
150
157
|
Message.DENSITIES = MESSAGE_DENSITIES;
|
package/__flow__/Modal/index.js
CHANGED
|
@@ -183,6 +183,11 @@ Modal.Footer = ModalFooter;
|
|
|
183
183
|
Modal.Content = ModalContent;
|
|
184
184
|
Modal.CloseButton = ModalCloseButton;
|
|
185
185
|
|
|
186
|
+
Modal.Header.displayName = "Modal.Header";
|
|
187
|
+
Modal.Footer.displayName = "Modal.Footer";
|
|
188
|
+
Modal.Content.displayName = "Modal.Content";
|
|
189
|
+
Modal.CloseButton.displayName = "Modal.CloseButton";
|
|
190
|
+
|
|
186
191
|
Modal.defaultProps = {
|
|
187
192
|
width: "800px",
|
|
188
193
|
zIndex: 6,
|
|
@@ -7,25 +7,6 @@ import { COLOR_PURPLE_300 } from "@sproutsocial/seeds-color";
|
|
|
7
7
|
afterEach(() => cleanup());
|
|
8
8
|
|
|
9
9
|
describe("Modal", () => {
|
|
10
|
-
it("renders a custom background color", () => {
|
|
11
|
-
// Use baseElement since it renders in a Portal
|
|
12
|
-
const { baseElement } = render(
|
|
13
|
-
<Modal
|
|
14
|
-
isOpen={true}
|
|
15
|
-
label="Label"
|
|
16
|
-
bg={COLOR_PURPLE_300}
|
|
17
|
-
onClose={() => {}}
|
|
18
|
-
closeButtonLabel="Close this dialog"
|
|
19
|
-
>
|
|
20
|
-
ajdsfljasdlfjlasdjf
|
|
21
|
-
</Modal>
|
|
22
|
-
);
|
|
23
|
-
expect(baseElement.querySelector(".ReactModal__Content")).toHaveStyleRule(
|
|
24
|
-
"background-color",
|
|
25
|
-
COLOR_PURPLE_300
|
|
26
|
-
);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
10
|
it("should close on overlay click and esc", () => {
|
|
30
11
|
const onClose = jest.fn();
|
|
31
12
|
const { baseElement, getByText, getByLabelText } = render(
|
package/__flow__/Popout/index.js
CHANGED
|
@@ -388,7 +388,7 @@ export default function Popout({
|
|
|
388
388
|
}
|
|
389
389
|
|
|
390
390
|
type TypePopoutContentProps = React.ElementConfig<typeof Box>;
|
|
391
|
-
|
|
391
|
+
const PopoutContent = ({ children, ...rest }: TypePopoutContentProps) => (
|
|
392
392
|
<Box
|
|
393
393
|
bg="container.background.base"
|
|
394
394
|
color="text.body"
|
|
@@ -403,3 +403,6 @@ Popout.Content = ({ children, ...rest }: TypePopoutContentProps) => (
|
|
|
403
403
|
{children}
|
|
404
404
|
</Box>
|
|
405
405
|
);
|
|
406
|
+
|
|
407
|
+
Popout.Content = PopoutContent;
|
|
408
|
+
Popout.Content.displayName = "Popout.Content";
|
package/__flow__/Table/index.js
CHANGED
|
@@ -116,4 +116,10 @@ Table.TableRow = TableRow;
|
|
|
116
116
|
Table.HeaderCell = TableHeaderCell;
|
|
117
117
|
Table.Cell = TableCell;
|
|
118
118
|
|
|
119
|
+
Table.TableHead.displayName = "Table.TableHead";
|
|
120
|
+
Table.TableBody.displayName = "Table.TableBody";
|
|
121
|
+
Table.TableRow.displayName = "Table.TableRow";
|
|
122
|
+
Table.HeaderCell.displayName = "Table.HeaderCell";
|
|
123
|
+
Table.Cell.displayName = "Table.Cell";
|
|
124
|
+
|
|
119
125
|
export default Table;
|
package/__flow__/Text/index.js
CHANGED
|
@@ -83,4 +83,12 @@ Text.SmallByline = SmallByline;
|
|
|
83
83
|
Text.BodyCopy = BodyCopy;
|
|
84
84
|
Text.SmallBodyCopy = SmallBodyCopy;
|
|
85
85
|
|
|
86
|
+
Text.Headline.displayName = "Text.Headline";
|
|
87
|
+
Text.SubHeadline.displayName = "Text.SubHeadline";
|
|
88
|
+
Text.SmallSubHeadline.displayName = "Text.SmallSubHeadline";
|
|
89
|
+
Text.Byline.displayName = "Text.Byline";
|
|
90
|
+
Text.SmallByline.displayName = "Text.SmallByline";
|
|
91
|
+
Text.BodyCopy.displayName = "Text.BodyCopy";
|
|
92
|
+
Text.SmallBodyCopy.displayName = "Text.SmallBodyCopy";
|
|
93
|
+
|
|
86
94
|
export default Text;
|
|
@@ -4,49 +4,10 @@ import "jest-styled-components";
|
|
|
4
4
|
import Text from "./";
|
|
5
5
|
|
|
6
6
|
describe("Text", () => {
|
|
7
|
-
it("does not set word break or truncated styles by default", () => {
|
|
8
|
-
const { getByDataQaLabel } = render(<Text children="Default" />);
|
|
9
|
-
const component = getByDataQaLabel({ text: "Default" });
|
|
10
|
-
expect(component).not.toHaveStyleRule("word-break", "break-word");
|
|
11
|
-
expect(component).not.toHaveStyleRule("text-overflow", "ellipsis");
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it("sets word break styles when breakWord is true", () => {
|
|
15
|
-
const { getByDataQaLabel } = render(
|
|
16
|
-
<Text breakWord children="Word Break" />
|
|
17
|
-
);
|
|
18
|
-
const component = getByDataQaLabel({ text: "Word Break" });
|
|
19
|
-
expect(component).toHaveStyleRule("word-break", "break-word");
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it("sets truncated styles when truncated is true", () => {
|
|
23
|
-
const { getByDataQaLabel } = render(
|
|
24
|
-
<Text truncated children="Truncated" />
|
|
25
|
-
);
|
|
26
|
-
const component = getByDataQaLabel({ text: "Truncated" });
|
|
27
|
-
expect(component).toHaveStyleRule("text-overflow", "ellipsis");
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it("is italic when isItalicized is true", () => {
|
|
31
|
-
const { getByDataQaLabel } = render(
|
|
32
|
-
<Text isItalicized children="Italicized" />
|
|
33
|
-
);
|
|
34
|
-
const component = getByDataQaLabel({ text: "Italicized" });
|
|
35
|
-
expect(component).toHaveStyleRule("font-style", "italic");
|
|
36
|
-
});
|
|
37
|
-
|
|
38
7
|
it("outputs the correct string/content", () => {
|
|
39
8
|
const { getByText } = render(
|
|
40
9
|
<Text children="Supercalifragilisticexpialidocious" />
|
|
41
10
|
);
|
|
42
11
|
expect(getByText("Supercalifragilisticexpialidocious")).toBeTruthy();
|
|
43
12
|
});
|
|
44
|
-
|
|
45
|
-
it("displays a custom size if using fontSize", () => {
|
|
46
|
-
const { getByText } = render(
|
|
47
|
-
<Text children="Custom sized text!" fontSize={1000} />
|
|
48
|
-
);
|
|
49
|
-
const component = getByText("Custom sized text!");
|
|
50
|
-
expect(component).toHaveStyleRule("font-size", "76px");
|
|
51
|
-
});
|
|
52
13
|
});
|
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;
|