@thecb/components 7.8.1 → 7.8.2-beta.3

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
@@ -5015,7 +5015,9 @@ var INFO_BLUE = "#E4F4FD";
5015
5015
  var HOVER_LIGHT_BLUE = "#EFFAFF";
5016
5016
  var MATISSE_BLUE = "#15749D";
5017
5017
  var ROYAL_BLUE = "#3181E3";
5018
- var ASTRAL_BLUE = "#3176AA"; // GREEN
5018
+ var ASTRAL_BLUE = "#3176AA";
5019
+ var SAPPHIRE_BLUE = "#116285";
5020
+ var PEACOCK_BLUE = "#0E506D"; // GREEN
5019
5021
 
5020
5022
  var FOREST_GREEN = "#19b03F";
5021
5023
  var MEADOW_GREEN = "#16C98D";
@@ -5038,6 +5040,7 @@ var RED = "#FF0000";
5038
5040
  var CRIMSON_RED = "#ED1C24";
5039
5041
  var THUNDERBIRD_RED = "#C3191F";
5040
5042
  var RAZZMATAZZ_RED = "#D11053";
5043
+ var RASPBERRY = "#ED125F";
5041
5044
  var FANTASY_RED = "#FCF4F4";
5042
5045
  var COSMOS_RED = "#FFD0D3";
5043
5046
  var BLUSH_RED = "#FFF0F5"; // Second level color constants
@@ -5122,6 +5125,8 @@ var colors = /*#__PURE__*/Object.freeze({
5122
5125
  MATISSE_BLUE: MATISSE_BLUE,
5123
5126
  ROYAL_BLUE: ROYAL_BLUE,
5124
5127
  ASTRAL_BLUE: ASTRAL_BLUE,
5128
+ SAPPHIRE_BLUE: SAPPHIRE_BLUE,
5129
+ PEACOCK_BLUE: PEACOCK_BLUE,
5125
5130
  FOREST_GREEN: FOREST_GREEN,
5126
5131
  MEADOW_GREEN: MEADOW_GREEN,
5127
5132
  POLAR_GREEN: POLAR_GREEN,
@@ -5143,6 +5148,7 @@ var colors = /*#__PURE__*/Object.freeze({
5143
5148
  FANTASY_RED: FANTASY_RED,
5144
5149
  COSMOS_RED: COSMOS_RED,
5145
5150
  BLUSH_RED: BLUSH_RED,
5151
+ RASPBERRY: RASPBERRY,
5146
5152
  ALERT_COLORS: ALERT_COLORS,
5147
5153
  ERROR_COLOR: ERROR_COLOR
5148
5154
  });
@@ -6667,7 +6673,7 @@ var ClusterInnerWrapper = styled__default.div.withConfig({
6667
6673
  return childGap;
6668
6674
  });
6669
6675
 
6670
- var _excluded$6 = ["justify", "align", "childGap", "minHeight", "minWidth", "nowrap", "overflow", "justifySelf", "alignSelf", "flexGrow", "extraStyles", "children"];
6676
+ var _excluded$6 = ["justify", "align", "childGap", "minHeight", "minWidth", "nowrap", "overflow", "justifySelf", "alignSelf", "flexGrow", "extraStyles", "children", "innerWrapperAs"];
6671
6677
  /*
6672
6678
  Cluster components suit any groups of elements that differ in
6673
6679
  length and are liable to wrap. Buttons that appear together at the
@@ -6691,6 +6697,8 @@ var Cluster = function Cluster(_ref) {
6691
6697
  flexGrow = _ref.flexGrow,
6692
6698
  extraStyles = _ref.extraStyles,
6693
6699
  children = _ref.children,
6700
+ _ref$innerWrapperAs = _ref.innerWrapperAs,
6701
+ innerWrapperAs = _ref$innerWrapperAs === void 0 ? "div" : _ref$innerWrapperAs,
6694
6702
  rest = _objectWithoutProperties(_ref, _excluded$6);
6695
6703
 
6696
6704
  return /*#__PURE__*/React__default.createElement(ClusterWrapper, _extends({
@@ -6706,7 +6714,8 @@ var Cluster = function Cluster(_ref) {
6706
6714
  childGap: childGap,
6707
6715
  minHeight: minHeight,
6708
6716
  minWidth: minWidth,
6709
- $nowrap: nowrap
6717
+ $nowrap: nowrap,
6718
+ as: innerWrapperAs
6710
6719
  }, safeChildren(children, /*#__PURE__*/React__default.createElement(React.Fragment, null))));
6711
6720
  };
6712
6721
 
@@ -12543,10 +12552,6 @@ var Reel = function Reel(_ref) {
12543
12552
  }), safeChildren(children, /*#__PURE__*/React__default.createElement(React.Fragment, null)));
