@comicrelief/component-library 8.19.0 → 8.20.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 (22) hide show
  1. package/README.md +2 -2
  2. package/dist/components/Atoms/Input/Input.js +42 -30
  3. package/dist/components/Atoms/Input/Input.md +14 -0
  4. package/dist/components/Atoms/Input/input.test.js +13 -1
  5. package/dist/components/Atoms/TextInputWithDropdown/__snapshots__/TextInputWithDropdown.test.js.snap +145 -73
  6. package/dist/components/Molecules/SchoolLookup/__snapshots__/SchoolLookup.test.js.snap +44 -20
  7. package/dist/components/Molecules/SearchInput/SearchInput.test.js +1 -1
  8. package/dist/components/Molecules/Typeahead/__snapshots__/Typeahead.test.js.snap +44 -20
  9. package/dist/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +290 -179
  10. package/dist/components/Organisms/EmailSignUp/__snapshots__/EmailSignUp.test.js.snap +90 -56
  11. package/dist/components/Organisms/Membership/Membership.test.js +1 -1
  12. package/package.json +1 -1
  13. package/src/components/Atoms/Input/Input.js +51 -34
  14. package/src/components/Atoms/Input/Input.md +14 -0
  15. package/src/components/Atoms/Input/input.test.js +173 -13
  16. package/src/components/Atoms/TextInputWithDropdown/__snapshots__/TextInputWithDropdown.test.js.snap +145 -73
  17. package/src/components/Molecules/SchoolLookup/__snapshots__/SchoolLookup.test.js.snap +44 -20
  18. package/src/components/Molecules/SearchInput/SearchInput.test.js +44 -20
  19. package/src/components/Molecules/Typeahead/__snapshots__/Typeahead.test.js.snap +44 -20
  20. package/src/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +290 -179
  21. package/src/components/Organisms/EmailSignUp/__snapshots__/EmailSignUp.test.js.snap +90 -56
  22. package/src/components/Organisms/Membership/Membership.test.js +120 -81
package/README.md CHANGED
@@ -46,7 +46,7 @@ _Test will run through all Jest tests and watch for any changes on snapshots._
46
46
 
47
47
  To update snapshots with desired changes brought in through your work:
48
48
  ```
49
- $ yarn test:unit-update
49
+ $ yarn test:unit:update
50
50
  ```
51
51
 
52
52
  To publish
@@ -64,4 +64,4 @@ yarn playwright install
64
64
  Run the tests:
