@thecb/components 4.0.23 → 4.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ nodejs 10.15.3
package/dist/index.cjs.js CHANGED
@@ -14130,6 +14130,49 @@ var NotFoundIcon = function NotFoundIcon() {
14130
14130
  }))))));
14131
14131
  };
14132
14132
 
14133
+ var SearchIcon = function SearchIcon() {
14134
+ return /*#__PURE__*/React__default.createElement("svg", {
14135
+ width: "22px",
14136
+ height: "22px",
14137
+ viewBox: "0 0 22 22",
14138
+ version: "1.1"
14139
+ }, /*#__PURE__*/React__default.createElement("g", {
14140
+ id: "Debt-Search",
14141
+ stroke: "none",
14142
+ strokeWidth: "1",
14143
+ fill: "none",
14144
+ fillRule: "evenodd"
14145
+ }, /*#__PURE__*/React__default.createElement("g", {
14146
+ id: "Debt-Search---Expanded",
14147
+ transform: "translate(-155.000000, -258.000000)",
14148
+ stroke: "#292A33",
14149
+ strokeWidth: "2"
14150
+ }, /*#__PURE__*/React__default.createElement("g", {
14151
+ id: "debt-search",
14152
+ transform: "translate(132.000000, 189.000000)"
14153
+ }, /*#__PURE__*/React__default.createElement("g", {
14154
+ id: "search",
14155
+ transform: "translate(0.000000, 44.000000)"
14156
+ }, /*#__PURE__*/React__default.createElement("g", {
14157
+ id: "search_icon",
14158
+ transform: "translate(24.000000, 26.000000)"
14159
+ }, /*#__PURE__*/React__default.createElement("circle", {
14160
+ id: "Oval-2",
14161
+ transform: "translate(7.407407, 7.407407) scale(-1, 1) translate(-7.407407, -7.407407) ",
14162
+ cx: "7.40740741",
14163
+ cy: "7.40740741",
14164
+ r: "7.40740741"
14165
+ }), /*#__PURE__*/React__default.createElement("line", {
14166
+ x1: "19.6296296",
14167
+ y1: "12.962963",
14168
+ x2: "12.9219369",
14169
+ y2: "19.6706557",
14170
+ id: "Line",
14171
+ strokeLinecap: "round",
14172
+ transform: "translate(16.296296, 16.296296) scale(-1, 1) translate(-16.296296, -16.296296) "
14173
+ })))))));
14174
+ };
14175
+
14133
14176
  var color$2 = "#15749D";
14134
14177
  var hoverColor$1 = "#116285";
14135
14178
  var activeColor$1 = "#0E506D";
@@ -20224,7 +20267,9 @@ var ERRORS = {
20224
20267
  "71": "Passed invalid pixel value %s to %s(), please pass a value like \"12px\" or 12.\n\n",
20225
20268
  "72": "Passed invalid base value %s to %s(), please pass a value like \"12px\" or 12.\n\n",
20226
20269
  "73": "Please provide a valid CSS variable.\n\n",
20227
- "74": "CSS variable not found.\n"
20270
+ "74": "CSS variable not found and no default was provided.\n\n",
20271
+ "75": "important requires a valid style object, got a %s instead.\n\n",
20272
+ "76": "fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n"
20228
20273
  };