12544
12553
  };
12545
12554
 
12546
- /*
12547
- For now I'm using string values, eventually shared components library will have its own constants file
12548
- for colors/values that should be used here instead
12549
- */
12550
12555
  var padding = {
12551
12556
  primary: "0.75rem 1.5rem",
12552
12557
  secondary: "0.75rem 1.5rem",
@@ -12562,18 +12567,18 @@ var padding = {
12562
12567
  whitePrimary: "1.125rem 0.75rem"
12563
12568
  };
12564
12569
  var color$1 = {
12565
- primary: "#FFFFFF",
12566
- secondary: "#15749D",
12567
- back: "#15749D",
12568
- smallPrimary: "#FFFFFF",
12569
- smallSecondary: "#15749D",
12570
- smallGhost: "#15749D",
12571
- ghost: "#15749D",
12572
- tertiary: "#15749D",
12573
- danger: "#FFFFFF",
12574
- dangerSecondary: "#D11053",
12575
- whiteSecondary: "#FFFFFF",
12576
- whitePrimary: "#FFFFFF"
12570
+ primary: WHITE,
12571
+ secondary: MATISSE_BLUE,
12572
+ back: MATISSE_BLUE,
12573
+ smallPrimary: WHITE,
12574
+ smallSecondary: MATISSE_BLUE,
12575
+ smallGhost: MATISSE_BLUE,
12576
+ ghost: MATISSE_BLUE,
12577
+ tertiary: MATISSE_BLUE,
12578
+ danger: WHITE,
12579
+ dangerSecondary: ERROR_COLOR,
12580
+ whiteSecondary: WHITE,
12581
+ whitePrimary: WHITE
12577
12582
  };
12578
12583
  var fontSizeVariant = {
12579
12584
  primary: "pS",
@@ -12632,116 +12637,116 @@ var minWidth = {
12632
12637
  whitePrimary: "130px"
12633
12638
  };
12634
12639
  var backgroundColor = {
12635
- primary: "#15749D",
12636
- secondary: "transparent",
12637
- back: "transparent",
12638
- smallPrimary: "#15749D",
12639
- smallSecondary: "transparent",
12640
- smallGhost: "transparent",
12641
- ghost: "transparent",
12642
- tertiary: "transparent",
12643
- danger: "#ED125F",
12644
- dangerSecondary: "transparent",
12645
- whiteSecondary: "transparent",
12646
- whitePrimary: "transparent"
12640
+ primary: MATISSE_BLUE,
12641
+ secondary: TRANSPARENT,
12642
+ back: TRANSPARENT,
12643
+ smallPrimary: MATISSE_BLUE,
12644
+ smallSecondary: TRANSPARENT,
12645
+ smallGhost: TRANSPARENT,
12646
+ ghost: TRANSPARENT,
12647
+ tertiary: TRANSPARENT,
12648
+ danger: RASPBERRY,
12649
+ dangerSecondary: TRANSPARENT,
12650
+ whiteSecondary: TRANSPARENT,
12651
+ whitePrimary: TRANSPARENT
12647
12652
  };
12648
12653
  var border = {
12649
- primary: "2px solid #15749D",
12650
- secondary: "2px solid #15749D",
12651
- back: "2px solid #15749D",
12652
- smallPrimary: "2px solid #15749D",
12653
- smallSecondary: "2px solid #15749D",
12654
+ primary: "2px solid " + MATISSE_BLUE,
12655
+ secondary: "2px solid " + MATISSE_BLUE,
12656
+ back: "2px solid " + MATISSE_BLUE,
12657
+ smallPrimary: "2px solid " + MATISSE_BLUE,
12658
+ smallSecondary: "2px solid " + MATISSE_BLUE,
12654
12659
  smallGhost: "none",
12655
12660
  ghost: "none",
12656
12661
  tertiary: "none",
12657
- danger: "2px solid #ED125F",
12658
- dangerSecondary: "2px solid #D11053",
12659
- whiteSecondary: "2px solid white",
12660
- whitePrimary: "2px solid transparent"
12662
+ danger: "2px solid " + RASPBERRY,
12663
+ dangerSecondary: "2px solid " + ERROR_COLOR,
12664
+ whiteSecondary: "2px solid " + WHITE,
12665
+ whitePrimary: "2px solid " + TRANSPARENT
12661
12666
  };
12662
12667
  var hoverBackgroundColor = {
12663
- primary: "#116285",
12668
+ primary: SAPPHIRE_BLUE,
12664
12669
  secondary: "#DBEAF0",
12665
- back: "transparent",
12666
- smallPrimary: "#116285",
12670
+ back: TRANSPARENT,
12671
+ smallPrimary: SAPPHIRE_BLUE,
12667
12672
  smallSecondary: "#DBEAF0",
12668
- smallGhost: "transparent",
12669
- ghost: "transparent",
12670
- tertiary: "transparent",
12673
+ smallGhost: TRANSPARENT,
12674
+ ghost: TRANSPARENT,
12675
+ tertiary: TRANSPARENT,
12671
12676
  danger: "#BA002C",
12672
- dangerSecondary: "transparent",
12673
- whiteSecondary: "transparent",
12674
- whitePrimary: "transparent"
12677
+ dangerSecondary: "#FAE7EE",
12678
+ whiteSecondary: TRANSPARENT,
12679
+ whitePrimary: TRANSPARENT
12675
12680
  };
12676
12681
  var hoverBorderColor = {
12677
- primary: "#116285",
12678
- secondary: "#15749D",
12682
+ primary: SAPPHIRE_BLUE,
12683
+ secondary: MATISSE_BLUE,
12679
12684
  back: "#DCEAF1",
12680
- smallPrimary: "#116285",
12681
- smallSecondary: "#15749D",
12682
- smallGhost: "transparent",
12683
- ghost: "transparent",
12684
- tertiary: "transparent",
12685
+ smallPrimary: SAPPHIRE_BLUE,
12686
+ smallSecondary: MATISSE_BLUE,
12687
+ smallGhost: TRANSPARENT,
12688
+ ghost: TRANSPARENT,
12689
+ tertiary: TRANSPARENT,
12685
12690
  danger: "#BA002C",
12686
12691
  dangerSecondary: "#B10541",
12687
- whiteSecondary: "2px solid transparent",
12688
- whitePrimary: "2px solid transparent"
12692
+ whiteSecondary: "2px solid " + TRANSPARENT,
12693
+ whitePrimary: "2px solid " + TRANSPARENT
12689
12694
  };
12690
12695
  var hoverColor = {
12691
- primary: "#FFFFFF",
12692
- secondary: "#116285",
12693
- back: "#116285",
12694
- smallPrimary: "#FFFFFF",
12695
- smallSecondary: "#116285",
12696
- smallGhost: "#116285",
12697
- ghost: "#116285",
12698
- tertiary: "#116285",
12699
- danger: "#FFFFFF",
12696
+ primary: WHITE,
12697
+ secondary: SAPPHIRE_BLUE,
12698
+ back: SAPPHIRE_BLUE,
12699
+ smallPrimary: WHITE,
12700
+ smallSecondary: SAPPHIRE_BLUE,
12701
+ smallGhost: SAPPHIRE_BLUE,
12702
+ ghost: SAPPHIRE_BLUE,
12703
+ tertiary: SAPPHIRE_BLUE,
12704
+ danger: WHITE,
12700
12705
  dangerSecondary: "#B10541",
12701
- whiteSecondary: "#FFFFFF",
12702
- whitePrimary: "#FFFFFF"
12706
+ whiteSecondary: WHITE,
12707
+ whitePrimary: WHITE
12703
12708
  };
12704
12709
  var activeBackgroundColor = {
12705
- primary: "#0E506D",
12710
+ primary: PEACOCK_BLUE,
12706
12711
  secondary: "#B8D5E1",
12707
- back: "transparent",
12708
- smallPrimary: "#0E506D",
12712
+ back: TRANSPARENT,
12713
+ smallPrimary: PEACOCK_BLUE,
12709
12714
  smallSecondary: "#B8D5E1",
12710
- smallGhost: "transparent",
12711
- ghost: "transparent",
12712
- tertiary: "transparent",
12715
+ smallGhost: TRANSPARENT,
12716
+ ghost: TRANSPARENT,
12717
+ tertiary: TRANSPARENT,
12713
12718
  danger: "#870000",
12714
- dangerSecondary: "transparent",
12715
- whiteSecondary: "transparent",
12716
- whitePrimary: "transparent"
12719
+ dangerSecondary: "#FAE7EE",
12720
+ whiteSecondary: TRANSPARENT,
12721
+ whitePrimary: TRANSPARENT
12717
12722
  };
12718
12723
  var activeBorderColor = {
12719
- primary: "#0E506D",
12720
- secondary: "#15749D",
12721
- back: "#0E506D",
12722
- smallPrimary: "#0E506D",
12723
- smallSecondary: "#15749D",
12724
- smallGhost: "transparent",
12725
- ghost: "transparent",
12726
- tertiary: "transparent",
12724
+ primary: PEACOCK_BLUE,
12725
+ secondary: MATISSE_BLUE,
12726
+ back: PEACOCK_BLUE,
12727
+ smallPrimary: PEACOCK_BLUE,
12728
+ smallSecondary: MATISSE_BLUE,
12729
+ smallGhost: TRANSPARENT,
12730
+ ghost: TRANSPARENT,
12731
+ tertiary: TRANSPARENT,
12727
12732
  danger: "#870000",
12728
12733
  dangerSecondary: "#910029",
12729
- whiteSecondary: "2px solid transparent",
12730
- whitePrimary: "2px solid transparent"
12734
+ whiteSecondary: "2px solid " + TRANSPARENT,
12735
+ whitePrimary: "2px solid " + TRANSPARENT
12731
12736
  };
12732
12737
  var activeColor = {
12733
- primary: "#FFFFFF",
12734
- secondary: "#15749D",
12735
- back: "#0E506D",
12736
- smallPrimary: "#FFFFFF",
12737
- smallSecondary: "#0E506D",
12738
- smallGhost: "#0E506D",
12739
- ghost: "#0E506D",
12740
- tertiary: "#0E506D",
12741
- danger: "#FFFFFF",
12738
+ primary: WHITE,
12739
+ secondary: MATISSE_BLUE,
12740
+ back: PEACOCK_BLUE,
12741
+ smallPrimary: WHITE,
12742
+ smallSecondary: PEACOCK_BLUE,
12743
+ smallGhost: PEACOCK_BLUE,
12744
+ ghost: PEACOCK_BLUE,
12745
+ tertiary: PEACOCK_BLUE,
12746
+ danger: WHITE,
12742
12747
  dangerSecondary: "#910029",
12743
- whiteSecondary: "#FFFFFF",
12744
- whitePrimary: "#FFFFFF"
12748
+ whiteSecondary: WHITE,
12749
+ whitePrimary: WHITE
12745
12750
  };
12746
12751
  var fallbackValues$1 = {
12747
12752
  padding: padding,
@@ -46556,6 +46561,7 @@ var PrevNextPlaceholder = function PrevNextPlaceholder(_ref) {
46556
46561
 
46557
46562
  var PrevNextButton = function PrevNextButton(_ref2) {
46558
46563
  var action = _ref2.action,
46564
+ ariaLabel = _ref2.ariaLabel,
46559
46565
  arrowColor = _ref2.arrowColor,
46560
46566
  borderRadius = _ref2.borderRadius,
46561
46567
  buttonHeight = _ref2.buttonHeight,
@@ -46565,12 +46571,14 @@ var PrevNextButton = function PrevNextButton(_ref2) {
46565
46571
  return /*#__PURE__*/React__default.createElement(Box, {
46566
46572
  padding: "0",
46567
46573
  minHeight: buttonHeight,
46568
- extraStyles: "max-height: ".concat(buttonHeight, ";")
46574
+ extraStyles: "max-height: ".concat(buttonHeight, ";"),
46575
+ as: "li"
46569
46576
  }, /*#__PURE__*/React__default.createElement(ButtonWithAction, {
46570
46577
  action: action,
46571
46578
  contentOverride: true,
46572
46579
  dataQa: type,
46573
- extraStyles: "\n background-color: ".concat(numberColor, ";\n border-color: ").concat(numberColor, ";\n border-radius: ").concat(borderRadius, ";\n margin: 0;\n max-height: ").concat(buttonHeight, ";\n min-height: 100%;\n min-width: ").concat(buttonWidth, ";\n padding: 0;\n &:focus {\n outline: none\n }\n ")
46580
+ "aria-label": ariaLabel,
46581
+ extraStyles: "\n background-color: ".concat(numberColor, ";\n border-color: ").concat(numberColor, ";\n border-radius: ").concat(borderRadius, ";\n margin: 0;\n max-height: ").concat(buttonHeight, ";\n min-height: 100%;\n min-width: ").concat(buttonWidth, ";\n padding: 0;\n ")
46574
46582
  }, /*#__PURE__*/React__default.createElement(Box, {
46575
46583
  padding: "0",
46576
46584
  extraStyles: type === "prev" && "transform: scaleX(-1)"
@@ -46653,13 +46661,18 @@ var Pagination = function Pagination(_ref3) {
46653
46661
  var _useContext = React.useContext(styled.ThemeContext),
46654
46662
  isMobile = _useContext.isMobile;
46655
46663
 
46656
- var extraStyles = "\n min-width: ".concat(buttonWidth, "; min-height: 100%; padding: 0;\n border-radius: ").concat(borderRadius, ";\n &:hover, &:focus {\n text-decoration: none;\n > * > span {\n text-decoration: none;\n }\n }\n > * > span {\n color: ").concat(numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor, "\n }\n margin: 0;\n &:hover {\n background-color: ").concat(themeValues.hoverBackgroundColor, "\n }\n &:focus {\n outline: none\n }\n ");
46664
+ var extraStyles = "\n min-width: ".concat(buttonWidth, "; min-height: 100%; padding: 0;\n border-radius: ").concat(borderRadius, ";\n &:hover, &:focus {\n text-decoration: none;\n > * > span {\n text-decoration: none;\n }\n }\n > * > span {\n color: ").concat(numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor, "\n }\n margin: 0;\n &:hover {\n background-color: ").concat(themeValues.hoverBackgroundColor, "\n }\n ");
46657
46665
  var extraDisabledStyles = "\n border: ".concat(activeBorderWidth, " solid ").concat(numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor, ";\n color: ").concat(numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.activeColor, ";\n background-color: ").concat(themeValues.activeBackgroundColor, ";\n &:focus {\n box-shadow: none;\n }\n &:hover {\n background-color: initial;\n }\n ");
46658
46666
  return /*#__PURE__*/React__default.createElement(Cluster, {
46659
46667
  justify: "center",
46660
- childGap: childGap
46668
+ childGap: childGap,
46669
+ overflow: true,
46670
+ as: "nav",
46671
+ innerWrapperAs: "ul",
46672
+ extraStyles: "> ul { padding: 0px; > li { list-style-type: none; } };"
46661
46673
  }, currentPage > 1 ? /*#__PURE__*/React__default.createElement(PrevNextButton, {
46662
46674
  action: pagePrevious,
46675
+ ariaLabel: "Previous Page Button",
46663
46676
  arrowColor: arrowColor !== null && arrowColor !== void 0 ? arrowColor : themeValues.arrowColor,
46664
46677
  borderRadius: borderRadius,
46665
46678
  buttonHeight: buttonHeight,
@@ -46681,13 +46694,16 @@ var Pagination = function Pagination(_ref3) {
46681
46694
  }, "".concat(currentPage, " of ").concat(pageCount)))) : getPagesPanel(currentPage, pageCount).map(function (item, index) {
46682
46695
  return item.isButton ? /*#__PURE__*/React__default.createElement(Box, {
46683
46696
  padding: "0",
46684
- extraStyles: "max-height: ".concat(buttonHeight, ";")
46697
+ extraStyles: "max-height: ".concat(buttonHeight, ";"),
46698
+ as: "li"
46685
46699
  }, /*#__PURE__*/React__default.createElement(ButtonWithAction, {
46686
46700
  variant: "ghost",
46687
46701
  key: item.index,
46688
46702
  text: item.index,
46689
46703
  disabled: item.active,
46690
46704
  extraDisabledStyles: extraDisabledStyles,
46705
+ "aria-current": item.active ? "page" : undefined,
46706
+ "aria-label": "".concat(item.active ? "Current " : "", "Page ").concat(item.index, " Button"),
46691
46707
  action: !item.active ? function () {
46692
46708
  return setCurrentPage({
46693
46709
  pageNumber: item.index
@@ -46708,6 +46724,7 @@ var Pagination = function Pagination(_ref3) {
46708
46724
  }, "...")));
46709
46725
  }), currentPage < pageCount ? /*#__PURE__*/React__default.createElement(PrevNextButton, {
46710
46726
  action: pageNext,
46727
+ ariaLabel: "Next Page Button",
46711
46728
  arrowColor: arrowColor !== null && arrowColor !== void 0 ? arrowColor : themeValues.arrowColor,
46712
46729
  borderRadius: borderRadius,
46713
46730
  buttonHeight: buttonHeight,