@thecb/components 3.6.0-beta.1 → 3.7.0-beta.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.
package/dist/index.cjs.js CHANGED
@@ -13099,7 +13099,8 @@ var SettingsIconSmall = function SettingsIconSmall(_ref) {
13099
13099
  var SettingsIconSmall$1 = themeComponent(SettingsIconSmall, "Icons", fallbackValues$2, "primary");
13100
13100
 
13101
13101
  var ChevronIcon = function ChevronIcon(_ref) {
13102
- var themeValues = _ref.themeValues;
13102
+ var themeValues = _ref.themeValues,
13103
+ iconFill = _ref.iconFill;
13103
13104
  return /*#__PURE__*/React__default.createElement("svg", {
13104
13105
  width: "24",
13105
13106
  height: "24",
@@ -13120,16 +13121,16 @@ var ChevronIcon = function ChevronIcon(_ref) {
13120
13121
  }, /*#__PURE__*/React__default.createElement("mask", {
13121
13122
  id: "icon-chevron-mask-2"
13122
13123
  }, /*#__PURE__*/React__default.createElement("use", {
13123
- fill: themeValues.singleIconColor,
13124
+ fill: iconFill !== null && iconFill !== void 0 ? iconFill : themeValues.singleIconColor,
13124
13125
  xlinkHref: "#icon-chevron-path-1"
13125
13126
  })), /*#__PURE__*/React__default.createElement("use", {
13126
- fill: themeValues.singleIconColor,
13127
+ fill: iconFill !== null && iconFill !== void 0 ? iconFill : themeValues.singleIconColor,
13127
13128
  id: "icon-chevron-Fill-2",
13128
13129
  xlinkHref: "#icon-chevron-path-1"
13129
13130
  }), /*#__PURE__*/React__default.createElement("g", {
13130
13131
  id: "Colors/Blue-Dark",
13131
13132
  mask: "url(#icon-chevron-mask-2)",
13132
- fill: themeValues.singleIconColor
13133
+ fill: iconFill !== null && iconFill !== void 0 ? iconFill : themeValues.singleIconColor
13133
13134
  }, /*#__PURE__*/React__default.createElement("rect", {
13134
13135
  id: "icon-chevron-rect",
13135
13136
  width: "24",
@@ -14097,7 +14098,7 @@ var AlertSuccessIcon = function AlertSuccessIcon() {
14097
14098
  xmlnsXlink: "http://www.w3.org/1999/xlink"
14098
14099
  }, /*#__PURE__*/React__default.createElement("defs", null, /*#__PURE__*/React__default.createElement("path", {
14099
14100
  d: "M12,24 C18.627417,24 24,18.627417 24,12 C24,5.372583 18.627417,0 12,0 C5.372583,0 0,5.372583 0,12 C0,18.627417 5.372583,24 12,24 Z M16.9497475,7.46446609 L18.363961,8.87867966 L9.87867966,17.363961 L5.63603897,13.1213203 L7.05025253,11.7071068 L9.87803897,14.5354661 L16.9497475,7.46446609 Z",
14100
- id: "path-1"
14101
+ id: "alertSuccess"
14101
14102
  })), /*#__PURE__*/React__default.createElement("g", {
14102
14103
  id: "Symbols",
14103
14104
  stroke: "none",
@@ -14114,12 +14115,12 @@ var AlertSuccessIcon = function AlertSuccessIcon() {
14114
14115
  id: "mask-2",
14115
14116
  fill: "white"
14116
14117
  }, /*#__PURE__*/React__default.createElement("use", {
14117
- xlinkHref: "#path-1"
14118
+ xlinkHref: "#alertSuccess"
14118
14119
  })), /*#__PURE__*/React__default.createElement("use", {
14119
14120
  id: "background-2",
14120
14121
  fill: "#47B872",
14121
14122
  fillRule: "nonzero",
14122
- xlinkHref: "#path-1"
14123
+ xlinkHref: "#alertSuccess"
14123
14124
  })))));
14124
14125
  };
14125
14126
 
@@ -14264,7 +14265,7 @@ var Alert = function Alert(_ref) {
14264
14265
  width: "24px",
14265
14266
  childGap: "0rem"
14266
14267
  }, /*#__PURE__*/React__default.createElement(Box, {
14267
- padding: "0 0 0 1rem",
14268
+ padding: "0 0.5rem 0 1rem",
14268
14269
  minHeight: "100%"
14269
14270
  }, /*#__PURE__*/React__default.createElement(Cover, {
14270
14271
  minHeight: "100%",
@@ -14280,7 +14281,7 @@ var Alert = function Alert(_ref) {
14280
14281
  width: "24px",
14281
14282
  childGap: "0rem"
14282
14283
  }, /*#__PURE__*/React__default.createElement(Box, {
14283
- padding: "1rem"
14284
+ padding: "1rem 1rem 1rem 0.5rem"
14284
14285
  }, /*#__PURE__*/React__default.createElement(Cluster, {
14285
14286
  justify: "flex-start",
14286
14287
  align: "center"
@@ -15349,7 +15350,7 @@ _curry2(function nth(offset, list) {
15349
15350
  *
15350
15351
  * @func
15351
15352
  * @memberOf R
15352
- * @since v0.27.0
15353
+ * @since v0.27.1
15353
15354
  * @category Object
15354
15355
  * @typedefn Idx = [String | Int]
15355
15356
  * @sig [Idx] -> {a} -> [a | Undefined]
@@ -18448,8 +18449,28 @@ var fallbackValues$e = {
18448
18449
  hoverFocusStyles: hoverFocusStyles
18449
18450
  };
18450
18451
 
18452
+ function _templateObject4$4() {
18453
+ var data = _taggedTemplateLiteral(["\n ", "\n "]);
18454
+
18455
+ _templateObject4$4 = function _templateObject4() {
18456
+ return data;
18457
+ };
18458
+
18459
+ return data;
18460
+ }
18461
+
18462
+ function _templateObject3$7() {
18463
+ var data = _taggedTemplateLiteral(["\n border: 1px solid\n ", ";\n border-radius: 2px;\n height: ", ";\n width: 100%;\n padding: 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: ", ";\n background-color: ", ";\n color: ", ";\n box-shadow: none;\n\n &:focus {\n border: 1px solid ", ";\n }\n\n ", "\n"]);
18464
+
18465
+ _templateObject3$7 = function _templateObject3() {
18466
+ return data;
18467
+ };
18468
+
18469
+ return data;
18470
+ }
18471
+
18451
18472
  function _templateObject2$d() {
18452
- var data = _taggedTemplateLiteral(["\n border: 1px solid\n ", ";\n border-radius: 2px;\n height: 48px;\n width: 100%;\n padding: 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: ", ";\n background-color: ", ";\n color: ", ";\n box-shadow: none;\n\n &:focus {\n border: 1px solid ", ";\n }\n"]);
18473
+ var data = _taggedTemplateLiteral(["\n ", "\n "]);
18453
18474
 
18454
18475
  _templateObject2$d = function _templateObject2() {
18455
18476
  return data;
@@ -18459,7 +18480,7 @@ function _templateObject2$d() {
18459
18480
  }
18460
18481
 
18461
18482
  function _templateObject$p() {
18462
- var data = _taggedTemplateLiteral(["\n border: 1px solid\n ", ";\n border-radius: 2px;\n height: 48px;\n width: 100%;\n padding: 1rem;\n min-width: 100px;\n margin: 0;\n box-sizing: border-box;\n position: relative;\n font-size: 1.1rem;\n font-family: Public Sans;\n line-height: 2rem;\n font-weight: ", ";\n background-color: ", ";\n color: ", ";\n box-shadow: none;\n ", "\n transition: background 0.3s ease;\n\n &:focus {\n border: 1px solid ", ";\n }\n"]);
18483
+ var data = _taggedTemplateLiteral(["\n border: 1px solid\n ", ";\n border-radius: 2px;\n height: ", ";\n width: 100%;\n padding: 1rem;\n min-width: 100px;\n margin: 0;\n box-sizing: border-box;\n position: relative;\n font-size: 1.1rem;\n font-family: Public Sans;\n line-height: 2rem;\n font-weight: ", ";\n background-color: ", ";\n color: ", ";\n box-shadow: none;\n ", "\n transition: background 0.3s ease;\n\n &:focus {\n border: 1px solid ", ";\n }\n\n ", "\n"]);
18463
18484
 
18464
18485
  _templateObject$p = function _templateObject() {
18465
18486
  return data;
@@ -18472,54 +18493,68 @@ var InputField = styled__default.input(_templateObject$p(), function (_ref) {
18472
18493
  showErrors = _ref.showErrors,
18473
18494
  themeValues = _ref.themeValues;
18474
18495
  return field.dirty && field.hasErrors || field.hasErrors && showErrors ? ERROR_COLOR : themeValues.borderColor;
18475
- }, FONT_WEIGHT_REGULAR, function (_ref2) {
18476
- var themeValues = _ref2.themeValues;
18477
- return themeValues.inputBackgroundColor && themeValues.inputBackgroundColor;
18478
- }, function (_ref3) {
18496
+ }, function (_ref2) {
18497
+ var customHeight = _ref2.customHeight;
18498
+ return customHeight ? customHeight : "48px";
18499
+ }, FONT_WEIGHT_REGULAR, function (_ref3) {
18479
18500
  var themeValues = _ref3.themeValues;
18480
- return themeValues.color && themeValues.color;
18501
+ return themeValues.inputBackgroundColor && themeValues.inputBackgroundColor;
18481
18502
  }, function (_ref4) {
18482
- var background = _ref4.background,
18483
- themeValues = _ref4.themeValues;
18503
+ var themeValues = _ref4.themeValues;
18504
+ return themeValues.color && themeValues.color;
18505
+ }, function (_ref5) {
18506
+ var background = _ref5.background,
18507
+ themeValues = _ref5.themeValues;
18484
18508
  return background && "background: ".concat(themeValues.inputBackgroundColor, " url(").concat(background, ") no-repeat right 0.5rem center;");
18485
- }, MATISSE_BLUE); // eslint-disable-next-line no-unused-vars
18509
+ }, MATISSE_BLUE, function (_ref6) {
18510
+ var extraStyles = _ref6.extraStyles;
18511
+ return styled.css(_templateObject2$d(), extraStyles);
18512
+ }); // eslint-disable-next-line no-unused-vars
18486
18513
 
18487
- var FormattedInputField = styled__default(function (_ref5) {
18488
- var showErrors = _ref5.showErrors,
18489
- props = _objectWithoutProperties(_ref5, ["showErrors"]);
18514
+ var FormattedInputField = styled__default(function (_ref7) {
18515
+ var showErrors = _ref7.showErrors,
18516
+ props = _objectWithoutProperties(_ref7, ["showErrors"]);
18490
18517
 
18491
18518
  return /*#__PURE__*/React__default.createElement(src_1, props);
18492
- })(_templateObject2$d(), function (_ref6) {
18493
- var field = _ref6.field,
18494
- showErrors = _ref6.showErrors,
18495
- themeValues = _ref6.themeValues;
18519
+ })(_templateObject3$7(), function (_ref8) {
18520
+ var field = _ref8.field,
18521
+ showErrors = _ref8.showErrors,
18522
+ themeValues = _ref8.themeValues;
18496
18523
  return field.dirty && field.hasErrors || field.hasErrors && showErrors ? ERROR_COLOR : themeValues.borderColor;
18497
- }, FONT_WEIGHT_REGULAR, function (_ref7) {
18498
- var themeValues = _ref7.themeValues;
18524
+ }, function (_ref9) {
18525
+ var customHeight = _ref9.customHeight;
18526
+ return customHeight ? customHeight : "48px";
18527
+ }, FONT_WEIGHT_REGULAR, function (_ref10) {
18528
+ var themeValues = _ref10.themeValues;
18499
18529
  return themeValues.inputBackgroundColor && themeValues.inputBackgroundColor;
18500
- }, function (_ref8) {
18501
- var themeValues = _ref8.themeValues;
18530
+ }, function (_ref11) {
18531
+ var themeValues = _ref11.themeValues;
18502
18532
  return themeValues.color && themeValues.color;
18503
- }, MATISSE_BLUE);
18533
+ }, MATISSE_BLUE, function (_ref12) {
18534
+ var extraStyles = _ref12.extraStyles;
18535
+ return styled.css(_templateObject4$4(), extraStyles);
18536
+ });
18504
18537
 
18505
- var FormInput = function FormInput(_ref9) {
18506
- var _ref9$type = _ref9.type,
18507
- type = _ref9$type === void 0 ? "text" : _ref9$type,
18508
- labelTextWhenNoError = _ref9.labelTextWhenNoError,
18509
- errorMessages = _ref9.errorMessages,
18510
- _ref9$isNum = _ref9.isNum,
18511
- isNum = _ref9$isNum === void 0 ? false : _ref9$isNum,
18512
- _ref9$helperModal = _ref9.helperModal,
18513
- helperModal = _ref9$helperModal === void 0 ? false : _ref9$helperModal,
18514
- field = _ref9.field,
18515
- fieldActions = _ref9.fieldActions,
18516
- showErrors = _ref9.showErrors,
18517
- _ref9$formatter = _ref9.formatter,
18518
- formatter = _ref9$formatter === void 0 ? null : _ref9$formatter,
18519
- decorator = _ref9.decorator,
18520
- themeValues = _ref9.themeValues,
18521
- background = _ref9.background,
18522
- props = _objectWithoutProperties(_ref9, ["type", "labelTextWhenNoError", "errorMessages", "isNum", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background"]);
18538
+ var FormInput = function FormInput(_ref13) {
18539
+ var _ref13$type = _ref13.type,
18540
+ type = _ref13$type === void 0 ? "text" : _ref13$type,
18541
+ labelTextWhenNoError = _ref13.labelTextWhenNoError,
18542
+ errorMessages = _ref13.errorMessages,
18543
+ _ref13$isNum = _ref13.isNum,
18544
+ isNum = _ref13$isNum === void 0 ? false : _ref13$isNum,
18545
+ _ref13$helperModal = _ref13.helperModal,
18546
+ helperModal = _ref13$helperModal === void 0 ? false : _ref13$helperModal,
18547
+ field = _ref13.field,
18548
+ fieldActions = _ref13.fieldActions,
18549
+ showErrors = _ref13.showErrors,
18550
+ _ref13$formatter = _ref13.formatter,
18551
+ formatter = _ref13$formatter === void 0 ? null : _ref13$formatter,
18552
+ decorator = _ref13.decorator,
18553
+ themeValues = _ref13.themeValues,
18554
+ background = _ref13.background,
18555
+ customHeight = _ref13.customHeight,
18556
+ extraStyles = _ref13.extraStyles,
18557
+ props = _objectWithoutProperties(_ref13, ["type", "labelTextWhenNoError", "errorMessages", "isNum", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "extraStyles"]);
18523
18558
 
18524
18559
  var _useState = React.useState(false),
18525
18560
  _useState2 = _slicedToArray(_useState, 2),
@@ -18588,7 +18623,9 @@ var FormInput = function FormInput(_ref9) {
18588
18623
  formatter: formatter,
18589
18624
  showErrors: showErrors,
18590
18625
  "data-qa": labelTextWhenNoError,
18591
- themeValues: themeValues
18626
+ themeValues: themeValues,
18627
+ customHeight: customHeight,
18628
+ extraStyles: extraStyles
18592
18629
  }, props)) : /*#__PURE__*/React__default.createElement(InputField, _extends({
18593
18630
  "aria-labelledby": labelTextWhenNoError,
18594
18631
  onChange: function onChange(e) {
@@ -18602,7 +18639,9 @@ var FormInput = function FormInput(_ref9) {
18602
18639
  showErrors: showErrors,
18603
18640
  "data-qa": labelTextWhenNoError,
18604
18641
  themeValues: themeValues,
18605
- background: background
18642
+ background: background,
18643
+ customHeight: customHeight,
18644
+ extraStyles: extraStyles
18606
18645
  }, props))), /*#__PURE__*/React__default.createElement(Stack, {
18607
18646
  direction: "row",
18608
18647
  justify: "space-between"
@@ -18832,10 +18871,10 @@ var FormattedCreditCard = function FormattedCreditCard(_ref) {
18832
18871
 
18833
18872
  var FormattedCreditCard$1 = themeComponent(FormattedCreditCard, "FormattedCreditCard", fallbackValues$g, "default");
18834
18873
 
18835
- function _templateObject3$7() {
18874
+ function _templateObject3$8() {
18836
18875
  var data = _taggedTemplateLiteral(["\n display: block;\n top: auto;\n bottom: 6px;\n left: 2px;\n transition-duration: 0.13s;\n transition-delay: 0.13s;\n transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);\n margin-top: 12px;\n background-color: ", ";\n\n &, &::before, &::after {\n background-color: ", ";\n width: 30px;\n height: 3px;\n position: absolute;\n transition-property: transform;\n transition-duration: 0.15s;\n transition-timing-function: ease;\n }\n\n &::before, &::after {\n content: \"\";\n display: block;\n }\n\n &::before {\n top: -10px;\n transition: top 0.12s 0.2s cubic-bezier(0.33333, 0.66667, 0.66667, 1), \n transform 0.13s cubic-bezier(0.55, 0.055, 0.675, 0.19);\n }\n\n &::after {\n bottom: -10px;\n top: -20px;\n transition: top 0.2s 0.2s cubic-bezier(0.33333, 0.66667, 0.66667, 1), \n opacity 0.1s linear;\n }\n\n &.active, &.active::before, &.active::after {\n background-color: ", ";\n }\n\n &.active {\n transform: translate3d(0, -10px, 0) rotate(-45deg);\n transition-delay: 0.22s;\n transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);\n }\n\n &.active::after {\n top: 0;\n opacity: 0;\n transition: top 0.2s cubic-bezier(0.33333, 0, 0.66667, 0.33333), \n opacity: 0.1s 0.22s linear;\n }\n\n &.active::before {\n top: 0;\n transform: rotate(-90deg);\n transition: top 0.1s 0.16s cubic-bezier(0.33333, 0, 0.66667, 0.33333), \n transform 0.13s 0.25s cubic-bezier(0.215, 0.61, 0.355, 1);\n }\n"]);
18837
18876
 
18838
- _templateObject3$7 = function _templateObject3() {
18877
+ _templateObject3$8 = function _templateObject3() {
18839
18878
  return data;
18840
18879
  };
18841
18880
 
@@ -18863,7 +18902,7 @@ function _templateObject$r() {
18863
18902
  }
18864
18903
  var Hamburger = styled__default.button(_templateObject$r());
18865
18904
  var HamburgerBox = styled__default.span(_templateObject2$f());
18866
- var HamburgerInner = styled__default.span(_templateObject3$7(), function (_ref) {
18905
+ var HamburgerInner = styled__default.span(_templateObject3$8(), function (_ref) {
18867
18906
  var inactiveColor = _ref.inactiveColor;
18868
18907
  return inactiveColor;
18869
18908
  }, function (_ref2) {
@@ -19099,7 +19138,8 @@ var NavFooter = function NavFooter(_ref) {
19099
19138
  _ref$footerPadding = _ref.footerPadding,
19100
19139
  footerPadding = _ref$footerPadding === void 0 ? "1.5rem 1rem" : _ref$footerPadding,
19101
19140
  isMobile = _ref.isMobile,
19102
- rest = _objectWithoutProperties(_ref, ["leftContent", "rightContent", "footerMinHeight", "backgroundColor", "largeSide", "largeSideSize", "footerPadding", "isMobile"]);
19141
+ footerWidth = _ref.footerWidth,
19142
+ rest = _objectWithoutProperties(_ref, ["leftContent", "rightContent", "footerMinHeight", "backgroundColor", "largeSide", "largeSideSize", "footerPadding", "isMobile", "footerWidth"]);
19103
19143
 
19104
19144
  return /*#__PURE__*/React__default.createElement(Box, _extends({
19105
19145
  padding: footerPadding,
@@ -19108,7 +19148,7 @@ var NavFooter = function NavFooter(_ref) {
19108
19148
  minWidth: "100%",
19109
19149
  extraStyles: isMobile ? "overflow: hidden;" : "height: ".concat(footerMinHeight, "; > * { height: 100%; };")
19110
19150
  }, rest), /*#__PURE__*/React__default.createElement(Center, {
19111
- maxWidth: "76.5rem"
19151
+ maxWidth: footerWidth || "76.5rem"
19112
19152
  }, /*#__PURE__*/React__default.createElement(Cover, {
19113
19153
  singleChild: true,
19114
19154
  minHeight: "100%"
@@ -19138,7 +19178,8 @@ var NavHeader = function NavHeader(_ref) {
19138
19178
  headerHeight = _ref$headerHeight === void 0 ? "105px" : _ref$headerHeight,
19139
19179
  isMobile = _ref.isMobile,
19140
19180
  backgroundColor = _ref.backgroundColor,
19141
- rest = _objectWithoutProperties(_ref, ["leftContent", "rightContent", "headerHeight", "isMobile", "backgroundColor"]);
19181
+ headerWidth = _ref.headerWidth,
19182
+ rest = _objectWithoutProperties(_ref, ["leftContent", "rightContent", "headerHeight", "isMobile", "backgroundColor", "headerWidth"]);
19142
19183
 
19143
19184
  return /*#__PURE__*/React__default.createElement(Box, _extends({
19144
19185
  padding: "0 16px 4px",
@@ -19146,7 +19187,7 @@ var NavHeader = function NavHeader(_ref) {
19146
19187
  extraStyles: isMobile ? "height: 72px; > * { height: 100%; }; z-index: 2;" : "height: ".concat(headerHeight, "; > * { height: 100%; }; z-index: 2;"),
19147
19188
  minWidth: "100%"
19148
19189
  }, rest), /*#__PURE__*/React__default.createElement(Center, {
19149
- maxWidth: "76.5rem"
19190
+ maxWidth: headerWidth || "76.5rem"
19150
19191
  }, /*#__PURE__*/React__default.createElement(Box, {
19151
19192
  minHeight: "100%",
19152
19193
  padding: "0"
@@ -19286,20 +19327,20 @@ function _templateObject5$2() {
19286
19327
  return data;
19287
19328
  }
19288
19329
 
19289
- function _templateObject4$4() {
19330
+ function _templateObject4$5() {
19290
19331
  var data = _taggedTemplateLiteral(["", " is not a valid length"]);
19291
19332
 
19292
- _templateObject4$4 = function _templateObject4() {
19333
+ _templateObject4$5 = function _templateObject4() {
19293
19334
  return data;
19294
19335
  };
19295
19336
 
19296
19337
  return data;
19297
19338
  }
19298
19339
 
19299
- function _templateObject3$8() {
19340
+ function _templateObject3$9() {
19300
19341
  var data = _taggedTemplateLiteral(["", " is not the right length"]);
19301
19342
 
19302
- _templateObject3$8 = function _templateObject3() {
19343
+ _templateObject3$9 = function _templateObject3() {
19303
19344
  return data;
19304
19345
  };
19305
19346
 
@@ -19365,7 +19406,7 @@ with interpolation.
19365
19406
  */
19366
19407
 
19367
19408
 
19368
- var DEFAULT_ERROR_MESSAGES = (_DEFAULT_ERROR_MESSAG = {}, _defineProperty(_DEFAULT_ERROR_MESSAG, MIN_LENGTH_ERROR, genErrorMessage(_templateObject$t(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, MAX_LENGTH_ERROR, genErrorMessage(_templateObject2$h(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, EXACT_LENGTH_ERROR, genErrorMessage(_templateObject3$8(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, MULTIPLE_LENGTHS_ERROR, genErrorMessage(_templateObject4$4(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, EMAIL_ERROR, genErrorMessage(_templateObject5$2(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, HAS_NUMBER_ERROR, genErrorMessage(_templateObject6$2(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, HAS_UPPERCASE_LETTER_ERROR, genErrorMessage(_templateObject7$2(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, HAS_LOWERCASE_LETTER_ERROR, genErrorMessage(_templateObject8$1(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, HAS_SPECIAL_CHARACTER_ERROR, genErrorMessage(_templateObject9$1(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, ONLY_NUMBERS_ERROR, genErrorMessage(_templateObject10$1(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, ONLY_LETTERS_ERROR, genErrorMessage(_templateObject11$1(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, REQUIRED_FIELD_ERROR, genErrorMessage(_templateObject12(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, NUM_GREATER_THAN_ERROR, genErrorMessage(_templateObject13(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, NUM_LESS_THAN_ERROR, genErrorMessage(_templateObject14(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, MATCHES_FIELD_ERROR, genErrorMessage(_templateObject15(), "fieldLabel", "matchField")), _defineProperty(_DEFAULT_ERROR_MESSAG, VALID_SELECT_OPTION_ERROR, genErrorMessage(_templateObject16(), "fieldLabel")), _DEFAULT_ERROR_MESSAG); // Constants to represent an input's state
19409
+ var DEFAULT_ERROR_MESSAGES = (_DEFAULT_ERROR_MESSAG = {}, _defineProperty(_DEFAULT_ERROR_MESSAG, MIN_LENGTH_ERROR, genErrorMessage(_templateObject$t(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, MAX_LENGTH_ERROR, genErrorMessage(_templateObject2$h(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, EXACT_LENGTH_ERROR, genErrorMessage(_templateObject3$9(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, MULTIPLE_LENGTHS_ERROR, genErrorMessage(_templateObject4$5(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, EMAIL_ERROR, genErrorMessage(_templateObject5$2(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, HAS_NUMBER_ERROR, genErrorMessage(_templateObject6$2(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, HAS_UPPERCASE_LETTER_ERROR, genErrorMessage(_templateObject7$2(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, HAS_LOWERCASE_LETTER_ERROR, genErrorMessage(_templateObject8$1(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, HAS_SPECIAL_CHARACTER_ERROR, genErrorMessage(_templateObject9$1(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, ONLY_NUMBERS_ERROR, genErrorMessage(_templateObject10$1(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, ONLY_LETTERS_ERROR, genErrorMessage(_templateObject11$1(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, REQUIRED_FIELD_ERROR, genErrorMessage(_templateObject12(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, NUM_GREATER_THAN_ERROR, genErrorMessage(_templateObject13(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, NUM_LESS_THAN_ERROR, genErrorMessage(_templateObject14(), "fieldLabel")), _defineProperty(_DEFAULT_ERROR_MESSAG, MATCHES_FIELD_ERROR, genErrorMessage(_templateObject15(), "fieldLabel", "matchField")), _defineProperty(_DEFAULT_ERROR_MESSAG, VALID_SELECT_OPTION_ERROR, genErrorMessage(_templateObject16(), "fieldLabel")), _DEFAULT_ERROR_MESSAG); // Constants to represent an input's state
19369
19410
  // Neutral - has not been validated
19370
19411
  // Invalid - has been validated and has an error
19371
19412
  // Valid - has been validated and has no error
@@ -30327,20 +30368,20 @@ var fallbackValues$o = {
30327
30368
  leftLabelStyles: leftLabelStyles
30328
30369
  };
30329
30370
 
30330
- function _templateObject4$5() {
30371
+ function _templateObject4$6() {
30331
30372
  var data = _taggedTemplateLiteral(["\n position: absolute;\n width: 14px;\n height: 14px;\n top: 3px;\n left: 3px;\n right: 3px;\n bottom: 3px;\n border-radius: 50%;\n box-sizing: border-box;\n"]);
30332
30373
 
30333
- _templateObject4$5 = function _templateObject4() {
30374
+ _templateObject4$6 = function _templateObject4() {
30334
30375
  return data;
30335
30376
  };
30336
30377
 
30337
30378
  return data;
30338
30379
  }
30339
30380
 
30340
- function _templateObject3$9() {
30381
+ function _templateObject3$a() {
30341
30382
  var data = _taggedTemplateLiteral(["\n position: absolute;\n width: 20px;\n height: 20px;\n border: none;\n border-radius: 50%;\n box-sizing: border-box;\n"]);
30342
30383
 
30343
- _templateObject3$9 = function _templateObject3() {
30384
+ _templateObject3$a = function _templateObject3() {
30344
30385
  return data;
30345
30386
  };
30346
30387
 
@@ -30383,8 +30424,8 @@ var VisibleSwitchComponent = styled__default.label(_templateObject2$i(), functio
30383
30424
  var isMobile = _ref5.isMobile;
30384
30425
  return isMobile ? "transform: scale(0.75)" : "";
30385
30426
  });
30386
- var ToggleSwitchMiddleRingComponent = styled__default.div(_templateObject3$9());
30387
- var ToggleSwitchInnerRingComponent = styled__default.div(_templateObject4$5());
30427
+ var ToggleSwitchMiddleRingComponent = styled__default.div(_templateObject3$a());
30428
+ var ToggleSwitchInnerRingComponent = styled__default.div(_templateObject4$6());
30388
30429
 
30389
30430
  var ToggleSwitch = function ToggleSwitch(_ref6) {
30390
30431
  var _ref6$isOn = _ref6.isOn,
@@ -32683,20 +32724,20 @@ function _templateObject5$3() {
32683
32724
  return data;
32684
32725
  }
32685
32726
 
32686
- function _templateObject4$6() {
32727
+ function _templateObject4$7() {
32687
32728
  var data = _taggedTemplateLiteral(["\n color: ", ";\n align-items: center;\n font-size: 1rem;\n padding-right: 1rem;\n cursor: pointer;\n display: ", ";\n"]);
32688
32729
 
32689
- _templateObject4$6 = function _templateObject4() {
32730
+ _templateObject4$7 = function _templateObject4() {
32690
32731
  return data;
32691
32732
  };
32692
32733
 
32693
32734
  return data;
32694
32735
  }
32695
32736
 
32696
- function _templateObject3$a() {
32737
+ function _templateObject3$b() {
32697
32738
  var data = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-evenly;\n align-items: center;\n"]);
32698
32739
 
32699
- _templateObject3$a = function _templateObject3() {
32740
+ _templateObject3$b = function _templateObject3() {
32700
32741
  return data;
32701
32742
  };
32702
32743
 
@@ -32739,8 +32780,8 @@ var EditableTableListItem = styled__default.div(_templateObject2$k(), function (
32739
32780
  var isMobile = _ref5.isMobile;
32740
32781
  return isMobile ? "padding: 1rem 0.5rem" : "padding: 0 0.5rem";
32741
32782
  });
32742
- var EditableListItemControls$1 = styled__default.div(_templateObject3$a());
32743
- var EditableListAction = styled__default.div(_templateObject4$6(), MATISSE_BLUE, function (_ref6) {
32783
+ var EditableListItemControls$1 = styled__default.div(_templateObject3$b());
32784
+ var EditableListAction = styled__default.div(_templateObject4$7(), MATISSE_BLUE, function (_ref6) {
32744
32785
  var hide = _ref6.hide;
32745
32786
  return hide ? "none" : "flex";
32746
32787
  });
@@ -36412,6 +36453,128 @@ var createPartialAmountFormState = function createPartialAmountFormState(lineIte
36412
36453
  };
36413
36454
  };
36414
36455
 
36456
+ var PAGING_SPACE = 2; // how many pages we want to have before/after delimiter
36457
+
36458
+ var PAGING_INIT_SPACE = 3; // first delimiter should appear after 3 pages
36459
+
36460
+ var PrevNextButton = function PrevNextButton(_ref) {
36461
+ var action = _ref.action,
36462
+ type = _ref.type,
36463
+ arrowColor = _ref.arrowColor;
36464
+ return /*#__PURE__*/React__default.createElement(Box, {
36465
+ padding: "0 10px 0",
36466
+ minHeight: "40px",
36467
+ extraStyles: "max-height: 40px;"
36468
+ }, /*#__PURE__*/React__default.createElement(ButtonWithAction, {
36469
+ action: action,
36470
+ contentOverride: true,
36471
+ dataQa: type,
36472
+ extraStyles: "\n min-width: 40px;\n min-height: 100%;\n max-height: 40px;\n padding: 6px;\n border-radius: 3px;\n "
36473
+ }, /*#__PURE__*/React__default.createElement(Box, {
36474
+ padding: "0",
36475
+ extraStyles: type === "prev" && "transform: scaleX(-1)"
36476
+ }, /*#__PURE__*/React__default.createElement(ChevronIcon$1, {
36477
+ variant: "darkMode",
36478
+ iconFill: arrowColor
36479
+ }))));
36480
+ };
36481
+
36482
+ var getPagesPanel = function getPagesPanel(page, pagesCount) {
36483
+ if (!pagesCount || pagesCount <= 1) {
36484
+ return [];
36485
+ }
36486
+
36487
+ var lastPageNumber = pagesCount;
36488
+ var space = page === 1 ? PAGING_INIT_SPACE : PAGING_SPACE;
36489
+ var pages = [{
36490
+ index: 1,
36491
+ isButton: true
36492
+ }];
36493
+
36494
+ if (page > space + 1) {
36495
+ pages.push({
36496
+ isDelimiter: true
36497
+ });
36498
+ }
36499
+
36500
+ for (var j = Math.max(1, page - space) + 1; j < Math.min(lastPageNumber, page + space); j++) {
36501
+ pages.push({
36502
+ index: j,
36503
+ isButton: true
36504
+ });
36505
+ }
36506
+
36507
+ if (page < lastPageNumber - space) {
36508
+ pages.push({
36509
+ isDelimiter: true
36510
+ });
36511
+ }
36512
+
36513
+ pages.push({
36514
+ index: lastPageNumber,
36515
+ isButton: true
36516
+ });
36517
+ var activePage = pages.find(function (p) {
36518
+ return p.index === page;
36519
+ });
36520
+
36521
+ if (activePage) {
36522
+ activePage.active = true;
36523
+ }
36524
+
36525
+ return pages;
36526
+ };
36527
+
36528
+ var Pagination = function Pagination(_ref2) {
36529
+ var pagePrevious = _ref2.pagePrevious,
36530
+ pageNext = _ref2.pageNext,
36531
+ setCurrentPage = _ref2.setCurrentPage,
36532
+ currentPage = _ref2.currentPage,
36533
+ pageCount = _ref2.pageCount,
36534
+ numberColor = _ref2.numberColor,
36535
+ arrowColor = _ref2.arrowColor;
36536
+ return /*#__PURE__*/React__default.createElement(Cluster, {
36537
+ justify: "center",
36538
+ childGap: "10px"
36539
+ }, currentPage > 1 && /*#__PURE__*/React__default.createElement(PrevNextButton, {
36540
+ type: "prev",
36541
+ action: pagePrevious
36542
+ }), getPagesPanel(currentPage, pageCount).map(function (item, index) {
36543
+ return item.isButton ? /*#__PURE__*/React__default.createElement(Box, {
36544
+ padding: "0",
36545
+ border: item.active && "1px solid ".concat(numberColor !== null && numberColor !== void 0 ? numberColor : MATISSE_BLUE),
36546
+ borderRadius: item.active && "3px",
36547
+ extraStyles: "max-height: 40px;"
36548
+ }, /*#__PURE__*/React__default.createElement(ButtonWithAction, {
36549
+ variant: "ghost",
36550
+ key: item.index,
36551
+ text: item.index,
36552
+ disabled: item.active,
36553
+ action: !item.active ? function () {
36554
+ return setCurrentPage({
36555
+ pageNumber: item.index
36556
+ });
36557
+ } : noop,
36558
+ textExtraStyles: "font-size: 17px; font-weight: 900;",
36559
+ extraStyles: "\n min-width: 40px; min-height: 100%; padding: 0;\n &:hover, &:focus {\n text-decoration: none;\n > * > span {\n text-decoration: none;\n }\n }\n color: ".concat(numberColor !== null && numberColor !== void 0 ? numberColor : MATISSE_BLUE, "\n }\n &:hover { ").concat(item.active ? "cursor: default;" : "background-color: ".concat(ALABASTER_WHITE), " }\n "),
36560
+ dataQa: index
36561
+ }, item.index)) : /*#__PURE__*/React__default.createElement(Box, {
36562
+ padding: "0 10px"
36563
+ }, /*#__PURE__*/React__default.createElement(Cluster, {
36564
+ justify: "flex-end"
36565
+ }, /*#__PURE__*/React__default.createElement(Text$1, {
36566
+ key: index,
36567
+ variant: "pXL",
36568
+ weight: "900",
36569
+ color: numberColor !== null && numberColor !== void 0 ? numberColor : MATISSE_BLUE
36570
+ }, "...")));
36571
+ }), currentPage < pageCount && /*#__PURE__*/React__default.createElement(PrevNextButton, {
36572
+ type: "next",
36573
+ action: pageNext,
36574
+ arrowColor: arrowColor
36575
+ }));
36576
+ };
36577
+
36415
36578
  var PaymentButtonBar = function PaymentButtonBar(_ref) {
36416
36579
  var _ref$forwardButtonTex = _ref.forwardButtonText,
36417
36580
  forwardButtonText = _ref$forwardButtonTex === void 0 ? "Next" : _ref$forwardButtonTex,
@@ -37272,11 +37435,15 @@ var RadioSection = function RadioSection(_ref) {
37272
37435
  return toggleOpenSection(section.id);
37273
37436
  },
37274
37437
  tabIndex: "-1"
37275
- })), /*#__PURE__*/React__default.createElement(Text$1, {
37438
+ })), section.titleIcon && /*#__PURE__*/React__default.createElement(Cluster, {
37439
+ align: "center"
37440
+ }, section.titleIcon), /*#__PURE__*/React__default.createElement(Box, {
37441
+ padding: section.titleIcon ? "0 0 0 8px" : "0"
37442
+ }, /*#__PURE__*/React__default.createElement(Text$1, {
37276
37443
  variant: "p",
37277
37444
  color: CHARADE_GREY,
37278
37445
  "aria-level": "3"
37279
- }, section.title)), section.rightIcons && /*#__PURE__*/React__default.createElement(Cluster, {
37446
+ }, section.title))), section.rightIcons && /*#__PURE__*/React__default.createElement(Cluster, {
37280
37447
  childGap: "0.5rem"
37281
37448
  }, section.rightIcons.map(function (icon) {
37282
37449
  return /*#__PURE__*/React__default.createElement(RightIcon, {
@@ -37865,7 +38032,10 @@ var Timeout$1 = withWindowSize(Timeout);
37865
38032
  var WorkflowTile = function WorkflowTile(_ref) {
37866
38033
  var _ref$workflowName = _ref.workflowName,
37867
38034
  workflowName = _ref$workflowName === void 0 ? "Test Workflow" : _ref$workflowName,
37868
- workflowDescription = _ref.workflowDescription,
38035
+ _ref$workflowDescript = _ref.workflowDescription,
38036
+ workflowDescription = _ref$workflowDescript === void 0 ? "Link your benefit plan" : _ref$workflowDescript,
38037
+ _ref$workflowActionNa = _ref.workflowActionName,
38038
+ workflowActionName = _ref$workflowActionNa === void 0 ? "Search" : _ref$workflowActionNa,
37869
38039
  slug = _ref.slug;
37870
38040
  return /*#__PURE__*/React__default.createElement(Box, {
37871
38041
  background: WHITE,
@@ -37888,7 +38058,7 @@ var WorkflowTile = function WorkflowTile(_ref) {
37888
38058
  }, /*#__PURE__*/React__default.createElement(Paragraph$1, {
37889
38059
  variant: "pS",
37890
38060
  color: STORM_GREY
37891
- }, workflowDescription || "Link your benefit plan")), /*#__PURE__*/React__default.createElement(Box, {
38061
+ }, workflowDescription)), /*#__PURE__*/React__default.createElement(Box, {
37892
38062
  padding: "1.5rem 1rem",
37893
38063
  background: GRECIAN_GREY
37894
38064
  }, /*#__PURE__*/React__default.createElement(ButtonWithLink, {
@@ -37897,7 +38067,7 @@ var WorkflowTile = function WorkflowTile(_ref) {
37897
38067
  fontWeight: FONT_WEIGHT_SEMIBOLD,
37898
38068
  fontSize: "1.125rem",
37899
38069
  borderRadius: "0px",
37900
- text: "Link Benefits",
38070
+ text: workflowActionName,
37901
38071
  minWidth: "100%",
37902
38072
  url: "/service/".concat(slug),
37903
38073
  extraStyles: "width: 100%;"
@@ -38245,6 +38415,7 @@ exports.NavHeader = NavHeader;
38245
38415
  exports.NavMenuDesktop = NavMenuDesktop$1;
38246
38416
  exports.NavMenuMobile = NavMenuMobile$1;
38247
38417
  exports.Obligation = Obligation;
38418
+ exports.Pagination = Pagination;
38248
38419
  exports.Paragraph = Paragraph$1;
38249
38420
  exports.PartialAmountForm = PartialAmountForm;
38250
38421
  exports.PasswordRequirements = PasswordRequirements;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "3.6.0-beta.1",
3
+ "version": "3.7.0-beta.2",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -28,7 +28,7 @@ const Alert = ({
28
28
  borderSize="1px"
29
29
  >
30
30
  <Sidebar width="24px" childGap="0rem">
31
- <Box padding="0 0 0 1rem" minHeight="100%">
31
+ <Box padding="0 0.5rem 0 1rem" minHeight="100%">
32
32
  <Cover minHeight="100%" singleChild>
33
33
  <Box padding="0" width="1.5rem" minHeight="1.5rem">
34
34
  <Icon />
@@ -37,7 +37,7 @@ const Alert = ({
37
37
  </Box>
38
38
  <Box padding="0">
39
39
  <Sidebar sidebarOnRight width="24px" childGap="0rem">
40
- <Box padding="1rem">
40
+ <Box padding="1rem 1rem 1rem 0.5rem">
41
41
  <Cluster justify="flex-start" align="center">
42
42
  <Stack fullHeight childGap="0.25rem">
43
43
  <Text variant="p" color={themeValues.text} weight="600">
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useContext } from "react";
2
- import styled, { ThemeContext } from "styled-components";
2
+ import styled, { ThemeContext, css } from "styled-components";
3
3
  import { FormattedInput } from "formatted-input";
4
4
  import { fallbackValues } from "./FormLayouts.theme.js";
5
5
  import { themeComponent } from "../../../util/themeUtils";
@@ -15,7 +15,7 @@ const InputField = styled.input`
15
15
  ? ERROR_COLOR
16
16
  : themeValues.borderColor};
17
17
  border-radius: 2px;
18
- height: 48px;
18
+ height: ${({ customHeight }) => (customHeight ? customHeight : "48px")};
19
19
  width: 100%;
20
20
  padding: 1rem;
21
21
  min-width: 100px;
@@ -38,6 +38,11 @@ const InputField = styled.input`
38
38
  &:focus {
39
39
  border: 1px solid ${MATISSE_BLUE};
40
40
  }
41
+
42
+ ${({ extraStyles }) =>
43
+ css`
44
+ ${extraStyles}
45
+ `}
41
46
  `;
42
47
 
43
48
  // eslint-disable-next-line no-unused-vars
@@ -50,7 +55,7 @@ const FormattedInputField = styled(({ showErrors, ...props }) => (
50
55
  ? ERROR_COLOR
51
56
  : themeValues.borderColor};
52
57
  border-radius: 2px;
53
- height: 48px;
58
+ height: ${({ customHeight }) => (customHeight ? customHeight : "48px")};
54
59
  width: 100%;
55
60
  padding: 1rem;
56
61
  min-width: 100px;
@@ -68,6 +73,11 @@ const FormattedInputField = styled(({ showErrors, ...props }) => (
68
73
  &:focus {
69
74
  border: 1px solid ${MATISSE_BLUE};
70
75
  }
76
+
77
+ ${({ extraStyles }) =>
78
+ css`
79
+ ${extraStyles}
80
+ `}
71
81
  `;
72
82
 
73
83
  const FormInput = ({
@@ -83,6 +93,8 @@ const FormInput = ({
83
93
  decorator,
84
94
  themeValues,
85
95
  background,
96
+ customHeight,
97
+ extraStyles,
86
98
  ...props
87
99
  }) => {
88
100
  const [showPassword, setShowPassword] = useState(false);
@@ -167,6 +179,8 @@ const FormInput = ({
167
179
  showErrors={showErrors}
168
180
  data-qa={labelTextWhenNoError}
169
181
  themeValues={themeValues}
182
+ customHeight={customHeight}
183
+ extraStyles={extraStyles}
170
184
  {...props}
171
185
  />
172
186
  ) : (
@@ -182,6 +196,8 @@ const FormInput = ({
182
196
  data-qa={labelTextWhenNoError}
183
197
  themeValues={themeValues}
184
198
  background={background}
199
+ customHeight={customHeight}
200
+ extraStyles={extraStyles}
185
201
  {...props}
186
202
  />
187
203
  )}
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import { fallbackValues } from "./Icons.theme";
3
3
  import { themeComponent } from "../../../util/themeUtils";
4
4
 
5
- const ChevronIcon = ({ themeValues }) => {
5
+ const ChevronIcon = ({ themeValues, iconFill }) => {
6
6
  return (
7
7
  <svg
8
8
  width="24"
@@ -21,20 +21,20 @@ const ChevronIcon = ({ themeValues }) => {
21
21
  <g id={`icon-chevron-Icon/Chevron-Down`} fill="none" fillRule="evenodd">
22
22
  <mask id={`icon-chevron-mask-2`}>
23
23
  <use
24
- fill={themeValues.singleIconColor}
24
+ fill={iconFill ?? themeValues.singleIconColor}
25
25
  xlinkHref={`#icon-chevron-path-1`}
26
26
  />
27
27
  </mask>
28
28
 
29
29
  <use
30
- fill={themeValues.singleIconColor}
30
+ fill={iconFill ?? themeValues.singleIconColor}
31
31
  id={`icon-chevron-Fill-2`}
32
32
  xlinkHref={`#icon-chevron-path-1`}
33
33
  />
34
34
  <g
35
35
  id="Colors/Blue-Dark"
36
36
  mask={`url(#icon-chevron-mask-2)`}
37
- fill={themeValues.singleIconColor}
37
+ fill={iconFill ?? themeValues.singleIconColor}
38
38
  >
39
39
  <rect id={`icon-chevron-rect`} width="24" height="24" />
40
40
  </g>
@@ -10,6 +10,7 @@ const NavFooter = ({
10
10
  largeSideSize = "2",
11
11
  footerPadding = "1.5rem 1rem",
12
12
  isMobile,
13
+ footerWidth,
13
14
  ...rest
14
15
  }) => (
15
16
  <Box
@@ -24,7 +25,7 @@ const NavFooter = ({
24
25
  }
25
26
  {...rest}
26
27
  >
27
- <Center maxWidth="76.5rem">
28
+ <Center maxWidth={footerWidth || "76.5rem"}>
28
29
  <Cover singleChild minHeight="100%">
29
30
  <Box minHeight="100%" padding="0">
30
31
  <Switcher
@@ -7,6 +7,7 @@ const NavHeader = ({
7
7
  headerHeight = "105px",
8
8
  isMobile,
9
9
  backgroundColor,
10
+ headerWidth,
10
11
  ...rest
11
12
  }) => (
12
13
  <Box
@@ -20,7 +21,7 @@ const NavHeader = ({
20
21
  minWidth="100%"
21
22
  {...rest}
22
23
  >
23
- <Center maxWidth="76.5rem">
24
+ <Center maxWidth={headerWidth || "76.5rem"}>
24
25
  <Box minHeight="100%" padding="0">
25
26
  <Cover singleChild minHeight={isMobile ? "72px" : headerHeight}>
26
27
  <Cluster justify="space-between" align="center" overflow>
@@ -13,6 +13,7 @@ export { default as Module } from "./module";
13
13
  export * from "./nav-menu";
14
14
  export { default as Obligation } from "./obligation";
15
15
  export * from "./partial-amount-form";
16
+ export { default as Pagination } from "./pagination";
16
17
  export { default as PaymentButtonBar } from "./payment-button-bar";
17
18
  export { default as PaymentDetails } from "./payment-details";
18
19
  export { default as PaymentFormACH } from "./payment-form-ach";
@@ -0,0 +1,133 @@
1
+ import React from "react";
2
+ import { Cluster, Box } from "../../atoms/layouts";
3
+ import Text from "../../atoms/text";
4
+ import ButtonWithAction from "../../atoms/button-with-action";
5
+ import { ChevronIcon } from "../../atoms/icons";
6
+ import { MATISSE_BLUE, ALABASTER_WHITE } from "../../../constants/colors";
7
+ import { noop } from "../../../util/general";
8
+
9
+ const PAGING_SPACE = 2; // how many pages we want to have before/after delimiter
10
+ const PAGING_INIT_SPACE = 3; // first delimiter should appear after 3 pages
11
+
12
+ const PrevNextButton = ({ action, type, arrowColor }) => (
13
+ <Box padding="0 10px 0" minHeight="40px" extraStyles="max-height: 40px;">
14
+ <ButtonWithAction
15
+ action={action}
16
+ contentOverride
17
+ dataQa={type}
18
+ extraStyles={`
19
+ min-width: 40px;
20
+ min-height: 100%;
21
+ max-height: 40px;
22
+ padding: 6px;
23
+ border-radius: 3px;
24
+ `}
25
+ >
26
+ <Box padding="0" extraStyles={type === "prev" && "transform: scaleX(-1)"}>
27
+ <ChevronIcon variant="darkMode" iconFill={arrowColor} />
28
+ </Box>
29
+ </ButtonWithAction>
30
+ </Box>
31
+ );
32
+
33
+ export const getPagesPanel = (page, pagesCount) => {
34
+ if (!pagesCount || pagesCount <= 1) {
35
+ return [];
36
+ }
37
+ const lastPageNumber = pagesCount;
38
+ const space = page === 1 ? PAGING_INIT_SPACE : PAGING_SPACE;
39
+ const pages = [{ index: 1, isButton: true }];
40
+ if (page > space + 1) {
41
+ pages.push({ isDelimiter: true });
42
+ }
43
+ for (
44
+ let j = Math.max(1, page - space) + 1;
45
+ j < Math.min(lastPageNumber, page + space);
46
+ j++
47
+ ) {
48
+ pages.push({ index: j, isButton: true });
49
+ }
50
+ if (page < lastPageNumber - space) {
51
+ pages.push({ isDelimiter: true });
52
+ }
53
+ pages.push({ index: lastPageNumber, isButton: true });
54
+ const activePage = pages.find(p => p.index === page);
55
+ if (activePage) {
56
+ activePage.active = true;
57
+ }
58
+ return pages;
59
+ };
60
+
61
+ const Pagination = ({
62
+ pagePrevious,
63
+ pageNext,
64
+ setCurrentPage,
65
+ currentPage,
66
+ pageCount,
67
+ numberColor,
68
+ arrowColor
69
+ }) => (
70
+ <Cluster justify="center" childGap="10px">
71
+ {currentPage > 1 && <PrevNextButton type="prev" action={pagePrevious} />}
72
+ {getPagesPanel(currentPage, pageCount).map((item, index) =>
73
+ item.isButton ? (
74
+ <Box
75
+ padding="0"
76
+ border={item.active && `1px solid ${numberColor ?? MATISSE_BLUE}`}
77
+ borderRadius={item.active && "3px"}
78
+ extraStyles="max-height: 40px;"
79
+ >
80
+ <ButtonWithAction
81
+ variant="ghost"
82
+ key={item.index}
83
+ text={item.index}
84
+ disabled={item.active}
85
+ action={
86
+ !item.active
87
+ ? () => setCurrentPage({ pageNumber: item.index })
88
+ : noop
89
+ }
90
+ textExtraStyles={`font-size: 17px; font-weight: 900;`}
91
+ extraStyles={`
92
+ min-width: 40px; min-height: 100%; padding: 0;
93
+ &:hover, &:focus {
94
+ text-decoration: none;
95
+ > * > span {
96
+ text-decoration: none;
97
+ }
98
+ }
99
+ color: ${numberColor ?? MATISSE_BLUE}
100
+ }
101
+ &:hover { ${
102
+ item.active
103
+ ? "cursor: default;"
104
+ : `background-color: ${ALABASTER_WHITE}`
105
+ } }
106
+ `}
107
+ dataQa={index}
108
+ >
109
+ {item.index}
110
+ </ButtonWithAction>
111
+ </Box>
112
+ ) : (
113
+ <Box padding="0 10px">
114
+ <Cluster justify="flex-end">
115
+ <Text
116
+ key={index}
117
+ variant="pXL"
118
+ weight="900"
119
+ color={numberColor ?? MATISSE_BLUE}
120
+ >
121
+ {"..."}
122
+ </Text>
123
+ </Cluster>
124
+ </Box>
125
+ )
126
+ )}
127
+ {currentPage < pageCount && (
128
+ <PrevNextButton type="next" action={pageNext} arrowColor={arrowColor} />
129
+ )}
130
+ </Cluster>
131
+ );
132
+
133
+ export default Pagination;
@@ -0,0 +1,3 @@
1
+ import Pagination from "./Pagination";
2
+
3
+ export default Pagination;
@@ -160,9 +160,14 @@ const RadioSection = ({
160
160
  />
161
161
  </Box>
162
162
  )}
163
- <Text variant="p" color={CHARADE_GREY} aria-level="3">
164
- {section.title}
165
- </Text>
163
+ {section.titleIcon && (
164
+ <Cluster align="center">{section.titleIcon}</Cluster>
165
+ )}
166
+ <Box padding={section.titleIcon ? "0 0 0 8px" : "0"}>
167
+ <Text variant="p" color={CHARADE_GREY} aria-level="3">
168
+ {section.title}
169
+ </Text>
170
+ </Box>
166
171
  </Cluster>
167
172
  {section.rightIcons && (
168
173
  <Cluster childGap="0.5rem">
@@ -14,7 +14,8 @@ import ButtonWithLink from "../../atoms/button-with-link";
14
14
  import { Box, Stack } from "../../atoms/layouts";
15
15
  const WorkflowTile = ({
16
16
  workflowName = "Test Workflow",
17
- workflowDescription,
17
+ workflowDescription = "Link your benefit plan",
18
+ workflowActionName = "Search",
18
19
  slug
19
20
  }) => (
20
21
  <Box
@@ -35,7 +36,7 @@ const WorkflowTile = ({
35
36
  </Box>
36
37
  <Box padding={"0 1rem 1rem 1rem"} minHeight={"4.25rem"}>
37
38
  <Paragraph variant="pS" color={STORM_GREY}>
38
- {workflowDescription || `Link your benefit plan`}
39
+ {workflowDescription}
39
40
  </Paragraph>
40
41
  </Box>
41
42
  <Box padding={"1.5rem 1rem"} background={GRECIAN_GREY}>
@@ -45,7 +46,7 @@ const WorkflowTile = ({
45
46
  fontWeight={FONT_WEIGHT_SEMIBOLD}
46
47
  fontSize={"1.125rem"}
47
48
  borderRadius={"0px"}
48
- text={"Link Benefits"}
49
+ text={workflowActionName}
49
50
  minWidth={"100%"}
50
51
  url={`/service/${slug}`}
51
52
  extraStyles={`width: 100%;`}
@@ -11,7 +11,7 @@ export const AlertSuccessIcon = () => (
11
11
  <defs>
12
12
  <path
13
13
  d="M12,24 C18.627417,24 24,18.627417 24,12 C24,5.372583 18.627417,0 12,0 C5.372583,0 0,5.372583 0,12 C0,18.627417 5.372583,24 12,24 Z M16.9497475,7.46446609 L18.363961,8.87867966 L9.87867966,17.363961 L5.63603897,13.1213203 L7.05025253,11.7071068 L9.87803897,14.5354661 L16.9497475,7.46446609 Z"
14
- id="path-1"
14
+ id="alertSuccess"
15
15
  ></path>
16
16
  </defs>
17
17
  <g
@@ -27,13 +27,13 @@ export const AlertSuccessIcon = () => (
27
27
  transform="translate(24.000000, 34.000000)"
28
28
  >
29
29
  <mask id="mask-2" fill="white">
30
- <use xlinkHref="#path-1"></use>
30
+ <use xlinkHref="#alertSuccess"></use>
31
31
  </mask>
32
32
  <use
33
33
  id="background-2"
34
34
  fill="#47B872"
35
35
  fillRule="nonzero"
36
- xlinkHref="#path-1"
36
+ xlinkHref="#alertSuccess"
37
37
  ></use>
38
38
  </g>
39
39
  </g>