@sproutsocial/racine 11.3.1-beta-deps.3 → 11.4.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 (197) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/__flow__/Button/__snapshots__/index.test.js.snap +511 -0
  3. package/__flow__/Button/index.js +0 -2
  4. package/__flow__/Button/index.stories.js +67 -51
  5. package/__flow__/Button/index.test.js +113 -0
  6. package/__flow__/Button/styles.js +1 -1
  7. package/__flow__/EmptyState/index.test.js +1 -1
  8. package/__flow__/Input/index.js +185 -66
  9. package/__flow__/Input/index.stories.js +65 -0
  10. package/__flow__/Input/index.test.js +230 -1
  11. package/__flow__/Input/styles.js +1 -1
  12. package/__flow__/Link/index.js +2 -1
  13. package/__flow__/Menu/__snapshots__/index.test.js.snap +2 -2
  14. package/__flow__/TokenInput/index.js +1 -1
  15. package/__flow__/setupTests.js +1 -1
  16. package/__flow__/systemProps/tests/__snapshots__/layout.test.js.snap +14 -0
  17. package/__flow__/systemProps/tests/layout.test.js +9 -0
  18. package/__flow__/themes/dark/theme.js +3 -0
  19. package/__flow__/themes/light/theme.js +3 -0
  20. package/__flow__/types/theme.colors.flow.js +3 -0
  21. package/commonjs/Avatar/index.js +4 -7
  22. package/commonjs/Badge/index.js +1 -3
  23. package/commonjs/Badge/styles.js +1 -1
  24. package/commonjs/Banner/index.js +1 -3
  25. package/commonjs/Banner/styles.js +1 -1
  26. package/commonjs/Box/styles.js +1 -1
  27. package/commonjs/Breadcrumb/index.js +2 -5
  28. package/commonjs/Button/index.js +1 -4
  29. package/commonjs/Button/styles.js +0 -1
  30. package/commonjs/Card/index.js +1 -3
  31. package/commonjs/Card/styles.js +3 -3
  32. package/commonjs/CharacterCounter/index.js +1 -3
  33. package/commonjs/CharacterCounter/styles.js +1 -1
  34. package/commonjs/ChartLegend/index.js +1 -3
  35. package/commonjs/ChartLegend/styles.js +3 -3
  36. package/commonjs/Checkbox/index.js +1 -3
  37. package/commonjs/Checkbox/styles.js +1 -1
  38. package/commonjs/Collapsible/index.js +2 -5
  39. package/commonjs/DatePicker/DateRangePicker.js +1 -3
  40. package/commonjs/DatePicker/SingleDatePicker.js +1 -3
  41. package/commonjs/DatePicker/StatefulDateRangePicker.js +1 -3
  42. package/commonjs/DatePicker/StatefulSingleDatePicker.js +1 -3
  43. package/commonjs/DatePicker/common.js +1 -1
  44. package/commonjs/DatePicker/styles.js +1 -1
  45. package/commonjs/Drawer/SlideTransition.js +1 -3
  46. package/commonjs/Drawer/index.js +4 -9
  47. package/commonjs/Drawer/styles.js +2 -2
  48. package/commonjs/EmptyState/index.js +1 -3
  49. package/commonjs/Fieldset/index.js +3 -7
  50. package/commonjs/FormField/index.js +1 -3
  51. package/commonjs/Icon/index.js +2 -5
  52. package/commonjs/Icon/styles.js +1 -1
  53. package/commonjs/Image/index.js +1 -3
  54. package/commonjs/Image/styles.js +1 -1
  55. package/commonjs/Indicator/index.js +1 -3
  56. package/commonjs/Input/index.js +123 -31
  57. package/commonjs/Input/styles.js +3 -3
  58. package/commonjs/KeyboardKey/index.js +1 -3
  59. package/commonjs/Label/index.js +2 -4
  60. package/commonjs/Link/index.js +1 -3
  61. package/commonjs/Link/styles.js +1 -1
  62. package/commonjs/Listbox/index.js +4 -7
  63. package/commonjs/Loader/index.js +1 -3
  64. package/commonjs/Loader/styles.js +2 -2
  65. package/commonjs/LoaderButton/index.js +1 -3
  66. package/commonjs/Menu/constants.js +1 -1
  67. package/commonjs/Menu/descendants.js +7 -10
  68. package/commonjs/Menu/hooks.js +1 -1
  69. package/commonjs/Menu/index.js +6 -12
  70. package/commonjs/Menu/styles.js +2 -2
  71. package/commonjs/Message/index.js +1 -3
  72. package/commonjs/Message/styles.js +1 -1
  73. package/commonjs/Modal/index.js +3 -7
  74. package/commonjs/Modal/styles.js +2 -4
  75. package/commonjs/Numeral/constants.js +1 -1
  76. package/commonjs/Numeral/index.js +1 -3
  77. package/commonjs/Numeral/styles.js +3 -3
  78. package/commonjs/OverflowList/styles.js +1 -1
  79. package/commonjs/Popout/index.js +3 -7
  80. package/commonjs/Popout/styles.js +1 -1
  81. package/commonjs/Radio/index.js +1 -3
  82. package/commonjs/Radio/styles.js +4 -4
  83. package/commonjs/SegmentedControl/index.js +2 -5
  84. package/commonjs/Select/index.js +1 -3
  85. package/commonjs/Stack/index.js +1 -3
  86. package/commonjs/Switch/index.js +1 -3
  87. package/commonjs/Switch/styles.js +1 -1
  88. package/commonjs/Table/index.js +5 -10
  89. package/commonjs/TableCell/index.js +1 -3
  90. package/commonjs/TableHeaderCell/index.js +1 -3
  91. package/commonjs/TableRowAccordion/index.js +1 -3
  92. package/commonjs/Tabs/index.js +2 -5
  93. package/commonjs/Tabs/styles.js +4 -4
  94. package/commonjs/Text/index.js +1 -3
  95. package/commonjs/Text/styles.js +1 -1
  96. package/commonjs/Textarea/index.js +1 -3
  97. package/commonjs/Toast/index.js +1 -1
  98. package/commonjs/Toast/styles.js +2 -2
  99. package/commonjs/ToggleHint/index.js +1 -3
  100. package/commonjs/Token/index.js +1 -3
  101. package/commonjs/Token/styles.js +1 -1
  102. package/commonjs/TokenInput/index.js +2 -4
  103. package/commonjs/Tooltip/index.js +2 -5
  104. package/commonjs/Tooltip/styles.js +1 -1
  105. package/commonjs/VisuallyHidden/index.js +1 -1
  106. package/commonjs/index.js +1 -1
  107. package/commonjs/themes/dark/decorative-palettes.js +1 -1
  108. package/commonjs/themes/dark/theme.js +5 -2
  109. package/commonjs/themes/light/decorative-palettes.js +1 -1
  110. package/commonjs/themes/light/theme.js +5 -2
  111. package/commonjs/utils/hooks.js +2 -3
  112. package/commonjs/utils/mixins.js +1 -1
  113. package/commonjs/utils/system-props.js +1 -1
  114. package/dist/themes/dark/dark.scss +9 -6
  115. package/dist/themes/light/light.scss +99 -96
  116. package/lib/Avatar/index.js +4 -7
  117. package/lib/Badge/index.js +1 -3
  118. package/lib/Badge/styles.js +1 -1
  119. package/lib/Banner/index.js +1 -3
  120. package/lib/Banner/styles.js +1 -1
  121. package/lib/Box/styles.js +1 -1
  122. package/lib/Breadcrumb/index.js +2 -5
  123. package/lib/Button/index.js +1 -4
  124. package/lib/Button/styles.js +0 -1
  125. package/lib/Card/index.js +1 -3
  126. package/lib/Card/styles.js +2 -2
  127. package/lib/CharacterCounter/index.js +1 -3
  128. package/lib/CharacterCounter/styles.js +1 -1
  129. package/lib/ChartLegend/index.js +1 -3
  130. package/lib/ChartLegend/styles.js +3 -3
  131. package/lib/Checkbox/index.js +1 -3
  132. package/lib/Collapsible/index.js +2 -5
  133. package/lib/DatePicker/DateRangePicker.js +1 -3
  134. package/lib/DatePicker/SingleDatePicker.js +1 -3
  135. package/lib/DatePicker/StatefulDateRangePicker.js +1 -3
  136. package/lib/DatePicker/StatefulSingleDatePicker.js +1 -3
  137. package/lib/DatePicker/styles.js +1 -1
  138. package/lib/Drawer/SlideTransition.js +1 -3
  139. package/lib/Drawer/index.js +4 -9
  140. package/lib/Drawer/styles.js +2 -2
  141. package/lib/EmptyState/index.js +1 -3
  142. package/lib/Fieldset/index.js +3 -7
  143. package/lib/FormField/index.js +1 -3
  144. package/lib/Icon/index.js +2 -5
  145. package/lib/Icon/styles.js +1 -1
  146. package/lib/Image/index.js +1 -3
  147. package/lib/Image/styles.js +1 -1
  148. package/lib/Indicator/index.js +1 -3
  149. package/lib/Input/index.js +117 -32
  150. package/lib/Input/styles.js +3 -3
  151. package/lib/KeyboardKey/index.js +1 -3
  152. package/lib/Label/index.js +2 -4
  153. package/lib/Link/index.js +1 -3
  154. package/lib/Link/styles.js +1 -1
  155. package/lib/Listbox/index.js +3 -6
  156. package/lib/Loader/index.js +1 -3
  157. package/lib/Loader/styles.js +2 -2
  158. package/lib/LoaderButton/index.js +1 -3
  159. package/lib/Menu/descendants.js +2 -5
  160. package/lib/Menu/index.js +5 -10
  161. package/lib/Menu/styles.js +2 -2
  162. package/lib/Message/index.js +1 -3
  163. package/lib/Modal/index.js +3 -7
  164. package/lib/Modal/styles.js +1 -3
  165. package/lib/Numeral/index.js +1 -3
  166. package/lib/Numeral/styles.js +2 -2
  167. package/lib/OverflowList/styles.js +1 -1
  168. package/lib/Popout/index.js +3 -7
  169. package/lib/Popout/styles.js +1 -1
  170. package/lib/Radio/index.js +1 -3
  171. package/lib/Radio/styles.js +4 -4
  172. package/lib/SegmentedControl/index.js +2 -5
  173. package/lib/Select/index.js +1 -3
  174. package/lib/Stack/index.js +1 -3
  175. package/lib/Switch/index.js +1 -3
  176. package/lib/Switch/styles.js +1 -1
  177. package/lib/Table/index.js +4 -9
  178. package/lib/TableCell/index.js +1 -3
  179. package/lib/TableHeaderCell/index.js +1 -3
  180. package/lib/TableRowAccordion/index.js +1 -3
  181. package/lib/Tabs/index.js +2 -5
  182. package/lib/Tabs/styles.js +3 -3
  183. package/lib/Text/index.js +1 -3
  184. package/lib/Text/styles.js +1 -1
  185. package/lib/Textarea/index.js +1 -3
  186. package/lib/Toast/styles.js +2 -2
  187. package/lib/ToggleHint/index.js +1 -3
  188. package/lib/Token/index.js +1 -3
  189. package/lib/Token/styles.js +1 -1
  190. package/lib/TokenInput/index.js +2 -4
  191. package/lib/Tooltip/index.js +2 -5
  192. package/lib/Tooltip/styles.js +1 -1
  193. package/lib/VisuallyHidden/index.js +1 -1
  194. package/lib/themes/dark/theme.js +4 -1
  195. package/lib/themes/light/theme.js +4 -1
  196. package/package.json +20 -24
  197. package/bin/buildNpm.js +0 -58
