@sproutsocial/racine 11.3.0-beta.3 → 11.3.1-beta-deps.2

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.
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import "jest-styled-components";
3
- import { render, fireEvent, userEvent } from "../utils/react-testing-library";
3
+ import { render, fireEvent } from "../utils/react-testing-library";
4
4
  import Input from "./";
5
5
  import Text from "../Text";
6
6
 
@@ -69,232 +69,6 @@ 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
- clearButtonLabel="Clear search"
201
- />
202
- );
203
- expect(getByRole("button")).toBeTruthy();
204
- });
205
-
206
- it("should not render a clear button if there is no text", () => {
207
- const { queryByRole } = render(
208
- <Input
209
- id="name"
210
- name="name"
211
- value=""
212
- type="text"
213
- elemAfter={<Input.ClearButton />}
214
- clearButtonLabel="Clear search"
215
- />
216
- );
217
- expect(queryByRole("button")).toBeFalsy();
218
- });
219
-
220
- it("should use the fallback title if clearButtonLabel is not provided", () => {
221
- const { getByTitle } = render(
222
- <Input
223
- id="name"
224
- name="name"
225
- value="mic"
226
- type="text"
227
- elemAfter={<Input.ClearButton />}
228
- />
229
- );
230
- expect(getByTitle("Clear")).toBeTruthy();
231
- });
232
-
233
- it("should call onClear when Input.ClearButton is clicked", () => {
234
- const mockOnClear = jest.fn();
235
- const { getByRole } = render(
236
- <Input
237
- id="name"
238
- name="name"
239
- value="mic"
240
- type="text"
241
- elemAfter={<Input.ClearButton />}
242
- onClear={mockOnClear}
243
- clearButtonLabel="Clear search"
244
- />
245
- );
246
- fireEvent.click(getByRole("button"));
247
- expect(mockOnClear).toHaveBeenCalled();
248
- });
249
-
250
- it("should allow keyboard access to and Space key triggering of the clear button", () => {
251
- const mockOnClear = jest.fn();
252
- const { getByRole } = render(
253
- <Input
254
- id="name"
255
- name="name"
256
- value="mic"
257
- type="text"
258
- elemAfter={<Input.ClearButton />}
259
- onClear={mockOnClear}
260
- clearButtonLabel="Clear search"
261
- />
262
- );
263
- const input = getByRole("textbox");
264
- const button = getByRole("button");
265
- userEvent.tab();
266
- expect(input).toHaveFocus();
267
- userEvent.tab();
268
- expect(button).toHaveFocus();
269
- userEvent.keyboard("{space}");
270
- expect(mockOnClear).toHaveBeenCalled();
271
- });
272
-
273
- it("should allow keyboard access to and Enter key triggering of the clear button", () => {
274
- const mockOnClear = jest.fn();
275
- const { getByRole } = render(
276
- <Input
277
- id="name"
278
- name="name"
279
- value="mic"
280
- type="text"
281
- elemAfter={<Input.ClearButton />}
282
- onClear={mockOnClear}
283
- clearButtonLabel="Clear search"
284
- />
285
- );
286
- const input = getByRole("textbox");
287
- const button = getByRole("button");
288
- userEvent.tab();
289
- expect(input).toHaveFocus();
290
- userEvent.tab();
291
- expect(button).toHaveFocus();
292
- userEvent.keyboard("{enter}");
293
- expect(mockOnClear).toHaveBeenCalled();
294
- });
295
- });
296
- });
297
-
298
72
  describe("autoComplete prop", () => {
299
73
  it("should not have autoComplete attribute when passed prop is not passed", () => {
300
74
  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.isClearButton ? 0 : props.theme.space[350]};
143
+ right: ${props.theme.space[350]};
144
144
  `};
145
145
  `;
146
146
 
@@ -8,11 +8,10 @@ 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 */
12
11
  href?: string,
13
12
  /** Disables user action and applies a disabled style to the component */
14
13
  disabled?: boolean,
15
- /** Can be used in addition to an href but still renders as a link. Omitting href will render as button */
14
+ /** Setting this prop will cause the component to be rendered as a button instead of an anchor) */
16
15
  onClick?: (e: SyntheticEvent<HTMLButtonElement>) => void,
17
16
  as?: $PropertyType<TypeStyledComponentsCommonProps, "as">,
18
17
  underline?: boolean,
@@ -14,12 +14,12 @@ exports[`Menu AsMenuButton should match snapshot 1`] = `
14
14
  fill: currentColor;
15
15
  }
16
16
 
17
- _:-ms-fullscreen .c3,
17
+ _:-ms-fullscreen .c2,
18
18
  html .c3 {
19
19
  width: 16px;
20
20
  }
21
21
 
22
- .pdf-page .c3 {
22
+ .pdf-page .c2 {
23
23
  width: 16px;
24
24
  }
25
25
 
@@ -1,5 +1,5 @@
1
1
  import "mutationobserver-shim";
2
- import "jest-dom/extend-expect";
2
+ import "@testing-library/jest-dom/extend-expect";
3
3
  import "jest-axe/extend-expect";
4
4
  import "babel-polyfill";
5
5
  import "jest-styled-components";
@@ -1,19 +1,5 @@
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
-
17
3
  exports[`layout system props height 1`] = `
18
4
  .c0 {
19
5
  height: string;
@@ -10,15 +10,6 @@ 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
-
22
13
  test("height", () => {
23
14
  const { container } = render(
24
15
  <>
@@ -65,5 +65,6 @@ var Button = function Button(_ref) {
65
65
  }, qa, rest), children);
66
66
  };
67
67
 
68
+ Button.displayName = "Button";
68
69
  var _default = Button;
69
70
  exports.default = _default;
@@ -60,6 +60,7 @@ 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";
63
64
  var _default = Container; //${props.theme.mode === "dark" ? "screen" : "multiply"}
64
65
 
65
66
  exports.default = _default;
@@ -11,12 +11,16 @@ var _Box = _interopRequireDefault(require("../Box"));
11
11
 
12
12
  var _mixins = require("../utils/mixins");
13
13
 
14
+ var _templateObject;
15
+
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
16
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); }
17
19
 
18
20
  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; }
19
21
 
22
+ function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
23
+
20
24
  /*
21
25
  * Partial list of modifiers given to renderDayContents by airbnb/react-dates. There may be more.
22
26
  *
@@ -83,7 +87,7 @@ var CalendarDay = (0, _styledComponents.default)(_Box.default).withConfig({
83
87
  }
84
88
  });
85
89
  exports.CalendarDay = CalendarDay;
86
- var ReactDatesCssOverrides = (0, _styledComponents.createGlobalStyle)([".DayPicker{box-sizing:content-box;font-weight:", ";font-family:", ";&_transitionContainer{height:228px !important;}&_weekHeader{color:", ";border-bottom:1px solid ", ";top:26px;width:230px;&_ul{padding-left:10px;}}&_weekHeaders__horizontal{margin-left:0}&_weekHeader_li{", " color:", ";font-weight:", ";margin:0;}&__horizontal{box-shadow:none;background:", ";}}.CalendarDay{background-color:transparent;&__selected,&__selected_span,&:hover{background-color:transparent;}&__default{color:", ";}&__default,&__default:hover{border:none;color:", ";}}.CalendarMonth{", " background:", ";padding:0 15px;&_caption{", " color:", ";padding-top:0;background:", ";strong{font-weight:", ";}}&_table{line-height:21.333px;tr{vertical-align:middle;}td{padding:0;border-bottom:none;}}}.CalendarMonthGrid{background:", ";}.DayPickerNavigation_button__horizontal{color:", ";top:-4px;padding:7px 8px;position:absolute;line-height:0.78;border-radius:9999px;border:none;background:", ";&:nth-child(1){left:22px;}&:nth-child(2){right:22px;}&:hover{background:", ";}}"], function (_ref2) {
90
+ var ReactDatesCssOverrides = (0, _styledComponents.createGlobalStyle)(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n\t.DayPicker {\n\t\tbox-sizing: content-box;\n\t\tfont-weight: ", ";\n\t\tfont-family: ", ";\n\n\t\t/* override react-dates height to better reflect how tall the component actually is */\n\t\t/* adding margin/padding will be more truer to our seeds system because the height */\n\t\t/* of the calendar adds an extra row of padding if we do not override it */\n\t\t&_transitionContainer {\n\t\t\t/* need !important because react-dates sets height on the element itself */\n\t\t\theight: 228px !important;\n\t\t}\n\n\t\t&_weekHeader {\n\t\t\tcolor: ", ";\n\t\t\tborder-bottom: 1px solid ", ";\n\n \t\t\t/* Magic number to match position of .CalendarMonth_caption */\n\t\t\ttop: 26px;\n\n\t\t\t/* Magic number to make the bottom border line stretch the full width */\n\t\t\twidth: 230px;\n\n\t\t\t&_ul {\n \t\t\t\t/* Magic number to line up day name headings over the correct numbers */\n\t\t\t\tpadding-left: 10px;\n\t\t\t}\n\t\t}\n\n\t\t&_weekHeaders__horizontal {\n\t\t\tmargin-left: 0\n\t\t}\n\n\t\t&_weekHeader_li {\n\t\t\t", "\n\t\t\tcolor: ", ";\n\t\t\tfont-weight: ", ";\n\t\t\tmargin: 0;\n\t\t}\n\n\t\t&__horizontal {\n\t\t\tbox-shadow: none;\n\t\t\tbackground: ", ";\n\t\t}\n\t}\n\n .CalendarDay {\n\t\tbackground-color: transparent;\n\n &__selected, &__selected_span, &:hover {\n background-color: transparent;\n\t\t}\n\n\t\t&__default {\n\t\t\tcolor: ", ";\n\t\t}\n\t\t&__default,\n\t\t&__default:hover {\n\t\t\tborder: none;\n\t\t\tcolor: ", ";\n\t\t}\n\t}\n\n .CalendarMonth {\n\t\t", "\n\t\tbackground: ", ";\n\n \t\t/* spacing between visible months and months off canvas */\n\t\tpadding: 0 15px;\n\n\t\t&_caption {\n\t\t\t", "\n\t\t\tcolor: ", ";\n\t\t\tpadding-top: 0;\n\t\t\tbackground: ", ";\n\n\t\t\tstrong {\n\t\t\t\tfont-weight: ", ";\n\t\t\t}\n\n\t\t}\n\t\t&_table {\n\t\t\tline-height: 21.333px;\n\t\t\ttr {\n\t\t\t\tvertical-align: middle;\n\t\t\t}\n\t\t\ttd {\n\t\t\t\tpadding: 0;\n\t\t\t\tborder-bottom: none;\n\t\t\t}\n\t\t}\n\t}\n\n\t.CalendarMonthGrid {\n\t\tbackground: ", ";\n\t}\n\n\t/* Left and Right Arrow Buttons to navigate months */\n\t.DayPickerNavigation_button__horizontal {\n\t\tcolor: ", ";\n\t\ttop: -4px;\n\t\tpadding: 7px 8px;\n\t\tposition: absolute;\n\t\tline-height: 0.78;\n\t\tborder-radius: 9999px;\n\t\tborder: none;\n\t\tbackground: ", ";\n\n\t\t&:nth-child(1) {\n\t\t\tleft: 22px;\n\t\t}\n\t\t&:nth-child(2) {\n\t\t\tright: 22px;\n\t\t}\n\n\t\t&:hover {\n\t\t\tbackground: ", ";\n\t\t}\n\t}\n"])), function (_ref2) {
87
91
  var theme = _ref2.theme;
