@thecb/components 7.8.2-beta.4 → 7.8.2-beta.6

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
@@ -46602,26 +46602,30 @@ var getPagesPanel = function getPagesPanel(page, pagesCount) {
46602
46602
 
46603
46603
  if (page > space + 1) {
46604
46604
  pages.push({
46605
- isDelimiter: true
46605
+ isDelimiter: true,
46606
+ id: "first-delimiter"
46606
46607
  });
46607
46608
  }
46608
46609
 
46609
46610
  for (var j = Math.max(1, page - space) + 1; j < Math.min(lastPageNumber, page + space); j++) {
46610
46611
  pages.push({
46611
46612
  index: j,
46612
- isButton: true
46613
+ isButton: true,
46614
+ id: "page-".concat(j)
46613
46615
  });
46614
46616
  }
46615
46617
 
46616
46618
  if (page < lastPageNumber - space) {
46617
46619
  pages.push({
46618
- isDelimiter: true
46620
+ isDelimiter: true,
46621
+ id: "last-delimiter"
46619
46622
  });
46620
46623
  }
46621
46624
 
46622
46625
  pages.push({
46623
46626
  index: lastPageNumber,
46624
- isButton: true
46627
+ isButton: true,
46628
+ id: "page-".concat(lastPageNumber)
46625
46629
  });
46626
46630
  var activePage = pages.find(function (p) {
46627
46631
  return p.index === page;
@@ -46663,18 +46667,19 @@ var Pagination = function Pagination(_ref3) {
46663
46667
  isMobile = _useContext.isMobile;
46664
46668
 
46665
46669
  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 ");
46666
- 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 ");
46670
+ var currentPageStyles = "\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 border: ").concat(activeBorderWidth, " solid ").concat(numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor, ";\n background-color: ").concat(themeValues.activeBackgroundColor, ";\n }\n ");
46667
46671
  return /*#__PURE__*/React__default.createElement(Cluster, {
46668
46672
  justify: "center",
46669
46673
  childGap: childGap,
46670
46674
  overflow: true,
46671
46675
  as: "nav",
46676
+ role: "navigation",
46672
46677
  innerWrapperAs: "ul",
46673
46678
  "aria-label": ariaLabel,
46674
46679
  extraStyles: "> ul { padding: 0px; > li { list-style-type: none; } };"
46675
46680
  }, currentPage > 1 ? /*#__PURE__*/React__default.createElement(PrevNextButton, {
46676
46681
  action: pagePrevious,
46677
- ariaLabel: "Previous Page Button",
46682
+ ariaLabel: "Previous Page",
46678
46683
  arrowColor: arrowColor !== null && arrowColor !== void 0 ? arrowColor : themeValues.arrowColor,
46679
46684
  borderRadius: borderRadius,
46680
46685
  buttonHeight: buttonHeight,
@@ -46698,36 +46703,35 @@ var Pagination = function Pagination(_ref3) {
46698
46703
  padding: "0",
46699
46704
  extraStyles: "max-height: ".concat(buttonHeight, ";"),
46700
46705
  as: "li",
46701
- key: "pagination-button-".concat(item.index)
46706
+ key: item.id
46702
46707
  }, /*#__PURE__*/React__default.createElement(ButtonWithAction, {
46703
46708
  variant: "ghost",
46704
46709
  text: item.index,
46705
- disabled: item.active,
46706
- extraDisabledStyles: extraDisabledStyles,
46707
46710
  "aria-current": item.active ? "page" : undefined,
46708
- "aria-label": "".concat(item.active ? "Current " : "", "Page ").concat(item.index, " Button"),
46711
+ "aria-label": "".concat(item.index == pageCount ? "Last Page, " : "", "page ").concat(item.index),
46709
46712
  action: !item.active ? function () {
46710
46713
  return setCurrentPage({
46711
46714
  pageNumber: item.index
46712
46715
  });
46713
46716
  } : noop,
46714
46717
  textExtraStyles: "font-size: ".concat(fontSize, "; font-weight: ").concat(fontWeight, ";"),
46715
- extraStyles: extraStyles,
46718
+ extraStyles: "".concat(extraStyles).concat(item.active ? currentPageStyles : ""),
46716
46719
  dataQa: index
46717
46720
  }, item.index)) : /*#__PURE__*/React__default.createElement(Box, {
46718
46721
  padding: "0 10px",
46719
46722
  as: "li",
46720
- key: "pagination-elipsis-".concat(index)
46723
+ key: item.id
46721
46724
  }, /*#__PURE__*/React__default.createElement(Cluster, {
46722
46725
  justify: "flex-end"
46723
46726
  }, /*#__PURE__*/React__default.createElement(Text$1, {
46724
46727
  variant: "pXL",
46725
46728
  weight: fontWeight,
46726
- color: numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor
46729
+ color: numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor,
46730
+ "aria-label": "ellipsis"
46727
46731
  }, "...")));
46728
46732
  }), currentPage < pageCount ? /*#__PURE__*/React__default.createElement(PrevNextButton, {
46729
46733
  action: pageNext,
46730
- ariaLabel: "Next Page Button",
46734
+ ariaLabel: "Next Page",
46731
46735
  arrowColor: arrowColor !== null && arrowColor !== void 0 ? arrowColor : themeValues.arrowColor,
46732
46736
  borderRadius: borderRadius,
46733
46737
  buttonHeight: buttonHeight,