20229
20274
  /**
20230
20275
  * super basic version of sprintf
@@ -31879,6 +31924,55 @@ var ToggleSwitch = function ToggleSwitch(_ref6) {
31879
31924
 
31880
31925
  var ToggleSwitch$1 = themeComponent(ToggleSwitch, "ToggleSwitch", fallbackValues$p);
31881
31926
 
31927
+ var background$1 = "".concat(ATHENS_GREY);
31928
+ var white$1 = "".concat(WHITE);
31929
+ var black = "#000";
31930
+ var focusBorder = "".concat(MATISSE_BLUE);
31931
+ var themeValues = {
31932
+ background: background$1,
31933
+ white: white$1,
31934
+ black: black,
31935
+ focusBorder: focusBorder
31936
+ };
31937
+
31938
+ function _templateObject$w() {
31939
+ var data = _taggedTemplateLiteral(["\n display: flex;\n align-content: center;\n align-items: center;\n background: ", ";\n\n input {\n border: 0;\n height: 72px;\n width: 100%;\n padding: 1.5rem;\n padding-left: 1rem;\n min-width: 100px;\n margin: 0;\n box-sizing: border-box;\n position: relative;\n font-size: 1.1rem;\n line-height: 2rem;\n font-weight: 400;\n background-color: ", ";\n color: ", ";\n box-shadow: none;\n border: 1px solid transparent;\n\n &:focus {\n border: 1px solid ", ";\n }\n }\n"]);
31940
+
31941
+ _templateObject$w = function _templateObject() {
31942
+ return data;
31943
+ };
31944
+
31945
+ return data;
31946
+ }
31947
+ var TypeaheadInputWrapper = styled__default.div(_templateObject$w(), themeValues.background, themeValues.background, themeValues.black, themeValues.focusBorder);
31948
+
31949
+ var TypeaheadInput = function TypeaheadInput(_ref) {
31950
+ var handleChange = _ref.handleChange,
31951
+ placeholder = _ref.placeholder,
31952
+ id = _ref.id,
31953
+ labelText = _ref.labelText;
31954
+
31955
+ var onChange = function onChange(el) {
31956
+ return handleChange(el.currentTarget.value);
31957
+ };
31958
+
31959
+ return /*#__PURE__*/React__default.createElement(TypeaheadInputWrapper, null, /*#__PURE__*/React__default.createElement(Box, {
31960
+ padding: "1.5rem 0 1.5rem 1.5rem"
31961
+ }, /*#__PURE__*/React__default.createElement(SearchIcon, null)), /*#__PURE__*/React__default.createElement(Text$1, {
31962
+ as: "label",
31963
+ color: "black",
31964
+ variant: "pS",
31965
+ weight: 500,
31966
+ extraStyles: "\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n ",
31967
+ id: id
31968
+ }, labelText), /*#__PURE__*/React__default.createElement("input", {
31969
+ "aria-labelledby": id,
31970
+ type: "text",
31971
+ placeholder: placeholder,
31972
+ onChange: onChange
31973
+ }));
31974
+ };
31975
+
31882
31976
  const validatorToPredicate = (validatorFn, emptyCase) => (
31883
31977
  value,
31884
31978
  ...rest
@@ -33877,16 +33971,16 @@ function _templateObject2$j() {
33877
33971
  return data;
33878
33972
  }
33879
33973
 
33880
- function _templateObject$w() {
33974
+ function _templateObject$x() {
33881
33975
  var data = _taggedTemplateLiteral(["\n box-sizing: border-box;\n background: ", ";\n height: ", ";\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 1.5rem;\n :not(:last-child),\n :not(:first-child) {\n box-shadow: inset 0px -1px 0px 0px rgb(202, 206, 216);\n }\n :first-child {\n border-top-left-radius: 3px;\n border-top-right-radius: 3px;\n }\n :last-child {\n border-bottom-left-radius: 3px;\n border-bottom-right-radius: 3px;\n box-shadow: none;\n }\n"]);
33882
33976
 
33883
- _templateObject$w = function _templateObject() {
33977
+ _templateObject$x = function _templateObject() {
33884
33978
  return data;
33885
33979
  };
33886
33980
 
33887
33981
  return data;
33888
33982
  }
33889
- var EditableListItem = styled__default.div(_templateObject$w(), WHITE, function (_ref) {
33983
+ var EditableListItem = styled__default.div(_templateObject$x(), WHITE, function (_ref) {
33890
33984
  var listItemSize = _ref.listItemSize;
33891
33985
  return listItemSize === "big" ? "120px" : "72px";
33892
33986
  });
@@ -34071,16 +34165,16 @@ function _templateObject2$k() {
34071
34165
  return data;
34072
34166
  }
34073
34167
 
34074
- function _templateObject$x() {
34168
+ function _templateObject$y() {
34075
34169
  var data = _taggedTemplateLiteral(["\n display: ", ";\n flex-direction: column;\n flex: 1;\n"]);
34076
34170
 
34077
- _templateObject$x = function _templateObject() {
34171
+ _templateObject$y = function _templateObject() {
34078
34172
  return data;
34079
34173
  };
34080
34174
 
34081
34175
  return data;
34082
34176
  }
34083
- var EditableTableContainer = styled__default.div(_templateObject$x(), function (_ref) {
34177
+ var EditableTableContainer = styled__default.div(_templateObject$y(), function (_ref) {
34084
34178
  var hide = _ref.hide;
34085
34179
  return hide ? "none" : "flex";
34086
34180
  });
@@ -35806,10 +35900,10 @@ var NavMenuDesktop = function NavMenuDesktop(_ref) {
35806
35900
 
35807
35901
  var NavMenuDesktop$1 = themeComponent(NavMenuDesktop, "NavMenu", fallbackValues$t, "profile");
35808
35902
 
35809
- function _templateObject$y() {
35903
+ function _templateObject$z() {
35810
35904
  var data = _taggedTemplateLiteral(["\n position: fixed;\n top: 72px;\n"]);
35811
35905
 
35812
- _templateObject$y = function _templateObject() {
35906
+ _templateObject$z = function _templateObject() {
35813
35907
  return data;
35814
35908
  };
35815
35909
 
@@ -35845,7 +35939,7 @@ var menu = posed.div({
35845
35939
  }
35846
35940
  }
35847
35941
  });
35848
- var ImposterMenu = styled__default(menu)(_templateObject$y());
35942
+ var ImposterMenu = styled__default(menu)(_templateObject$z());
35849
35943
 
35850
35944
  var NavMenuMobile = function NavMenuMobile(_ref) {
35851
35945
  var id = _ref.id,
@@ -38254,16 +38348,16 @@ var AccountAndRoutingModal = function AccountAndRoutingModal(_ref) {
38254
38348
 
38255
38349
  var AccountAndRoutingModal$1 = themeComponent(AccountAndRoutingModal, "AccountAndRoutingModal", fallbackValues$w, "default");
38256
38350
 
38257
- function _templateObject$z() {
38351
+ function _templateObject$A() {
38258
38352
  var data = _taggedTemplateLiteral([""]);
38259
38353
 
38260
- _templateObject$z = function _templateObject() {
38354
+ _templateObject$A = function _templateObject() {
38261
38355
  return data;
38262
38356
  };
38263
38357
 
38264
38358
  return data;
38265
38359
  }
38266
- var ModalWrapper = styled__default.div(_templateObject$z());
38360
+ var ModalWrapper = styled__default.div(_templateObject$A());
38267
38361
 
38268
38362
  var PaymentFormACH = function PaymentFormACH(_ref) {
38269
38363
  var _routingNumberErrors, _accountNumberErrors;
@@ -38637,10 +38731,10 @@ var fallbackValues$x = {
38637
38731
  focusStyles: focusStyles
38638
38732
  };
38639
38733
 
38640
- function _templateObject$A() {
38734
+ function _templateObject$B() {
38641
38735
  var data = _taggedTemplateLiteral(["\n height: ", ";\n width: ", ";\n ", "\n transition: opacity 0.3s ease;\n "]);
38642
38736
 
38643
- _templateObject$A = function _templateObject() {
38737
+ _templateObject$B = function _templateObject() {
38644
38738
  return data;
38645
38739
  };
38646
38740
 
@@ -38710,7 +38804,7 @@ var RadioSection = function RadioSection(_ref) {
38710
38804
  }
38711
38805
  };
38712
38806
  var borderStyles = "\n border-width: 0 0 1px 0;\n border-color: ".concat(themeValues.borderColor, ";\n border-style: solid;\n border-radius: 0px;\n transform-origin: 100% 0;\n\n &:last-child {\n border-width: 0;\n }\n ");
38713
- var RightIcon = styled__default.img(_templateObject$A(), function (_ref2) {
38807
+ var RightIcon = styled__default.img(_templateObject$B(), function (_ref2) {
38714
38808
  var isMobile = _ref2.isMobile;
38715
38809
  return isMobile ? "14px" : "18px";
38716
38810
  }, function (_ref3) {
@@ -39271,16 +39365,16 @@ function _templateObject2$l() {
39271
39365
  return data;
39272
39366
  }
39273
39367
 
39274
- function _templateObject$B() {
39368
+ function _templateObject$C() {
39275
39369
  var data = _taggedTemplateLiteral(["\n outline: none;\n"]);
39276
39370
 
39277
- _templateObject$B = function _templateObject() {
39371
+ _templateObject$C = function _templateObject() {
39278
39372
  return data;
39279
39373
  };
39280
39374
 
39281
39375
  return data;
39282
39376
  }
39283
- var CheckboxWrapper = styled__default.div(_templateObject$B());
39377
+ var CheckboxWrapper = styled__default.div(_templateObject$C());
39284
39378
  var ModalWrapper$1 = styled__default.div(_templateObject2$l());
39285
39379
 
39286
39380
  var TermsAndConditions = function TermsAndConditions(_ref) {
@@ -39396,16 +39490,16 @@ var fallbackValues$A = {
39396
39490
  imageBackgroundColor: imageBackgroundColor
39397
39491
  };
39398
39492
 
39399
- function _templateObject$C() {
39493
+ function _templateObject$D() {
39400
39494
  var data = _taggedTemplateLiteral(["\n width: auto;\n height: 215px;\n"]);
39401
39495
 
39402
- _templateObject$C = function _templateObject() {
39496
+ _templateObject$D = function _templateObject() {
39403
39497
  return data;
39404
39498
  };
39405
39499
 
39406
39500
  return data;
39407
39501
  }
39408
- var WelcomeImage = styled__default.img(_templateObject$C());
39502
+ var WelcomeImage = styled__default.img(_templateObject$D());
39409
39503
 
39410
39504
  var WelcomeModule = function WelcomeModule(_ref) {
39411
39505
  var heading = _ref.heading,
@@ -39856,6 +39950,7 @@ exports.ResetConfirmationForm = ResetConfirmationForm$1;
39856
39950
  exports.ResetPasswordForm = ResetPasswordForm;
39857
39951
  exports.ResetPasswordSuccess = ResetPasswordSuccess;
39858
39952
  exports.RoutingNumberImage = RoutingNumberImage;
39953
+ exports.SearchIcon = SearchIcon;
39859
39954
  exports.SettingsIconSmall = SettingsIconSmall$1;
39860
39955
  exports.Sidebar = Sidebar;
39861
39956
  exports.SidebarSingleContent = SidebarSingleContent$1;
@@ -39873,6 +39968,7 @@ exports.Text = Text$1;
39873
39968
  exports.Timeout = Timeout$1;
39874
39969
  exports.TimeoutImage = TimeoutImage;
39875
39970
  exports.ToggleSwitch = ToggleSwitch$1;
39971
+ exports.TypeaheadInput = TypeaheadInput;
39876
39972
  exports.VerifiedEmailIcon = VerifiedEmailIcon$1;
39877
39973
  exports.WelcomeModule = WelcomeModule$1;
39878
39974
  exports.WorkflowTile = WorkflowTile;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "4.0.23",
3
+ "version": "4.0.24",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -0,0 +1,45 @@
1
+ import React from "react";
2
+
3
+ const SearchIcon = () => (
4
+ <svg width="22px" height="22px" viewBox="0 0 22 22" version="1.1">
5
+ <g
6
+ id="Debt-Search"
7
+ stroke="none"
8
+ strokeWidth="1"
9
+ fill="none"
10
+ fillRule="evenodd"
11
+ >
12
+ <g
13
+ id="Debt-Search---Expanded"
14
+ transform="translate(-155.000000, -258.000000)"
15
+ stroke="#292A33"
16
+ strokeWidth="2"
17
+ >
18
+ <g id="debt-search" transform="translate(132.000000, 189.000000)">
19
+ <g id="search" transform="translate(0.000000, 44.000000)">
20
+ <g id="search_icon" transform="translate(24.000000, 26.000000)">
21
+ <circle
22
+ id="Oval-2"
23
+ transform="translate(7.407407, 7.407407) scale(-1, 1) translate(-7.407407, -7.407407) "
24
+ cx="7.40740741"
25
+ cy="7.40740741"
26
+ r="7.40740741"
27
+ ></circle>
28
+ <line
29
+ x1="19.6296296"
30
+ y1="12.962963"
31
+ x2="12.9219369"
32
+ y2="19.6706557"
33
+ id="Line"
34
+ strokeLinecap="round"
35
+ transform="translate(16.296296, 16.296296) scale(-1, 1) translate(-16.296296, -16.296296) "
36
+ ></line>
37
+ </g>
38
+ </g>
39
+ </g>
40
+ </g>
41
+ </g>
42
+ </svg>
43
+ );
44
+
45
+ export default SearchIcon;
@@ -21,7 +21,8 @@ import {
21
21
  BankIcon,
22
22
  GenericCard,
23
23
  PaymentIcon,
24
- AutopayOnIcon
24
+ AutopayOnIcon,
25
+ SearchIcon
25
26
  } from "./index";
26
27
 
27
28
  const story = page({
@@ -50,3 +51,4 @@ export const bankIcon = () => <BankIcon />;
50
51
  export const genericCard = () => <GenericCard />;
51
52
  export const paymentIcon = () => <PaymentIcon />;
52
53
  export const autopayOnIcon = () => <AutopayOnIcon />;
54
+ export const searchIcon = () => <SearchIcon />;
@@ -22,6 +22,7 @@ import IconAdd from "./IconAdd";
22
22
  import TimeoutImage from "./TimeoutImage";
23
23
  import AutopayOnIcon from "./AutopayOnIcon";
24
24
  import NotFoundIcon from "./NotFoundIcon";
25
+ import SearchIcon from "./SearchIcon";
25
26
 
26
27
  export {
27
28
  AccountsIcon,
@@ -47,5 +48,6 @@ export {
47
48
  IconAdd,
48
49
  TimeoutImage,
49
50
  AutopayOnIcon,
50
- NotFoundIcon
51
+ NotFoundIcon,
52
+ SearchIcon
51
53
  };
@@ -36,3 +36,4 @@ export { default as Spinner } from "./spinner";
36
36
  export { default as StateProvinceDropdown } from "./state-province-dropdown";
37
37
  export { default as Text } from "./text";
38
38
  export { default as ToggleSwitch } from "./toggle-switch";
39
+ export { default as TypeaheadInput } from "./typeahead-input";
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+
3
+ import TypeaheadInput from "./TypeaheadInput";
4
+ import page from "../../../../.storybook/page";
5
+
6
+ export const text = () => (
7
+ <TypeaheadInput
8
+ id="typeahead-1"
9
+ labelText="typeahead-index"
10
+ placeholder={"Search items..."}
11
+ handleChange={data => console.log(data)}
12
+ />
13
+ );
14
+
15
+ const story = page({
16
+ title: "Components|Atoms/TypeaheadInput",
17
+ Component: TypeaheadInput
18
+ });
19
+ export default story;
@@ -0,0 +1,77 @@
1
+ import React from "react";
2
+ import styled from "styled-components";
3
+
4
+ import { SearchIcon } from "../icons";
5
+ import { Box } from "../layouts";
6
+ import Text from "../text";
7
+
8
+ import { themeValues } from "./TypeaheadInput.theme";
9
+
10
+ export const TypeaheadInputWrapper = styled.div`
11
+ display: flex;
12
+ align-content: center;
13
+ align-items: center;
14
+ background: ${themeValues.background};
15
+
16
+ input {
17
+ border: 0;
18
+ height: 72px;
19
+ width: 100%;
20
+ padding: 1.5rem;
21
+ padding-left: 1rem;
22
+ min-width: 100px;
23
+ margin: 0;
24
+ box-sizing: border-box;
25
+ position: relative;
26
+ font-size: 1.1rem;
27
+ line-height: 2rem;
28
+ font-weight: 400;
29
+ background-color: ${themeValues.background};
30
+ color: ${themeValues.black};
31
+ box-shadow: none;
32
+ border: 1px solid transparent;
33
+
34
+ &:focus {
35
+ border: 1px solid ${themeValues.focusBorder};
36
+ }
37
+ }
38
+ `;
39
+
40
+ const TypeaheadInput = ({ handleChange, placeholder, id, labelText }) => {
41
+ const onChange = el => handleChange(el.currentTarget.value);
42
+ return (
43
+ <TypeaheadInputWrapper>
44
+ <Box padding="1.5rem 0 1.5rem 1.5rem">
45
+ <SearchIcon />
46
+ </Box>
47
+
48
+ <Text
49
+ as="label"
50
+ color={"black"}
51
+ variant="pS"
52
+ weight={500}
53
+ extraStyles={`
54
+ border: 0;
55
+ clip: rect(0 0 0 0);
56
+ height: 1px;
57
+ margin: -1px;
58
+ overflow: hidden;
59
+ padding: 0;
60
+ position: absolute;
61
+ width: 1px;
62
+ `}
63
+ id={id}
64
+ >
65
+ {labelText}
66
+ </Text>
67
+ <input
68
+ aria-labelledby={id}
69
+ type="text"
70
+ placeholder={placeholder}
71
+ onChange={onChange}
72
+ />
73
+ </TypeaheadInputWrapper>
74
+ );
75
+ };
76
+
77
+ export default TypeaheadInput;
@@ -0,0 +1,13 @@
1
+ import { ATHENS_GREY, WHITE, MATISSE_BLUE } from "../../../constants/colors";
2
+
3
+ const background = `${ATHENS_GREY}`;
4
+ const white = `${WHITE}`;
5
+ const black = "#000";
6
+ const focusBorder = `${MATISSE_BLUE}`;
7
+
8
+ export const themeValues = {
9
+ background,
10
+ white,
11
+ black,
12
+ focusBorder
13
+ };
@@ -0,0 +1,3 @@
1
+ import TypeaheadInput from "./TypeaheadInput";
2
+
3
+ export default TypeaheadInput;