65
65
  ```
66
66
  yarn test:e2e:local
67
- ```
67
+ ```
@@ -16,51 +16,56 @@ var _zIndex = _interopRequireDefault(require("../../../theme/shared/zIndex"));
16
16
  // This seems to get a decent approximation of the necessary width (without resorting to measuring
17
17
  // the element with JS)
18
18
  const getPrefixWidth = prefixLength => "calc(1.5rem + (".concat(prefixLength, " * 0.5rem))");
19
- const InputField = _styledComponents.default.input.withConfig({
20
- displayName: "Input__InputField",
19
+ const InputWrapper = _styledComponents.default.div.withConfig({
20
+ displayName: "Input__InputWrapper",
21
21
  componentId: "sc-bcqy1o-0"
22
- })(["", ""], _ref => {
22
+ })(["position:relative;font-size:", ";"], _ref => {
23
23
  let {
24
- theme,
25
- error,
26
- prefixLength
24
+ theme
27
25
  } = _ref;
28
- return (0, _styledComponents.css)(["position:relative;box-sizing:border-box;width:100%;height:48px;padding:1rem 2.4rem 1rem 1.5rem;", " background-color:", ";border:1px solid;border-color:", ";box-shadow:none;appearance:none;color:", ";border-radius:0.5rem;font-size:inherit;z-index:2;font-family:", ";:focus{border:1px solid ", ";}"], prefixLength > 0 ? "padding-left: ".concat(getPrefixWidth(prefixLength), ";") : '', theme.color('grey_light'), error ? theme.color('red') : theme.color('grey_medium'), theme.color('black'), theme.fontFamilies(theme.font.regular), theme.color('grey_for_forms'));
26
+ return theme.fontSize('m');
29
27
  });
30
- const InputWrapper = _styledComponents.default.div.withConfig({
31
- displayName: "Input__InputWrapper",
28
+ const InputFieldContainer = _styledComponents.default.div.withConfig({
29
+ displayName: "Input__InputFieldContainer",
32
30
  componentId: "sc-bcqy1o-1"
33
- })(["position:relative;font-size:", ";", " @media ", "{max-width:290px;}"], _ref2 => {
31
+ })(["position:relative;width:100%;display:flex;justify-content:flex-end;align-items:center;", ""], _ref2 => {
34
32
  let {
33
+ maxPxWidthMediumBreakpoint,
34
+ maxPxWidthLargeBreakpoint,
35
35
  theme
36
36
  } = _ref2;
37
- return theme.fontSize('m');
38
- }, _ref3 => {
37
+ return (0, _styledComponents.css)(["@media ", "{", "}@media ", "{", "}"], theme.allBreakpoints('M'), maxPxWidthMediumBreakpoint && "max-width: ".concat(maxPxWidthMediumBreakpoint, "px;"), theme.allBreakpoints('L'), maxPxWidthLargeBreakpoint && "max-width: ".concat(maxPxWidthLargeBreakpoint, "px;"));
38
+ });
39
+ const InputField = _styledComponents.default.input.withConfig({
40
+ displayName: "Input__InputField",
41
+ componentId: "sc-bcqy1o-2"
42
+ })(["", ""], _ref3 => {
39
43
  let {
40
- error
44
+ theme,
45
+ error,
46
+ prefixLength
41
47
  } = _ref3;
42
- return error && (0, _styledComponents.css)(["&::after{content:'';position:absolute;top:50%;right:0.5rem;transform:translateY(-50%);background:url(", ") center/contain no-repeat;--iconSize:19px;width:var(--iconSize);height:var(--iconSize);z-index:3;}"], _errorAlertIconRed.default);
43
- }, _ref4 => {
44
- let {
45
- theme
46
- } = _ref4;
47
- return theme.allBreakpoints('M');
48
+ return (0, _styledComponents.css)(["position:relative;box-sizing:border-box;width:100%;height:48px;padding:1rem 2.4rem 1rem 1.5rem;", " background-color:", ";border:1px solid;border-color:", ";box-shadow:none;appearance:none;color:", ";border-radius:0.5rem;font-size:inherit;z-index:2;font-family:", ";:focus{border:1px solid ", ";}"], prefixLength > 0 ? "padding-left: ".concat(getPrefixWidth(prefixLength), ";") : '', theme.color('grey_light'), error ? theme.color('red') : theme.color('grey_medium'), theme.color('black'), theme.fontFamilies(theme.font.regular), theme.color('grey_for_forms'));
48
49
  });
50
+ const ErrorIconWrapper = _styledComponents.default.div.withConfig({
51
+ displayName: "Input__ErrorIconWrapper",
52
+ componentId: "sc-bcqy1o-3"
53
+ })(["position:absolute;right:0.6rem;background:url(", ") center/contain no-repeat;--iconSize:19px;width:var(--iconSize);height:var(--iconSize);z-index:3;"], _errorAlertIconRed.default);
49
54
  const Prefix = _styledComponents.default.div.withConfig({
50
55
  displayName: "Input__Prefix",
51
- componentId: "sc-bcqy1o-2"
52
- })(["position:absolute;left:0;top:0;", " display:flex;height:100%;width:", ";justify-content:center;align-items:center;color:", ";font-weight:700;font-size:inherit;margin-left:2px;"], (0, _zIndex.default)('high'), _ref5 => {
56
+ componentId: "sc-bcqy1o-4"
57
+ })(["position:absolute;left:0;top:0;", " display:flex;height:100%;width:", ";justify-content:center;align-items:center;color:", ";font-weight:700;font-size:inherit;margin-left:2px;"], (0, _zIndex.default)('high'), _ref4 => {
53
58
  let {
54
59
  length
55
- } = _ref5;
60
+ } = _ref4;
56
61
  return getPrefixWidth(length);
57
- }, _ref6 => {
62
+ }, _ref5 => {
58
63
  let {
59
64
  theme
60
- } = _ref6;
65
+ } = _ref5;
61
66
  return theme.color('grey_dark');
62
67
  });
63
- const Input = /*#__PURE__*/_react.default.forwardRef((_ref7, ref) => {
68
+ const Input = /*#__PURE__*/_react.default.forwardRef((_ref6, ref) => {
64
69
  let {
65
70
  errorMsg = '',
66
71
  id,
@@ -73,8 +78,10 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref7, ref) => {
73
78
  labelProps = {},
74
79
  prefix = '',
75
80
  optional = null,
81
+ maxPxWidthMediumBreakpoint,
82
+ maxPxWidthLargeBreakpoint,
76
83
  ...rest
77
- } = _ref7;
84
+ } = _ref6;
78
85
  return /*#__PURE__*/_react.default.createElement(_Label.default, Object.assign({
79
86
  className: className,
80
87
  htmlFor: id,
@@ -86,16 +93,19 @@ const Input = /*#__PURE__*/_react.default.forwardRef((_ref7, ref) => {
86
93
  error: Boolean(errorMsg)
87
94
  }, prefix && /*#__PURE__*/_react.default.createElement(Prefix, {
88
95
  length: prefix.length
89
- }, prefix), /*#__PURE__*/_react.default.createElement(InputField, Object.assign({
96
+ }, prefix), /*#__PURE__*/_react.default.createElement(InputFieldContainer, {
97
+ maxPxWidthMediumBreakpoint: maxPxWidthMediumBreakpoint,
98
+ maxPxWidthLargeBreakpoint: maxPxWidthLargeBreakpoint
99
+ }, /*#__PURE__*/_react.default.createElement(InputField, Object.assign({
90
100
  id: id,
91
101
  type: type,
92
102
  placeholder: placeholder,
93
- error: !!errorMsg,
103
+ error: Boolean(errorMsg),
94
104
  "aria-describedby": hasAria ? id : undefined,
95
105
  ref: ref,
96
106
  prefixLength: prefix.length,
97
107
  required: optional === false
98
- }, rest))), errorMsg && /*#__PURE__*/_react.default.createElement(_ErrorText.default, {
108
+ }, rest)), errorMsg && /*#__PURE__*/_react.default.createElement(ErrorIconWrapper, null))), errorMsg && /*#__PURE__*/_react.default.createElement(_ErrorText.default, {
99
109
  size: "sm",
100
110
  weight: "bold",
101
111
  "data-test": "error-message"
@@ -119,6 +129,8 @@ Input.propTypes = {
119
129
  // (as `rest` is not spread on the outermost component)
120
130
  className: _propTypes.default.string,
121
131
  prefix: _propTypes.default.string,
122
- optional: _propTypes.default.bool
132
+ optional: _propTypes.default.bool,
133
+ maxPxWidthMediumBreakpoint: _propTypes.default.number,
134
+ maxPxWidthLargeBreakpoint: _propTypes.default.number
123
135
  };
124
136
  var _default = exports.default = Input;
@@ -105,3 +105,17 @@ const ItalicText = styled(Text).attrs({weight: 'normal'})`
105
105
  }
