@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.
Files changed (179) hide show
  1. package/CHANGELOG.md +59 -1
  2. package/__flow__/Avatar/index.stories.js +1 -0
  3. package/__flow__/Avatar/index.test.js +1 -0
  4. package/__flow__/Badge/index.stories.js +1 -0
  5. package/__flow__/Badge/index.test.js +1 -0
  6. package/__flow__/Banner/index.js +5 -4
  7. package/__flow__/Banner/index.stories.js +1 -0
  8. package/__flow__/Banner/index.test.js +11 -0
  9. package/__flow__/Box/index.stories.js +1 -0
  10. package/__flow__/Box/index.test.js +1 -0
  11. package/__flow__/Breadcrumb/index.stories.js +1 -0
  12. package/__flow__/Breadcrumb/index.test.js +1 -0
  13. package/__flow__/Button/index.js +14 -3
  14. package/__flow__/Button/index.stories.js +24 -17
  15. package/__flow__/CharacterCounter/index.stories.js +1 -0
  16. package/__flow__/CharacterCounter/index.test.js +1 -0
  17. package/__flow__/ChartLegend/index.stories.js +1 -0
  18. package/__flow__/ChartLegend/index.test.js +1 -0
  19. package/__flow__/Checkbox/index.js +5 -5
  20. package/__flow__/Checkbox/index.stories.js +18 -13
  21. package/__flow__/Checkbox/index.test.js +9 -1
  22. package/__flow__/Collapsible/index.stories.js +16 -2
  23. package/__flow__/Collapsible/index.test.js +1 -0
  24. package/__flow__/Drawer/index.stories.js +14 -5
  25. package/__flow__/Drawer/index.test.js +4 -3
  26. package/__flow__/EmptyState/index.stories.js +1 -0
  27. package/__flow__/EmptyState/index.test.js +1 -0
  28. package/__flow__/EnumIconNames.js +1 -1
  29. package/__flow__/EnumIllustrationNames.js +1 -1
  30. package/__flow__/EnumLogoNames.js +1 -1
  31. package/__flow__/Fieldset/index.stories.js +21 -6
  32. package/__flow__/FormField/index.stories.js +11 -6
  33. package/__flow__/FormField/index.test.js +5 -4
  34. package/__flow__/Icon/index.js +5 -2
  35. package/__flow__/Icon/index.stories.js +8 -7
  36. package/__flow__/Icon/index.test.js +1 -0
  37. package/__flow__/Icon/styles.js +2 -0
  38. package/__flow__/IconViewBoxes.js +1 -1
  39. package/__flow__/IllustrationViewBoxes.js +1 -1
  40. package/__flow__/Image/index.stories.js +1 -0
  41. package/__flow__/Image/index.test.js +1 -0
  42. package/__flow__/Indicator/index.stories.js +1 -0
  43. package/__flow__/Indicator/index.test.js +1 -0
  44. package/__flow__/Indicator/styles.js +1 -1
  45. package/__flow__/Input/index.stories.js +37 -0
  46. package/__flow__/Input/index.test.js +1 -0
  47. package/__flow__/KeyboardKey/index.stories.js +1 -0
  48. package/__flow__/KeyboardKey/index.test.js +1 -0
  49. package/__flow__/Label/index.stories.js +2 -1
  50. package/__flow__/Label/index.test.js +1 -0
  51. package/__flow__/Link/index.stories.js +1 -0
  52. package/__flow__/Link/index.test.js +1 -0
  53. package/__flow__/Listbox/index.stories.js +12 -6
  54. package/__flow__/Listbox/index.test.js +1 -0
  55. package/__flow__/Loader/index.js +1 -1
  56. package/__flow__/Loader/index.stories.js +5 -4
  57. package/__flow__/Loader/index.test.js +1 -0
  58. package/__flow__/LoaderButton/index.js +3 -1
  59. package/__flow__/LoaderButton/index.stories.js +1 -0
  60. package/__flow__/LoaderButton/index.test.js +1 -0
  61. package/__flow__/LogoViewBoxes.js +1 -1
  62. package/__flow__/Menu/index.flow.js +2 -0
  63. package/__flow__/Menu/index.stories.js +16 -8
  64. package/__flow__/Menu/index.test.js +3 -1
  65. package/__flow__/Message/index.stories.js +14 -6
  66. package/__flow__/Message/index.test.js +3 -3
  67. package/__flow__/Modal/index.stories.js +1 -0
  68. package/__flow__/Modal/index.test.js +1 -0
  69. package/__flow__/Numeral/index.js +1 -1
  70. package/__flow__/Numeral/index.stories.js +8 -7
  71. package/__flow__/OverflowList/index.flow.js +2 -2
  72. package/__flow__/OverflowList/index.stories.js +4 -3
  73. package/__flow__/OverflowList/index.test.js +7 -2
  74. package/__flow__/PartnerLogo/TypePartnerNames.js +2 -0
  75. package/__flow__/PartnerLogo/index.js +32 -33
  76. package/__flow__/PartnerLogo/index.stories.js +43 -13
  77. package/__flow__/PartnerLogo/partnerLogos/dropbox-lockup-dark.svg +7 -0
  78. package/__flow__/PartnerLogo/partnerLogos/dropbox-lockup.svg +7 -0
  79. package/__flow__/PartnerLogo/partnerLogos/dropbox-wordmark-dark.svg +3 -0
  80. package/__flow__/PartnerLogo/partnerLogos/dropbox-wordmark.svg +3 -0
  81. package/__flow__/PartnerLogo/partnerLogos/facebook-audience-network-dark.svg +3 -0
  82. package/__flow__/PartnerLogo/partnerLogos/facebook-audience-network.svg +3 -0
  83. package/__flow__/PartnerLogo/partnerLogos/linkedin-audience-network-dark.svg +3 -0
  84. package/__flow__/PartnerLogo/partnerLogos/linkedin-audience-network.svg +3 -0
  85. package/__flow__/PartnerLogo/partnerLogos/zendesk-lockup-dark.svg +28 -0
  86. package/__flow__/PartnerLogo/partnerLogos/zendesk-lockup.svg +28 -0
  87. package/__flow__/PartnerLogo/partnerLogos/zendesk-wordmark-dark.svg +9 -0
  88. package/__flow__/PartnerLogo/partnerLogos/zendesk-wordmark.svg +9 -0
  89. package/__flow__/PartnerLogo/styles.js +50 -0
  90. package/__flow__/Popout/index.js +2 -2
  91. package/__flow__/Popout/index.stories.js +24 -9
  92. package/__flow__/Popout/index.test.js +2 -1
  93. package/__flow__/Radio/index.js +1 -1
  94. package/__flow__/Radio/index.stories.js +9 -8
  95. package/__flow__/Radio/index.test.js +1 -0
  96. package/__flow__/SegmentedControl/index.stories.js +1 -0
  97. package/__flow__/SegmentedControl/index.test.js +1 -0
  98. package/__flow__/Select/index.stories.js +25 -6
  99. package/__flow__/Select/index.test.js +1 -0
  100. package/__flow__/Skeleton/index.stories.js +1 -0
  101. package/__flow__/SpotIllustration/illustrationNames.js +7 -0
  102. package/__flow__/SpotIllustration/index.js +1 -1
  103. package/__flow__/SpotIllustration/index.stories.js +9 -5
  104. package/__flow__/SpotIllustration/spotIllustrations/competitors.svg +29 -0
  105. package/__flow__/SpotIllustration/spotIllustrations/grow-large.svg +12 -0
  106. package/__flow__/SpotIllustration/spotIllustrations/grow.svg +5 -0
  107. package/__flow__/SpotIllustration/spotIllustrations/listening-sentiment.svg +27 -0
  108. package/__flow__/SpotIllustration/spotIllustrations/listening-topic-templates.svg +26 -0
  109. package/__flow__/SpotIllustration/spotIllustrations/listening.svg +9 -0
  110. package/__flow__/SpotIllustration/spotIllustrations/message.svg +6 -0
  111. package/__flow__/Stack/index.stories.js +1 -0
  112. package/__flow__/Stack/index.test.js +1 -0
  113. package/__flow__/Switch/index.js +1 -1
  114. package/__flow__/Switch/index.stories.js +6 -5
  115. package/__flow__/Switch/index.test.js +1 -0
  116. package/__flow__/Table/index.stories.js +14 -12
  117. package/__flow__/Table/index.test.js +1 -0
  118. package/__flow__/TableCell/index.stories.js +1 -0
  119. package/__flow__/TableCell/index.test.js +2 -1
  120. package/__flow__/TableHeaderCell/index.stories.js +1 -0
  121. package/__flow__/TableHeaderCell/index.test.js +5 -2
  122. package/__flow__/TableRowAccordion/index.stories.js +3 -2
  123. package/__flow__/TableRowAccordion/index.test.js +2 -1
  124. package/__flow__/Tabs/index.stories.js +1 -0
  125. package/__flow__/Tabs/index.test.js +1 -0
  126. package/__flow__/Text/index.js +11 -7
  127. package/__flow__/Text/index.stories.js +1 -0
  128. package/__flow__/Text/index.test.js +1 -0
  129. package/__flow__/Textarea/index.stories.js +9 -0
  130. package/__flow__/Textarea/index.test.js +1 -0
  131. package/__flow__/Toast/index.stories.js +10 -6
  132. package/__flow__/ToggleHint/index.test.js +1 -0
  133. package/__flow__/Token/index.stories.js +1 -0
  134. package/__flow__/Token/index.test.js +1 -0
  135. package/__flow__/TokenInput/tests/default/deleting.test.js +10 -9
  136. package/__flow__/TokenInput/tests/default/focusing.test.js +1 -0
  137. package/__flow__/TokenInput/tests/default/inputting.test.js +2 -1
  138. package/__flow__/Tooltip/index.stories.js +1 -17
  139. package/__flow__/Tooltip/index.test.js +2 -0
  140. package/__flow__/dataviz/dataviz.stories.js +1 -0
  141. package/__flow__/dataviz/index.js +1 -0
  142. package/__flow__/themes/dark/decorative-palettes.js +3 -1
  143. package/__flow__/themes/light/decorative-palettes.js +2 -0
  144. package/__flow__/utils/system-props.js +1 -0
  145. package/commonjs/Banner/index.js +4 -2
  146. package/commonjs/Button/index.js +7 -1
  147. package/commonjs/Checkbox/index.js +3 -3
  148. package/commonjs/Icon/styles.js +3 -0
  149. package/commonjs/IconViewBoxes.js +2 -0
  150. package/commonjs/IllustrationViewBoxes.js +7 -0
  151. package/commonjs/Indicator/styles.js +3 -1
  152. package/commonjs/LoaderButton/index.js +3 -1
  153. package/commonjs/LogoViewBoxes.js +12 -0
  154. package/commonjs/PartnerLogo/index.js +18 -19
  155. package/commonjs/PartnerLogo/styles.js +40 -0
  156. package/commonjs/SpotIllustration/illustrationNames.js +1 -1
  157. package/commonjs/themes/dark/decorative-palettes.js +1 -1
  158. package/dist/icon.svg +1 -1
  159. package/dist/iconList.js +1 -1
  160. package/dist/illustration.svg +1 -1
  161. package/dist/illustrationList.js +1 -1
  162. package/dist/logo.svg +1 -1
  163. package/dist/logoList.js +1 -1
  164. package/dist/themes/dark/theme.scss +2 -2
  165. package/dist/themes/extendedThemes/sproutTheme/dark/theme.scss +2 -2
  166. package/lib/Banner/index.js +4 -2
  167. package/lib/Button/index.js +11 -1
  168. package/lib/Checkbox/index.js +3 -3
  169. package/lib/Icon/styles.js +3 -0
  170. package/lib/IconViewBoxes.js +2 -0
  171. package/lib/IllustrationViewBoxes.js +7 -0
  172. package/lib/Indicator/styles.js +3 -1
  173. package/lib/LoaderButton/index.js +3 -1
  174. package/lib/LogoViewBoxes.js +12 -0
  175. package/lib/PartnerLogo/index.js +17 -14
  176. package/lib/PartnerLogo/styles.js +26 -0
  177. package/lib/SpotIllustration/illustrationNames.js +1 -1
  178. package/lib/themes/dark/decorative-palettes.js +1 -1
  179. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
