@thecb/components 7.8.1 → 7.8.2-beta.4

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.d.ts CHANGED
@@ -259,6 +259,7 @@ interface ClusterProps {
259
259
  justifySelf?: string;
260
260
  alignSelf?: string;
261
261
  flexGrow?: string;
262
+ innerWrapperAs?: string;
262
263
  }
263
264
 
264
265
  declare const Cluster: React.FC<Expand<ClusterProps> &
package/dist/index.esm.js CHANGED
@@ -5007,7 +5007,9 @@ var INFO_BLUE = "#E4F4FD";
5007
5007
  var HOVER_LIGHT_BLUE = "#EFFAFF";
5008
5008
  var MATISSE_BLUE = "#15749D";
5009
5009
  var ROYAL_BLUE = "#3181E3";
5010
- var ASTRAL_BLUE = "#3176AA"; // GREEN
5010
+ var ASTRAL_BLUE = "#3176AA";
5011
+ var SAPPHIRE_BLUE = "#116285";
5012
+ var PEACOCK_BLUE = "#0E506D"; // GREEN
5011
5013
 
5012
5014
  var FOREST_GREEN = "#19b03F";
5013
5015
  var MEADOW_GREEN = "#16C98D";
@@ -5030,6 +5032,7 @@ var RED = "#FF0000";
5030
5032
  var CRIMSON_RED = "#ED1C24";
5031
5033
  var THUNDERBIRD_RED = "#C3191F";
5032
5034
  var RAZZMATAZZ_RED = "#D11053";
5035
+ var RASPBERRY = "#ED125F";
5033
5036
  var FANTASY_RED = "#FCF4F4";
5034
5037
  var COSMOS_RED = "#FFD0D3";
5035
5038
  var BLUSH_RED = "#FFF0F5"; // Second level color constants
@@ -5114,6 +5117,8 @@ var colors = /*#__PURE__*/Object.freeze({
5114
5117
  MATISSE_BLUE: MATISSE_BLUE,
5115
5118
  ROYAL_BLUE: ROYAL_BLUE,
5116
5119
  ASTRAL_BLUE: ASTRAL_BLUE,
5120
+ SAPPHIRE_BLUE: SAPPHIRE_BLUE,
5121
+ PEACOCK_BLUE: PEACOCK_BLUE,
5117
5122
  FOREST_GREEN: FOREST_GREEN,
5118
5123
  MEADOW_GREEN: MEADOW_GREEN,
5119
5124
  POLAR_GREEN: POLAR_GREEN,
@@ -5135,6 +5140,7 @@ var colors = /*#__PURE__*/Object.freeze({
5135
5140
  FANTASY_RED: FANTASY_RED,
5136
5141
  COSMOS_RED: COSMOS_RED,
5137
5142
  BLUSH_RED: BLUSH_RED,
5143
+ RASPBERRY: RASPBERRY,
5138
5144
  ALERT_COLORS: ALERT_COLORS,
5139
5145
  ERROR_COLOR: ERROR_COLOR
5140
5146
  });
@@ -6659,7 +6665,7 @@ var ClusterInnerWrapper = styled.div.withConfig({
6659
6665
  return childGap;
6660
6666
  });
6661
6667
 
6662
- var _excluded$6 = ["justify", "align", "childGap", "minHeight", "minWidth", "nowrap", "overflow", "justifySelf", "alignSelf", "flexGrow", "extraStyles", "children"];
6668
+ var _excluded$6 = ["justify", "align", "childGap", "minHeight", "minWidth", "nowrap", "overflow", "justifySelf", "alignSelf", "flexGrow", "extraStyles", "children", "innerWrapperAs"];
6663
6669
  /*
6664
6670
  Cluster components suit any groups of elements that differ in
6665
6671
  length and are liable to wrap. Buttons that appear together at the
@@ -6683,6 +6689,8 @@ var Cluster = function Cluster(_ref) {
6683
6689
  flexGrow = _ref.flexGrow,
6684
6690
  extraStyles = _ref.extraStyles,
6685
6691
  children = _ref.children,
6692
+ _ref$innerWrapperAs = _ref.innerWrapperAs,
6693
+ innerWrapperAs = _ref$innerWrapperAs === void 0 ? "div" : _ref$innerWrapperAs,
6686
6694
  rest = _objectWithoutProperties(_ref, _excluded$6);
6687
6695
 
6688
6696
  return /*#__PURE__*/React.createElement(ClusterWrapper, _extends({
@@ -6698,7 +6706,8 @@ var Cluster = function Cluster(_ref) {
6698
6706
  childGap: childGap,
6699
6707
  minHeight: minHeight,
6700
6708
  minWidth: minWidth,
6701
- $nowrap: nowrap
6709
+ $nowrap: nowrap,
6710
+ as: innerWrapperAs
6702
6711
  }, safeChildren(children, /*#__PURE__*/React.createElement(Fragment$1, null))));
6703
6712
  };
6704
6713
 
@@ -12535,10 +12544,6 @@ var Reel = function Reel(_ref) {
12535
12544
  }), safeChildren(children, /*#__PURE__*/React.createElement(Fragment$1, null)));