106
106
  }}
107
107
  />
108
+ ```
109
+
110
+ ```js
111
+ <h4>Input with responsive max width</h4>
112
+ <Input
113
+ name="responsive-width"
114
+ placeholder="I'm responsive"
115
+ type="text"
116
+ label="Responsive Width Input at M and L breakpoints"
117
+ id="input-example-7"
118
+ maxPxWidthMediumBreakpoint={150}
119
+ maxPxWidthLargeBreakpoint={250}
120
+ />
121
+ ```
@@ -14,5 +14,17 @@ it('renders correctly', () => {
14
14
  errorMsg: "",
15
15
  id: "Accessibility info go here"
16
16
  })).toJSON();
17
- expect(tree).toMatchInlineSnapshot("\n .c1 {\n font-size: 1rem;\n line-height: 1rem;\n text-transform: inherit;\n line-height: normal;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c0 {\n width: 100%;\n position: relative;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-flex-direction: column;\n -ms-flex-direction: column;\n flex-direction: column;\n color: #5C5C5E;\n }\n\n .c2 {\n margin-bottom: 0.5rem;\n font-weight: normal;\n }\n\n .c4 {\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: 48px;\n padding: 1rem 2.4rem 1rem 1.5rem;\n background-color: #F4F3F5;\n border: 1px solid;\n border-color: #E1E2E3;\n box-shadow: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n color: #000000;\n border-radius: 0.5rem;\n font-size: inherit;\n z-index: 2;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c4:focus {\n border: 1px solid #666;\n }\n\n .c3 {\n position: relative;\n font-size: 1.25rem;\n }\n\n @media (min-width:740px) {\n .c3 {\n max-width: 290px;\n }\n }\n\n <label\n className=\"c0\"\n htmlFor=\"Accessibility info go here\"\n >\n <span\n className=\"c1 c2\"\n color=\"inherit\"\n dangerouslySetInnerHTML={\n Object {\n \"__html\": \"Label\",\n }\n }\n size=\"s\"\n />\n <div\n className=\"c3\"\n >\n \n <input\n aria-describedby=\"Accessibility info go here\"\n className=\"c4\"\n id=\"Accessibility info go here\"\n name=\"fullname\"\n placeholder=\"This is the hint text\"\n required={false}\n type=\"text\"\n />\n </div>\n \n </label>\n ");
17
+ expect(tree).toMatchInlineSnapshot("\n .c1 {\n font-size: 1rem;\n line-height: 1rem;\n text-transform: inherit;\n line-height: normal;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c0 {\n width: 100%;\n position: relative;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-flex-direction: column;\n -ms-flex-direction: column;\n flex-direction: column;\n color: #5C5C5E;\n }\n\n .c2 {\n margin-bottom: 0.5rem;\n font-weight: normal;\n }\n\n .c3 {\n position: relative;\n font-size: 1.25rem;\n }\n\n .c4 {\n position: relative;\n width: 100%;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: end;\n -webkit-justify-content: flex-end;\n -ms-flex-pack: end;\n justify-content: flex-end;\n -webkit-align-items: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n }\n\n .c5 {\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: 48px;\n padding: 1rem 2.4rem 1rem 1.5rem;\n background-color: #F4F3F5;\n border: 1px solid;\n border-color: #E1E2E3;\n box-shadow: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n color: #000000;\n border-radius: 0.5rem;\n font-size: inherit;\n z-index: 2;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c5:focus {\n border: 1px solid #666;\n }\n\n @media (min-width:740px) {\n\n }\n\n @media (min-width:1024px) {\n\n }\n\n <label\n className=\"c0\"\n htmlFor=\"Accessibility info go here\"\n >\n <span\n className=\"c1 c2\"\n color=\"inherit\"\n dangerouslySetInnerHTML={\n Object {\n \"__html\": \"Label\",\n }\n }\n size=\"s\"\n />\n <div\n className=\"c3\"\n >\n \n <div\n className=\"c4\"\n >\n <input\n aria-describedby=\"Accessibility info go here\"\n className=\"c5\"\n id=\"Accessibility info go here\"\n name=\"fullname\"\n placeholder=\"This is the hint text\"\n required={false}\n type=\"text\"\n />\n \n </div>\n </div>\n \n </label>\n ");
18
+ });
19
+ it('renders with responsive max widths correctly', () => {
20
+ const tree = (0, _shallowWithTheme.default)( /*#__PURE__*/_react.default.createElement(_Input.default, {
21
+ name: "responsive-width",
22
+ placeholder: "This input has responsive max widths",
23
+ type: "text",
24
+ label: "Responsive Width Input",
25
+ id: "input-example-7",
26
+ maxPxWidthMediumBreakpoint: 150,
27
+ maxPxWidthLargeBreakpoint: 250
28
+ })).toJSON();
29
+ expect(tree).toMatchInlineSnapshot("\n .c1 {\n font-size: 1rem;\n line-height: 1rem;\n text-transform: inherit;\n line-height: normal;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c0 {\n width: 100%;\n position: relative;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-flex-direction: column;\n -ms-flex-direction: column;\n flex-direction: column;\n color: #5C5C5E;\n }\n\n .c2 {\n margin-bottom: 0.5rem;\n font-weight: normal;\n }\n\n .c3 {\n position: relative;\n font-size: 1.25rem;\n }\n\n .c4 {\n position: relative;\n width: 100%;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: end;\n -webkit-justify-content: flex-end;\n -ms-flex-pack: end;\n justify-content: flex-end;\n -webkit-align-items: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n }\n\n .c5 {\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: 48px;\n padding: 1rem 2.4rem 1rem 1.5rem;\n background-color: #F4F3F5;\n border: 1px solid;\n border-color: #E1E2E3;\n box-shadow: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n color: #000000;\n border-radius: 0.5rem;\n font-size: inherit;\n z-index: 2;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c5:focus {\n border: 1px solid #666;\n }\n\n @media (min-width:740px) {\n .c4 {\n max-width: 150px;\n }\n }\n\n @media (min-width:1024px) {\n .c4 {\n max-width: 250px;\n }\n }\n\n <label\n className=\"c0\"\n htmlFor=\"input-example-7\"\n >\n <span\n className=\"c1 c2\"\n color=\"inherit\"\n dangerouslySetInnerHTML={\n Object {\n \"__html\": \"Responsive Width Input\",\n }\n }\n size=\"s\"\n />\n <div\n className=\"c3\"\n >\n \n <div\n className=\"c4\"\n >\n <input\n aria-describedby=\"input-example-7\"\n className=\"c5\"\n id=\"input-example-7\"\n name=\"responsive-width\"\n placeholder=\"This input has responsive max widths\"\n required={false}\n type=\"text\"\n />\n \n </div>\n </div>\n \n </label>\n ");
18
30
  });
@@ -27,7 +27,29 @@ exports[`renders correctly with no value and no options 1`] = `
27
27
  font-weight: normal;
