@sproutsocial/racine 12.14.0 → 12.16.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 +59 -1
- package/__flow__/Avatar/index.stories.js +1 -0
- package/__flow__/Avatar/index.test.js +1 -0
- package/__flow__/Badge/index.stories.js +1 -0
- package/__flow__/Badge/index.test.js +1 -0
- package/__flow__/Banner/index.js +5 -4
- package/__flow__/Banner/index.stories.js +1 -0
- package/__flow__/Banner/index.test.js +11 -0
- package/__flow__/Box/index.stories.js +1 -0
- package/__flow__/Box/index.test.js +1 -0
- package/__flow__/Breadcrumb/index.stories.js +1 -0
- package/__flow__/Breadcrumb/index.test.js +1 -0
- package/__flow__/Button/index.js +14 -3
- package/__flow__/Button/index.stories.js +24 -17
- package/__flow__/CharacterCounter/index.stories.js +1 -0
- package/__flow__/CharacterCounter/index.test.js +1 -0
- package/__flow__/ChartLegend/index.stories.js +1 -0
- package/__flow__/ChartLegend/index.test.js +1 -0
- package/__flow__/Checkbox/index.js +5 -5
- package/__flow__/Checkbox/index.stories.js +18 -13
- package/__flow__/Checkbox/index.test.js +9 -1
- package/__flow__/Collapsible/index.stories.js +16 -2
- package/__flow__/Collapsible/index.test.js +1 -0
- package/__flow__/Drawer/index.stories.js +14 -5
- package/__flow__/Drawer/index.test.js +4 -3
- package/__flow__/EmptyState/index.stories.js +1 -0
- package/__flow__/EmptyState/index.test.js +1 -0
- package/__flow__/EnumIconNames.js +1 -1
- package/__flow__/EnumIllustrationNames.js +1 -1
- package/__flow__/EnumLogoNames.js +1 -1
- package/__flow__/Fieldset/index.stories.js +21 -6
- package/__flow__/FormField/index.stories.js +11 -6
- package/__flow__/FormField/index.test.js +5 -4
- package/__flow__/Icon/index.js +5 -2
- package/__flow__/Icon/index.stories.js +8 -7
- package/__flow__/Icon/index.test.js +1 -0
- package/__flow__/Icon/styles.js +2 -0
- package/__flow__/IconViewBoxes.js +1 -1
- package/__flow__/IllustrationViewBoxes.js +1 -1
- package/__flow__/Image/index.stories.js +1 -0
- package/__flow__/Image/index.test.js +1 -0
- package/__flow__/Indicator/index.stories.js +1 -0
- package/__flow__/Indicator/index.test.js +1 -0
- package/__flow__/Indicator/styles.js +1 -1
- package/__flow__/Input/index.stories.js +37 -0
- package/__flow__/Input/index.test.js +1 -0
- package/__flow__/KeyboardKey/index.stories.js +1 -0
- package/__flow__/KeyboardKey/index.test.js +1 -0
- package/__flow__/Label/index.stories.js +2 -1
- package/__flow__/Label/index.test.js +1 -0
- package/__flow__/Link/index.stories.js +1 -0
- package/__flow__/Link/index.test.js +1 -0
- package/__flow__/Listbox/index.stories.js +12 -6
- package/__flow__/Listbox/index.test.js +1 -0
- package/__flow__/Loader/index.js +1 -1
- package/__flow__/Loader/index.stories.js +5 -4
- package/__flow__/Loader/index.test.js +1 -0
- package/__flow__/LoaderButton/index.js +3 -1
- package/__flow__/LoaderButton/index.stories.js +1 -0
- package/__flow__/LoaderButton/index.test.js +1 -0
- package/__flow__/LogoViewBoxes.js +1 -1
- package/__flow__/Menu/index.flow.js +2 -0
- package/__flow__/Menu/index.stories.js +16 -8
- package/__flow__/Menu/index.test.js +3 -1
- package/__flow__/Message/index.stories.js +14 -6
- package/__flow__/Message/index.test.js +3 -3
- package/__flow__/Modal/index.stories.js +1 -0
- package/__flow__/Modal/index.test.js +1 -0
- package/__flow__/Numeral/index.js +1 -1
- package/__flow__/Numeral/index.stories.js +8 -7
- package/__flow__/OverflowList/index.flow.js +2 -2
- package/__flow__/OverflowList/index.stories.js +4 -3
- package/__flow__/OverflowList/index.test.js +7 -2
- package/__flow__/PartnerLogo/TypePartnerNames.js +2 -0
- package/__flow__/PartnerLogo/index.js +32 -33
- package/__flow__/PartnerLogo/index.stories.js +43 -13
- package/__flow__/PartnerLogo/partnerLogos/dropbox-lockup-dark.svg +7 -0
- package/__flow__/PartnerLogo/partnerLogos/dropbox-lockup.svg +7 -0
- package/__flow__/PartnerLogo/partnerLogos/dropbox-wordmark-dark.svg +3 -0
- package/__flow__/PartnerLogo/partnerLogos/dropbox-wordmark.svg +3 -0
- package/__flow__/PartnerLogo/partnerLogos/facebook-audience-network-dark.svg +3 -0
- package/__flow__/PartnerLogo/partnerLogos/facebook-audience-network.svg +3 -0
- package/__flow__/PartnerLogo/partnerLogos/linkedin-audience-network-dark.svg +3 -0
- package/__flow__/PartnerLogo/partnerLogos/linkedin-audience-network.svg +3 -0
- package/__flow__/PartnerLogo/partnerLogos/zendesk-lockup-dark.svg +28 -0
- package/__flow__/PartnerLogo/partnerLogos/zendesk-lockup.svg +28 -0
- package/__flow__/PartnerLogo/partnerLogos/zendesk-wordmark-dark.svg +9 -0
- package/__flow__/PartnerLogo/partnerLogos/zendesk-wordmark.svg +9 -0
- package/__flow__/PartnerLogo/styles.js +50 -0
- package/__flow__/Popout/index.js +2 -2
- package/__flow__/Popout/index.stories.js +24 -9
- package/__flow__/Popout/index.test.js +2 -1
- package/__flow__/Radio/index.js +1 -1
- package/__flow__/Radio/index.stories.js +9 -8
- package/__flow__/Radio/index.test.js +1 -0
- package/__flow__/SegmentedControl/index.stories.js +1 -0
- package/__flow__/SegmentedControl/index.test.js +1 -0
- package/__flow__/Select/index.stories.js +25 -6
- package/__flow__/Select/index.test.js +1 -0
- package/__flow__/Skeleton/index.stories.js +1 -0
- package/__flow__/SpotIllustration/illustrationNames.js +7 -0
- package/__flow__/SpotIllustration/index.js +1 -1
- package/__flow__/SpotIllustration/index.stories.js +9 -5
- package/__flow__/SpotIllustration/spotIllustrations/competitors.svg +29 -0
- package/__flow__/SpotIllustration/spotIllustrations/grow-large.svg +12 -0
- package/__flow__/SpotIllustration/spotIllustrations/grow.svg +5 -0
- package/__flow__/SpotIllustration/spotIllustrations/listening-sentiment.svg +27 -0
- package/__flow__/SpotIllustration/spotIllustrations/listening-topic-templates.svg +26 -0
- package/__flow__/SpotIllustration/spotIllustrations/listening.svg +9 -0
- package/__flow__/SpotIllustration/spotIllustrations/message.svg +6 -0
- package/__flow__/Stack/index.stories.js +1 -0
- package/__flow__/Stack/index.test.js +1 -0
- package/__flow__/Switch/index.js +1 -1
- package/__flow__/Switch/index.stories.js +6 -5
- package/__flow__/Switch/index.test.js +1 -0
- package/__flow__/Table/index.stories.js +14 -12
- package/__flow__/Table/index.test.js +1 -0
- package/__flow__/TableCell/index.stories.js +1 -0
- package/__flow__/TableCell/index.test.js +2 -1
- package/__flow__/TableHeaderCell/index.stories.js +1 -0
- package/__flow__/TableHeaderCell/index.test.js +5 -2
- package/__flow__/TableRowAccordion/index.stories.js +3 -2
- package/__flow__/TableRowAccordion/index.test.js +2 -1
- package/__flow__/Tabs/index.stories.js +1 -0
- package/__flow__/Tabs/index.test.js +1 -0
- package/__flow__/Text/index.js +11 -7
- package/__flow__/Text/index.stories.js +1 -0
- package/__flow__/Text/index.test.js +1 -0
- package/__flow__/Textarea/index.stories.js +9 -0
- package/__flow__/Textarea/index.test.js +1 -0
- package/__flow__/Toast/index.stories.js +10 -6
- package/__flow__/ToggleHint/index.test.js +1 -0
- package/__flow__/Token/index.stories.js +1 -0
- package/__flow__/Token/index.test.js +1 -0
- package/__flow__/TokenInput/tests/default/deleting.test.js +10 -9
- package/__flow__/TokenInput/tests/default/focusing.test.js +1 -0
- package/__flow__/TokenInput/tests/default/inputting.test.js +2 -1
- package/__flow__/Tooltip/index.stories.js +1 -17
- package/__flow__/Tooltip/index.test.js +2 -0
- package/__flow__/dataviz/dataviz.stories.js +1 -0
- package/__flow__/dataviz/index.js +1 -0
- package/__flow__/themes/dark/decorative-palettes.js +3 -1
- package/__flow__/themes/light/decorative-palettes.js +2 -0
- package/__flow__/utils/system-props.js +1 -0
- package/commonjs/Banner/index.js +4 -2
- package/commonjs/Button/index.js +7 -1
- package/commonjs/Checkbox/index.js +3 -3
- package/commonjs/Icon/styles.js +3 -0
- package/commonjs/IconViewBoxes.js +2 -0
- package/commonjs/IllustrationViewBoxes.js +7 -0
- package/commonjs/Indicator/styles.js +3 -1
- package/commonjs/LoaderButton/index.js +3 -1
- package/commonjs/LogoViewBoxes.js +12 -0
- package/commonjs/PartnerLogo/index.js +18 -19
- package/commonjs/PartnerLogo/styles.js +40 -0
- package/commonjs/SpotIllustration/illustrationNames.js +1 -1
- package/commonjs/themes/dark/decorative-palettes.js +1 -1
- package/dist/icon.svg +1 -1
- package/dist/iconList.js +1 -1
- package/dist/illustration.svg +1 -1
- package/dist/illustrationList.js +1 -1
- package/dist/logo.svg +1 -1
- package/dist/logoList.js +1 -1
- package/dist/themes/dark/theme.scss +2 -2
- package/dist/themes/extendedThemes/sproutTheme/dark/theme.scss +2 -2
- package/lib/Banner/index.js +4 -2
- package/lib/Button/index.js +11 -1
- package/lib/Checkbox/index.js +3 -3
- package/lib/Icon/styles.js +3 -0
- package/lib/IconViewBoxes.js +2 -0
- package/lib/IllustrationViewBoxes.js +7 -0
- package/lib/Indicator/styles.js +3 -1
- package/lib/LoaderButton/index.js +3 -1
- package/lib/LogoViewBoxes.js +12 -0
- package/lib/PartnerLogo/index.js +17 -14
- package/lib/PartnerLogo/styles.js +26 -0
- package/lib/SpotIllustration/illustrationNames.js +1 -1
- package/lib/themes/dark/decorative-palettes.js +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @flow
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { render } from "../utils/react-testing-library";
|
|
3
4
|
import TableCell from "./";
|
|
@@ -12,7 +13,7 @@ describe("TableCell", () => {
|
|
|
12
13
|
});
|
|
13
14
|
|
|
14
15
|
it("renders the children if present", () => {
|
|
15
|
-
const { getByText } = render(<TableCell>Child</TableCell>);
|
|
16
|
+
const { getByText } = render(<TableCell id="test">Child</TableCell>);
|
|
16
17
|
|
|
17
18
|
expect(getByText("Child")).toBeInTheDocument();
|
|
18
19
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @flow
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { render } from "../utils/react-testing-library";
|
|
3
4
|
import TableHeaderCell from "./";
|
|
@@ -6,7 +7,7 @@ describe("TableHeaderCell", () => {
|
|
|
6
7
|
it("should render properly", () => {
|
|
7
8
|
const { getByDataQaLabel, getByText } = render(
|
|
8
9
|
<table>
|
|
9
|
-
<TableHeaderCell content="more stuff here" />
|
|
10
|
+
<TableHeaderCell id="test" content="more stuff here" />
|
|
10
11
|
</table>
|
|
11
12
|
);
|
|
12
13
|
expect(getByDataQaLabel({ "table-header-cell": "" })).toBeTruthy();
|
|
@@ -16,7 +17,9 @@ describe("TableHeaderCell", () => {
|
|
|
16
17
|
it("renders the children if present", () => {
|
|
17
18
|
const { getByText } = render(
|
|
18
19
|
<table>
|
|
19
|
-
<TableHeaderCell content="content">
|
|
20
|
+
<TableHeaderCell id="test" content="content">
|
|
21
|
+
Child
|
|
22
|
+
</TableHeaderCell>
|
|
20
23
|
</table>
|
|
21
24
|
);
|
|
22
25
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @flow
|
|
1
2
|
import React from "react";
|
|
2
3
|
import TableRowAccordion from "./";
|
|
3
4
|
|
|
@@ -31,7 +32,7 @@ export const collapsed = () => (
|
|
|
31
32
|
},
|
|
32
33
|
]}
|
|
33
34
|
isExpanded={false}
|
|
34
|
-
onToggle={() =>
|
|
35
|
+
onToggle={() => {}}
|
|
35
36
|
detail={
|
|
36
37
|
<img
|
|
37
38
|
src="//i.kym-cdn.com/entries/icons/mobile/000/013/564/doge.jpg"
|
|
@@ -71,7 +72,7 @@ export const expanded = () => (
|
|
|
71
72
|
},
|
|
72
73
|
]}
|
|
73
74
|
isExpanded={true}
|
|
74
|
-
onToggle={() =>
|
|
75
|
+
onToggle={() => {}}
|
|
75
76
|
detail={
|
|
76
77
|
<img
|
|
77
78
|
src="//i.kym-cdn.com/entries/icons/mobile/000/013/564/doge.jpg"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @flow
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { render, fireEvent } from "../utils/react-testing-library";
|
|
3
4
|
import TableRowAccordion from "./";
|
|
@@ -34,7 +35,7 @@ describe("TableRowAccordion", () => {
|
|
|
34
35
|
/>
|
|
35
36
|
),
|
|
36
37
|
isExpanded: false,
|
|
37
|
-
onToggle: (
|
|
38
|
+
onToggle: () => {},
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
it("should render the table cells RTL", () => {
|
package/__flow__/Text/index.js
CHANGED
|
@@ -3,6 +3,8 @@ import * as React from "react";
|
|
|
3
3
|
import Container from "./styles";
|
|
4
4
|
import styled from "styled-components";
|
|
5
5
|
|
|
6
|
+
import type { TypeTheme } from "../types/theme.flow";
|
|
7
|
+
|
|
6
8
|
type TypeProps = {
|
|
7
9
|
/** Maps to the typeScale system prop, sets font size and line height using Seeds values */
|
|
8
10
|
fontSize?:
|
|
@@ -26,40 +28,42 @@ type TypeProps = {
|
|
|
26
28
|
qa?: Object,
|
|
27
29
|
};
|
|
28
30
|
|
|
29
|
-
const Headline = styled(Container)`
|
|
31
|
+
const Headline = styled<typeof Container, TypeTheme, TypeProps>(Container)`
|
|
30
32
|
color: ${(props) => props.theme.colors.text.headline};
|
|
31
33
|
font-weight: ${(props) => props.theme.fontWeights.bold};
|
|
32
34
|
${(props) => props.theme.typography[400]}
|
|
33
35
|
`;
|
|
34
36
|
|
|
35
|
-
const SubHeadline = styled(Container)`
|
|
37
|
+
const SubHeadline = styled<typeof Container, TypeTheme, TypeProps>(Container)`
|
|
36
38
|
color: ${(props) => props.theme.colors.text.headline};
|
|
37
39
|
font-weight: ${(props) => props.theme.fontWeights.bold};
|
|
38
40
|
${(props) => props.theme.typography[300]}
|
|
39
41
|
`;
|
|
40
42
|
|
|
41
|
-
const SmallSubHeadline = styled(
|
|
43
|
+
const SmallSubHeadline = styled<typeof Container, TypeTheme, TypeProps>(
|
|
44
|
+
Container
|
|
45
|
+
)`
|
|
42
46
|
color: ${(props) => props.theme.colors.text.headline};
|
|
43
47
|
font-weight: ${(props) => props.theme.fontWeights.bold};
|
|
44
48
|
${(props) => props.theme.typography[200]}
|
|
45
49
|
`;
|
|
46
50
|
|
|
47
|
-
const Byline = styled(Container)`
|
|
51
|
+
const Byline = styled<typeof Container, TypeTheme, TypeProps>(Container)`
|
|
48
52
|
color: ${(props) => props.theme.colors.text.subtext};
|
|
49
53
|
${(props) => props.theme.typography[200]}
|
|
50
54
|
`;
|
|
51
55
|
|
|
52
|
-
const SmallByline = styled(Container)`
|
|
56
|
+
const SmallByline = styled<typeof Container, TypeTheme, TypeProps>(Container)`
|
|
53
57
|
color: ${(props) => props.theme.colors.text.subtext};
|
|
54
58
|
${(props) => props.theme.typography[100]}
|
|
55
59
|
`;
|
|
56
60
|
|
|
57
|
-
const BodyCopy = styled(Container)`
|
|
61
|
+
const BodyCopy = styled<typeof Container, TypeTheme, TypeProps>(Container)`
|
|
58
62
|
color: ${(props) => props.theme.colors.text.body};
|
|
59
63
|
${(props) => props.theme.typography[300]}
|
|
60
64
|
`;
|
|
61
65
|
|
|
62
|
-
const SmallBodyCopy = styled(Container)`
|
|
66
|
+
const SmallBodyCopy = styled<typeof Container, TypeTheme, TypeProps>(Container)`
|
|
63
67
|
color: ${(props) => props.theme.colors.text.body};
|
|
64
68
|
${(props) => props.theme.typography[200]}
|
|
65
69
|
`;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @flow
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { boolean, text } from "@storybook/addon-knobs";
|
|
3
4
|
|
|
@@ -10,6 +11,7 @@ export default {
|
|
|
10
11
|
|
|
11
12
|
export const defaultStory = () => (
|
|
12
13
|
<Textarea
|
|
14
|
+
id="textarea"
|
|
13
15
|
value={text("value", "")}
|
|
14
16
|
name={text("name", "basic-textarea")}
|
|
15
17
|
placeholder={text("placeholder", "Enter your resume...")}
|
|
@@ -23,6 +25,7 @@ defaultStory.story = {
|
|
|
23
25
|
|
|
24
26
|
export const invalid = () => (
|
|
25
27
|
<Textarea
|
|
28
|
+
id="textarea"
|
|
26
29
|
isInvalid={boolean("isInvalid", true)}
|
|
27
30
|
value={text("value", "")}
|
|
28
31
|
name={text("name", "basic-textarea")}
|
|
@@ -37,6 +40,7 @@ invalid.story = {
|
|
|
37
40
|
|
|
38
41
|
export const disabled = () => (
|
|
39
42
|
<Textarea
|
|
43
|
+
id="textarea"
|
|
40
44
|
disabled={boolean("disabled", true)}
|
|
41
45
|
value={text("value", "")}
|
|
42
46
|
name={text("name", "basic-textarea")}
|
|
@@ -51,6 +55,7 @@ disabled.story = {
|
|
|
51
55
|
|
|
52
56
|
export const readOnly = () => (
|
|
53
57
|
<Textarea
|
|
58
|
+
id="textarea"
|
|
54
59
|
readOnly={boolean("readOnly", true)}
|
|
55
60
|
value={text("value", "")}
|
|
56
61
|
name={text("name", "basic-textarea")}
|
|
@@ -65,6 +70,7 @@ readOnly.story = {
|
|
|
65
70
|
|
|
66
71
|
export const leftIcon = () => (
|
|
67
72
|
<Textarea
|
|
73
|
+
id="textarea"
|
|
68
74
|
value={text("value", "")}
|
|
69
75
|
name={text("name", "basic-textarea")}
|
|
70
76
|
placeholder={text("placeholder", "Enter your resume...")}
|
|
@@ -79,6 +85,7 @@ leftIcon.story = {
|
|
|
79
85
|
|
|
80
86
|
export const rightIcon = () => (
|
|
81
87
|
<Textarea
|
|
88
|
+
id="textarea"
|
|
82
89
|
value={text("value", "")}
|
|
83
90
|
name={text("name", "basic-textarea")}
|
|
84
91
|
placeholder={text("placeholder", "Enter your resume...")}
|
|
@@ -93,6 +100,7 @@ rightIcon.story = {
|
|
|
93
100
|
|
|
94
101
|
export const autofocus = () => (
|
|
95
102
|
<Textarea
|
|
103
|
+
id="textarea"
|
|
96
104
|
autoFocus
|
|
97
105
|
value={text("value", "")}
|
|
98
106
|
name={text("name", "basic-textarea")}
|
|
@@ -107,6 +115,7 @@ autofocus.story = {
|
|
|
107
115
|
|
|
108
116
|
export const maxLength = () => (
|
|
109
117
|
<Textarea
|
|
118
|
+
id="textarea"
|
|
110
119
|
autoFocus
|
|
111
120
|
name={text("name", "basic-textarea")}
|
|
112
121
|
placeholder={text("placeholder", "Max Length is 10")}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
// @flow
|
|
1
2
|
import React from "react";
|
|
2
|
-
import ToastContainer, { toast } from "./index";
|
|
3
|
+
import ToastContainer, { toast, type TypeToastTheme } from "./index";
|
|
3
4
|
import Button from "../Button";
|
|
4
5
|
import Link from "../Link";
|
|
5
6
|
import Stack from "../Stack";
|
|
6
7
|
import Box from "../Box";
|
|
7
8
|
import Text from "../Text";
|
|
9
|
+
import type { EnumIconNames } from "../EnumIconNames";
|
|
10
|
+
import type { TypeColor } from "../../src/types/theme.flow";
|
|
8
11
|
|
|
9
12
|
const ToastContent = ({ verbose = false }) => (
|
|
10
13
|
<Box>
|
|
@@ -31,10 +34,10 @@ export default {
|
|
|
31
34
|
|
|
32
35
|
export const defaultStory = () => {
|
|
33
36
|
const triggerToast = (
|
|
34
|
-
type = "info",
|
|
35
|
-
verbose = false,
|
|
36
|
-
color
|
|
37
|
-
icon
|
|
37
|
+
type?: TypeToastTheme = "info",
|
|
38
|
+
verbose?: boolean = false,
|
|
39
|
+
color?: TypeColor,
|
|
40
|
+
icon?: EnumIconNames
|
|
38
41
|
) =>
|
|
39
42
|
toast({
|
|
40
43
|
theme: type,
|
|
@@ -67,7 +70,8 @@ export const defaultStory = () => {
|
|
|
67
70
|
</Button>
|
|
68
71
|
<Button
|
|
69
72
|
appearance="secondary"
|
|
70
|
-
|
|
73
|
+
// $FlowExpectedError - 'green.700' is a valid styled color but not TypeColor
|
|
74
|
+
onClick={() => triggerToast(undefined, false, "green.700", "glassdoor")}
|
|
71
75
|
>
|
|
72
76
|
Social Network toast
|
|
73
77
|
</Button>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @flow
|
|
1
2
|
import React from "react";
|
|
2
3
|
import "jest-styled-components";
|
|
3
4
|
import { render, userEvent } from "../../../utils/react-testing-library";
|
|
@@ -6,7 +7,7 @@ import TokenInput from "../../";
|
|
|
6
7
|
describe("When deleting...", () => {
|
|
7
8
|
describe("...in an empty input", () => {
|
|
8
9
|
it("should do nothing", () => {
|
|
9
|
-
const mockCallback = jest.fn((
|
|
10
|
+
const mockCallback = jest.fn(() => {});
|
|
10
11
|
|
|
11
12
|
const { getByPlaceholderText } = render(
|
|
12
13
|
<TokenInput
|
|
@@ -41,15 +42,15 @@ describe("When deleting...", () => {
|
|
|
41
42
|
|
|
42
43
|
describe("...in an input with at least one token and no text", () => {
|
|
43
44
|
it("should delete the last token", () => {
|
|
44
|
-
const mockCallback = jest.fn((
|
|
45
|
+
const mockCallback = jest.fn(() => {});
|
|
45
46
|
const { getByPlaceholderText } = render(
|
|
46
47
|
<TokenInput
|
|
47
48
|
id="0"
|
|
48
49
|
name="token-input"
|
|
49
50
|
tokens={[
|
|
50
|
-
{ id: "0",
|
|
51
|
-
{ id: "1",
|
|
52
|
-
{ id: "2",
|
|
51
|
+
{ id: "0", value: "you" },
|
|
52
|
+
{ id: "1", value: "are" },
|
|
53
|
+
{ id: "2", value: "beautiful" },
|
|
53
54
|
]}
|
|
54
55
|
placeholder="Enter text"
|
|
55
56
|
onRemoveToken={mockCallback}
|
|
@@ -68,15 +69,15 @@ describe("When deleting...", () => {
|
|
|
68
69
|
|
|
69
70
|
describe("...in an input with at least one token and text", () => {
|
|
70
71
|
it("should delete all the text and then the token", () => {
|
|
71
|
-
const mockCallback = jest.fn((
|
|
72
|
+
const mockCallback = jest.fn(() => {});
|
|
72
73
|
const { getByPlaceholderText } = render(
|
|
73
74
|
<TokenInput
|
|
74
75
|
id="0"
|
|
75
76
|
name="token-input"
|
|
76
77
|
tokens={[
|
|
77
|
-
{ id: "0",
|
|
78
|
-
{ id: "1",
|
|
79
|
-
{ id: "2",
|
|
78
|
+
{ id: "0", value: "you" },
|
|
79
|
+
{ id: "1", value: "are" },
|
|
80
|
+
{ id: "2", value: "beautiful" },
|
|
80
81
|
]}
|
|
81
82
|
placeholder="Enter text"
|
|
82
83
|
onRemoveToken={mockCallback}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @flow
|
|
1
2
|
import React from "react";
|
|
2
3
|
import "jest-styled-components";
|
|
3
4
|
import { render, userEvent } from "../../../utils/react-testing-library";
|
|
@@ -36,7 +37,7 @@ describe("When inputting...", () => {
|
|
|
36
37
|
|
|
37
38
|
describe("...a delimiter into an input with a value", () => {
|
|
38
39
|
it("should add a token rather than a value", () => {
|
|
39
|
-
const mockCallback = jest.fn((
|
|
40
|
+
const mockCallback = jest.fn(() => {});
|
|
40
41
|
|
|
41
42
|
const { getByPlaceholderText } = render(
|
|
42
43
|
<TokenInput
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @flow
|
|
1
2
|
import React from "react";
|
|
2
3
|
import Tooltip from "./index";
|
|
3
4
|
import Box from "../Box";
|
|
@@ -161,23 +162,6 @@ withFocusableContent.story = {
|
|
|
161
162
|
name: "With focusable content",
|
|
162
163
|
};
|
|
163
164
|
|
|
164
|
-
export const withoutContent = () => (
|
|
165
|
-
<Box
|
|
166
|
-
width="100%"
|
|
167
|
-
p={600}
|
|
168
|
-
alignItems="center"
|
|
169
|
-
justifyContent="center"
|
|
170
|
-
display="flex"
|
|
171
|
-
height="200px"
|
|
172
|
-
>
|
|
173
|
-
<Tooltip content={undefined}>show tooltip</Tooltip>
|
|
174
|
-
</Box>
|
|
175
|
-
);
|
|
176
|
-
|
|
177
|
-
withoutContent.story = {
|
|
178
|
-
name: "Without content",
|
|
179
|
-
};
|
|
180
|
-
|
|
181
165
|
export const truncated = () => (
|
|
182
166
|
<Box width="200px" height="200px">
|
|
183
167
|
<Tooltip content="sup" truncated>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @flow
|
|
1
2
|
import React from "react";
|
|
2
3
|
import {
|
|
3
4
|
render,
|
|
@@ -142,6 +143,7 @@ describe("Tooltip", () => {
|
|
|
142
143
|
it("should not render undefined content", async () => {
|
|
143
144
|
expect.assertions(1);
|
|
144
145
|
const { container, getByText } = render(
|
|
146
|
+
// $FlowExpectedError: testing undefined
|
|
145
147
|
<Tooltip content={undefined}>hi</Tooltip>
|
|
146
148
|
);
|
|
147
149
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// @flow strict-local
|
|
2
|
+
|
|
1
3
|
import COLORS from "@sproutsocial/seeds-color";
|
|
2
4
|
|
|
3
5
|
export const green = {
|
|
@@ -13,7 +15,7 @@ export const blue = {
|
|
|
13
15
|
};
|
|
14
16
|
|
|
15
17
|
export const purple = {
|
|
16
|
-
background: COLORS.
|
|
18
|
+
background: COLORS.COLOR_PURPLE_900,
|
|
17
19
|
highlight: COLORS.COLOR_PURPLE_500,
|
|
18
20
|
foreground: COLORS.COLOR_PURPLE_100,
|
|
19
21
|
};
|
package/commonjs/Banner/index.js
CHANGED
|
@@ -64,6 +64,8 @@ var getBannerIcon = function getBannerIcon(type) {
|
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
|
+
/** TODO: change to 'info' type by default in future version */
|
|
68
|
+
|
|
67
69
|
|
|
68
70
|
var Banner = function Banner(_ref) {
|
|
69
71
|
var _ref$type = _ref.type,
|
|
@@ -78,9 +80,9 @@ var Banner = function Banner(_ref) {
|
|
|
78
80
|
}
|
|
79
81
|
|
|
80
82
|
return /*#__PURE__*/React.createElement(_styles.default, _extends({
|
|
81
|
-
type:
|
|
83
|
+
type: type,
|
|
82
84
|
"data-qa-alert": "",
|
|
83
|
-
"data-qa-alert-type":
|
|
85
|
+
"data-qa-alert-type": type,
|
|
84
86
|
"data-qa-alert-text": text // $FlowIssue - upgrade v0.112.0
|
|
85
87
|
|
|
86
88
|
}, rest), /*#__PURE__*/React.createElement(_Box.default, {
|
package/commonjs/Button/index.js
CHANGED
|
@@ -41,10 +41,16 @@ var Button = function Button(_ref) {
|
|
|
41
41
|
|
|
42
42
|
if (!href && external) {
|
|
43
43
|
console.warn("Warning: external prop cannot be set without a href declaration");
|
|
44
|
-
}
|
|
44
|
+
}
|
|
45
|
+
/** "default" is @deprecated in favor of "unstyled" */
|
|
45
46
|
|
|
46
47
|
|
|
47
48
|
var appearanceCheck = appearance === "default" ? "unstyled" : appearance;
|
|
49
|
+
|
|
50
|
+
if (appearance === "default") {
|
|
51
|
+
console.warn("Warning: The `default` appearance has been deprecated on the Button component. Please use `unstyled` instead.");
|
|
52
|
+
}
|
|
53
|
+
|
|
48
54
|
return /*#__PURE__*/React.createElement(_styles.default, _extends({
|
|
49
55
|
title: title,
|
|
50
56
|
active: active,
|
|
@@ -44,14 +44,14 @@ var Checkbox = /*#__PURE__*/function (_React$Component) {
|
|
|
44
44
|
var _proto = Checkbox.prototype;
|
|
45
45
|
|
|
46
46
|
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
|
|
47
|
-
if (prevProps.indeterminate !== this.props.indeterminate && this.el) {
|
|
48
|
-
this.el.indeterminate = this.props.indeterminate;
|
|
47
|
+
if (prevProps.indeterminate !== !!this.props.indeterminate && this.el) {
|
|
48
|
+
this.el.indeterminate = !!this.props.indeterminate;
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
_proto.componentDidMount = function componentDidMount() {
|
|
53
53
|
if (this.el) {
|
|
54
|
-
this.el.indeterminate = this.props.indeterminate;
|
|
54
|
+
this.el.indeterminate = !!this.props.indeterminate;
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
|
package/commonjs/Icon/styles.js
CHANGED
|
@@ -15,7 +15,10 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
15
15
|
|
|
16
16
|
var sizes = {
|
|
17
17
|
mini: "12px",
|
|
18
|
+
|
|
19
|
+
/** TODO: deprecate default in favor of small in future release */
|
|
18
20
|
default: "16px",
|
|
21
|
+
small: "16px",
|
|
19
22
|
medium: "24px",
|
|
20
23
|
large: "32px",
|
|
21
24
|
jumbo: "64px"
|
|
@@ -10,6 +10,8 @@ module.exports = {
|
|
|
10
10
|
"address-card-solid": "0 0 18 16",
|
|
11
11
|
"adobe-experience-manager": "0 0 16 18",
|
|
12
12
|
"ads": "0 0 9 16",
|
|
13
|
+
"advocacy-outline": "0 0 14 16",
|
|
14
|
+
"advocacy": "0 0 14 16",
|
|
13
15
|
"android": "0 0 14 16",
|
|
14
16
|
"apple": "0 0 14 16",
|
|
15
17
|
"approval-indicator-outline": "0 0 14 16",
|
|
@@ -13,6 +13,7 @@ module.exports = {
|
|
|
13
13
|
"cat": "0 0 240 171",
|
|
14
14
|
"checkbox-alert": "0 0 193 169",
|
|
15
15
|
"coffee-cup": "0 0 196 234",
|
|
16
|
+
"competitors": "0 0 355 258",
|
|
16
17
|
"compose-window": "0 0 372 188",
|
|
17
18
|
"compose": "0 0 62 45",
|
|
18
19
|
"computer-error": "0 0 237 259",
|
|
@@ -29,6 +30,8 @@ module.exports = {
|
|
|
29
30
|
"general-topic": "0 0 101 63",
|
|
30
31
|
"global-features": "0 0 239 226",
|
|
31
32
|
"global-trend": "0 0 56 42",
|
|
33
|
+
"grow-large": "0 0 189 137",
|
|
34
|
+
"grow": "0 0 73 45",
|
|
32
35
|
"hands-raised": "0 0 192 176",
|
|
33
36
|
"headset": "0 0 106 54",
|
|
34
37
|
"heartbeat-connection": "0 0 335 201",
|
|
@@ -43,10 +46,14 @@ module.exports = {
|
|
|
43
46
|
"link-sections": "0 0 270 273",
|
|
44
47
|
"link-upload": "0 0 180 140",
|
|
45
48
|
"listening-pendo": "0 0 544 109",
|
|
49
|
+
"listening-sentiment": "0 0 343 154",
|
|
50
|
+
"listening-topic-templates": "0 0 337 247",
|
|
46
51
|
"listening-tour": "0 0 236 212",
|
|
52
|
+
"listening": "0 0 101 63",
|
|
47
53
|
"loading": "0 0 62 39",
|
|
48
54
|
"mailbox-empty": "0 0 309 240",
|
|
49
55
|
"mailbox-full": "0 0 352 252",
|
|
56
|
+
"message": "0 0 58 44",
|
|
50
57
|
"network-data": "0 0 369 229",
|
|
51
58
|
"no-messages-found": "0 0 272 211",
|
|
52
59
|
"no-notifications": "0 0 281 134",
|
|
@@ -21,7 +21,9 @@ var Container = _styledComponents.default.span.attrs({
|
|
|
21
21
|
}, function (props) {
|
|
22
22
|
return props.theme.space[400];
|
|
23
23
|
}, function (props) {
|
|
24
|
-
|
|
24
|
+
var _props$color;
|
|
25
|
+
|
|
26
|
+
return (_props$color = props.color) != null ? _props$color : props.theme.colors.icon.info;
|
|
25
27
|
}, _mixins.visuallyHidden, _systemProps.COMMON);
|
|
26
28
|
|
|
27
29
|
var _default = Container;
|
|
@@ -31,7 +31,9 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
31
31
|
|
|
32
32
|
var getColor = function getColor(appearance) {
|
|
33
33
|
switch (appearance) {
|
|
34
|
+
/** "default" is @deprecated in favour of unstyled */
|
|
34
35
|
case "default":
|
|
36
|
+
case "unstyled":
|
|
35
37
|
case "outline":
|
|
36
38
|
case "secondary":
|
|
37
39
|
return "dark";
|
|
@@ -52,7 +54,7 @@ var CustomLoader = (0, _styledComponents.default)(_Loader.default).withConfig({
|
|
|
52
54
|
|
|
53
55
|
var LoaderButton = function LoaderButton(_ref) {
|
|
54
56
|
var _ref$appearance = _ref.appearance,
|
|
55
|
-
appearance = _ref$appearance === void 0 ? "
|
|
57
|
+
appearance = _ref$appearance === void 0 ? "unstyled" : _ref$appearance,
|
|
56
58
|
_ref$isLoading = _ref.isLoading,
|
|
57
59
|
_isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
58
60
|
disabled = _ref.disabled,
|
|
@@ -6,7 +6,13 @@ module.exports = {
|
|
|
6
6
|
"canva-dark": "0 0 140 140",
|
|
7
7
|
"canva": "0 0 140 140",
|
|
8
8
|
"dropbox-dark": "0 0 140 119",
|
|
9
|
+
"dropbox-lockup-dark": "0 0 291 57",
|
|
10
|
+
"dropbox-lockup": "0 0 291 57",
|
|
11
|
+
"dropbox-wordmark-dark": "0 0 308 71",
|
|
12
|
+
"dropbox-wordmark": "0 0 308 71",
|
|
9
13
|
"dropbox": "0 0 140 119",
|
|
14
|
+
"facebook-audience-network-dark": "0 0 140 145",
|
|
15
|
+
"facebook-audience-network": "0 0 140 145",
|
|
10
16
|
"facebook-dark": "0 0 141 139",
|
|
11
17
|
"facebook-groups-dark": "0 0 140 140",
|
|
12
18
|
"facebook-groups": "0 0 140 140",
|
|
@@ -29,6 +35,8 @@ module.exports = {
|
|
|
29
35
|
"hubspot": "0 0 140 156",
|
|
30
36
|
"instagram-dark": "0 0 140 140",
|
|
31
37
|
"instagram": "0 0 140 140",
|
|
38
|
+
"linkedin-audience-network-dark": "0 0 140 141",
|
|
39
|
+
"linkedin-audience-network": "0 0 140 141",
|
|
32
40
|
"linkedin-dark": "0 0 140 140",
|
|
33
41
|
"linkedin": "0 0 140 140",
|
|
34
42
|
"marketo-dark": "0 0 140 164",
|
|
@@ -66,5 +74,9 @@ module.exports = {
|
|
|
66
74
|
"youtube-dark": "0 0 140 99",
|
|
67
75
|
"youtube": "0 0 140 99",
|
|
68
76
|
"zendesk-dark": "0 0 140 107",
|
|
77
|
+
"zendesk-lockup-dark": "0 0 160 115",
|
|
78
|
+
"zendesk-lockup": "0 0 160 115",
|
|
79
|
+
"zendesk-wordmark-dark": "0 0 350 67",
|
|
80
|
+
"zendesk-wordmark": "0 0 350 67",
|
|
69
81
|
"zendesk": "0 0 140 107"
|
|
70
82
|
};
|