12536
12545
  };
12537
12546
 
12538
- /*
12539
- For now I'm using string values, eventually shared components library will have its own constants file
12540
- for colors/values that should be used here instead
12541
- */
12542
12547
  var padding = {
12543
12548
  primary: "0.75rem 1.5rem",
12544
12549
  secondary: "0.75rem 1.5rem",
@@ -12554,18 +12559,18 @@ var padding = {
12554
12559
  whitePrimary: "1.125rem 0.75rem"
12555
12560
  };
12556
12561
  var color$1 = {
12557
- primary: "#FFFFFF",
12558
- secondary: "#15749D",
12559
- back: "#15749D",
12560
- smallPrimary: "#FFFFFF",
12561
- smallSecondary: "#15749D",
12562
- smallGhost: "#15749D",
12563
- ghost: "#15749D",
12564
- tertiary: "#15749D",
12565
- danger: "#FFFFFF",
12566
- dangerSecondary: "#D11053",
12567
- whiteSecondary: "#FFFFFF",
12568
- whitePrimary: "#FFFFFF"
12562
+ primary: WHITE,
12563
+ secondary: MATISSE_BLUE,
12564
+ back: MATISSE_BLUE,
12565
+ smallPrimary: WHITE,
12566
+ smallSecondary: MATISSE_BLUE,
12567
+ smallGhost: MATISSE_BLUE,
12568
+ ghost: MATISSE_BLUE,
12569
+ tertiary: MATISSE_BLUE,
12570
+ danger: WHITE,
12571
+ dangerSecondary: ERROR_COLOR,
12572
+ whiteSecondary: WHITE,
12573
+ whitePrimary: WHITE
12569
12574
  };
12570
12575
  var fontSizeVariant = {
12571
12576
  primary: "pS",
@@ -12624,116 +12629,116 @@ var minWidth = {
12624
12629
  whitePrimary: "130px"
12625
12630
  };
12626
12631
  var backgroundColor = {
12627
- primary: "#15749D",
12628
- secondary: "transparent",
12629
- back: "transparent",
12630
- smallPrimary: "#15749D",
12631
- smallSecondary: "transparent",
12632
- smallGhost: "transparent",
12633
- ghost: "transparent",
12634
- tertiary: "transparent",
12635
- danger: "#ED125F",
12636
- dangerSecondary: "transparent",
12637
- whiteSecondary: "transparent",
12638
- whitePrimary: "transparent"
12632
+ primary: MATISSE_BLUE,
12633
+ secondary: TRANSPARENT,
12634
+ back: TRANSPARENT,
12635
+ smallPrimary: MATISSE_BLUE,
12636
+ smallSecondary: TRANSPARENT,
12637
+ smallGhost: TRANSPARENT,
12638
+ ghost: TRANSPARENT,
12639
+ tertiary: TRANSPARENT,
12640
+ danger: RASPBERRY,
12641
+ dangerSecondary: TRANSPARENT,
12642
+ whiteSecondary: TRANSPARENT,
12643
+ whitePrimary: TRANSPARENT
12639
12644
  };
12640
12645
  var border = {
12641
- primary: "2px solid #15749D",
12642
- secondary: "2px solid #15749D",
12643
- back: "2px solid #15749D",
12644
- smallPrimary: "2px solid #15749D",
12645
- smallSecondary: "2px solid #15749D",
12646
+ primary: "2px solid " + MATISSE_BLUE,
12647
+ secondary: "2px solid " + MATISSE_BLUE,
12648
+ back: "2px solid " + MATISSE_BLUE,
12649
+ smallPrimary: "2px solid " + MATISSE_BLUE,
12650
+ smallSecondary: "2px solid " + MATISSE_BLUE,
12646
12651
  smallGhost: "none",
12647
12652
  ghost: "none",
12648
12653
  tertiary: "none",
12649
- danger: "2px solid #ED125F",
12650
- dangerSecondary: "2px solid #D11053",
12651
- whiteSecondary: "2px solid white",
12652
- whitePrimary: "2px solid transparent"
12654
+ danger: "2px solid " + RASPBERRY,
12655
+ dangerSecondary: "2px solid " + ERROR_COLOR,
12656
+ whiteSecondary: "2px solid " + WHITE,
12657
+ whitePrimary: "2px solid " + TRANSPARENT
12653
12658
  };
12654
12659
  var hoverBackgroundColor = {
12655
- primary: "#116285",
12660
+ primary: SAPPHIRE_BLUE,
12656
12661
  secondary: "#DBEAF0",
12657
- back: "transparent",
12658
- smallPrimary: "#116285",
12662
+ back: TRANSPARENT,
12663
+ smallPrimary: SAPPHIRE_BLUE,
12659
12664
  smallSecondary: "#DBEAF0",
12660
- smallGhost: "transparent",
12661
- ghost: "transparent",
12662
- tertiary: "transparent",
12665
+ smallGhost: TRANSPARENT,
12666
+ ghost: TRANSPARENT,
12667
+ tertiary: TRANSPARENT,
12663
12668
  danger: "#BA002C",
12664
- dangerSecondary: "transparent",
12665
- whiteSecondary: "transparent",
12666
- whitePrimary: "transparent"
12669
+ dangerSecondary: "#FAE7EE",
12670
+ whiteSecondary: TRANSPARENT,
12671
+ whitePrimary: TRANSPARENT
12667
12672
  };
12668
12673
  var hoverBorderColor = {
12669
- primary: "#116285",
12670
- secondary: "#15749D",
12674
+ primary: SAPPHIRE_BLUE,
12675
+ secondary: MATISSE_BLUE,
12671
12676
  back: "#DCEAF1",
12672
- smallPrimary: "#116285",
12673
- smallSecondary: "#15749D",
12674
- smallGhost: "transparent",
12675
- ghost: "transparent",
12676
- tertiary: "transparent",
12677
+ smallPrimary: SAPPHIRE_BLUE,
12678
+ smallSecondary: MATISSE_BLUE,
12679
+ smallGhost: TRANSPARENT,
12680
+ ghost: TRANSPARENT,
12681
+ tertiary: TRANSPARENT,
12677
12682
  danger: "#BA002C",
12678
12683
  dangerSecondary: "#B10541",
12679
- whiteSecondary: "2px solid transparent",
12680
- whitePrimary: "2px solid transparent"
12684
+ whiteSecondary: "2px solid " + TRANSPARENT,
12685
+ whitePrimary: "2px solid " + TRANSPARENT
12681
12686
  };
12682
12687
  var hoverColor = {
12683
- primary: "#FFFFFF",
12684
- secondary: "#116285",
12685
- back: "#116285",
12686
- smallPrimary: "#FFFFFF",
12687
- smallSecondary: "#116285",
12688
- smallGhost: "#116285",
12689
- ghost: "#116285",
12690
- tertiary: "#116285",
12691
- danger: "#FFFFFF",
12688
+ primary: WHITE,
12689
+ secondary: SAPPHIRE_BLUE,
12690
+ back: SAPPHIRE_BLUE,
12691
+ smallPrimary: WHITE,
12692
+ smallSecondary: SAPPHIRE_BLUE,
12693
+ smallGhost: SAPPHIRE_BLUE,
12694
+ ghost: SAPPHIRE_BLUE,
12695
+ tertiary: SAPPHIRE_BLUE,
12696
+ danger: WHITE,
12692
12697
  dangerSecondary: "#B10541",
12693
- whiteSecondary: "#FFFFFF",
12694
- whitePrimary: "#FFFFFF"
12698
+ whiteSecondary: WHITE,
12699
+ whitePrimary: WHITE
12695
12700
  };
12696
12701
  var activeBackgroundColor = {
12697
- primary: "#0E506D",
12702
+ primary: PEACOCK_BLUE,
12698
12703
  secondary: "#B8D5E1",
12699
- back: "transparent",
12700
- smallPrimary: "#0E506D",
12704
+ back: TRANSPARENT,
12705
+ smallPrimary: PEACOCK_BLUE,
12701
12706
  smallSecondary: "#B8D5E1",
12702
- smallGhost: "transparent",
12703
- ghost: "transparent",
12704
- tertiary: "transparent",
12707
+ smallGhost: TRANSPARENT,
12708
+ ghost: TRANSPARENT,
12709
+ tertiary: TRANSPARENT,
12705
12710
  danger: "#870000",
12706
- dangerSecondary: "transparent",
12707
- whiteSecondary: "transparent",
12708
- whitePrimary: "transparent"
12711
+ dangerSecondary: "#FAE7EE",
12712
+ whiteSecondary: TRANSPARENT,
12713
+ whitePrimary: TRANSPARENT
12709
12714
  };
12710
12715
  var activeBorderColor = {
12711
- primary: "#0E506D",
12712
- secondary: "#15749D",
12713
- back: "#0E506D",
12714
- smallPrimary: "#0E506D",
12715
- smallSecondary: "#15749D",
12716
- smallGhost: "transparent",
12717
- ghost: "transparent",
12718
- tertiary: "transparent",
12716
+ primary: PEACOCK_BLUE,
12717
+ secondary: MATISSE_BLUE,
12718
+ back: PEACOCK_BLUE,
12719
+ smallPrimary: PEACOCK_BLUE,
12720
+ smallSecondary: MATISSE_BLUE,
12721
+ smallGhost: TRANSPARENT,
12722
+ ghost: TRANSPARENT,
12723
+ tertiary: TRANSPARENT,
12719
12724
  danger: "#870000",
12720
12725
  dangerSecondary: "#910029",
12721
- whiteSecondary: "2px solid transparent",
12722
- whitePrimary: "2px solid transparent"
12726
+ whiteSecondary: "2px solid " + TRANSPARENT,
12727
+ whitePrimary: "2px solid " + TRANSPARENT
12723
12728
  };
12724
12729
  var activeColor = {
12725
- primary: "#FFFFFF",
12726
- secondary: "#15749D",
12727
- back: "#0E506D",
12728
- smallPrimary: "#FFFFFF",
12729
- smallSecondary: "#0E506D",
12730
- smallGhost: "#0E506D",
12731
- ghost: "#0E506D",
12732
- tertiary: "#0E506D",
12733
- danger: "#FFFFFF",
12730
+ primary: WHITE,
12731
+ secondary: MATISSE_BLUE,
12732
+ back: PEACOCK_BLUE,
12733
+ smallPrimary: WHITE,
12734
+ smallSecondary: PEACOCK_BLUE,
12735
+ smallGhost: PEACOCK_BLUE,
12736
+ ghost: PEACOCK_BLUE,
12737
+ tertiary: PEACOCK_BLUE,
12738
+ danger: WHITE,
12734
12739
  dangerSecondary: "#910029",
12735
- whiteSecondary: "#FFFFFF",
12736
- whitePrimary: "#FFFFFF"
12740
+ whiteSecondary: WHITE,
12741
+ whitePrimary: WHITE
12737
12742
  };
12738
12743
  var fallbackValues$1 = {
12739
12744
  padding: padding,
@@ -46548,6 +46553,7 @@ var PrevNextPlaceholder = function PrevNextPlaceholder(_ref) {
46548
46553
 
46549
46554
  var PrevNextButton = function PrevNextButton(_ref2) {
46550
46555
  var action = _ref2.action,
46556
+ ariaLabel = _ref2.ariaLabel,
46551
46557
  arrowColor = _ref2.arrowColor,
46552
46558
  borderRadius = _ref2.borderRadius,
46553
46559
  buttonHeight = _ref2.buttonHeight,
@@ -46557,12 +46563,14 @@ var PrevNextButton = function PrevNextButton(_ref2) {
46557
46563
  return /*#__PURE__*/React.createElement(Box, {
46558
46564
  padding: "0",
46559
46565
  minHeight: buttonHeight,
46560
- extraStyles: "max-height: ".concat(buttonHeight, ";")
46566
+ extraStyles: "max-height: ".concat(buttonHeight, ";"),
46567
+ as: "li"
46561
46568
  }, /*#__PURE__*/React.createElement(ButtonWithAction, {
46562
46569
  action: action,
46563
46570
  contentOverride: true,
46564
46571
  dataQa: type,
46565
- 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 ")
46572
+ "aria-label": ariaLabel,
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 ")
46566
46574
  }, /*#__PURE__*/React.createElement(Box, {
46567
46575
  padding: "0",
46568
46576
  extraStyles: type === "prev" && "transform: scaleX(-1)"
@@ -46640,18 +46648,25 @@ var Pagination = function Pagination(_ref3) {
46640
46648
  pageNext = _ref3.pageNext,
46641
46649
  pagePrevious = _ref3.pagePrevious,
46642
46650
  setCurrentPage = _ref3.setCurrentPage,
46651
+ ariaLabel = _ref3.ariaLabel,
46643
46652
  themeValues = _ref3.themeValues;
46644
46653
 
46645
46654
  var _useContext = useContext(ThemeContext),
46646
46655
  isMobile = _useContext.isMobile;
46647
46656
 
46648
- 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 ");
46657
+ 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 ");
46649
46658
  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 ");
46650
46659
  return /*#__PURE__*/React.createElement(Cluster, {
46651
46660
  justify: "center",
46652
- childGap: childGap
46661
+ childGap: childGap,
46662
+ overflow: true,
46663
+ as: "nav",
46664
+ innerWrapperAs: "ul",
46665
+ "aria-label": ariaLabel,
46666
+ extraStyles: "> ul { padding: 0px; > li { list-style-type: none; } };"
46653
46667
  }, currentPage > 1 ? /*#__PURE__*/React.createElement(PrevNextButton, {
46654
46668
  action: pagePrevious,
46669
+ ariaLabel: "Previous Page Button",
46655
46670
  arrowColor: arrowColor !== null && arrowColor !== void 0 ? arrowColor : themeValues.arrowColor,
46656
46671
  borderRadius: borderRadius,
46657
46672
  buttonHeight: buttonHeight,
@@ -46673,13 +46688,16 @@ var Pagination = function Pagination(_ref3) {
46673
46688
  }, "".concat(currentPage, " of ").concat(pageCount)))) : getPagesPanel(currentPage, pageCount).map(function (item, index) {
46674
46689
  return item.isButton ? /*#__PURE__*/React.createElement(Box, {
46675
46690
  padding: "0",
46676
- extraStyles: "max-height: ".concat(buttonHeight, ";")
46691
+ extraStyles: "max-height: ".concat(buttonHeight, ";"),
46692
+ as: "li",
46693
+ key: "pagination-button-".concat(item.index)
46677
46694
  }, /*#__PURE__*/React.createElement(ButtonWithAction, {
46678
46695
  variant: "ghost",
46679
- key: item.index,
46680
46696
  text: item.index,
46681
46697
  disabled: item.active,
46682
46698
  extraDisabledStyles: extraDisabledStyles,
46699
+ "aria-current": item.active ? "page" : undefined,
46700
+ "aria-label": "".concat(item.active ? "Current " : "", "Page ").concat(item.index, " Button"),
46683
46701
  action: !item.active ? function () {
46684
46702
  return setCurrentPage({
46685
46703
  pageNumber: item.index
@@ -46689,17 +46707,19 @@ var Pagination = function Pagination(_ref3) {
46689
46707
  extraStyles: extraStyles,
46690
46708
  dataQa: index
46691
46709
  }, item.index)) : /*#__PURE__*/React.createElement(Box, {
46692
- padding: "0 10px"
46710
+ padding: "0 10px",
46711
+ as: "li",
46712
+ key: "pagination-elipsis-".concat(index)
46693
46713
  }, /*#__PURE__*/React.createElement(Cluster, {
46694
46714
  justify: "flex-end"
46695
46715
  }, /*#__PURE__*/React.createElement(Text$1, {
46696
- key: index,
46697
46716
  variant: "pXL",
46698
46717
  weight: fontWeight,
46699
46718
  color: numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor
46700
46719
  }, "...")));
46701
46720
  }), currentPage < pageCount ? /*#__PURE__*/React.createElement(PrevNextButton, {
46702
46721
  action: pageNext,
46722
+ ariaLabel: "Next Page Button",
46703
46723
  arrowColor: arrowColor !== null && arrowColor !== void 0 ? arrowColor : themeValues.arrowColor,
46704
46724
  borderRadius: borderRadius,
46705
46725
  buttonHeight: buttonHeight,