@sproutsocial/racine 12.15.0 → 12.16.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 +50 -0
- 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.stories.js +1 -0
- package/__flow__/Banner/index.test.js +1 -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__/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__/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/index.js +34 -34
- package/__flow__/PartnerLogo/index.stories.js +41 -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/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/index.js +1 -1
- package/__flow__/SpotIllustration/index.stories.js +6 -5
- 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 +2 -0
- package/__flow__/themes/light/decorative-palettes.js +2 -0
- package/__flow__/utils/system-props.js +1 -0
- 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/Indicator/styles.js +3 -1
- package/commonjs/LoaderButton/index.js +3 -1
- package/commonjs/LogoViewBoxes.js +8 -0
- package/commonjs/PartnerLogo/index.js +20 -20
- package/commonjs/PartnerLogo/styles.js +40 -0
- package/dist/icon.svg +1 -1
- package/dist/iconList.js +1 -1
- package/dist/logo.svg +1 -1
- package/dist/logoList.js +1 -1
- 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/Indicator/styles.js +3 -1
- package/lib/LoaderButton/index.js +3 -1
- package/lib/LogoViewBoxes.js +8 -0
- package/lib/PartnerLogo/index.js +19 -15
- package/lib/PartnerLogo/styles.js +26 -0
- package/package.json +1 -1
package/__flow__/Switch/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import Container from "./styles";
|
|
|
4
4
|
import Icon from "../Icon";
|
|
5
5
|
import { VisuallyHidden } from "../VisuallyHidden";
|
|
6
6
|
|
|
7
|
-
type TypeProps = {
|
|
7
|
+
export type TypeProps = {
|
|
8
8
|
onClick: (e: SyntheticEvent<HTMLButtonElement>, checked: boolean) => void,
|
|
9
9
|
checked: boolean,
|
|
10
10
|
/** Customizable object to pass in localized "On" and "Off" label text for screen readers {"on": ONTEXT, "off": OFFTEXT} */
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
+
// @flow
|
|
1
2
|
import React from "react";
|
|
2
|
-
import Switch from "./";
|
|
3
|
+
import Switch, { type TypeProps } from "./";
|
|
3
4
|
|
|
4
5
|
export default {
|
|
5
6
|
title: "Switch",
|
|
6
7
|
component: Switch,
|
|
7
8
|
};
|
|
8
9
|
|
|
9
|
-
export const On = (args) => <Switch {...args} />;
|
|
10
|
+
export const On = (args: TypeProps) => <Switch {...args} />;
|
|
10
11
|
|
|
11
12
|
On.args = {
|
|
12
13
|
checked: true,
|
|
13
14
|
};
|
|
14
15
|
|
|
15
|
-
export const Off = (args) => <Switch {...args} />;
|
|
16
|
+
export const Off = (args: TypeProps) => <Switch {...args} />;
|
|
16
17
|
|
|
17
18
|
Off.args = {
|
|
18
19
|
checked: false,
|
|
19
20
|
};
|
|
20
21
|
|
|
21
|
-
export const DisabledOn = (args) => <Switch {...args} />;
|
|
22
|
+
export const DisabledOn = (args: TypeProps) => <Switch {...args} />;
|
|
22
23
|
|
|
23
24
|
DisabledOn.args = {
|
|
24
25
|
checked: true,
|
|
@@ -29,7 +30,7 @@ DisabledOn.story = {
|
|
|
29
30
|
name: "Disabled/On",
|
|
30
31
|
};
|
|
31
32
|
|
|
32
|
-
export const DisabledOff = (args) => <Switch {...args} />;
|
|
33
|
+
export const DisabledOff = (args: TypeProps) => <Switch {...args} />;
|
|
33
34
|
|
|
34
35
|
DisabledOff.args = {
|
|
35
36
|
checked: false,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
// @flow
|
|
1
2
|
import React from "react";
|
|
2
3
|
import Table from "./";
|
|
3
4
|
import TableRowAccordion from "../TableRowAccordion";
|
|
5
|
+
import { SORT_DIRECTIONS } from "../TableHeaderCell";
|
|
4
6
|
|
|
5
7
|
export default {
|
|
6
8
|
title: "Table",
|
|
@@ -24,7 +26,7 @@ export const defaultStory = () => (
|
|
|
24
26
|
{ content: "62g", id: "4" },
|
|
25
27
|
{ content: "46g", id: "5" },
|
|
26
28
|
],
|
|
27
|
-
id: 1,
|
|
29
|
+
id: "1",
|
|
28
30
|
},
|
|
29
31
|
{
|
|
30
32
|
cells: [
|
|
@@ -34,11 +36,11 @@ export const defaultStory = () => (
|
|
|
34
36
|
{ content: "46g", id: "4" },
|
|
35
37
|
{ content: "25g", id: "5" },
|
|
36
38
|
],
|
|
37
|
-
id: 2,
|
|
39
|
+
id: "2",
|
|
38
40
|
},
|
|
39
41
|
]}
|
|
40
42
|
onSort={(e) => alert("Sort!")}
|
|
41
|
-
sortDirection=
|
|
43
|
+
sortDirection={SORT_DIRECTIONS.ASC}
|
|
42
44
|
sortId="2"
|
|
43
45
|
/>
|
|
44
46
|
);
|
|
@@ -62,7 +64,7 @@ export const columnSpan = () => (
|
|
|
62
64
|
{ content: "Column 1", id: "1" },
|
|
63
65
|
{ content: "Column 2", id: "2" },
|
|
64
66
|
],
|
|
65
|
-
id: 1,
|
|
67
|
+
id: "1",
|
|
66
68
|
},
|
|
67
69
|
{
|
|
68
70
|
cells: [
|
|
@@ -72,7 +74,7 @@ export const columnSpan = () => (
|
|
|
72
74
|
id: "1",
|
|
73
75
|
},
|
|
74
76
|
],
|
|
75
|
-
id: 2,
|
|
77
|
+
id: "2",
|
|
76
78
|
},
|
|
77
79
|
]}
|
|
78
80
|
/>
|
|
@@ -133,7 +135,7 @@ export const columnWidth = () => (
|
|
|
133
135
|
id: "4",
|
|
134
136
|
},
|
|
135
137
|
],
|
|
136
|
-
id: 1,
|
|
138
|
+
id: "1",
|
|
137
139
|
},
|
|
138
140
|
{
|
|
139
141
|
cells: [
|
|
@@ -159,7 +161,7 @@ export const columnWidth = () => (
|
|
|
159
161
|
id: "4",
|
|
160
162
|
},
|
|
161
163
|
],
|
|
162
|
-
id: 2,
|
|
164
|
+
id: "2",
|
|
163
165
|
},
|
|
164
166
|
]}
|
|
165
167
|
/>
|
|
@@ -269,16 +271,16 @@ export const staticTable = () => {
|
|
|
269
271
|
<Table.TableHead>
|
|
270
272
|
<Table.TableRow>
|
|
271
273
|
{columns.map((c) => (
|
|
272
|
-
<Table.HeaderCell>{c} </Table.HeaderCell>
|
|
274
|
+
<Table.HeaderCell id={c.toLowerCase()}>{c} </Table.HeaderCell>
|
|
273
275
|
))}
|
|
274
276
|
</Table.TableRow>
|
|
275
277
|
</Table.TableHead>
|
|
276
278
|
<Table.TableBody>
|
|
277
|
-
{rows.map((r) => (
|
|
279
|
+
{rows.map((r, i) => (
|
|
278
280
|
<Table.TableRow>
|
|
279
|
-
<Table.Cell>{r.name} </Table.Cell>
|
|
280
|
-
<Table.Cell>{r.squad} </Table.Cell>
|
|
281
|
-
<Table.Cell>{r.favoriteColor} </Table.Cell>
|
|
281
|
+
<Table.Cell id={`row-${i}-name`}>{r.name} </Table.Cell>
|
|
282
|
+
<Table.Cell id={`row-${i}-squad`}>{r.squad} </Table.Cell>
|
|
283
|
+
<Table.Cell id={`row-${i}-color`}>{r.favoriteColor} </Table.Cell>
|
|
282
284
|
</Table.TableRow>
|
|
283
285
|
))}
|
|
284
286
|
</Table.TableBody>
|
|
@@ -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
|
|
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"
|