+ // @flow
1
2
  import React from "react";
2
3
  import { text } from "@storybook/addon-knobs";
3
4
 
@@ -10,6 +11,8 @@ export default {
10
11
 
11
12
  export const defaultStory = () => (
12
13
  <Input
14
+ id="test"
15
+ name="test"
13
16
  placeholder={text("placeholder", "Please enter a value...")}
14
17
  value={text("value", "")}
15
18
  ariaLabel={text("ariaLabel", "Descriptive label goes here")}
@@ -22,6 +25,8 @@ defaultStory.story = {
22
25
 
23
26
  export const small = () => (
24
27
  <Input
28
+ id="small"
29
+ name="small"
25
30
  placeholder={text("placeholder", "Please enter a value...")}
26
31
  value={text("value", "")}
27
32
  ariaLabel={text("ariaLabel", "Descriptive label goes here")}
@@ -35,6 +40,8 @@ small.story = {
35
40
 
36
41
  export const large = () => (
37
42
  <Input
43
+ id="large"
44
+ name="large"
38
45
  placeholder={text("placeholder", "Please enter a value...")}
39
46
  value={text("value", "")}
40
47
  ariaLabel={text("ariaLabel", "Descriptive label goes here")}
@@ -48,6 +55,8 @@ large.story = {
48
55
 
49
56
  export const disabled = () => (
50
57
  <Input
58
+ id="disabled"
59
+ name="disabled"
51
60
  placeholder={text("placeholder", "Please enter a value...")}
52
61
  value={text("value", "")}
53
62
  ariaLabel={text("ariaLabel", "Descriptive label goes here")}
@@ -61,6 +70,8 @@ disabled.story = {
61
70
 
62
71
  export const readOnly = () => (
63
72
  <Input
73
+ id="readOnly"
74
+ name="readOnly"
64
75
  placeholder={text("placeholder", "Please enter a value...")}
65
76
  value={text("value", "")}
66
77
  ariaLabel={text("ariaLabel", "Descriptive label goes here")}
@@ -74,6 +85,8 @@ readOnly.story = {
74
85
 
75
86
  export const required = () => (
76
87
  <Input
88
+ id="required"
89
+ name="required"
77
90
  value={text("value", "")}
78
91
  placeholder={text("placeholder", "Please enter a value...")}
79
92
  ariaLabel={text("ariaLabel", "Descriptive label goes here")}
@@ -87,6 +100,8 @@ required.story = {
87
100
 
88
101
  export const error = () => (
89
102
  <Input
103
+ id="error"
104
+ name="error"
90
105
  value={text("value", "")}
91
106
  isInvalid
92
107
  placeholder={text("placeholder", "blah@something")}
@@ -100,6 +115,8 @@ error.story = {
100
115
 
101
116
  export const leftIcon = () => (
102
117
  <Input
118
+ id="left-icon"
119
+ name="left-icon"
103
120
  value={text("value", "")}
104
121
  elemBefore={<Icon fixedWidth name="lock" />}
105
122
  placeholder={text("placeholder", "Password")}
@@ -113,6 +130,8 @@ leftIcon.story = {
113
130
 
114
131
  export const rightIcon = () => (
115
132
  <Input
133
+ id="right-icon"
134
+ name="right-icon"
116
135
  value={text("value", "")}
117
136
  elemAfter={<Icon fixedWidth name="lock" />}
118
137
  placeholder="Password"
@@ -126,6 +145,8 @@ rightIcon.story = {
126
145
 
127
146
  export const leftAndRightIcons = () => (
128
147
  <Input
148
+ id="left-right-icons"
149
+ name="left-right-icons"
129
150
  elemBefore={<Icon fixedWidth name="search" />}
130
151
  elemAfter={<Icon fixedWidth name="lock" />}
131
152
  placeholder={text("placeholder", "Please enter a value...")}
@@ -145,6 +166,8 @@ export const SearchInput = () => {
145
166
  const [value, setValue] = React.useState("");
146
167
  return (
147
168
  <Input
169
+ id="search"
170
+ name="search"
148
171
  type="search"
149
172
  placeholder={text("placeholder", "Please enter a value...")}
150
173
  value={value}
@@ -164,6 +187,8 @@ export const SmallSearchInput = () => {
164
187
 
165
188
  return (
166
189
  <Input
190
+ id="small-search"
191
+ name="small-search"
167
192
  type="search"
168
193
  size="small"
169
194
  placeholder={text("placeholder", "Please enter a value...")}
@@ -184,6 +209,8 @@ export const LargeSearchInput = () => {
184
209
 
185
210
  return (
186
211
  <Input
212
+ id="large-search"
213
+ name="large-search"
187
214
  type="search"
188
215
  size="large"
189
216
  placeholder={text("placeholder", "Please enter a value...")}
@@ -201,6 +228,8 @@ LargeSearchInput.story = {
201
228
 
202
229
  export const uncontrolledSearchInput = () => (
203
230
  <Input
231
+ id="uncontrolled-search"
232
+ name="uncontrolled-search"
204
233
  type="search"
205
234
  placeholder={text("placeholder", "Please enter a value...")}
206
235
  clearButtonLabel={text("clearButtonLabel", "Clear search")}
@@ -217,6 +246,8 @@ export const NonSearchClearButtonInput = () => {
217
246
 
218
247
  return (
219
248
  <Input
249
+ id="clear-button"
250
+ name="clear-button"
220
251
  type="text"
221
252
  placeholder={text("placeholder", "Please enter a value...")}
222
253
  value={value}
@@ -234,6 +265,8 @@ NonSearchClearButtonInput.story = {
234
265
 
235
266
  export const autofocus = () => (
236
267
  <Input
268
+ id="autofocus"
269
+ name="autofocus"
237
270
  autoFocus
238
271
  placeholder={text("placeholder", "Please enter a value...")}
239
272
  value={text("value", "")}
@@ -247,6 +280,8 @@ autofocus.story = {
247
280
 
248
281
  export const maxLength = () => (
249
282
  <Input
283
+ id="maxlength"
284
+ name="maxlength"
250
285
  autoFocus
251
286
  placeholder={text("placeholder", "Max Length is 10")}
252
287
  maxLength={10}
@@ -260,6 +295,8 @@ maxLength.story = {
260
295
 
261
296
  export const secondary = () => (
262
297
  <Input
298
+ id="secondary"
299
+ name="secondary"
263
300
  appearance="secondary"
264
301
  placeholder={text("placeholder", "Please enter a value...")}
265
302
  value={text("value", "")}
@@ -1,3 +1,4 @@
1
+ // @flow
1
2
  import React from "react";
2
3
  import "jest-styled-components";
3
4
  import { render, fireEvent, userEvent } from "../utils/react-testing-library";
@@ -1,3 +1,4 @@
1
+ // @flow
1
2
  import React from "react";
2
3
  import { text } from "@storybook/addon-knobs";
3
4
 
@@ -1,3 +1,4 @@
1
+ // @flow
1
2
  import React from "react";
2
3
  import { render } from "../utils/react-testing-library";
3
4
  import KeyboardKey from "./";
@@ -1,3 +1,4 @@
1
+ // @flow
1
2
  import React from "react";
2
3
  import { text } from "@storybook/addon-knobs";
3
4
 
@@ -8,7 +9,7 @@ export default {
8
9
  };
9
10
 
10
11
  export const defaultStory = () => (
11
- <Label>{text("children", "Example label")}</Label>
12
+ <Label htmlFor="default">{text("children", "Example label")}</Label>
12
13
  );
13
14
 
14
15
  defaultStory.story = {
@@ -1,3 +1,4 @@
1
+ // @flow
1
2
  import React from "react";
2
3
  import { render } from "../utils/react-testing-library";
3
4
  import Label from "./";
@@ -1,3 +1,4 @@
1
+ // @flow
1
2
  import React from "react";
2
3
  import { boolean, text } from "@storybook/addon-knobs";
3
4
  import { Box } from "../index";
@@ -1,3 +1,4 @@
1
+ // @flow
1
2
  import React from "react";
2
3
  import "jest-styled-components";
3
4
  import { render } from "../utils/react-testing-library";
@@ -1,6 +1,8 @@
1
+ // @flow
1
2
  import React from "react";
2
3
  import Listbox, { ListboxButton } from "./index";
3
4
  import { MenuButton } from "../Menu";
5
+ import type { TypeListboxButtonProps } from "../Menu/index.flow";
4
6
  import { useMultiselect, useSelect } from "../utils/hooks";
5
7
  import Icon from "../Icon";
6
8
  import Button from "../Button";
@@ -59,13 +61,14 @@ const BaseListbox = () => {
59
61
  );
60
62
  };
61
63
 
62
- const BaseListboxMultiselect = (props) => {
64
+ const BaseListboxMultiselect = (props: $Shape<TypeListboxButtonProps>) => {
63
65
  const { value, onChange, onClear } = useMultiselect();
64
66
  const currentOption =
65
67
  value.length > 1 ? value.length + " selected" : value.length ? value : null;
66
68
 
67
69
  return (
68
70
  <ListboxButton
71
+ {...props}
69
72
  minWidth="140px"
70
73
  content={
71
74
  <Listbox
@@ -86,7 +89,6 @@ const BaseListboxMultiselect = (props) => {
86
89
  )}
87
90
  </Listbox>
88
91
  }
89
- {...props}
90
92
  >
91
93
  {currentOption || "Select a fruit"}
92
94
  </ListboxButton>
@@ -198,18 +200,22 @@ export const BigVirtualizedExample = () => {
198
200
  };
199
201
 
200
202
  const ListboxFilterInput = () => {
201
- const { value, onChange } = useSelect({ initialValue: null });
202
- const { inputValue } = useSelect({ initialValue: null });
203
+ const { value, onChange } = useSelect();
203
204
  return (
204
205
  <>
205
- <Text>{inputValue}</Text>
206
+ <Text>{value}</Text>
206
207
  <ListboxButton
207
208
  minWidth="200px"
208
209
  aria-label="Favorite fruit"
209
210
  content={
210
211
  <Listbox onChange={onChange} value={value} width="200px">
211
212
  <Listbox.Group>
212
- <Listbox.FilterInput placeholder="Filter items" mb={300} />
213
+ <Listbox.FilterInput
214
+ id="list-filter"
215
+ name="list-filter"
216
+ placeholder="Filter items"
217
+ mb={300}
218
+ />
213
219
  <Listbox.Item value="Apple">Apple</Listbox.Item>
214
220
  <Listbox.Item value="Orange">Orange</Listbox.Item>
215
221
  <Listbox.Item value="Banana">Banana</Listbox.Item>
@@ -1,3 +1,4 @@
1
+ // @flow
1
2
  import React from "react";
2
3
  import {
3
4
  render,
@@ -2,7 +2,7 @@
2
2
  import * as React from "react";
3
3
  import Container, { Text } from "./styles";
4
4
 
5
- type TypeProps = {
5
+ export type TypeProps = {
6
6
  size: "small" | "large",
7
7
  /** Text for the loader. This text is not visible, but is used for accessibility purposed */
8
8
  text: string,
@@ -1,12 +1,13 @@
1
+ // @flow
1
2
  import React from "react";
2
- import Loader from "./";
3
+ import Loader, { type TypeProps } from "./";
3
4
 
4
5
  export default {
5
6
  title: "Loader",
6
7
  component: Loader,
7
8
  };
8
9
 
9
- export const defaultStory = (args) => <Loader {...args} />;
10
+ export const defaultStory = (args: TypeProps) => <Loader {...args} />;
10
11
 
11
12
  defaultStory.args = {
12
13
  text: "Content loading",
@@ -16,7 +17,7 @@ defaultStory.story = {
16
17
  name: "Default",
17
18
  };
18
19
 
19
- export const small = (args) => <Loader {...args} />;
20
+ export const small = (args: TypeProps) => <Loader {...args} />;
20
21
 
21
22
  small.args = {
22
23
  text: "Content loading",
@@ -27,7 +28,7 @@ small.story = {
27
28
  name: "Small",
28
29
  };
29
30
 
30
- export const noDelay = (args) => <Loader {...args} />;
31
+ export const noDelay = (args: TypeProps) => <Loader {...args} />;
31
32
 
32
33
  noDelay.args = {
33
34
  text: "Content loading",
@@ -1,3 +1,4 @@
1
+ // @flow
1
2
  import React from "react";
2
3
  import { render } from "../utils/react-testing-library";
3
4
  import "jest-styled-components";
@@ -14,7 +14,9 @@ type TypeLoaderButtonProps = TypeButtonProps & {
14
14
 
15
15
  const getColor = (appearance) => {
16
16
  switch (appearance) {
17
+ /** "default" is @deprecated in favour of unstyled */
17
18
  case "default":
19
+ case "unstyled":
18
20
  case "outline":
19
21
  case "secondary":
20
22
  return "dark";
@@ -44,7 +46,7 @@ const CustomLoader = styled(Loader)`
44
46
  `;
45
47
 
46
48
  export const LoaderButton = ({
47
- appearance = "default",
49
+ appearance = "unstyled",
48
50
  isLoading: _isLoading = false,
49
51
  disabled,
50
52
  loaderLabel,
@@ -1,3 +1,4 @@
1
+ // @flow
1
2
  import React from "react";
2
3
  import LoaderButton from "./index";
3
4
  import Box from "../Box";
@@ -1,3 +1,4 @@
1
+ // @flow
1
2
  import React from "react";
2
3
  import { render } from "../utils/react-testing-library";
3
4
  import "jest-styled-components";
@@ -1 +1 @@
1
- module.exports = {"bitly-dark":"0 0 140 64","bitly":"0 0 140 64","canva-dark":"0 0 140 140","canva":"0 0 140 140","dropbox-dark":"0 0 140 119","dropbox":"0 0 140 119","facebook-dark":"0 0 141 139","facebook-groups-dark":"0 0 140 140","facebook-groups":"0 0 140 140","facebook-shops-dark":"0 0 141 155","facebook-shops":"0 0 141 155","facebook":"0 0 141 139","feedly-dark":"0 0 141 123","feedly":"0 0 141 123","glassdoor-dark":"0 0 140 196","glassdoor":"0 0 140 196","google-analytics-dark":"0 0 140 160","google-analytics":"0 0 140 160","google-business-messages-dark":"0 0 140 140","google-business-messages":"0 0 140 140","google-drive-dark":"0 0 140 126","google-drive":"0 0 140 126","google-my-business-dark":"0 0 140 123","google-my-business":"0 0 140 123","hubspot-dark":"0 0 140 156","hubspot":"0 0 140 156","instagram-dark":"0 0 140 140","instagram":"0 0 140 140","linkedin-dark":"0 0 140 140","linkedin":"0 0 140 140","marketo-dark":"0 0 140 164","marketo":"0 0 140 164","messenger-dark":"0 0 140 141","messenger":"0 0 140 140","microsoft-dynamics-dark":"0 0 140 227","microsoft-dynamics":"0 0 140 227","pinterest-dark":"0 0 140 141","pinterest":"0 0 140 141","reddit-dark":"0 0 140 140","reddit":"0 0 140 140","salesforce-dark":"0 0 140 99","salesforce":"0 0 140 99","shopify-dark":"0 0 140 159","shopify":"0 0 140 159","slack-dark":"0 0 140 140","slack":"0 0 140 140","tiktok-dark":"0 0 140 159","tiktok":"0 0 140 159","tripadvisor-dark":"0 0 140 140","tripadvisor":"0 0 140 140","tumblr-dark":"0 0 140 140","tumblr":"0 0 140 140","twitter-audience-network-dark":"0 0 140 140","twitter-audience-network":"0 0 140 140","twitter-dark":"0 0 140 114","twitter":"0 0 140 114","whatsapp-dark":"0 0 140 140","whatsapp":"0 0 140 141","woocommerce-dark":"0 0 140 84","woocommerce":"0 0 140 84","yelp-dark":"0 0 140 159","yelp":"0 0 140 159","youtube-dark":"0 0 140 99","youtube":"0 0 140 99","zendesk-dark":"0 0 140 107","zendesk":"0 0 140 107"};
1
+ module.exports = {"bitly-dark":"0 0 140 64","bitly":"0 0 140 64","canva-dark":"0 0 140 140","canva":"0 0 140 140","dropbox-dark":"0 0 140 119","dropbox-lockup-dark":"0 0 291 57","dropbox-lockup":"0 0 291 57","dropbox-wordmark-dark":"0 0 308 71","dropbox-wordmark":"0 0 308 71","dropbox":"0 0 140 119","facebook-audience-network-dark":"0 0 140 145","facebook-audience-network":"0 0 140 145","facebook-dark":"0 0 141 139","facebook-groups-dark":"0 0 140 140","facebook-groups":"0 0 140 140","facebook-shops-dark":"0 0 141 155","facebook-shops":"0 0 141 155","facebook":"0 0 141 139","feedly-dark":"0 0 141 123","feedly":"0 0 141 123","glassdoor-dark":"0 0 140 196","glassdoor":"0 0 140 196","google-analytics-dark":"0 0 140 160","google-analytics":"0 0 140 160","google-business-messages-dark":"0 0 140 140","google-business-messages":"0 0 140 140","google-drive-dark":"0 0 140 126","google-drive":"0 0 140 126","google-my-business-dark":"0 0 140 123","google-my-business":"0 0 140 123","hubspot-dark":"0 0 140 156","hubspot":"0 0 140 156","instagram-dark":"0 0 140 140","instagram":"0 0 140 140","linkedin-audience-network-dark":"0 0 140 141","linkedin-audience-network":"0 0 140 141","linkedin-dark":"0 0 140 140","linkedin":"0 0 140 140","marketo-dark":"0 0 140 164","marketo":"0 0 140 164","messenger-dark":"0 0 140 141","messenger":"0 0 140 140","microsoft-dynamics-dark":"0 0 140 227","microsoft-dynamics":"0 0 140 227","pinterest-dark":"0 0 140 141","pinterest":"0 0 140 141","reddit-dark":"0 0 140 140","reddit":"0 0 140 140","salesforce-dark":"0 0 140 99","salesforce":"0 0 140 99","shopify-dark":"0 0 140 159","shopify":"0 0 140 159","slack-dark":"0 0 140 140","slack":"0 0 140 140","tiktok-dark":"0 0 140 159","tiktok":"0 0 140 159","tripadvisor-dark":"0 0 140 140","tripadvisor":"0 0 140 140","tumblr-dark":"0 0 140 140","tumblr":"0 0 140 140","twitter-audience-network-dark":"0 0 140 140","twitter-audience-network":"0 0 140 140","twitter-dark":"0 0 140 114","twitter":"0 0 140 114","whatsapp-dark":"0 0 140 140","whatsapp":"0 0 140 141","woocommerce-dark":"0 0 140 84","woocommerce":"0 0 140 84","yelp-dark":"0 0 140 159","yelp":"0 0 140 159","youtube-dark":"0 0 140 99","youtube":"0 0 140 99","zendesk-dark":"0 0 140 107","zendesk-lockup-dark":"0 0 160 115","zendesk-lockup":"0 0 160 115","zendesk-wordmark-dark":"0 0 350 67","zendesk-wordmark":"0 0 350 67","zendesk":"0 0 140 107"};
@@ -98,4 +98,6 @@ export type TypeListboxButtonProps = {
98
98
  size?: "large" | "default" | "small",
99
99
  content: React.Node,
100
100
  popoutProps?: $Shape<React.ElementConfig<typeof Popout>>,
101
+ "aria-label"?: string,
102
+ "aria-labelledby"?: string,
101
103
  };
@@ -1,5 +1,7 @@
1
+ // @flow
1
2
  import React, { useContext } from "react";
2
3
  import Menu, { MenuButton, MenuCheckbox } from "./index";
4
+ import type { TypeMenuProps } from "./index.flow";
3
5
  import { MenuButtonContext } from "./hooks";
4
6
  import OverflowList from "../OverflowList";
5
7
  import Icon from "../Icon";
@@ -33,16 +35,16 @@ const BaseContents = () => (
33
35
  </>
34
36
  );
35
37
 
36
- const BaseMenu = (props) => (
38
+ const BaseMenu = (props: TypeMenuProps) => (
37
39
  <Menu width="200px" {...props}>
38
40
  <BaseContents />
39
41
  </Menu>
40
42
  );
41
43
 
42
- const VirtualizedMenu = (props) => {
44
+ const VirtualizedMenu = (props: TypeMenuProps) => {
43
45
  return (
44
46
  <Menu width="200px" {...props}>
45
- <OverflowList height="200px">
47
+ <OverflowList height="200px" width="auto">
46
48
  <Menu.Group title="1">
47
49
  {fruit.map((item) => (
48
50
  <Menu.Item key={item} onClick={() => alert(item)}>
@@ -127,6 +129,7 @@ export const PropGetters = () => {
127
129
  <Menu.Group>
128
130
  <OverflowList
129
131
  height="400px"
132
+ width="auto"
130
133
  items={names}
131
134
  getItemProps={({ item }) => ({ key: item, item })}
132
135
  ItemComponent={({ item }) => (
@@ -152,7 +155,7 @@ const CloseOnClick = () => {
152
155
  return (
153
156
  <Menu.Item
154
157
  onClick={() => {
155
- closePopout();
158
+ closePopout && closePopout();
156
159
  }}
157
160
  >
158
161
  close the popout
@@ -180,7 +183,7 @@ export const OneItemCanCloseThePopout = () => {
180
183
  );
181
184
  };
182
185
 
183
- export const MenuWithCheckboxes = (props) => {
186
+ export const MenuWithCheckboxes = (props: TypeMenuProps) => {
184
187
  return (
185
188
  <Menu width="200px" {...props}>
186
189
  <Menu.Group title="Fruit" titleAs="h2">
@@ -206,7 +209,7 @@ export const MenuWithCheckboxes = (props) => {
206
209
  };
207
210
 
208
211
  // Specifically testing that icons with a color inverse when active like the text does.
209
- export const MenuWithIcons = (props) => {
212
+ export const MenuWithIcons = (props: TypeMenuProps) => {
210
213
  return (
211
214
  <Box
212
215
  width="200px"
@@ -234,7 +237,7 @@ export const MenuWithIcons = (props) => {
234
237
  );
235
238
  };
236
239
 
237
- export const MenuWithFilter = (props) => {
240
+ export const MenuWithFilter = (props: TypeMenuProps) => {
238
241
  return (
239
242
  <Box
240
243
  width="200px"
@@ -245,7 +248,12 @@ export const MenuWithFilter = (props) => {
245
248
  backgroundColor="container.background.base"
246
249
  >
247
250
  <Menu {...props}>
248
- <Menu.FilterInput placeholder="filter contents..." m={300} />
251
+ <Menu.FilterInput
252
+ id="menu-input"
253
+ name="menu-input"
254
+ placeholder="filter contents..."
255
+ m={300}
256
+ />
249
257
  <BaseContents />
250
258
  </Menu>
251
259
  </Box>
@@ -1,3 +1,4 @@
1
+ // @flow
1
2
  import React from "react";
2
3
  import {
3
4
  render,
@@ -8,13 +9,14 @@ import {
8
9
  import Icon from "../Icon";
9
10
 
10
11
  import Menu, { MenuButton } from "./index";
12
+ import type { TypeMenuProps } from "./index.flow";
11
13
  import { MENU_ITEM_ROLES } from "./constants";
12
14
 
13
15
  const fruit = ["Apple", "Banana", "Orange"];
14
16
  const maybeFruit = ["Tomato", "Cucumber", "Squash"];
15
17
  const mockOnClick = jest.fn();
16
18
 
17
- export const AsMenu = (props) => {
19
+ export const AsMenu = (props: TypeMenuProps) => {
18
20
  return (
19
21
  <Menu width="200px" {...props}>
20
22
  <Menu.Group title="Fruit">
@@ -1,5 +1,6 @@
1
+ // @flow
1
2
  import React from "react";
2
- import Message from "./index";
3
+ import Message, { type EnumDensities } from "./index";
3
4
  import Box from "../Box";
4
5
  import Icon from "../Icon";
5
6
  import { select } from "@storybook/addon-knobs";
@@ -14,6 +15,8 @@ export const defaultStory = ({
14
15
  ["condensed", "compact", "small", "large"],
15
16
  "condensed"
16
17
  ),
18
+ }: {
19
+ density?: EnumDensities,
17
20
  }) => (
18
21
  <Message density={density} bg="container.background.base">
19
22
  <Message.Header>
@@ -26,11 +29,16 @@ export const defaultStory = ({
26
29
  Attribution
27
30
  </Box>
28
31
  <Box>
29
- <Message.Checkbox />
32
+ <Message.Checkbox
33
+ id="message-checkbox"
34
+ ariaLabel="Message Checkbox"
35
+ onChange={() => {}}
36
+ />
30
37
  </Box>
31
38
  </Message.Header>
32
39
  <Message.Body>Message Content</Message.Body>
33
40
  <Message.Footer>
41
+ {/* $FlowIssue - Could not decide which case to select */}
34
42
  <Box>
35
43
  <Message.Button>
36
44
  <Icon name="comment-alt-outline" mr={200} />
@@ -38,16 +46,16 @@ export const defaultStory = ({
38
46
  </Message.Button>
39
47
  </Box>
40
48
  <Box>
41
- <Message.Button>
49
+ <Message.Button aria-label="Heart Icon Example">
42
50
  <Icon name="heart-outline" />
43
51
  </Message.Button>
44
- <Message.Button>
52
+ <Message.Button aria-label="Tag Icon Example">
45
53
  <Icon name="tag-outline" />
46
54
  </Message.Button>
47
- <Message.Button>
55
+ <Message.Button aria-label="Reply Icon Example">
48
56
  <Icon name="reply-outline" />
49
57
  </Message.Button>
50
- <Message.Button>
58
+ <Message.Button aria-label="Check Icon Example">
51
59
  <Icon name="circle-check-outline" />
52
60
  </Message.Button>
53
61
  </Box>
@@ -1,11 +1,11 @@
1
- import React from "react";
1
+ // @flow
2
2
  import { render } from "../utils/react-testing-library";
3
3
  import "jest-styled-components";
4
- import Message from "./";
4
+ import { defaultStory as defaultMessageStory } from "./index.stories";
5
5
 
6
6
  describe("Message", () => {
7
7
  it("should render properly", async () => {
8
- const { container, runA11yCheck } = render(<Message />);
8
+ const { container, runA11yCheck } = render(defaultMessageStory({}));
9
9
  expect(container).toBeTruthy();
10
10
  await runA11yCheck();
11
11
  });
@@ -1,3 +1,4 @@
1
+ // @flow
1
2
  import React from "react";
2
3
  import Component from "@reach/component-component";
3
4
  import Modal from "./";
@@ -1,3 +1,4 @@
1
+ // @flow
1
2
  import "jest-styled-components";
2
3
  import React from "react";
3
4
  import { render, fireEvent, cleanup } from "../utils/react-testing-library";
@@ -15,7 +15,7 @@ import { EM_DASH } from "../utils/constants";
15
15
 
16
16
  type EnumNumeralFormat = "decimal" | "currency" | "percent";
17
17
 
18
- type TypeProps = {
18
+ export type TypeProps = {
19
19
  /** The number to be formatted */
20
20
  number?: ?number,
21
21
  /** Locale to format. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument */
@@ -1,5 +1,6 @@
1
+ // @flow
1
2
  import React from "react";
2
- import Numeral from "./index";
3
+ import Numeral, { type TypeProps } from "./index";
3
4
 
4
5
  const localeOptions = [
5
6
  "United States (en-US)",
@@ -120,13 +121,13 @@ export default {
120
121
  },
121
122
  };
122
123
 
123
- export const defaultStory = (args) => <Numeral {...args} />;
124
+ export const defaultStory = (args: TypeProps) => <Numeral {...args} />;
124
125
 
125
126
  defaultStory.story = {
126
127
  name: "Default",
127
128
  };
128
129
 
129
- export const total = (args) => <Numeral {...args} />;
130
+ export const total = (args: TypeProps) => <Numeral {...args} />;
130
131
 
131
132
  total.args = {
132
133
  number: 100,
@@ -138,7 +139,7 @@ total.story = {
138
139
  name: "Total",
139
140
  };
140
141
 
141
- export const trend = (args) => <Numeral {...args} />;
142
+ export const trend = (args: TypeProps) => <Numeral {...args} />;
142
143
 
143
144
  trend.args = {
144
145
  number: 100,
@@ -149,7 +150,7 @@ trend.story = {
149
150
  name: "Trend",
150
151
  };
151
152
 
152
- export const noPrecision = (args) => <Numeral {...args} />;
153
+ export const noPrecision = (args: TypeProps) => <Numeral {...args} />;
153
154
 
154
155
  noPrecision.args = {
155
156
  number: 123.45678,
@@ -160,7 +161,7 @@ noPrecision.story = {
160
161
  name: "No Precision",
161
162
  };
162
163
 
163
- export const currencyPrecision = (args) => <Numeral {...args} />;
164
+ export const currencyPrecision = (args: TypeProps) => <Numeral {...args} />;
164
165
 
165
166
  currencyPrecision.args = {
166
167
  number: 123.4,
@@ -171,7 +172,7 @@ currencyPrecision.story = {
171
172
  name: "Currency precision",
172
173
  };
173
174
 
174
- export const invalid = (args) => <Numeral {...args} />;
175
+ export const invalid = (args: TypeProps) => <Numeral {...args} />;
175
176
 
176
177
  invalid.args = {
177
178
  number: null,
@@ -15,8 +15,8 @@ export type TypeOverflowListProps<Item, Props> = {|
15
15
  width: string,
16
16
  items?: Array<Item>,
17
17
  children?: React.Node,
18
- ItemComponent: React.ComponentType<Props>,
19
- getItemProps: (Item) => Props,
18
+ ItemComponent?: React.ComponentType<Props>,
19
+ getItemProps?: (Item) => Props,
20
20
  itemWrapperProps?: TypeContainerProps,
21
21
  containerProps?: TypeContainerProps,
22
22
  |};