28
28
  }
29
29
 
30
+ .c4 {
31
+ position: relative;
32
+ font-size: 1.25rem;
33
+ }
34
+
30
35
  .c5 {
36
+ position: relative;
37
+ width: 100%;
38
+ display: -webkit-box;
39
+ display: -webkit-flex;
40
+ display: -ms-flexbox;
41
+ display: flex;
42
+ -webkit-box-pack: end;
43
+ -webkit-justify-content: flex-end;
44
+ -ms-flex-pack: end;
45
+ justify-content: flex-end;
46
+ -webkit-align-items: center;
47
+ -webkit-box-align: center;
48
+ -ms-flex-align: center;
49
+ align-items: center;
50
+ }
51
+
52
+ .c6 {
31
53
  position: relative;
32
54
  box-sizing: border-box;
33
55
  width: 100%;
@@ -47,23 +69,20 @@ exports[`renders correctly with no value and no options 1`] = `
47
69
  font-family: 'Montserrat',Helvetica,Arial,sans-serif;
48
70
  }
49
71
 
50
- .c5:focus {
72
+ .c6:focus {
51
73
  border: 1px solid #666;
52
74
  }
53
75
 
54
- .c4 {
55
- position: relative;
56
- font-size: 1.25rem;
57
- }
58
-
59
76
  .c0 {
60
77
  position: relative;
61
78
  }
62
79
 
63
80
  @media (min-width:740px) {
64
- .c4 {
65
- max-width: 290px;
66
- }
81
+
82
+ }
83
+
84
+ @media (min-width:1024px) {
85
+
67
86
  }
68
87
 
69
88
  <div
@@ -88,18 +107,23 @@ exports[`renders correctly with no value and no options 1`] = `
88
107
  className="c4"
89
108
  >
90
109
 
91
- <input
92
- aria-describedby="text-input-with-dropdown"
93
- autoComplete="off"
110
+ <div
94
111
  className="c5"
95
- id="text-input-with-dropdown"
96
- name="query"
97
- onChange={[Function]}
98
- placeholder=""
99
- required={false}
100
- type="text"
101
- value=""
102
- />
112
+ >
113
+ <input
114
+ aria-describedby="text-input-with-dropdown"
115
+ autoComplete="off"
116
+ className="c6"
117
+ id="text-input-with-dropdown"
118
+ name="query"
119
+ onChange={[Function]}
120
+ placeholder=""
121
+ required={false}
122
+ type="text"
123
+ value=""
124
+ />
125
+
126
+ </div>
103
127
  </div>
104
128
 
105
129
  </label>
@@ -133,7 +157,29 @@ exports[`renders correctly with value and no options 1`] = `
133
157
  font-weight: normal;
134
158
  }
135
159
 
160
+ .c4 {
161
+ position: relative;
162
+ font-size: 1.25rem;
163
+ }
164
+
136
165
  .c5 {
166
+ position: relative;
167
+ width: 100%;
168
+ display: -webkit-box;
169
+ display: -webkit-flex;
170
+ display: -ms-flexbox;
171
+ display: flex;
172
+ -webkit-box-pack: end;
173
+ -webkit-justify-content: flex-end;
174
+ -ms-flex-pack: end;
175
+ justify-content: flex-end;
176
+ -webkit-align-items: center;
177
+ -webkit-box-align: center;
178
+ -ms-flex-align: center;
179
+ align-items: center;
180
+ }
181
+
182
+ .c6 {
137
183
  position: relative;
138
184
  box-sizing: border-box;
139
185
  width: 100%;
@@ -153,23 +199,20 @@ exports[`renders correctly with value and no options 1`] = `
153
199
  font-family: 'Montserrat',Helvetica,Arial,sans-serif;
154
200
  }