88
92
  return theme.fontWeights.normal;
89
93
  }, function (props) {
@@ -7,13 +7,7 @@ var React = _interopRequireWildcard(require("react"));
7
7
 
8
8
  var _styles = _interopRequireWildcard(require("./styles"));
9
9
 
10
- var _Button = _interopRequireDefault(require("../Button"));
11
-
12
- var _Icon = _interopRequireDefault(require("../Icon"));
13
-
14
- var _excluded = ["autoComplete", "autoFocus", "disabled", "readOnly", "isInvalid", "hasWarning", "id", "name", "placeholder", "type", "required", "value", "elemBefore", "elemAfter", "maxLength", "ariaLabel", "ariaDescribedby", "clearButtonLabel", "innerRef", "onBlur", "onChange", "onClear", "onFocus", "onKeyDown", "onKeyUp", "onPaste", "inputProps", "qa", "appearance", "size"];
15
-
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ var _excluded = ["autoComplete", "autoFocus", "disabled", "readOnly", "isInvalid", "hasWarning", "id", "name", "placeholder", "type", "required", "value", "elemBefore", "elemAfter", "maxLength", "ariaLabel", "ariaDescribedby", "innerRef", "onBlur", "onChange", "onFocus", "onKeyDown", "onKeyUp", "onPaste", "inputProps", "qa", "appearance"];
17
11
 
18
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); }
19
13
 
