@sproutsocial/racine 11.0.2 → 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 +6 -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/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/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/package.json +12 -2
|
@@ -0,0 +1,93 @@
|
|
|
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 {
|
|
7
|
+
typographySystemProps,
|
|
8
|
+
type TypeTypographySystemProps,
|
|
9
|
+
} from "../typography";
|
|
10
|
+
|
|
11
|
+
describe("typography system props", () => {
|
|
12
|
+
const Component = styled<TypeTypographySystemProps, TypeTheme, "div">("div")`
|
|
13
|
+
${typographySystemProps}
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
test("fontFamily", () => {
|
|
17
|
+
const { container } = render(
|
|
18
|
+
<>
|
|
19
|
+
<Component fontFamily="string" />
|
|
20
|
+
</>
|
|
21
|
+
);
|
|
22
|
+
expect(container).toMatchSnapshot();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test("fontSize", () => {
|
|
26
|
+
const { container } = render(
|
|
27
|
+
<>
|
|
28
|
+
<Component fontSize="string" />
|
|
29
|
+
<Component fontSize={100} />
|
|
30
|
+
</>
|
|
31
|
+
);
|
|
32
|
+
expect(container).toMatchSnapshot();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test("fontStyle", () => {
|
|
36
|
+
const { container } = render(
|
|
37
|
+
<>
|
|
38
|
+
<Component fontStyle="string" />
|
|
39
|
+
</>
|
|
40
|
+
);
|
|
41
|
+
expect(container).toMatchSnapshot();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
test("fontWeight", () => {
|
|
45
|
+
const { container } = render(
|
|
46
|
+
<>
|
|
47
|
+
<Component fontWeight="normal" />
|
|
48
|
+
<Component fontWeight="semibold" />
|
|
49
|
+
<Component fontWeight="bold" />
|
|
50
|
+
<Component fontWeight="extrabold" />
|
|
51
|
+
<Component fontWeight={100} />
|
|
52
|
+
<Component
|
|
53
|
+
// $FlowExpectedError
|
|
54
|
+
fontWeight="string"
|
|
55
|
+
/>
|
|
56
|
+
</>
|
|
57
|
+
);
|
|
58
|
+
expect(container).toMatchSnapshot();
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test("letterSpacing", () => {
|
|
62
|
+
const { container } = render(
|
|
63
|
+
<>
|
|
64
|
+
<Component letterSpacing="string" />
|
|
65
|
+
<Component letterSpacing={1} />
|
|
66
|
+
</>
|
|
67
|
+
);
|
|
68
|
+
expect(container).toMatchSnapshot();
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test("lineHeight", () => {
|
|
72
|
+
const { container } = render(
|
|
73
|
+
<>
|
|
74
|
+
<Component lineHeight="string" />
|
|
75
|
+
<Component lineHeight={1} />
|
|
76
|
+
</>
|
|
77
|
+
);
|
|
78
|
+
expect(container).toMatchSnapshot();
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
test("textAlign", () => {
|
|
82
|
+
const { container } = render(
|
|
83
|
+
<>
|
|
84
|
+
<Component textAlign="center" />
|
|
85
|
+
<Component
|
|
86
|
+
// $FlowExpectedError
|
|
87
|
+
textAlign="string"
|
|
88
|
+
/>
|
|
89
|
+
</>
|
|
90
|
+
);
|
|
91
|
+
expect(container).toMatchSnapshot();
|
|
92
|
+
});
|
|
93
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
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 { variantSystemProps, type TypeVariantSystemProps } from "../variant";
|
|
7
|
+
|
|
8
|
+
describe("variant system props", () => {
|
|
9
|
+
const Component = styled<TypeVariantSystemProps, TypeTheme, "div">("div")`
|
|
10
|
+
${variantSystemProps}
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
test("typeScale", () => {
|
|
14
|
+
const { container } = render(
|
|
15
|
+
<>
|
|
16
|
+
<Component typeScale="100" />
|
|
17
|
+
<Component
|
|
18
|
+
// $FlowExpectedError
|
|
19
|
+
typeScale={100}
|
|
20
|
+
/>
|
|
21
|
+
</>
|
|
22
|
+
);
|
|
23
|
+
expect(container).toMatchSnapshot();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// @flow strict
|
|
2
|
+
|
|
3
|
+
export type TypeResponsiveSystemProp<T> =
|
|
4
|
+
| T
|
|
5
|
+
| [T]
|
|
6
|
+
| [T, T]
|
|
7
|
+
| [T, T, T]
|
|
8
|
+
| [T, T, T, T]
|
|
9
|
+
| [T, T, T, T, T];
|
|
10
|
+
export type TypeBaseSystemProp<T> = ?T | boolean;
|
|
11
|
+
// eslint-disable-next-line prettier/prettier
|
|
12
|
+
export type TypeResponsiveBaseSystemProp<T> = TypeResponsiveSystemProp<TypeBaseSystemProp<T>>;
|
|
13
|
+
|
|
14
|
+
export interface StyledSystemStyleFn {
|
|
15
|
+
(...args: mixed[]): mixed;
|
|
16
|
+
|
|
17
|
+
config?: { ... } | void;
|
|
18
|
+
propNames?: string[] | void;
|
|
19
|
+
cache?: { ... } | void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// @flow strict-local
|
|
2
|
+
|
|
3
|
+
import { typography } from "styled-system";
|
|
4
|
+
import type {
|
|
5
|
+
FontFamilyProperty,
|
|
6
|
+
FontSizeProperty,
|
|
7
|
+
FontStyleProperty,
|
|
8
|
+
FontWeightProperty,
|
|
9
|
+
LetterSpacingProperty,
|
|
10
|
+
LineHeightProperty,
|
|
11
|
+
TextAlignProperty,
|
|
12
|
+
} from "csstype";
|
|
13
|
+
|
|
14
|
+
import typeof { fontWeights as TypeofFontWeights } from "../themes/light/theme";
|
|
15
|
+
import type {
|
|
16
|
+
StyledSystemStyleFn,
|
|
17
|
+
TypeResponsiveBaseSystemProp,
|
|
18
|
+
} from "./types.flow.js";
|
|
19
|
+
|
|
20
|
+
// https://styled-system.com/table#typography
|
|
21
|
+
|
|
22
|
+
export type TypeTypographySystemProps = $ReadOnly<{|
|
|
23
|
+
fontFamily?: TypeResponsiveBaseSystemProp<FontFamilyProperty>,
|
|
24
|
+
fontSize?: TypeResponsiveBaseSystemProp<FontSizeProperty<number>>,
|
|
25
|
+
fontStyle?: TypeResponsiveBaseSystemProp<FontStyleProperty>,
|
|
26
|
+
// eslint-disable-next-line prettier/prettier
|
|
27
|
+
fontWeight?: TypeResponsiveBaseSystemProp<FontWeightProperty | $Keys<TypeofFontWeights>>,
|
|
28
|
+
// eslint-disable-next-line prettier/prettier
|
|
29
|
+
letterSpacing?: TypeResponsiveBaseSystemProp<LetterSpacingProperty<string | number>>,
|
|
30
|
+
lineHeight?: TypeResponsiveBaseSystemProp<LineHeightProperty<void>>,
|
|
31
|
+
textAlign?: TypeResponsiveBaseSystemProp<TextAlignProperty>,
|
|
32
|
+
|}>;
|
|
33
|
+
|
|
34
|
+
export const typographySystemProps: StyledSystemStyleFn = typography;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// @flow strict-local
|
|
2
|
+
import { compose, variant } from "styled-system";
|
|
3
|
+
import type { TypeTypography } from "../types/theme.flow";
|
|
4
|
+
|
|
5
|
+
import type { TypeResponsiveBaseSystemProp } from "./types.flow.js";
|
|
6
|
+
|
|
7
|
+
// https://styled-system.com/variants
|
|
8
|
+
|
|
9
|
+
export type TypeVariantSystemProps = $ReadOnly<{|
|
|
10
|
+
typeScale?: TypeResponsiveBaseSystemProp<$Keys<TypeTypography>>,
|
|
11
|
+
|}>;
|
|
12
|
+
|
|
13
|
+
export const variantSystemProps = compose(
|
|
14
|
+
variant({
|
|
15
|
+
key: "typography",
|
|
16
|
+
prop: "typeScale",
|
|
17
|
+
})
|
|
18
|
+
);
|
package/commonjs/index.js
CHANGED
|
@@ -1,8 +1,86 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
+
var _exportNames = {
|
|
5
|
+
visuallyHidden: true,
|
|
6
|
+
focusRing: true,
|
|
7
|
+
disabled: true,
|
|
8
|
+
useSelect: true,
|
|
9
|
+
useMultiselect: true,
|
|
10
|
+
useTextContent: true,
|
|
11
|
+
theme: true,
|
|
12
|
+
darkTheme: true,
|
|
13
|
+
Icon: true,
|
|
14
|
+
Alert: true,
|
|
15
|
+
Banner: true,
|
|
16
|
+
Badge: true,
|
|
17
|
+
Indicator: true,
|
|
18
|
+
Card: true,
|
|
19
|
+
CharacterCounter: true,
|
|
20
|
+
Checkbox: true,
|
|
21
|
+
Radio: true,
|
|
22
|
+
Textarea: true,
|
|
23
|
+
ToggleHint: true,
|
|
24
|
+
Loader: true,
|
|
25
|
+
Text: true,
|
|
26
|
+
Image: true,
|
|
27
|
+
KeyboardKey: true,
|
|
28
|
+
ChartLegend: true,
|
|
29
|
+
Table: true,
|
|
30
|
+
TableCell: true,
|
|
31
|
+
TableHeaderCell: true,
|
|
32
|
+
TableRowAccordion: true,
|
|
33
|
+
Box: true,
|
|
34
|
+
Label: true,
|
|
35
|
+
Input: true,
|
|
36
|
+
Select: true,
|
|
37
|
+
Button: true,
|
|
38
|
+
Link: true,
|
|
39
|
+
Switch: true,
|
|
40
|
+
Token: true,
|
|
41
|
+
TokenInput: true,
|
|
42
|
+
Tabs: true,
|
|
43
|
+
Modal: true,
|
|
44
|
+
Popout: true,
|
|
45
|
+
ThemeProvider: true,
|
|
46
|
+
Tooltip: true,
|
|
47
|
+
Drawer: true,
|
|
48
|
+
LoaderButton: true,
|
|
49
|
+
Numeral: true,
|
|
50
|
+
Collapsible: true,
|
|
51
|
+
SegmentedControl: true,
|
|
52
|
+
EmptyState: true,
|
|
53
|
+
FormField: true,
|
|
54
|
+
Fieldset: true,
|
|
55
|
+
Message: true,
|
|
56
|
+
Stack: true,
|
|
57
|
+
Avatar: true,
|
|
58
|
+
Breadcrumb: true,
|
|
59
|
+
Skeleton: true,
|
|
60
|
+
ToastContainer: true,
|
|
61
|
+
Menu: true,
|
|
62
|
+
Listbox: true,
|
|
63
|
+
OverflowList: true,
|
|
64
|
+
toast: true,
|
|
65
|
+
MenuButton: true,
|
|
66
|
+
MenuButtonContext: true,
|
|
67
|
+
MenuItemContainer: true,
|
|
68
|
+
ListboxButton: true,
|
|
69
|
+
SingleDatePicker: true,
|
|
70
|
+
DateRangePicker: true,
|
|
71
|
+
VisuallyHidden: true
|
|
72
|
+
};
|
|
4
73
|
exports.VisuallyHidden = exports.DateRangePicker = exports.SingleDatePicker = exports.ListboxButton = exports.MenuItemContainer = exports.MenuButtonContext = exports.MenuButton = exports.toast = exports.OverflowList = exports.Listbox = exports.Menu = exports.ToastContainer = exports.Skeleton = exports.Breadcrumb = exports.Avatar = exports.Stack = exports.Message = exports.Fieldset = exports.FormField = exports.EmptyState = exports.SegmentedControl = exports.Collapsible = exports.Numeral = exports.LoaderButton = exports.Drawer = exports.Tooltip = exports.ThemeProvider = exports.Popout = exports.Modal = exports.Tabs = exports.TokenInput = exports.Token = exports.Switch = exports.Link = exports.Button = exports.Select = exports.Input = exports.Label = exports.Box = exports.TableRowAccordion = exports.TableHeaderCell = exports.TableCell = exports.Table = exports.ChartLegend = exports.KeyboardKey = exports.Image = exports.Text = exports.Loader = exports.ToggleHint = exports.Textarea = exports.Radio = exports.Checkbox = exports.CharacterCounter = exports.Card = exports.Indicator = exports.Badge = exports.Banner = exports.Alert = exports.Icon = exports.darkTheme = exports.theme = exports.useTextContent = exports.useMultiselect = exports.useSelect = exports.disabled = exports.focusRing = exports.visuallyHidden = void 0;
|
|
5
74
|
|
|
75
|
+
var _systemProps = require("./systemProps");
|
|
76
|
+
|
|
77
|
+
Object.keys(_systemProps).forEach(function (key) {
|
|
78
|
+
if (key === "default" || key === "__esModule") return;
|
|
79
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
80
|
+
if (key in exports && exports[key] === _systemProps[key]) return;
|
|
81
|
+
exports[key] = _systemProps[key];
|
|
82
|
+
});
|
|
83
|
+
|
|
6
84
|
var _mixins = require("./utils/mixins");
|
|
7
85
|
|
|
8
86
|
exports.visuallyHidden = _mixins.visuallyHidden;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.customSystemProps = void 0;
|
|
5
|
+
|
|
6
|
+
var _styledSystem = require("styled-system");
|
|
7
|
+
|
|
8
|
+
var customSystemProps = (0, _styledSystem.compose)((0, _styledSystem.system)({
|
|
9
|
+
cursor: true,
|
|
10
|
+
whiteSpace: true
|
|
11
|
+
}));
|
|
12
|
+
exports.customSystemProps = customSystemProps;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
var _typesFlow = require("./types.flow.js");
|
|
6
|
+
|
|
7
|
+
Object.keys(_typesFlow).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _typesFlow[key]) return;
|
|
10
|
+
exports[key] = _typesFlow[key];
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _background = require("./background");
|
|
14
|
+
|
|
15
|
+
Object.keys(_background).forEach(function (key) {
|
|
16
|
+
if (key === "default" || key === "__esModule") return;
|
|
17
|
+
if (key in exports && exports[key] === _background[key]) return;
|
|
18
|
+
exports[key] = _background[key];
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
var _border = require("./border");
|
|
22
|
+
|
|
23
|
+
Object.keys(_border).forEach(function (key) {
|
|
24
|
+
if (key === "default" || key === "__esModule") return;
|
|
25
|
+
if (key in exports && exports[key] === _border[key]) return;
|
|
26
|
+
exports[key] = _border[key];
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
var _color = require("./color");
|
|
30
|
+
|
|
31
|
+
Object.keys(_color).forEach(function (key) {
|
|
32
|
+
if (key === "default" || key === "__esModule") return;
|
|
33
|
+
if (key in exports && exports[key] === _color[key]) return;
|
|
34
|
+
exports[key] = _color[key];
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
var _custom = require("./custom");
|
|
38
|
+
|
|
39
|
+
Object.keys(_custom).forEach(function (key) {
|
|
40
|
+
if (key === "default" || key === "__esModule") return;
|
|
41
|
+
if (key in exports && exports[key] === _custom[key]) return;
|
|
42
|
+
exports[key] = _custom[key];
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
var _flexbox = require("./flexbox");
|
|
46
|
+
|
|
47
|
+
Object.keys(_flexbox).forEach(function (key) {
|
|
48
|
+
if (key === "default" || key === "__esModule") return;
|
|
49
|
+
if (key in exports && exports[key] === _flexbox[key]) return;
|
|
50
|
+
exports[key] = _flexbox[key];
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
var _grid = require("./grid");
|
|
54
|
+
|
|
55
|
+
Object.keys(_grid).forEach(function (key) {
|
|
56
|
+
if (key === "default" || key === "__esModule") return;
|
|
57
|
+
if (key in exports && exports[key] === _grid[key]) return;
|
|
58
|
+
exports[key] = _grid[key];
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
var _layout = require("./layout");
|
|
62
|
+
|
|
63
|
+
Object.keys(_layout).forEach(function (key) {
|
|
64
|
+
if (key === "default" || key === "__esModule") return;
|
|
65
|
+
if (key in exports && exports[key] === _layout[key]) return;
|
|
66
|
+
exports[key] = _layout[key];
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
var _position = require("./position");
|
|
70
|
+
|
|
71
|
+
Object.keys(_position).forEach(function (key) {
|
|
72
|
+
if (key === "default" || key === "__esModule") return;
|
|
73
|
+
if (key in exports && exports[key] === _position[key]) return;
|
|
74
|
+
exports[key] = _position[key];
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
var _shadow = require("./shadow");
|
|
78
|
+
|
|
79
|
+
Object.keys(_shadow).forEach(function (key) {
|
|
80
|
+
if (key === "default" || key === "__esModule") return;
|
|
81
|
+
if (key in exports && exports[key] === _shadow[key]) return;
|
|
82
|
+
exports[key] = _shadow[key];
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
var _space = require("./space");
|
|
86
|
+
|
|
87
|
+
Object.keys(_space).forEach(function (key) {
|
|
88
|
+
if (key === "default" || key === "__esModule") return;
|
|
89
|
+
if (key in exports && exports[key] === _space[key]) return;
|
|
90
|
+
exports[key] = _space[key];
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
var _systemProps = require("./systemProps");
|
|
94
|
+
|
|
95
|
+
Object.keys(_systemProps).forEach(function (key) {
|
|
96
|
+
if (key === "default" || key === "__esModule") return;
|
|
97
|
+
if (key in exports && exports[key] === _systemProps[key]) return;
|
|
98
|
+
exports[key] = _systemProps[key];
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
var _typography = require("./typography");
|
|
102
|
+
|
|
103
|
+
Object.keys(_typography).forEach(function (key) {
|
|
104
|
+
if (key === "default" || key === "__esModule") return;
|
|
105
|
+
if (key in exports && exports[key] === _typography[key]) return;
|
|
106
|
+
exports[key] = _typography[key];
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
var _variant = require("./variant");
|
|
110
|
+
|
|
111
|
+
Object.keys(_variant).forEach(function (key) {
|
|
112
|
+
if (key === "default" || key === "__esModule") return;
|
|
113
|
+
if (key in exports && exports[key] === _variant[key]) return;
|
|
114
|
+
exports[key] = _variant[key];
|
|
115
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.spaceSystemProps = void 0;
|
|
5
|
+
|
|
6
|
+
var _styledSystem = require("styled-system");
|
|
7
|
+
|
|
8
|
+
/* eslint-disable prettier/prettier */
|
|
9
|
+
var spaceSystemProps = _styledSystem.space;
|
|
10
|
+
exports.spaceSystemProps = spaceSystemProps;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.systemProps = void 0;
|
|
5
|
+
|
|
6
|
+
var _styledSystem = require("styled-system");
|
|
7
|
+
|
|
8
|
+
var _background = require("./background");
|
|
9
|
+
|
|
10
|
+
var _border = require("./border");
|
|
11
|
+
|
|
12
|
+
var _color = require("./color");
|
|
13
|
+
|
|
14
|
+
var _custom = require("./custom");
|
|
15
|
+
|
|
16
|
+
var _flexbox = require("./flexbox");
|
|
17
|
+
|
|
18
|
+
var _grid = require("./grid");
|
|
19
|
+
|
|
20
|
+
var _layout = require("./layout");
|
|
21
|
+
|
|
22
|
+
var _position = require("./position");
|
|
23
|
+
|
|
24
|
+
var _shadow = require("./shadow");
|
|
25
|
+
|
|
26
|
+
var _space = require("./space");
|
|
27
|
+
|
|
28
|
+
var _typography = require("./typography");
|
|
29
|
+
|
|
30
|
+
var _variant = require("./variant");
|
|
31
|
+
|
|
32
|
+
var systemProps = (0, _styledSystem.compose)(_custom.customSystemProps, _variant.variantSystemProps, _background.backgroundSystemProps, _border.borderSystemProps, _color.colorSystemProps, _flexbox.flexboxSystemProps, _grid.gridSystemProps, _layout.layoutSystemProps, _position.positionSystemProps, _shadow.shadowSystemProps, _space.spaceSystemProps, _typography.typographySystemProps);
|
|
33
|
+
exports.systemProps = systemProps;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* All system props should be responsive but accepting a tuple of length 1-5.
|
|
5
|
+
*/
|
|
6
|
+
"a";
|
|
7
|
+
["a"];
|
|
8
|
+
["a", "a"];
|
|
9
|
+
["a", "a", "a"];
|
|
10
|
+
["a", "a", "a", "a"];
|
|
11
|
+
["a", "a", "a", "a", "a"]; // $FlowExpectedError
|
|
12
|
+
|
|
13
|
+
["a", "a", "a", "a", "a", "a"]; // $FlowExpectedError
|
|
14
|
+
|
|
15
|
+
["b"]; // $FlowExpectedError
|
|
16
|
+
|
|
17
|
+
[null];
|
|
18
|
+
/**
|
|
19
|
+
* All system props should accept "base" values: boolean, null, and undefined.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
"a";
|
|
23
|
+
true;
|
|
24
|
+
false;
|
|
25
|
+
null;
|
|
26
|
+
undefined;
|
|
27
|
+
/**
|
|
28
|
+
* All system props should be responsive and allow "base" values.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
"a";
|
|
32
|
+
"b";
|
|
33
|
+
true;
|
|
34
|
+
false;
|
|
35
|
+
null;
|
|
36
|
+
undefined;
|
|
37
|
+
["a", null, undefined, false, "b"];
|
|
38
|
+
["a"]; // $FlowExpectedError
|
|
39
|
+
|
|
40
|
+
"c"; // $FlowExpectedError
|
|
41
|
+
|
|
42
|
+
1; // $FlowExpectedError
|
|
43
|
+
|
|
44
|
+
({}); // $FlowExpectedError
|
|
45
|
+
|
|
46
|
+
[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.variantSystemProps = void 0;
|
|
5
|
+
|
|
6
|
+
var _styledSystem = require("styled-system");
|
|
7
|
+
|
|
8
|
+
var variantSystemProps = (0, _styledSystem.compose)((0, _styledSystem.variant)({
|
|
9
|
+
key: "typography",
|
|
10
|
+
prop: "typeScale"
|
|
11
|
+
}));
|
|
12
|
+
exports.variantSystemProps = variantSystemProps;
|
package/lib/index.js
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from "./types.flow.js";
|
|
2
|
+
export * from "./background";
|
|
3
|
+
export * from "./border";
|
|
4
|
+
export * from "./color";
|
|
5
|
+
export * from "./custom";
|
|
6
|
+
export * from "./flexbox";
|
|
7
|
+
export * from "./grid";
|
|
8
|
+
export * from "./layout";
|
|
9
|
+
export * from "./position";
|
|
10
|
+
export * from "./shadow";
|
|
11
|
+
export * from "./space";
|
|
12
|
+
export * from "./systemProps";
|
|
13
|
+
export * from "./typography";
|
|
14
|
+
export * from "./variant";
|