155
201
 
156
- .c5:focus {
202
+ .c6:focus {
157
203
  border: 1px solid #666;
158
204
  }
159
205
 
160
- .c4 {
161
- position: relative;
162
- font-size: 1.25rem;
163
- }
164
-
165
206
  .c0 {
166
207
  position: relative;
167
208
  }
168
209
 
169
210
  @media (min-width:740px) {
170
- .c4 {
171
- max-width: 290px;
172
- }
211
+
212
+ }
213
+
214
+ @media (min-width:1024px) {
215
+
173
216
  }
174
217
 
175
218
  <div
@@ -194,18 +237,23 @@ exports[`renders correctly with value and no options 1`] = `
194
237
  className="c4"
195
238
  >
196
239
 
197
- <input
198
- aria-describedby="text-input-with-dropdown"
199
- autoComplete="off"
240
+ <div
200
241
  className="c5"
201
- id="text-input-with-dropdown"
202
- name="query"
203
- onChange={[Function]}
204
- placeholder=""
205
- required={false}
206
- type="text"
207
- value="bikes"
208
- />
242
+ >
243
+ <input
244
+ aria-describedby="text-input-with-dropdown"
245
+ autoComplete="off"
246
+ className="c6"
247
+ id="text-input-with-dropdown"
248
+ name="query"
249
+ onChange={[Function]}
250
+ placeholder=""
251
+ required={false}
252
+ type="text"
253
+ value="bikes"
254
+ />
255
+
256
+ </div>
209
257
  </div>
210
258
 
211
259
  </label>
@@ -239,7 +287,29 @@ exports[`renders correctly with value and options 1`] = `
239
287
  font-weight: normal;
240
288
  }