@@ -27,51 +21,6 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.crea
27
21
 
28
22
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
29
23
 
30
- var InputContext = /*#__PURE__*/React.createContext({});
31
-
32
- var ClearButton = function ClearButton() {
33
- var _React$useContext = React.useContext(InputContext),
34
- handleClear = _React$useContext.handleClear,
35
- clearButtonLabel = _React$useContext.clearButtonLabel,
36
- hasValue = _React$useContext.hasValue,
37
- size = _React$useContext.size; // Hide the button when there is no text to clear.
38
-
39
-
40
- if (!hasValue) {
41
- return null;
42
- } // Cut down the padding for size small Inputs so that the focus ring won't go outside the bounds of the Input.
43
- // This adjustment is handled automatically for default and large Inputs via Button's size. There is no "small" Button.
44
-
45
-
46
- var py = size === "small" ? 100 : undefined;
47
- var px = size === "small" ? 200 : undefined;
48
- var buttonSize = size === "small" ? "default" : size; // Warn if clearButtonLabel is not included, so that the unlocalized fallback will not be mistaken for a proper label.
49
-
50
- if (!clearButtonLabel) {
51
- console.warn("Warning: clearButtonLabel prop is required when using Input.ClearButton. Please pass a localized label to Input.");
52
- }
53
-
54
- return /*#__PURE__*/React.createElement(_Button.default, {
55
- onClick: handleClear,
56
- size: buttonSize,
57
- py: py,
58
- px: px
59
- }, /*#__PURE__*/React.createElement(_Icon.default, {
60
- name: "circlex",
61
- title: clearButtonLabel || "Clear"
62
- }));
63
- }; // Used for positioning elementAfter. This logic will detect if the element is a ClearButton,
64
- // regardless of whether it was manually passed as elemAfter or automatically added to a search Input.
65
-
66
-
67
- var isClearButton = function isClearButton(elem) {
68
- if (elem != null && elem.type) {
69
- return elem.type.displayName === "Input.ClearButton";
70
- }
71
-
72
- return false;
73
- };
74
-
75
24
  var Input = /*#__PURE__*/function (_React$Component) {
76
25
  _inheritsLoose(Input, _React$Component);
77
26
 
@@ -85,34 +34,39 @@ var Input = /*#__PURE__*/function (_React$Component) {
85
34
  _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
86
35
 
87
36
  _this.handleBlur = function (e) {
88
- return _this.props.onBlur == null ? void 0 : _this.props.onBlur(e);
89
- };
90
-
91
- _this.handleClear = function (e) {
92
- var _this$props$innerRef, _this$props$innerRef$;
93
-
94
- _this.props.onClear == null ? void 0 : _this.props.onClear(e);
95
- (_this$props$innerRef = _this.props.innerRef) == null ? void 0 : (_this$props$innerRef$ = _this$props$innerRef.current) == null ? void 0 : _this$props$innerRef$.focus();
37
+ if (_this.props.onBlur) {
38
+ _this.props.onBlur(e);
39
+ }
96
40
  };
97
41
 
98
42
  _this.handleChange = function (e) {
99
- return _this.props.onChange == null ? void 0 : _this.props.onChange(e, e.currentTarget.value);
43
+ if (_this.props.onChange) {
44
+ _this.props.onChange(e, e.currentTarget.value);
45
+ }
100
46
  };
101
47
 
102
48
  _this.handleFocus = function (e) {
103
- return _this.props.onFocus == null ? void 0 : _this.props.onFocus(e);
49
+ if (_this.props.onFocus) {
50
+ _this.props.onFocus(e);
51
+ }
104
52
  };
105
53
 
106
54
  _this.handleKeyDown = function (e) {
107
- return _this.props.onKeyDown == null ? void 0 : _this.props.onKeyDown(e, e.currentTarget.value);
55
+ if (_this.props.onKeyDown) {
56
+ _this.props.onKeyDown(e, e.currentTarget.value);
57
+ }
108
58
  };
109
59
 
110
60
  _this.handleKeyUp = function (e) {
111
- return _this.props.onKeyUp == null ? void 0 : _this.props.onKeyUp(e, e.currentTarget.value);
61
+ if (_this.props.onKeyUp) {
62
+ _this.props.onKeyUp(e, e.currentTarget.value);
63
+ }
112
64
  };
113
65
 
114
66
  _this.handlePaste = function (e) {
115
- return _this.props.onPaste == null ? void 0 : _this.props.onPaste(e, e.currentTarget.value);
67
+ if (_this.props.onPaste) {
68
+ _this.props.onPaste(e, e.currentTarget.value);
69
+ }
116
70
  };
117
71
 
118
72
  return _this;
@@ -139,11 +93,9 @@ var Input = /*#__PURE__*/function (_React$Component) {
139
93
  maxLength = _this$props.maxLength,
140
94
  ariaLabel = _this$props.ariaLabel,
141
95
  ariaDescribedby = _this$props.ariaDescribedby,
142
- clearButtonLabel = _this$props.clearButtonLabel,
143
96
  innerRef = _this$props.innerRef,
144
97
  onBlur = _this$props.onBlur,
145
98
  onChange = _this$props.onChange,
146
- onClear = _this$props.onClear,
147
99
  onFocus = _this$props.onFocus,
148
100
  onKeyDown = _this$props.onKeyDown,
149
101
  onKeyUp = _this$props.onKeyUp,
@@ -153,43 +105,25 @@ var Input = /*#__PURE__*/function (_React$Component) {
153
105
  _this$props$qa = _this$props.qa,
154
106
  qa = _this$props$qa === void 0 ? {} : _this$props$qa,
155
107
  appearance = _this$props.appearance,
156
- size = _this$props.size,
157
- rest = _objectWithoutPropertiesLoose(_this$props, _excluded); // Convert autoComplete from a boolean prop to a string value.
158
-
108
+ rest = _objectWithoutPropertiesLoose(_this$props, _excluded);
159
109
 
160
110
  var autoCompleteValue = undefined;
161
111
 
162
112
  if (autoComplete !== undefined) {
163
113
  autoCompleteValue = autoComplete ? "on" : "off";
164
- } // Add default elemBefore and elemAfter elements if type is search.
165
-
166
-
167
- var elementBefore = type === "search" && !elemBefore ? /*#__PURE__*/React.createElement(_Icon.default, {
168
- name: "search",
169
- ariaHidden: true,
170
- color: "icon.base"
171
- }) : elemBefore; // Do not add a ClearButton if no onClear callback is provided or if an elemAfter prop was passed.
114
+ }
172
115
 
173
- var elementAfter = type === "search" && onClear && !elemAfter ? /*#__PURE__*/React.createElement(ClearButton, null) : elemAfter;
174
116
  return /*#__PURE__*/React.createElement(_styles.default, _extends({
175
- hasBeforeElement: !!elementBefore,
176
- hasAfterElement: !!elementAfter,
117
+ hasBeforeElement: !!elemBefore,
118
+ hasAfterElement: !!elemAfter,
177
119
  disabled: disabled,
178
120
  invalid: !!isInvalid,
179
121
  warning: hasWarning,
180
- appearance: appearance,
181
- size: size // $FlowIssue - upgrade v0.112.0
182
-
183
- }, rest), /*#__PURE__*/React.createElement(InputContext.Provider, {
184
- value: {
185
- handleClear: this.handleClear,
186
- hasValue: !!value,
187
- clearButtonLabel: clearButtonLabel,
188
- size: size
189
- }
190
- }, elementBefore && /*#__PURE__*/React.createElement(_styles.Accessory, {
122
+ appearance: appearance // $FlowIssue - upgrade v0.112.0
123
+
124
+ }, rest), elemBefore && /*#__PURE__*/React.createElement(_styles.Accessory, {
191
125
  before: true
192
- }, elementBefore), /*#__PURE__*/React.createElement("input", _extends({
126
+ }, elemBefore), /*#__PURE__*/React.createElement("input", _extends({
193
127
  "aria-invalid": !!isInvalid,
194
128
  "aria-label": ariaLabel,
195
129
  "aria-describedby": ariaDescribedby,
@@ -214,23 +148,19 @@ var Input = /*#__PURE__*/function (_React$Component) {
214
148
  "data-qa-input": name || "",
215
149
  "data-qa-input-isdisabled": disabled === true,
216
150
  "data-qa-input-isrequired": required === true
217
- }, qa, inputProps)), elementAfter && /*#__PURE__*/React.createElement(_styles.Accessory, {
218
- after: true,
219
- isClearButton: isClearButton(elementAfter)
220
- }, elementAfter)));
151
+ }, qa, inputProps)), elemAfter && /*#__PURE__*/React.createElement(_styles.Accessory, {
152
+ after: true
153
+ }, elemAfter));
221
154
  };