@@ -141,6 +141,71 @@ leftAndRightIcons.story = {
141
141
  name: "Left and right icons",
142
142
  };
143
143
 
144
+ export const searchInput = () => (
145
+ <Input
146
+ type="search"
147
+ placeholder={text("placeholder", "Please enter a value...")}
148
+ value={text("value", "val")}
149
+ onClear={() => window.alert("Cleared!")}
150
+ clearButtonLabel={text("clearButtonLabel", "Clear search")}
151
+ ariaLabel={text("ariaLabel", "Descriptive label goes here")}
152
+ />
153
+ );
154
+
155
+ searchInput.story = {
156
+ name: "Search Input",
157
+ };
158
+
159
+ export const smallSearchInput = () => (
160
+ <Input
161
+ type="search"
162
+ size="small"
163
+ placeholder={text("placeholder", "Please enter a value...")}
164
+ value={text("value", "val")}
165
+ onClear={() => window.alert("Cleared!")}
166
+ clearButtonLabel={text("clearButtonLabel", "Clear search")}
167
+ ariaLabel={text("ariaLabel", "Descriptive label goes here")}
168
+ />
169
+ );
170
+
171
+ smallSearchInput.story = {
172
+ name: "Small Search Input",
173
+ };
174
+
175
+ export const largeSearchInput = () => (
176
+ <Input
177
+ type="search"
178
+ size="large"
179
+ placeholder={text("placeholder", "Please enter a value...")}
180
+ value={text("value", "val")}
181
+ onClear={() => window.alert("Cleared!")}
182
+ clearButtonLabel={text("clearButtonLabel", "Clear search")}
183
+ ariaLabel={text("ariaLabel", "Descriptive label goes here")}
184
+ />
185
+ );
186
+
187
+ largeSearchInput.story = {
188
+ name: "Large Search Input",
189
+ };
190
+
191
+ export const nonSearchClearButtonInput = () => {
192
+ return (
193
+ <Input
194
+ type="text"
195
+ placeholder={text("placeholder", "Please enter a value...")}
196
+ value={text("value", "val")}
197
+ onClear={() => window.alert("Cleared!")}
198
+ ariaLabel={text("ariaLabel", "Descriptive label goes here")}
199
+ clearButtonLabel={text("clearButtonLabel", "Clear text")}
200
+ elemAfter={<Input.ClearButton />}
201
+ />
202
+ );
203
+ };
204
+
205
+ nonSearchClearButtonInput.story = {
206
+ name: "Manual Input.ClearButton usage",
207
+ };
208
+
144
209
  export const autofocus = () => (
145
210
  <Input
146
211
  autoFocus
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import "jest-styled-components";
3
- import { render, fireEvent } from "../utils/react-testing-library";
3
+ import { render, fireEvent, userEvent } from "../utils/react-testing-library";
4
4
  import Input from "./";
5
5
  import Text from "../Text";
6
6
 
@@ -69,6 +69,235 @@ describe("Input", () => {
69
69
  expect(getByText("After")).toBeTruthy();
70
70
  });
71
71
 
72
+ describe("Input.ClearButton", () => {
73
+ describe("Input type=search", () => {
74
+ it("should render a clear button for search Inputs", () => {
75
+ const { getByRole } = render(
76
+ <Input
77
+ id="name"
78
+ name="name"
79
+ value="mic"
80
+ type="search"
81
+ onClear={jest.fn()}
82
+ clearButtonLabel="Clear search"
83
+ />
84
+ );
85
+ expect(getByRole("button")).toBeTruthy();
86
+ });
87
+
88
+ it("should not render a clear button for search Inputs if there is no text", () => {
89
+ const { queryByRole } = render(
90
+ <Input
91
+ id="name"
92
+ name="name"
93
+ value=""
94
+ type="search"
95
+ onClear={jest.fn()}
96
+ clearButtonLabel="Clear search"
97
+ />
98
+ );
99
+ expect(queryByRole("button")).toBeFalsy();
100
+ });
101
+
102
+ it("should not override an elemAfter prop if passed", () => {
103
+ const { getByText, queryByTitle } = render(
104
+ <Input
105
+ id="name"
106
+ name="name"
107
+ value="mic"
108
+ type="search"
109
+ onClear={jest.fn()}
110
+ elemAfter={<Text>After</Text>}
111
+ />
112
+ );
113
+ expect(getByText("After")).toBeTruthy();
114
+ expect(queryByTitle("Clear")).not.toBeInTheDocument();
115
+ });
116
+
117
+ it("should use the fallback title if clearButtonLabel is not provided", () => {
118
+ const { getByTitle } = render(
119
+ <Input
120
+ id="name"
121
+ name="name"
122
+ value="mic"
123
+ type="search"
124
+ onClear={jest.fn()}
125
+ />
126
+ );
127
+ expect(getByTitle("Clear")).toBeTruthy();
128
+ });
129
+
130
+ it("should call onClear when clicked", () => {
131
+ const mockOnClear = jest.fn();
132
+ const { getByRole } = render(
133
+ <Input
134
+ id="name"
135
+ name="name"
136
+ value="mic"
137
+ type="search"
138
+ onClear={mockOnClear}
139
+ clearButtonLabel="Clear search"
140
+ />
141
+ );
142
+ fireEvent.click(getByRole("button"));
143
+ expect(mockOnClear).toHaveBeenCalled();
144
+ });
145
+
146
+ it("should allow keyboard access to and Space key triggering of the clear button", () => {
147
+ const mockOnClear = jest.fn();
148
+ const { getByRole } = render(
149
+ <Input
150
+ id="name"
151
+ name="name"
152
+ value="mic"
153
+ type="search"
154
+ onClear={mockOnClear}
155
+ clearButtonLabel="Clear search"
156
+ />
157
+ );
158
+ const input = getByRole("searchbox");
159
+ const button = getByRole("button");
160
+ userEvent.tab();
161
+ expect(input).toHaveFocus();
162
+ userEvent.tab();
163
+ expect(button).toHaveFocus();
164
+ userEvent.keyboard("{space}");
165
+ expect(mockOnClear).toHaveBeenCalled();
166
+ });
167
+
168
+ it("should allow keyboard access to and Enter key triggering of the clear button", () => {
169
+ const mockOnClear = jest.fn();
170
+ const { getByRole } = render(
171
+ <Input
172
+ id="name"
173
+ name="name"
174
+ value="mic"
175
+ type="search"
176
+ onClear={mockOnClear}
177
+ clearButtonLabel="Clear search"
178
+ />
179
+ );
180
+ const input = getByRole("searchbox");
181
+ const button = getByRole("button");
182
+ userEvent.tab();
183
+ expect(input).toHaveFocus();
184
+ userEvent.tab();
185
+ expect(button).toHaveFocus();
186
+ userEvent.keyboard("{enter}");
187
+ expect(mockOnClear).toHaveBeenCalled();
188
+ });
189
+ });
190
+
191
+ describe("Manual Input.ClearButton usage", () => {
192
+ it("should render a clear button when passed with elemAfter", () => {
193
+ const { getByRole } = render(
194
+ <Input
195
+ id="name"
196
+ name="name"
197
+ value="mic"
198
+ type="text"
199
+ elemAfter={<Input.ClearButton />}
200
+ onClear={jest.fn()}
201
+ clearButtonLabel="Clear search"
202
+ />
203
+ );
204
+ expect(getByRole("button")).toBeTruthy();
205
+ });
206
+
207
+ it("should not render a clear button if there is no text", () => {
208
+ const { queryByRole } = render(
209
+ <Input
210
+ id="name"
211
+ name="name"
212
+ value=""
213
+ type="text"
214
+ elemAfter={<Input.ClearButton />}
215
+ onClear={jest.fn()}
216
+ clearButtonLabel="Clear search"
217
+ />
218
+ );
219
+ expect(queryByRole("button")).toBeFalsy();
220
+ });
221
+
222
+ it("should use the fallback title if clearButtonLabel is not provided", () => {
223
+ const { getByTitle } = render(
224
+ <Input
225
+ id="name"
226
+ name="name"
227
+ value="mic"
228
+ type="text"
229
+ elemAfter={<Input.ClearButton />}
230
+ onClear={jest.fn()}
231
+ />
232
+ );
233
+ expect(getByTitle("Clear")).toBeTruthy();
234
+ });
235
+
236
+ it("should call onClear when Input.ClearButton is clicked", () => {
237
+ const mockOnClear = jest.fn();
238
+ const { getByRole } = render(
239
+ <Input
240
+ id="name"
241
+ name="name"
242
+ value="mic"
243
+ type="text"
244
+ elemAfter={<Input.ClearButton />}
245
+ onClear={mockOnClear}
246
+ clearButtonLabel="Clear search"
247
+ />
248
+ );
249
+ fireEvent.click(getByRole("button"));
250
+ expect(mockOnClear).toHaveBeenCalled();
251
+ });
252
+
253
+ it("should allow keyboard access to and Space key triggering of the clear button", () => {
254
+ const mockOnClear = jest.fn();
255
+ const { getByRole } = render(
256
+ <Input
257
+ id="name"
258
+ name="name"
259
+ value="mic"
260
+ type="text"
261
+ elemAfter={<Input.ClearButton />}
262
+ onClear={mockOnClear}
263
+ clearButtonLabel="Clear search"
264
+ />
265
+ );
266
+ const input = getByRole("textbox");
267
+ const button = getByRole("button");
268
+ userEvent.tab();
269
+ expect(input).toHaveFocus();
270
+ userEvent.tab();
271
+ expect(button).toHaveFocus();
272
+ userEvent.keyboard("{space}");
273
+ expect(mockOnClear).toHaveBeenCalled();
274
+ });
275
+
276
+ it("should allow keyboard access to and Enter key triggering of the clear button", () => {
277
+ const mockOnClear = jest.fn();
278
+ const { getByRole } = render(
279
+ <Input
280
+ id="name"
281
+ name="name"
282
+ value="mic"
283
+ type="text"
284
+ elemAfter={<Input.ClearButton />}
285
+ onClear={mockOnClear}
286
+ clearButtonLabel="Clear search"
287
+ />
288
+ );
289
+ const input = getByRole("textbox");
290
+ const button = getByRole("button");
291
+ userEvent.tab();
292
+ expect(input).toHaveFocus();
293
+ userEvent.tab();
294
+ expect(button).toHaveFocus();
295
+ userEvent.keyboard("{enter}");
296
+ expect(mockOnClear).toHaveBeenCalled();
297
+ });
298
+ });
299
+ });
300
+
72
301
  describe("autoComplete prop", () => {
73
302
  it("should not have autoComplete attribute when passed prop is not passed", () => {
74
303
  const { getByDataQaLabel } = render(<Input id="name" name="name" />);
@@ -140,7 +140,7 @@ export const Accessory: StyledComponent<any, TypeTheme, *> = styled.div`
140
140
  ${(props) =>
141
141
  props.after &&
142
142
  css`
143
- right: ${props.theme.space[350]};
143
+ right: ${props.isClearButton ? 0 : props.theme.space[350]};
144
144
  `};
145
145
  `;
146
146
 
@@ -8,10 +8,11 @@ type TypeProps = {
8
8
  /** Optional prop to make the URL open in a new tab */
9
9
  external?: boolean,
10
10
  children: React.Node,
11
+ /** Setting this prop will cause the component to be rendered as a link */
11
12
  href?: string,
12
13
  /** Disables user action and applies a disabled style to the component */
13
14
  disabled?: boolean,
14
- /** Setting this prop will cause the component to be rendered as a button instead of an anchor) */
15
+ /** Can be used in addition to an href but still renders as a link. Omitting href will render as button */
15
16
  onClick?: (e: SyntheticEvent<HTMLButtonElement>) => void,
16
17
  as?: $PropertyType<TypeStyledComponentsCommonProps, "as">,
17
18
  underline?: boolean,
@@ -14,12 +14,12 @@ exports[`Menu AsMenuButton should match snapshot 1`] = `
14
14
  fill: currentColor;
15
15
  }
16
16
 
17
- _:-ms-fullscreen .c2,
17
+ _:-ms-fullscreen .c3,
18
18
  html .c3 {
19
19
  width: 16px;
20
20
  }
21
21
 
22
- .pdf-page .c2 {
22
+ .pdf-page .c3 {
23
23
  width: 16px;
24
24
  }
25
25
 
@@ -341,7 +341,7 @@ export default class TokenInput extends React.Component<TypeProps, TypeState> {
341
341
  aria-invalid={!!isInvalid}
342
342
  aria-label={ariaLabel}
343
343
  autoFocus={autoFocus}
344
- autocomplete={autocomplete}
344
+ autoComplete={autocomplete}
345
345
  disabled={disabled}
346
346
  id={id}
347
347
  name={name}
@@ -1,5 +1,5 @@
1
1
  import "mutationobserver-shim";
2
- import "@testing-library/jest-dom/extend-expect";
2
+ import "jest-dom/extend-expect";
3
3
  import "jest-axe/extend-expect";
4
4
  import "babel-polyfill";
5
5
  import "jest-styled-components";
@@ -1,5 +1,19 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
+ exports[`layout system props display 1`] = `
4
+ .c0 {
5
+ display: -webkit-string;
6
+ display: string;
7
+ }
8
+
9
+ <div>
10
+ <div
11
+ class="c0"
12
+ display="string"
13
+ />
14
+ </div>
15
+ `;
16
+
3
17
  exports[`layout system props height 1`] = `
4
18
  .c0 {
5
19
  height: string;
@@ -10,6 +10,15 @@ describe("layout system props", () => {
10
10
  ${layoutSystemProps}
11
11
  `;
12
12
 
13
+ test("display", () => {
14
+ const { container } = render(
15
+ <>
16
+ <Component display="string" />
17
+ </>
18
+ );
19
+ expect(container).toMatchSnapshot();
20
+ });
21
+
13
22
  test("height", () => {
14
23
  const { container } = render(
15
24
  <>
@@ -174,6 +174,9 @@ const colors = {
174
174
  body: COLORS.COLOR_NEUTRAL_100,
175
175
  inverse: COLORS.COLOR_NEUTRAL_900,
176
176
  error: COLORS.COLOR_RED_400,
177
+ background: {
178
+ highlight: COLORS.COLOR_YELLOW_900,
179
+ },
177
180
  },
178
181
  icon: {
179
182
  base: COLORS.COLOR_NEUTRAL_100,
@@ -171,6 +171,9 @@ const colors = {
171
171
  body: COLORS.COLOR_NEUTRAL_800,
172
172
  inverse: COLORS.COLOR_NEUTRAL_0,
173
173
  error: COLORS.COLOR_RED_800,
174
+ background: {
175
+ highlight: COLORS.COLOR_YELLOW_200,
176
+ },
174
177
  },
175
178
  icon: {
176
179
  base: COLORS.COLOR_NEUTRAL_800,
@@ -158,6 +158,9 @@ type TypeTextColors = {|
158
158
  body: string,
159
159
  inverse: string,
160
160
  error: string,
161
+ background: {
162
+ highlight: string,
163
+ },
161
164
  },
162
165
  |};
163
166
 
@@ -15,9 +15,6 @@ var _Image = _interopRequireDefault(require("../Image"));
15
15
 
16
16
  var _Text = _interopRequireDefault(require("../Text"));
17
17
 
18
- var _excluded = ["fontSize"],
19
- _excluded2 = ["appearance", "name", "src", "variant", "type", "size", "bg", "color"];
20
-
21
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
19
 
23
20
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -30,12 +27,12 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
30
27
 
31
28
  var AvatarText = (0, _styledComponents.default)(function (_ref) {
32
29
  var fontSize = _ref.fontSize,
33
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
30
+ rest = _objectWithoutPropertiesLoose(_ref, ["fontSize"]);
34
31
 
35
32
  return /*#__PURE__*/React.createElement(_Text.default, rest);
36
33
  }).withConfig({
37
34
  displayName: "Avatar__AvatarText",
38
- componentId: "sc-yx873f-0"
35
+ componentId: "yx873f-0"
39
36
  })(["font-size:", "px;color:", "px;"], function (props) {
40
37
  return props.fontSize;
41
38
  }, function (props) {
@@ -43,7 +40,7 @@ var AvatarText = (0, _styledComponents.default)(function (_ref) {
43
40
  });
44
41
  var Container = (0, _styledComponents.default)(_Box.default).withConfig({
45
42
  displayName: "Avatar__Container",
46
- componentId: "sc-yx873f-1"
43
+ componentId: "yx873f-1"
47
44
  })(["", ""], function (_ref2) {
48
45
  var theme = _ref2.theme,
49
46
  type = _ref2.type,
@@ -78,7 +75,7 @@ var Avatar = function Avatar(_ref3) {
78
75
  size = _ref3$size === void 0 ? "40px" : _ref3$size,
79
76
  bg = _ref3.bg,
80
77
  color = _ref3.color,
81
- rest = _objectWithoutPropertiesLoose(_ref3, _excluded2);
78
+ rest = _objectWithoutPropertiesLoose(_ref3, ["appearance", "name", "src", "variant", "type", "size", "bg", "color"]);
82
79
 
83
80
  var _useState = (0, React.useState)(false),
84
81
  imageFailedLoading = _useState[0],
@@ -11,8 +11,6 @@ var _styles = _interopRequireDefault(require("./styles"));
11
11
 
12
12
  var _Box = _interopRequireDefault(require("../Box"));
13
13
 
14
- var _excluded = ["children", "text", "iconName", "type", "tip", "size", "badgeColor"];
15
-
16
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
15
 
18
16
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -33,7 +31,7 @@ var Badge = function Badge(_ref) {
33
31
  size = _ref$size === void 0 ? "small" : _ref$size,
34
32
  _ref$badgeColor = _ref.badgeColor,
35
33
  badgeColor = _ref$badgeColor === void 0 ? "blue" : _ref$badgeColor,
36
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
34
+ rest = _objectWithoutPropertiesLoose(_ref, ["children", "text", "iconName", "type", "tip", "size", "badgeColor"]);
37
35
 
38
36
  if (children && text) {
39
37
  throw new Error("can't use both `children` and `text` props. Text is deprecated, consider using children.");
@@ -16,7 +16,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
16
16
  // eslint-disable-next-line prettier/prettier
17
17
  var Container = _styledComponents.default.span.withConfig({
18
18
  displayName: "styles__Container",
19
- componentId: "sc-g1g76b-0"
19
+ componentId: "g1g76b-0"
20
20
  })(["font-family:", ";", ";border-radius:9999px;line-height:16px;display:inline-block;color:", ";background:", ";padding:", ";", ";"], function (p) {
21
21
  return p.theme.fontFamily;
22
22
  }, function (p) {
@@ -11,8 +11,6 @@ var _styles = _interopRequireDefault(require("./styles"));
11
11
 
12
12
  var _Box = _interopRequireDefault(require("../Box"));
13
13
 
14
- var _excluded = ["type", "text"];
15
-
16
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
15
 
18
16
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -83,7 +81,7 @@ var Banner = /*#__PURE__*/function (_React$Component) {
83
81
  var _this$props = this.props,
84
82
  type = _this$props.type,
85
83
  text = _this$props.text,
86
- rest = _objectWithoutPropertiesLoose(_this$props, _excluded);
84
+ rest = _objectWithoutPropertiesLoose(_this$props, ["type", "text"]);
87
85
 
88
86
  return /*#__PURE__*/React.createElement(_styles.default // danger needs to be properly deprecated and removed DS-1094
89
87
  , _extends({
@@ -13,7 +13,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
13
13
 
14
14
  var Container = _styledComponents.default.div.withConfig({
15
15
  displayName: "styles__Container",
16
- componentId: "sc-q43dr4-0"
16
+ componentId: "q43dr4-0"
17
17
  })(function (props) {
18
18
  return (0, _styledComponents.css)(["display:flex;overflow:hidden;align-items:center;justify-content:space-between;color:", ";border-radius:", ";font-family:", ";", " padding:", ";border:1px solid ", ";background-color:", ";.Icon{align-self:flex-start;margin-top:3px;margin-right:", ";min-width:16px;color:", ";}a,button{font-weight:", ";color:", ";font-size:inherit;&:hover{color:", ";text-decoration:underline;}}> span:not(.Icon){display:block;}", " ", ""], props.theme.colors.text.body, props.theme.radii.outer, props.theme.fontFamily, props.theme.typography[200], props.theme.space[300], props.theme.colors.container.border[props.type], props.theme.colors.container.background[props.type], props.theme.space[400], props.theme.colors.icon[props.type], props.theme.fontWeights.semibold, props.theme.colors.text.body, props.theme.colors.text.body, _systemProps.COMMON, _systemProps.LAYOUT);
19
19
  });
@@ -11,7 +11,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
11
11
 
12
12
  var Container = _styledComponents.default.div.withConfig({
13
13
  displayName: "styles__Container",
14
- componentId: "sc-ma8yo6-0"
14
+ componentId: "ma8yo6-0"
15
15
  })(["box-sizing:border-box;font-family:", ";", " ", " ", " ", " ", " ", ""], function (_ref) {
16
16
  var theme = _ref.theme;
17
17
  return theme.fontFamily;
@@ -13,9 +13,6 @@ var _Menu = require("../Menu");
13
13
 
14
14
  var _styles = _interopRequireDefault(require("./styles"));
15
15
 
16
- var _excluded = ["children", "href"],
17
- _excluded2 = ["ariaLabel", "overflow", "children"];
18
-
19
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
17
 
21
18
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -29,7 +26,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
29
26
  var BreadcrumbItem = function BreadcrumbItem(_ref) {
30
27
  var children = _ref.children,
31
28
  href = _ref.href,
32
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
29
+ rest = _objectWithoutPropertiesLoose(_ref, ["children", "href"]);
33
30
 
34
31
  return /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(_Link.default, _extends({
35
32
  href: href // $FlowIssue - upgrade v0.112.0
@@ -41,7 +38,7 @@ var Breadcrumb = function Breadcrumb(_ref2) {
41
38
  var ariaLabel = _ref2.ariaLabel,
42
39
  overflow = _ref2.overflow,
43
40
  children = _ref2.children,
44
- rest = _objectWithoutPropertiesLoose(_ref2, _excluded2);
41
+ rest = _objectWithoutPropertiesLoose(_ref2, ["ariaLabel", "overflow", "children"]);
45
42
 
46
43
  var listItems = React.Children.toArray(children);
47
44
  var lastItem = listItems[listItems.length - 1];
@@ -7,8 +7,6 @@ var React = _interopRequireWildcard(require("react"));
7
7
 
8
8
  var _styles = _interopRequireDefault(require("./styles"));
9
9
 
10
- var _excluded = ["href", "appearance", "active", "disabled", "external", "children", "size", "innerRef", "onClick", "title", "qa", "as", "ariaLabel"];
11
-
12
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
11
 
14
12
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -37,7 +35,7 @@ var Button = function Button(_ref) {
37
35
  qa = _ref$qa === void 0 ? {} : _ref$qa,
38
36
  as = _ref.as,
39
37
  ariaLabel = _ref.ariaLabel,
40
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
38
+ rest = _objectWithoutPropertiesLoose(_ref, ["href", "appearance", "active", "disabled", "external", "children", "size", "innerRef", "onClick", "title", "qa", "as", "ariaLabel"]);
41
39
 
42
40
  if (!href && external) {
43
41
  console.warn("Warning: external prop cannot be set without a href declaration");
@@ -65,6 +63,5 @@ var Button = function Button(_ref) {
65
63
  }, qa, rest), children);
66
64
  };
67
65
 
68
- Button.displayName = "Button";
69
66
  var _default = Button;
70
67
  exports.default = _default;
@@ -60,7 +60,6 @@ var Container = _styledComponents.default.button.withConfig({
60
60
  return props.appearance === "pill" && (0, _styledComponents.css)(["display:inline-flex;align-items:center;justify-content:center;mix-blend-mode:", ";", ""], props.theme.mode === "dark" ? "screen" : "multiply", _mixins.pill);
61
61
  }, _styles.default, _systemProps.LAYOUT, _systemProps.COMMON);
62
62
 
63
- Container.displayName = "Button-Container";
64
63
  var _default = Container; //${props.theme.mode === "dark" ? "screen" : "multiply"}
65
64
 
66
65
  exports.default = _default;
@@ -8,8 +8,6 @@ var React = _interopRequireWildcard(require("react"));
8
8
 
9
9
  var _styles = require("./styles");
10
10
 
11
- var _excluded = ["onClick", "href", "children", "ariaLabel", "buttonProps", "border", "borderColor", "color", "bg"];
12
-
13
11
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
14
12
 
15
13
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -33,7 +31,7 @@ var Card = function Card(_ref) {
33
31
  color = _ref$color === void 0 ? "text.body" : _ref$color,
34
32
  _ref$bg = _ref.bg,
35
33
  bg = _ref$bg === void 0 ? "container.background.base" : _ref$bg,
36
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
34
+ rest = _objectWithoutPropertiesLoose(_ref, ["onClick", "href", "children", "ariaLabel", "buttonProps", "border", "borderColor", "color", "bg"]);
37
35
 
38
36
  return /*#__PURE__*/React.createElement(_styles.Container, _extends({}, rest, {
39
37
  border: border,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.Container = exports.ClickableArea = void 0;
4
+ exports.ClickableArea = exports.Container = void 0;
5
5
 
6
6
  var _styledComponents = _interopRequireDefault(require("styled-components"));
7
7
 
@@ -13,7 +13,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
13
13
 
14
14
  var Container = (0, _styledComponents.default)(_Box.default).withConfig({
15
15
  displayName: "styles__Container",
16
- componentId: "sc-p098yi-0"
16
+ componentId: "p098yi-0"
17
17
  })(["width:100%;border-radius:", ";position:relative;z-index:0;::after{content:\"\";top:0;left:0;position:absolute;border-radius:", ";z-index:-1;width:100%;height:100%;opacity:0;box-shadow:", ";transition:opacity ", " ", ";}&:hover{&::after{opacity:1;}}[role=\"button\"],[type=\"button\"],a{position:relative;}"], function (props) {
18
18
  return props.theme.radii.outer;
19
19
  }, function (props) {
@@ -28,6 +28,6 @@ var Container = (0, _styledComponents.default)(_Box.default).withConfig({
28
28
  exports.Container = Container;
29
29
  var ClickableArea = (0, _styledComponents.default)(_Button.default).withConfig({
30
30
  displayName: "styles__ClickableArea",
31
- componentId: "sc-p098yi-1"
31
+ componentId: "p098yi-1"
32
32
  })(["position:absolute !important;top:0;bottom:0;left:0;right:0;width:100%;"]);
33
33
  exports.ClickableArea = ClickableArea;