241
289
 
290
+ .c4 {
291
+ position: relative;
292
+ font-size: 1.25rem;
293
+ }
294
+
242
295
  .c5 {
296
+ position: relative;
297
+ width: 100%;
298
+ display: -webkit-box;
299
+ display: -webkit-flex;
300
+ display: -ms-flexbox;
301
+ display: flex;
302
+ -webkit-box-pack: end;
303
+ -webkit-justify-content: flex-end;
304
+ -ms-flex-pack: end;
305
+ justify-content: flex-end;
306
+ -webkit-align-items: center;
307
+ -webkit-box-align: center;
308
+ -ms-flex-align: center;
309
+ align-items: center;
310
+ }
311
+
312
+ .c6 {
243
313
  position: relative;
244
314
  box-sizing: border-box;
245
315
  width: 100%;
@@ -259,20 +329,15 @@ exports[`renders correctly with value and options 1`] = `
259
329
  font-family: 'Montserrat',Helvetica,Arial,sans-serif;
260
330
  }
261
331
 
262
- .c5:focus {
332
+ .c6:focus {
263
333
  border: 1px solid #666;
264
334
  }
265
335
 
266
- .c4 {
267
- position: relative;
268
- font-size: 1.25rem;
269
- }
270
-
271
336
  .c0 {
272
337
  position: relative;
273
338
  }
274
339
 
275
- .c6 {
340
+ .c7 {
276
341
  z-index: 3;
277
342
  font-family: 'Montserrat',Helvetica,Arial,sans-serif;
278
343
  position: absolute;
@@ -285,34 +350,36 @@ exports[`renders correctly with value and options 1`] = `
285
350
  width: 100%;
286
351
  }
287
352
 