222
155
 
223
156
  return Input;
224
157
  }(React.Component);
225
158
 
159
+ exports.default = Input;
226
160
  Input.defaultProps = {
227
161
  autoFocus: false,
228
162
  disabled: false,
229
163
  type: "text",
230
164
  size: "default",
231
165
  appearance: "primary"
232
- };
233
- Input.ClearButton = ClearButton;
234
- Input.ClearButton.displayName = "Input.ClearButton";
235
- var _default = Input;
236
- exports.default = _default;
166
+ };
@@ -86,7 +86,7 @@ var Accessory = _styledComponents.default.div.withConfig({
86
86
  }, function (props) {
87
87
  return props.before && (0, _styledComponents.css)(["left:", ";"], props.theme.space[350]);
88
88
  }, function (props) {
89
- return props.after && (0, _styledComponents.css)(["right:", ";"], props.isClearButton ? 0 : props.theme.space[350]);
89
+ return props.after && (0, _styledComponents.css)(["right:", ";"], props.theme.space[350]);
90
90
  });
91
91
 
92
92
  exports.Accessory = Accessory;
@@ -267,6 +267,13 @@ var MenuRadio = function MenuRadio(props) {
267
267
 
268
268
  exports.MenuRadio = MenuRadio;
269
269
 
270
+ var _StyledText = (0, _styledComponents.default)(_Text.default).withConfig({
271
+ displayName: "Menu___StyledText",
272
+ componentId: "sc-1p3rdnp-0"
273
+ })(["", ""], function (p) {
274
+ return p._css;
275
+ });
276
+
270
277
  var MenuGroup = function MenuGroup(_ref2) {
271
278
  var children = _ref2.children,
272
279
  title = _ref2.title,
@@ -286,7 +293,7 @@ var MenuGroup = function MenuGroup(_ref2) {
286
293
  fontWeight: 600,
287
294
  mt: 350,
288
295
  color: "text.headline",
289
- $_css: isDisabled && _mixins.disabled
296
+ _css: isDisabled && _mixins.disabled
290
297
  }, title)), /*#__PURE__*/React.createElement(_Box.default, _extends({}, props, {
291
298
  p: 300,
292
299
  role: "group"
@@ -436,7 +443,7 @@ Menu.Divider.displayName = "Menu.Divider";
436
443
  Menu.FilterInput.displayName = "Menu.FilterInput";
437
444
  var CustomPopoutContent = (0, _styledComponents.default)(_Popout.default.Content).withConfig({
438
445
  displayName: "Menu__CustomPopoutContent",
439
- componentId: "sc-1p3rdnp-0"
446
+ componentId: "sc-1p3rdnp-1"
440
447
  })(["padding:0;margin-left:0;margin-right:0;"]);
441
448
 
442
449
  var MenuButton = function MenuButton(_ref5) {
@@ -494,11 +501,4 @@ var MenuButton = function MenuButton(_ref5) {
494
501
 
495
502
  exports.MenuButton = MenuButton;
496
503
  var _default = Menu;
497
- exports.default = _default;
498
-
499
- var _StyledText = (0, _styledComponents.default)(_Text.default).withConfig({
500
- displayName: "Menu___StyledText",
501
- componentId: "sc-1p3rdnp-1"
502
- })(["", ""], function (p) {
503
- return p.$_css;
504
- });
504
+ exports.default = _default;