@thecb/components 7.7.4-beta.3 → 7.7.4-beta.5

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.esm.js CHANGED
@@ -12803,7 +12803,7 @@ var SpinnerIcon = function SpinnerIcon(_ref3) {
12803
12803
  }))))));
12804
12804
  };
12805
12805
 
12806
- var _excluded$h = ["action", "children", "contentOverride", "dataQa", "disabledBackgroundColor", "disabledBorderColor", "disabledColor", "extraStyles", "isLoading", "tabIndex", "text", "textExtraStyles", "textWrap", "variant"];
12806
+ var _excluded$h = ["action", "variant", "text", "textWrap", "isLoading", "dataQa", "textExtraStyles", "contentOverride", "extraStyles", "tabIndex", "children", "extraDisabledStyles"];
12807
12807
  var rotate$1 = posed.div({
12808
12808
  fixed: {
12809
12809
  rotate: "0deg"
@@ -12857,28 +12857,23 @@ var Spinner = function Spinner(_ref) {
12857
12857
  var ButtonWithAction = function ButtonWithAction(_ref2) {
12858
12858
  var _ref2$action = _ref2.action,
12859
12859
  action = _ref2$action === void 0 ? noop : _ref2$action,
12860
- children = _ref2.children,
12861
- _ref2$contentOverride = _ref2.contentOverride,
12862
- contentOverride = _ref2$contentOverride === void 0 ? false : _ref2$contentOverride,
12860
+ _ref2$variant = _ref2.variant,
12861
+ variant = _ref2$variant === void 0 ? "primary" : _ref2$variant,
12862
+ text = _ref2.text,
12863
+ _ref2$textWrap = _ref2.textWrap,
12864
+ textWrap = _ref2$textWrap === void 0 ? false : _ref2$textWrap,
12865
+ _ref2$isLoading = _ref2.isLoading,
12866
+ isLoading = _ref2$isLoading === void 0 ? false : _ref2$isLoading,
12863
12867
  _ref2$dataQa = _ref2.dataQa,
12864
12868
  dataQa = _ref2$dataQa === void 0 ? null : _ref2$dataQa,
12865
- _ref2$disabledBackgro = _ref2.disabledBackgroundColor,
12866
- disabledBackgroundColor = _ref2$disabledBackgro === void 0 ? "#6D717E" : _ref2$disabledBackgro,
12867
- _ref2$disabledBorderC = _ref2.disabledBorderColor,
12868
- disabledBorderColor = _ref2$disabledBorderC === void 0 ? "#6D717E" : _ref2$disabledBorderC,
12869
- _ref2$disabledColor = _ref2.disabledColor,
12870
- disabledColor = _ref2$disabledColor === void 0 ? "#FFFFFF" : _ref2$disabledColor,
12869
+ textExtraStyles = _ref2.textExtraStyles,
12870
+ _ref2$contentOverride = _ref2.contentOverride,
12871
+ contentOverride = _ref2$contentOverride === void 0 ? false : _ref2$contentOverride,
12871
12872
  _ref2$extraStyles = _ref2.extraStyles,
12872
12873
  extraStyles = _ref2$extraStyles === void 0 ? "" : _ref2$extraStyles,
12873
- _ref2$isLoading = _ref2.isLoading,
12874
- isLoading = _ref2$isLoading === void 0 ? false : _ref2$isLoading,
12875
12874
  tabIndex = _ref2.tabIndex,
12876
- text = _ref2.text,
12877
- textExtraStyles = _ref2.textExtraStyles,
12878
- _ref2$textWrap = _ref2.textWrap,
12879
- textWrap = _ref2$textWrap === void 0 ? false : _ref2$textWrap,
12880
- _ref2$variant = _ref2.variant,
12881
- variant = _ref2$variant === void 0 ? "primary" : _ref2$variant,
12875
+ children = _ref2.children,
12876
+ extraDisabledStyles = _ref2.extraDisabledStyles,
12882
12877
  rest = _objectWithoutProperties(_ref2, _excluded$h);
12883
12878
 
12884
12879
  var themeContext = useContext(ThemeContext);
@@ -12886,7 +12881,7 @@ var ButtonWithAction = function ButtonWithAction(_ref2) {
12886
12881
  var isMobile = themeContext.isMobile;
12887
12882
  var hoverStyles = "\n outline: none;\n background-color: ".concat(themeValues.hoverBackgroundColor, ";\n border-color: ").concat(themeValues.hoverBorderColor, ";\n color: ").concat(themeValues.hoverColor, ";\n text-decoration: ").concat(variant === "ghost" || variant === "smallGhost" ? "underline" : "none", ";\n cursor: pointer;\n ");
12888
12883
  var activeStyles = "\n outline: none;\n background-color: ".concat(themeValues.activeBackgroundColor, ";\n border-color: ").concat(themeValues.activeBorderColor, ";\n color: ").concat(themeValues.activeColor, ";\n text-decoration: ").concat(variant === "ghost" || variant === "smallGhost" ? "underline" : "none", ";\n ");
12889
- var disabledStyles = "\n background-color: ".concat(disabledBackgroundColor, ";\n border-color: ").concat(disabledBorderColor, ";\n color: ").concat(disabledColor, ";\n cursor: default;\n &:focus {\n box-shadow: 0 0 10px ").concat(disabledBackgroundColor, ";\n outline: none;\n }\n ");
12884
+ var disabledStyles = "\n background-color: #6D717E;\n border-color: #6D717E;\n color: #FFFFFF;\n cursor: default;\n &:focus {\n box-shadow: 0 0 10px #6D717E;\n outline: none;\n }\n ".concat(extraDisabledStyles, "\n ");
12890
12885
  return /*#__PURE__*/React.createElement(Box, _extends({
12891
12886
  variant: variant,
12892
12887
  padding: themeValues.padding,
@@ -45681,7 +45676,13 @@ var createPartialAmountFormState = function createPartialAmountFormState(lineIte
45681
45676
  var arrowColor = WHITE;
45682
45677
  var numberColor = MATISSE_BLUE;
45683
45678
  var hoverBackgroundColor$2 = ALABASTER_WHITE;
45679
+ var activeBackgroundColor$1 = WHITE;
45680
+ var activeBorderColor$1 = MATISSE_BLUE;
45681
+ var activeColor$8 = MATISSE_BLUE;
45684
45682
  var fallbackValues$J = {
45683
+ activeColor: activeColor$8,
45684
+ activeBackgroundColor: activeBackgroundColor$1,
45685
+ activeBorderColor: activeBorderColor$1,
45685
45686
  arrowColor: arrowColor,
45686
45687
  hoverBackgroundColor: hoverBackgroundColor$2,
45687
45688
  numberColor: numberColor
@@ -45691,23 +45692,34 @@ var PAGING_SPACE = 2; // how many pages we want to have before/after delimiter
45691
45692
 
45692
45693
  var PAGING_INIT_SPACE = 3; // first delimiter should appear after 3 pages
45693
45694
 
45694
- var PrevNextButton = function PrevNextButton(_ref) {
45695
- var action = _ref.action,
45696
- arrowColor = _ref.arrowColor,
45697
- borderRadius = _ref.borderRadius,
45698
- buttonHeight = _ref.buttonHeight,
45699
- buttonWidth = _ref.buttonWidth,
45700
- numberColor = _ref.numberColor,
45701
- type = _ref.type;
45695
+ var PrevNextPlaceholder = function PrevNextPlaceholder(_ref) {
45696
+ var buttonHeight = _ref.buttonHeight,
45697
+ buttonWidth = _ref.buttonWidth;
45702
45698
  return /*#__PURE__*/React.createElement(Box, {
45703
- padding: "0 10px 0",
45699
+ padding: "0",
45700
+ minHeight: buttonHeight,
45701
+ minWidth: buttonWidth,
45702
+ extraStyles: "max-height: ".concat(buttonHeight, ";")
45703
+ });
45704
+ };
45705
+
45706
+ var PrevNextButton = function PrevNextButton(_ref2) {
45707
+ var action = _ref2.action,
45708
+ arrowColor = _ref2.arrowColor,
45709
+ borderRadius = _ref2.borderRadius,
45710
+ buttonHeight = _ref2.buttonHeight,
45711
+ buttonWidth = _ref2.buttonWidth,
45712
+ numberColor = _ref2.numberColor,
45713
+ type = _ref2.type;
45714
+ return /*#__PURE__*/React.createElement(Box, {
45715
+ padding: "0",
45704
45716
  minHeight: buttonHeight,
45705
45717
  extraStyles: "max-height: ".concat(buttonHeight, ";")
45706
45718
  }, /*#__PURE__*/React.createElement(ButtonWithAction, {
45707
45719
  action: action,
45708
45720
  contentOverride: true,
45709
45721
  dataQa: type,
45710
- 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 &:focus {\n outline: none\n }\n ")
45722
+ 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 ")
45711
45723
  }, /*#__PURE__*/React.createElement(Box, {
45712
45724
  padding: "0",
45713
45725
  extraStyles: type === "prev" && "transform: scaleX(-1)"
@@ -45763,34 +45775,37 @@ var getPagesPanel = function getPagesPanel(page, pagesCount) {
45763
45775
  return pages;
45764
45776
  };
45765
45777
 
45766
- var Pagination = function Pagination(_ref2) {
45767
- var _ref2$activeBorderWid = _ref2.activeBorderWidth,
45768
- activeBorderWidth = _ref2$activeBorderWid === void 0 ? "1px" : _ref2$activeBorderWid,
45769
- activeBackgroundColor = _ref2.activeBackgroundColor,
45770
- arrowColor = _ref2.arrowColor,
45771
- _ref2$borderRadius = _ref2.borderRadius,
45772
- borderRadius = _ref2$borderRadius === void 0 ? "3px" : _ref2$borderRadius,
45773
- _ref2$buttonHeight = _ref2.buttonHeight,
45774
- buttonHeight = _ref2$buttonHeight === void 0 ? "40px" : _ref2$buttonHeight,
45775
- _ref2$buttonWidth = _ref2.buttonWidth,
45776
- buttonWidth = _ref2$buttonWidth === void 0 ? "40px" : _ref2$buttonWidth,
45777
- _ref2$childGap = _ref2.childGap,
45778
- childGap = _ref2$childGap === void 0 ? "10px" : _ref2$childGap,
45779
- currentPage = _ref2.currentPage,
45780
- _ref2$fontSize = _ref2.fontSize,
45781
- fontSize = _ref2$fontSize === void 0 ? "17px" : _ref2$fontSize,
45782
- _ref2$fontWeight = _ref2.fontWeight,
45783
- fontWeight = _ref2$fontWeight === void 0 ? "900" : _ref2$fontWeight,
45784
- numberColor = _ref2.numberColor,
45785
- pageCount = _ref2.pageCount,
45786
- pageNext = _ref2.pageNext,
45787
- pagePrevious = _ref2.pagePrevious,
45788
- setCurrentPage = _ref2.setCurrentPage,
45789
- themeValues = _ref2.themeValues;
45778
+ var Pagination = function Pagination(_ref3) {
45779
+ var _ref3$activeBorderWid = _ref3.activeBorderWidth,
45780
+ activeBorderWidth = _ref3$activeBorderWid === void 0 ? "3px" : _ref3$activeBorderWid,
45781
+ arrowColor = _ref3.arrowColor,
45782
+ _ref3$borderRadius = _ref3.borderRadius,
45783
+ borderRadius = _ref3$borderRadius === void 0 ? "3px" : _ref3$borderRadius,
45784
+ _ref3$buttonHeight = _ref3.buttonHeight,
45785
+ buttonHeight = _ref3$buttonHeight === void 0 ? "40px" : _ref3$buttonHeight,
45786
+ _ref3$buttonWidth = _ref3.buttonWidth,
45787
+ buttonWidth = _ref3$buttonWidth === void 0 ? "40px" : _ref3$buttonWidth,
45788
+ _ref3$childGap = _ref3.childGap,
45789
+ childGap = _ref3$childGap === void 0 ? "10px" : _ref3$childGap,
45790
+ currentPage = _ref3.currentPage,
45791
+ _ref3$fontSize = _ref3.fontSize,
45792
+ fontSize = _ref3$fontSize === void 0 ? "17px" : _ref3$fontSize,
45793
+ _ref3$fontWeight = _ref3.fontWeight,
45794
+ fontWeight = _ref3$fontWeight === void 0 ? "900" : _ref3$fontWeight,
45795
+ numberColor = _ref3.numberColor,
45796
+ pageCount = _ref3.pageCount,
45797
+ pageNext = _ref3.pageNext,
45798
+ pagePrevious = _ref3.pagePrevious,
45799
+ setCurrentPage = _ref3.setCurrentPage,
45800
+ themeValues = _ref3.themeValues;
45801
+
45802
+ var _useContext = useContext(ThemeContext),
45803
+ isMobile = _useContext.isMobile;
45804
+
45790
45805
  return /*#__PURE__*/React.createElement(Cluster, {
45791
45806
  justify: "center",
45792
45807
  childGap: childGap
45793
- }, currentPage > 1 && /*#__PURE__*/React.createElement(PrevNextButton, {
45808
+ }, currentPage > 1 ? /*#__PURE__*/React.createElement(PrevNextButton, {
45794
45809
  action: pagePrevious,
45795
45810
  arrowColor: arrowColor !== null && arrowColor !== void 0 ? arrowColor : themeValues.arrowColor,
45796
45811
  borderRadius: borderRadius,
@@ -45798,7 +45813,19 @@ var Pagination = function Pagination(_ref2) {
45798
45813
  buttonWidth: buttonWidth,
45799
45814
  numberColor: numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor,
45800
45815
  type: "prev"
45801
- }), getPagesPanel(currentPage, pageCount).map(function (item, index) {
45816
+ }) : isMobile && /*#__PURE__*/React.createElement(PrevNextPlaceholder, {
45817
+ buttonHeight: buttonHeight,
45818
+ buttonWidth: buttonWidth
45819
+ }), isMobile ? /*#__PURE__*/React.createElement(Box, {
45820
+ padding: "0"
45821
+ }, /*#__PURE__*/React.createElement(Cluster, {
45822
+ justify: "flex-end"
45823
+ }, /*#__PURE__*/React.createElement(Text$1, {
45824
+ variant: "pXL",
45825
+ weight: fontWeight,
45826
+ color: numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor,
45827
+ extraStyles: "font-size: ".concat(fontSize)
45828
+ }, "".concat(currentPage, " of ").concat(pageCount)))) : getPagesPanel(currentPage, pageCount).map(function (item, index) {
45802
45829
  return item.isButton ? /*#__PURE__*/React.createElement(Box, {
45803
45830
  padding: "0",
45804
45831
  extraStyles: "max-height: ".concat(buttonHeight, ";")
@@ -45807,17 +45834,15 @@ var Pagination = function Pagination(_ref2) {
45807
45834
  key: item.index,
45808
45835
  text: item.index,
45809
45836
  disabled: item.active,
45837
+ 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 "),
45810
45838
  action: !item.active ? function () {
45811
45839
  return setCurrentPage({
45812
45840
  pageNumber: item.index
45813
45841
  });
45814
45842
  } : noop,
45815
45843
  textExtraStyles: "font-size: ".concat(fontSize, "; font-weight: ").concat(fontWeight, ";"),
45816
- extraStyles: "\n ".concat(item.active ? "border: ".concat(activeBorderWidth, " solid ").concat(numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor, ";") : "", "\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 { ").concat(item.active ? "cursor: default;" : "background-color: ".concat(themeValues.hoverBackgroundColor), " }\n &:focus {\n outline: none\n }\n "),
45817
- dataQa: index,
45818
- disabledBackgroundColor: activeBackgroundColor,
45819
- disabledBorderColor: numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor,
45820
- disabledColor: numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor
45844
+ 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 "),
45845
+ dataQa: index
45821
45846
  }, item.index)) : /*#__PURE__*/React.createElement(Box, {
45822
45847
  padding: "0 10px"
45823
45848
  }, /*#__PURE__*/React.createElement(Cluster, {
@@ -45826,9 +45851,10 @@ var Pagination = function Pagination(_ref2) {
45826
45851
  key: index,
45827
45852
  variant: "pXL",
45828
45853
  weight: fontWeight,
45829
- color: numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor
45854
+ color: numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor,
45855
+ extraStyles: "font-size: ".concat(fontSize)
45830
45856
  }, "...")));
45831
- }), currentPage < pageCount && /*#__PURE__*/React.createElement(PrevNextButton, {
45857
+ }), currentPage < pageCount ? /*#__PURE__*/React.createElement(PrevNextButton, {
45832
45858
  action: pageNext,
45833
45859
  arrowColor: arrowColor !== null && arrowColor !== void 0 ? arrowColor : themeValues.arrowColor,
45834
45860
  borderRadius: borderRadius,
@@ -45836,6 +45862,9 @@ var Pagination = function Pagination(_ref2) {
45836
45862
  buttonWidth: buttonWidth,
45837
45863
  numberColor: numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor,
45838
45864
  type: "next"
45865
+ }) : isMobile && /*#__PURE__*/React.createElement(PrevNextPlaceholder, {
45866
+ buttonHeight: buttonHeight,
45867
+ buttonWidth: buttonWidth
45839
45868
  }));
45840
45869
  };
45841
45870