288
- .c7 {
353
+ .c8 {
289
354
  list-style: none;
290
355
  padding: 0;
291
356
  margin: 0;
292
357
  }
293
358
 
294
- .c8 {
359
+ .c9 {
295
360
  padding: 0.5rem;
296
361
  }
297
362
 
298
- .c9 {
363
+ .c10 {
299
364
  cursor: pointer;
300
365
  border-top: 1px solid #F4F3F5;
301
366
  }
302
367
 
303
- .c9:hover,
304
- .c9:focus {
368
+ .c10:hover,
369
+ .c10:focus {
305
370
  background-color: #F4F3F5;
306
371
  }
307
372
 
308
373
  @media (min-width:740px) {
309
- .c4 {
310
- max-width: 290px;
311
- }
374
+
375
+ }
376
+
377
+ @media (min-width:1024px) {
378
+
312
379
  }
313
380
 
314
381
  @media (min-width:740px) {
315
- .c6 {
382
+ .c7 {
316
383
  max-width: 500px;
317
384
  }
318
385
  }
@@ -339,32 +406,37 @@ exports[`renders correctly with value and options 1`] = `
339
406
  className="c4"
340
407
  >
341
408
 
342
- <input
343
- aria-describedby="text-input-with-dropdown"
344
- autoComplete="off"
409
+ <div
345
410
  className="c5"
346
- id="text-input-with-dropdown"
347
- name="query"
348
- onChange={[Function]}
349
- placeholder=""
350
- required={false}
351
- type="text"
352
- value="c"
353
- />
411
+ >
412
+ <input
413
+ aria-describedby="text-input-with-dropdown"
414
+ autoComplete="off"
415
+ className="c6"
416
+ id="text-input-with-dropdown"
417
+ name="query"
418
+ onChange={[Function]}
419
+ placeholder=""
420
+ required={false}
421
+ type="text"
422
+ value="c"
423
+ />
424
+
425
+ </div>
354
426
  </div>
355
427
 
356
428
  </label>
357
429
  <div
358
- className="c6 TextInputWithDropdown__options"
430
+ className="c7 TextInputWithDropdown__options"
359
431
  >
360
432
  <ul
361
- className="c7"
433
+ className="c8"
362
434
  onBlur={[Function]}
363
435
  role="listbox"
364
436
  >
365
437
  <li
366
438
  aria-selected={false}
367
- className="c8 c9"
439
+ className="c9 c10"
368
440
  id="option-0"
369
441
  onClick={[Function]}
370
442
  onKeyPress={[Function]}
@@ -381,7 +453,7 @@ exports[`renders correctly with value and options 1`] = `
381
453
  </li>
382
454
  <li
383
455
  aria-selected={false}
384
- className="c8 c9"
456
+ className="c9 c10"
385
457
  id="option-1"
386
458
  onClick={[Function]}
387
459
  onKeyPress={[Function]}
@@ -398,7 +470,7 @@ exports[`renders correctly with value and options 1`] = `
398
470
  </li>
399
471
  <li
400
472
  aria-selected={false}
401
- className="c8 c9"
473
+ className="c9 c10"
402
474
  id="option-2"
403
475
  onClick={[Function]}
404
476
  onKeyPress={[Function]}
@@ -415,7 +487,7 @@ exports[`renders correctly with value and options 1`] = `
415
487
  </li>
416
488
  <li
417
489
  aria-selected={false}
418
- className="c8 c9"
490
+ className="c9 c10"
419
491
  id="option-3"
420
492
  onClick={[Function]}
421
493
  onKeyPress={[Function]}
@@ -27,7 +27,29 @@ exports[`renders correctly 1`] = `
27
27
  font-weight: normal;
28
28
  }
29
29
 
30
+ .c4 {
31
+ position: relative;
32
+ font-size: 1.25rem;
33
+ }
34
+
30
35
  .c5 {
36
+ position: relative;
37
+ width: 100%;
38
+ display: -webkit-box;
39
+ display: -webkit-flex;
40
+ display: -ms-flexbox;
41
+ display: flex;
42
+ -webkit-box-pack: end;
43
+ -webkit-justify-content: flex-end;
44
+ -ms-flex-pack: end;
45
+ justify-content: flex-end;
46
+ -webkit-align-items: center;
47
+ -webkit-box-align: center;
48
+ -ms-flex-align: center;
49
+ align-items: center;
50
+ }
51
+
52
+ .c6 {
31
53
  position: relative;
32
54
  box-sizing: border-box;
33
55
  width: 100%;
@@ -47,23 +69,20 @@ exports[`renders correctly 1`] = `
47
69
  font-family: 'Montserrat',Helvetica,Arial,sans-serif;
48
70
  }
49
71
 
50
- .c5:focus {
72
+ .c6:focus {
51
73
  border: 1px solid #666;
52
74
  }
53
75
 
54
- .c4 {
55
- position: relative;
56
- font-size: 1.25rem;
57
- }
58
-
59
76
  .c0 {
60
77
  position: relative;
61
78
  }
62
79
 
63
80
  @media (min-width:740px) {
64
- .c4 {
65
- max-width: 290px;
66
- }
81
+
82
+ }
83
+
84
+ @media (min-width:1024px) {
85
+
67
86
  }
68
87
 
69
88
  <div
@@ -88,18 +107,23 @@ exports[`renders correctly 1`] = `
88
107
  className="c4"
89
108
  >
90
109
 
91
- <input
92
- aria-describedby="school-lookup"
93
- autoComplete="off"
110
+ <div
94
111
  className="c5"
95
- defaultValue=""
96
- id="school-lookup"
97
- name="school-lookup"
98
- onChange={[Function]}
99
- placeholder="Type to start search"
100
- required={false}
101
- type="text"
102
- />
112
+ >
113
+ <input
114
+ aria-describedby="school-lookup"
115
+ autoComplete="off"
116
+ className="c6"
117
+ defaultValue=""
118
+ id="school-lookup"
119
+ name="school-lookup"
120
+ onChange={[Function]}
121
+ placeholder="Type to start search"
122
+ required={false}
123
+ type="text"
124
+ />
125
+
126
+ </div>
103
127
  </div>
104
128
 
105
129
  </label>
@@ -13,5 +13,5 @@ it('renders correctly', () => {
13
13
  },
14
14
  value: ""
15
15
  })).toJSON();
16
- expect(tree).toMatchInlineSnapshot("\n .c6 {\n font-size: 1rem;\n line-height: 1rem;\n text-transform: inherit;\n line-height: normal;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c4 {\n width: 100%;\n position: relative;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-flex-direction: column;\n -ms-flex-direction: column;\n flex-direction: column;\n color: #5C5C5E;\n }\n\n .c7 {\n border: 0;\n -webkit-clip: rect(0 0 0 0);\n clip: rect(0 0 0 0);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n }\n\n .c9 {\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: 48px;\n padding: 1rem 2.4rem 1rem 1.5rem;\n background-color: #F4F3F5;\n border: 1px solid;\n border-color: #E1E2E3;\n box-shadow: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n color: #000000;\n border-radius: 0.5rem;\n font-size: inherit;\n z-index: 2;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c9:focus {\n border: 1px solid #666;\n }\n\n .c8 {\n position: relative;\n font-size: 1.25rem;\n }\n\n .c0 {\n width: 100%;\n max-width: 1440px;\n margin: auto;\n }\n\n .c1 {\n margin: 1rem auto;\n padding: 0 calc((4 * 0.25rem));\n }\n\n .c2 {\n margin: 4rem auto;\n width: 100%;\n border-bottom: 4px solid #E52630;\n overflow: hidden;\n }\n\n .c3 {\n width: 100%;\n padding: 0 0.5rem;\n }\n\n .c5 input {\n padding: 13px 0;\n margin: 0;\n max-width: 100%;\n border: 0;\n outline: #E52630;\n background: none;\n }\n\n .c5 input:focus {\n border: 0;\n }\n\n @media (min-width:740px) {\n .c8 {\n max-width: 290px;\n }\n }\n\n @media (min-width:740px) {\n .c5 input {\n height: 100px;\n font-size: 3rem;\n }\n }\n\n <div\n className=\"c0\"\n >\n <div\n className=\"c1\"\n >\n <div\n className=\"c2\"\n role=\"search\"\n >\n <div\n className=\"c3\"\n >\n <label\n className=\"c4 c5\"\n htmlFor=\"search\"\n >\n <span\n className=\"c6 c7\"\n color=\"inherit\"\n dangerouslySetInnerHTML={\n Object {\n \"__html\": \"Search\",\n }\n }\n size=\"s\"\n />\n <div\n className=\"c8\"\n >\n \n <input\n aria-describedby=\"search\"\n className=\"c9\"\n id=\"search\"\n name=\"search\"\n onChange={[Function]}\n placeholder=\"\"\n required={false}\n role=\"searchbox\"\n type=\"text\"\n value=\"\"\n />\n </div>\n \n </label>\n </div>\n </div>\n </div>\n </div>\n ");
16
+ expect(tree).toMatchInlineSnapshot("\n .c6 {\n font-size: 1rem;\n line-height: 1rem;\n text-transform: inherit;\n line-height: normal;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c4 {\n width: 100%;\n position: relative;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-flex-direction: column;\n -ms-flex-direction: column;\n flex-direction: column;\n color: #5C5C5E;\n }\n\n .c7 {\n border: 0;\n -webkit-clip: rect(0 0 0 0);\n clip: rect(0 0 0 0);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n }\n\n .c8 {\n position: relative;\n font-size: 1.25rem;\n }\n\n .c9 {\n position: relative;\n width: 100%;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: end;\n -webkit-justify-content: flex-end;\n -ms-flex-pack: end;\n justify-content: flex-end;\n -webkit-align-items: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n }\n\n .c10 {\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: 48px;\n padding: 1rem 2.4rem 1rem 1.5rem;\n background-color: #F4F3F5;\n border: 1px solid;\n border-color: #E1E2E3;\n box-shadow: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n color: #000000;\n border-radius: 0.5rem;\n font-size: inherit;\n z-index: 2;\n font-family: 'Montserrat',Helvetica,Arial,sans-serif;\n }\n\n .c10:focus {\n border: 1px solid #666;\n }\n\n .c0 {\n width: 100%;\n max-width: 1440px;\n margin: auto;\n }\n\n .c1 {\n margin: 1rem auto;\n padding: 0 calc((4 * 0.25rem));\n }\n\n .c2 {\n margin: 4rem auto;\n width: 100%;\n border-bottom: 4px solid #E52630;\n overflow: hidden;\n }\n\n .c3 {\n width: 100%;\n padding: 0 0.5rem;\n }\n\n .c5 input {\n padding: 13px 0;\n margin: 0;\n max-width: 100%;\n border: 0;\n outline: #E52630;\n background: none;\n }\n\n .c5 input:focus {\n border: 0;\n }\n\n @media (min-width:740px) {\n\n }\n\n @media (min-width:1024px) {\n\n }\n\n @media (min-width:740px) {\n .c5 input {\n height: 100px;\n font-size: 3rem;\n }\n }\n\n <div\n className=\"c0\"\n >\n <div\n className=\"c1\"\n >\n <div\n className=\"c2\"\n role=\"search\"\n >\n <div\n className=\"c3\"\n >\n <label\n className=\"c4 c5\"\n htmlFor=\"search\"\n >\n <span\n className=\"c6 c7\"\n color=\"inherit\"\n dangerouslySetInnerHTML={\n Object {\n \"__html\": \"Search\",\n }\n }\n size=\"s\"\n />\n <div\n className=\"c8\"\n >\n \n <div\n className=\"c9\"\n >\n <input\n aria-describedby=\"search\"\n className=\"c10\"\n id=\"search\"\n name=\"search\"\n onChange={[Function]}\n placeholder=\"\"\n required={false}\n role=\"searchbox\"\n type=\"text\"\n value=\"\"\n />\n \n </div>\n </div>\n \n </label>\n </div>\n </div>\n </div>\n </div>\n ");
17
17
  });