@thecb/components 7.7.4-beta.4 → 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.cjs.js +91 -62
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +91 -62
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/button-with-action/ButtonWithAction.js +13 -14
- package/src/components/molecules/pagination/Pagination.js +123 -78
- package/src/components/molecules/pagination/Pagination.theme.js +8 -1
package/dist/index.cjs.js
CHANGED
|
@@ -12811,7 +12811,7 @@ var SpinnerIcon = function SpinnerIcon(_ref3) {
|
|
|
12811
12811
|
}))))));
|
|
12812
12812
|
};
|
|
12813
12813
|
|
|
12814
|
-
var _excluded$h = ["action", "
|
|
12814
|
+
var _excluded$h = ["action", "variant", "text", "textWrap", "isLoading", "dataQa", "textExtraStyles", "contentOverride", "extraStyles", "tabIndex", "children", "extraDisabledStyles"];
|
|
12815
12815
|
var rotate$1 = posed.div({
|
|
12816
12816
|
fixed: {
|
|
12817
12817
|
rotate: "0deg"
|
|
@@ -12865,28 +12865,23 @@ var Spinner = function Spinner(_ref) {
|
|
|
12865
12865
|
var ButtonWithAction = function ButtonWithAction(_ref2) {
|
|
12866
12866
|
var _ref2$action = _ref2.action,
|
|
12867
12867
|
action = _ref2$action === void 0 ? noop : _ref2$action,
|
|
12868
|
-
|
|
12869
|
-
_ref2$
|
|
12870
|
-
|
|
12868
|
+
_ref2$variant = _ref2.variant,
|
|
12869
|
+
variant = _ref2$variant === void 0 ? "primary" : _ref2$variant,
|
|
12870
|
+
text = _ref2.text,
|
|
12871
|
+
_ref2$textWrap = _ref2.textWrap,
|
|
12872
|
+
textWrap = _ref2$textWrap === void 0 ? false : _ref2$textWrap,
|
|
12873
|
+
_ref2$isLoading = _ref2.isLoading,
|
|
12874
|
+
isLoading = _ref2$isLoading === void 0 ? false : _ref2$isLoading,
|
|
12871
12875
|
_ref2$dataQa = _ref2.dataQa,
|
|
12872
12876
|
dataQa = _ref2$dataQa === void 0 ? null : _ref2$dataQa,
|
|
12873
|
-
|
|
12874
|
-
|
|
12875
|
-
_ref2$
|
|
12876
|
-
disabledBorderColor = _ref2$disabledBorderC === void 0 ? "#6D717E" : _ref2$disabledBorderC,
|
|
12877
|
-
_ref2$disabledColor = _ref2.disabledColor,
|
|
12878
|
-
disabledColor = _ref2$disabledColor === void 0 ? "#FFFFFF" : _ref2$disabledColor,
|
|
12877
|
+
textExtraStyles = _ref2.textExtraStyles,
|
|
12878
|
+
_ref2$contentOverride = _ref2.contentOverride,
|
|
12879
|
+
contentOverride = _ref2$contentOverride === void 0 ? false : _ref2$contentOverride,
|
|
12879
12880
|
_ref2$extraStyles = _ref2.extraStyles,
|
|
12880
12881
|
extraStyles = _ref2$extraStyles === void 0 ? "" : _ref2$extraStyles,
|
|
12881
|
-
_ref2$isLoading = _ref2.isLoading,
|
|
12882
|
-
isLoading = _ref2$isLoading === void 0 ? false : _ref2$isLoading,
|
|
12883
12882
|
tabIndex = _ref2.tabIndex,
|
|
12884
|
-
|
|
12885
|
-
|
|
12886
|
-
_ref2$textWrap = _ref2.textWrap,
|
|
12887
|
-
textWrap = _ref2$textWrap === void 0 ? false : _ref2$textWrap,
|
|
12888
|
-
_ref2$variant = _ref2.variant,
|
|
12889
|
-
variant = _ref2$variant === void 0 ? "primary" : _ref2$variant,
|
|
12883
|
+
children = _ref2.children,
|
|
12884
|
+
extraDisabledStyles = _ref2.extraDisabledStyles,
|
|
12890
12885
|
rest = _objectWithoutProperties(_ref2, _excluded$h);
|
|
12891
12886
|
|
|
12892
12887
|
var themeContext = React.useContext(styled.ThemeContext);
|
|
@@ -12894,7 +12889,7 @@ var ButtonWithAction = function ButtonWithAction(_ref2) {
|
|
|
12894
12889
|
var isMobile = themeContext.isMobile;
|
|
12895
12890
|
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 ");
|
|
12896
12891
|
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 ");
|
|
12897
|
-
var disabledStyles = "\n background-color:
|
|
12892
|
+
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 ");
|
|
12898
12893
|
return /*#__PURE__*/React__default.createElement(Box, _extends({
|
|
12899
12894
|
variant: variant,
|
|
12900
12895
|
padding: themeValues.padding,
|
|
@@ -45689,7 +45684,13 @@ var createPartialAmountFormState = function createPartialAmountFormState(lineIte
|
|
|
45689
45684
|
var arrowColor = WHITE;
|
|
45690
45685
|
var numberColor = MATISSE_BLUE;
|
|
45691
45686
|
var hoverBackgroundColor$2 = ALABASTER_WHITE;
|
|
45687
|
+
var activeBackgroundColor$1 = WHITE;
|
|
45688
|
+
var activeBorderColor$1 = MATISSE_BLUE;
|
|
45689
|
+
var activeColor$8 = MATISSE_BLUE;
|
|
45692
45690
|
var fallbackValues$J = {
|
|
45691
|
+
activeColor: activeColor$8,
|
|
45692
|
+
activeBackgroundColor: activeBackgroundColor$1,
|
|
45693
|
+
activeBorderColor: activeBorderColor$1,
|
|
45693
45694
|
arrowColor: arrowColor,
|
|
45694
45695
|
hoverBackgroundColor: hoverBackgroundColor$2,
|
|
45695
45696
|
numberColor: numberColor
|
|
@@ -45699,23 +45700,34 @@ var PAGING_SPACE = 2; // how many pages we want to have before/after delimiter
|
|
|
45699
45700
|
|
|
45700
45701
|
var PAGING_INIT_SPACE = 3; // first delimiter should appear after 3 pages
|
|
45701
45702
|
|
|
45702
|
-
var
|
|
45703
|
-
var
|
|
45704
|
-
|
|
45705
|
-
borderRadius = _ref.borderRadius,
|
|
45706
|
-
buttonHeight = _ref.buttonHeight,
|
|
45707
|
-
buttonWidth = _ref.buttonWidth,
|
|
45708
|
-
numberColor = _ref.numberColor,
|
|
45709
|
-
type = _ref.type;
|
|
45703
|
+
var PrevNextPlaceholder = function PrevNextPlaceholder(_ref) {
|
|
45704
|
+
var buttonHeight = _ref.buttonHeight,
|
|
45705
|
+
buttonWidth = _ref.buttonWidth;
|
|
45710
45706
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
45711
|
-
padding: "0
|
|
45707
|
+
padding: "0",
|
|
45708
|
+
minHeight: buttonHeight,
|
|
45709
|
+
minWidth: buttonWidth,
|
|
45710
|
+
extraStyles: "max-height: ".concat(buttonHeight, ";")
|
|
45711
|
+
});
|
|
45712
|
+
};
|
|
45713
|
+
|
|
45714
|
+
var PrevNextButton = function PrevNextButton(_ref2) {
|
|
45715
|
+
var action = _ref2.action,
|
|
45716
|
+
arrowColor = _ref2.arrowColor,
|
|
45717
|
+
borderRadius = _ref2.borderRadius,
|
|
45718
|
+
buttonHeight = _ref2.buttonHeight,
|
|
45719
|
+
buttonWidth = _ref2.buttonWidth,
|
|
45720
|
+
numberColor = _ref2.numberColor,
|
|
45721
|
+
type = _ref2.type;
|
|
45722
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
|
45723
|
+
padding: "0",
|
|
45712
45724
|
minHeight: buttonHeight,
|
|
45713
45725
|
extraStyles: "max-height: ".concat(buttonHeight, ";")
|
|
45714
45726
|
}, /*#__PURE__*/React__default.createElement(ButtonWithAction, {
|
|
45715
45727
|
action: action,
|
|
45716
45728
|
contentOverride: true,
|
|
45717
45729
|
dataQa: type,
|
|
45718
|
-
extraStyles: "\n background-color: ".concat(numberColor, ";\n border-color: ").concat(numberColor, "
|
|
45730
|
+
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 ")
|
|
45719
45731
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
45720
45732
|
padding: "0",
|
|
45721
45733
|
extraStyles: type === "prev" && "transform: scaleX(-1)"
|
|
@@ -45771,34 +45783,37 @@ var getPagesPanel = function getPagesPanel(page, pagesCount) {
|
|
|
45771
45783
|
return pages;
|
|
45772
45784
|
};
|
|
45773
45785
|
|
|
45774
|
-
var Pagination = function Pagination(
|
|
45775
|
-
var
|
|
45776
|
-
activeBorderWidth =
|
|
45777
|
-
|
|
45778
|
-
|
|
45779
|
-
|
|
45780
|
-
|
|
45781
|
-
|
|
45782
|
-
|
|
45783
|
-
|
|
45784
|
-
|
|
45785
|
-
|
|
45786
|
-
|
|
45787
|
-
|
|
45788
|
-
|
|
45789
|
-
|
|
45790
|
-
|
|
45791
|
-
|
|
45792
|
-
|
|
45793
|
-
|
|
45794
|
-
|
|
45795
|
-
|
|
45796
|
-
|
|
45797
|
-
|
|
45786
|
+
var Pagination = function Pagination(_ref3) {
|
|
45787
|
+
var _ref3$activeBorderWid = _ref3.activeBorderWidth,
|
|
45788
|
+
activeBorderWidth = _ref3$activeBorderWid === void 0 ? "3px" : _ref3$activeBorderWid,
|
|
45789
|
+
arrowColor = _ref3.arrowColor,
|
|
45790
|
+
_ref3$borderRadius = _ref3.borderRadius,
|
|
45791
|
+
borderRadius = _ref3$borderRadius === void 0 ? "3px" : _ref3$borderRadius,
|
|
45792
|
+
_ref3$buttonHeight = _ref3.buttonHeight,
|
|
45793
|
+
buttonHeight = _ref3$buttonHeight === void 0 ? "40px" : _ref3$buttonHeight,
|
|
45794
|
+
_ref3$buttonWidth = _ref3.buttonWidth,
|
|
45795
|
+
buttonWidth = _ref3$buttonWidth === void 0 ? "40px" : _ref3$buttonWidth,
|
|
45796
|
+
_ref3$childGap = _ref3.childGap,
|
|
45797
|
+
childGap = _ref3$childGap === void 0 ? "10px" : _ref3$childGap,
|
|
45798
|
+
currentPage = _ref3.currentPage,
|
|
45799
|
+
_ref3$fontSize = _ref3.fontSize,
|
|
45800
|
+
fontSize = _ref3$fontSize === void 0 ? "17px" : _ref3$fontSize,
|
|
45801
|
+
_ref3$fontWeight = _ref3.fontWeight,
|
|
45802
|
+
fontWeight = _ref3$fontWeight === void 0 ? "900" : _ref3$fontWeight,
|
|
45803
|
+
numberColor = _ref3.numberColor,
|
|
45804
|
+
pageCount = _ref3.pageCount,
|
|
45805
|
+
pageNext = _ref3.pageNext,
|
|
45806
|
+
pagePrevious = _ref3.pagePrevious,
|
|
45807
|
+
setCurrentPage = _ref3.setCurrentPage,
|
|
45808
|
+
themeValues = _ref3.themeValues;
|
|
45809
|
+
|
|
45810
|
+
var _useContext = React.useContext(styled.ThemeContext),
|
|
45811
|
+
isMobile = _useContext.isMobile;
|
|
45812
|
+
|
|
45798
45813
|
return /*#__PURE__*/React__default.createElement(Cluster, {
|
|
45799
45814
|
justify: "center",
|
|
45800
45815
|
childGap: childGap
|
|
45801
|
-
}, currentPage > 1
|
|
45816
|
+
}, currentPage > 1 ? /*#__PURE__*/React__default.createElement(PrevNextButton, {
|
|
45802
45817
|
action: pagePrevious,
|
|
45803
45818
|
arrowColor: arrowColor !== null && arrowColor !== void 0 ? arrowColor : themeValues.arrowColor,
|
|
45804
45819
|
borderRadius: borderRadius,
|
|
@@ -45806,7 +45821,19 @@ var Pagination = function Pagination(_ref2) {
|
|
|
45806
45821
|
buttonWidth: buttonWidth,
|
|
45807
45822
|
numberColor: numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor,
|
|
45808
45823
|
type: "prev"
|
|
45809
|
-
})
|
|
45824
|
+
}) : isMobile && /*#__PURE__*/React__default.createElement(PrevNextPlaceholder, {
|
|
45825
|
+
buttonHeight: buttonHeight,
|
|
45826
|
+
buttonWidth: buttonWidth
|
|
45827
|
+
}), isMobile ? /*#__PURE__*/React__default.createElement(Box, {
|
|
45828
|
+
padding: "0"
|
|
45829
|
+
}, /*#__PURE__*/React__default.createElement(Cluster, {
|
|
45830
|
+
justify: "flex-end"
|
|
45831
|
+
}, /*#__PURE__*/React__default.createElement(Text$1, {
|
|
45832
|
+
variant: "pXL",
|
|
45833
|
+
weight: fontWeight,
|
|
45834
|
+
color: numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor,
|
|
45835
|
+
extraStyles: "font-size: ".concat(fontSize)
|
|
45836
|
+
}, "".concat(currentPage, " of ").concat(pageCount)))) : getPagesPanel(currentPage, pageCount).map(function (item, index) {
|
|
45810
45837
|
return item.isButton ? /*#__PURE__*/React__default.createElement(Box, {
|
|
45811
45838
|
padding: "0",
|
|
45812
45839
|
extraStyles: "max-height: ".concat(buttonHeight, ";")
|
|
@@ -45815,17 +45842,15 @@ var Pagination = function Pagination(_ref2) {
|
|
|
45815
45842
|
key: item.index,
|
|
45816
45843
|
text: item.index,
|
|
45817
45844
|
disabled: item.active,
|
|
45845
|
+
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 "),
|
|
45818
45846
|
action: !item.active ? function () {
|
|
45819
45847
|
return setCurrentPage({
|
|
45820
45848
|
pageNumber: item.index
|
|
45821
45849
|
});
|
|
45822
45850
|
} : noop,
|
|
45823
45851
|
textExtraStyles: "font-size: ".concat(fontSize, "; font-weight: ").concat(fontWeight, ";"),
|
|
45824
|
-
extraStyles: "\n
|
|
45825
|
-
dataQa: index
|
|
45826
|
-
disabledBackgroundColor: activeBackgroundColor,
|
|
45827
|
-
disabledBorderColor: numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor,
|
|
45828
|
-
disabledColor: numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor
|
|
45852
|
+
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 "),
|
|
45853
|
+
dataQa: index
|
|
45829
45854
|
}, item.index)) : /*#__PURE__*/React__default.createElement(Box, {
|
|
45830
45855
|
padding: "0 10px"
|
|
45831
45856
|
}, /*#__PURE__*/React__default.createElement(Cluster, {
|
|
@@ -45834,9 +45859,10 @@ var Pagination = function Pagination(_ref2) {
|
|
|
45834
45859
|
key: index,
|
|
45835
45860
|
variant: "pXL",
|
|
45836
45861
|
weight: fontWeight,
|
|
45837
|
-
color: numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor
|
|
45862
|
+
color: numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor,
|
|
45863
|
+
extraStyles: "font-size: ".concat(fontSize)
|
|
45838
45864
|
}, "...")));
|
|
45839
|
-
}), currentPage < pageCount
|
|
45865
|
+
}), currentPage < pageCount ? /*#__PURE__*/React__default.createElement(PrevNextButton, {
|
|
45840
45866
|
action: pageNext,
|
|
45841
45867
|
arrowColor: arrowColor !== null && arrowColor !== void 0 ? arrowColor : themeValues.arrowColor,
|
|
45842
45868
|
borderRadius: borderRadius,
|
|
@@ -45844,6 +45870,9 @@ var Pagination = function Pagination(_ref2) {
|
|
|
45844
45870
|
buttonWidth: buttonWidth,
|
|
45845
45871
|
numberColor: numberColor !== null && numberColor !== void 0 ? numberColor : themeValues.numberColor,
|
|
45846
45872
|
type: "next"
|
|
45873
|
+
}) : isMobile && /*#__PURE__*/React__default.createElement(PrevNextPlaceholder, {
|
|
45874
|
+
buttonHeight: buttonHeight,
|
|
45875
|
+
buttonWidth: buttonWidth
|
|
45847
45876
|
}));
|
|
45848
45877
|
};
|
|
45849
45878
|
|