@shoplflow/base 0.31.20 → 0.32.0
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 +12 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1745,7 +1745,8 @@ var IconButton = React3.forwardRef(
|
|
|
1745
1745
|
color,
|
|
1746
1746
|
onMouseEnter,
|
|
1747
1747
|
onMouseLeave,
|
|
1748
|
-
isLoading = false
|
|
1748
|
+
isLoading = false,
|
|
1749
|
+
type = "button"
|
|
1749
1750
|
} = _b, rest = __objRest(_b, [
|
|
1750
1751
|
"styleVar",
|
|
1751
1752
|
"sizeVar",
|
|
@@ -1754,7 +1755,8 @@ var IconButton = React3.forwardRef(
|
|
|
1754
1755
|
"color",
|
|
1755
1756
|
"onMouseEnter",
|
|
1756
1757
|
"onMouseLeave",
|
|
1757
|
-
"isLoading"
|
|
1758
|
+
"isLoading",
|
|
1759
|
+
"type"
|
|
1758
1760
|
]);
|
|
1759
1761
|
const [isHovered, setIsHovered] = React3.useState(false);
|
|
1760
1762
|
const handleOnMouseEnter = (e) => {
|
|
@@ -1775,7 +1777,8 @@ var IconButton = React3.forwardRef(
|
|
|
1775
1777
|
ref,
|
|
1776
1778
|
onMouseEnter: handleOnMouseEnter,
|
|
1777
1779
|
onMouseLeave: handleOnMouseLeave,
|
|
1778
|
-
isHovered
|
|
1780
|
+
isHovered,
|
|
1781
|
+
type
|
|
1779
1782
|
}, rest), {
|
|
1780
1783
|
"data-shoplflow": "IconButton",
|
|
1781
1784
|
children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx(LoadingSpinner_default, { color: styleVar === "SECONDARY" || styleVar === "GHOST" ? "neutral500" : "neutral0" }) : children
|
|
@@ -2796,7 +2799,7 @@ var getRadiusBySize = (size2) => {
|
|
|
2796
2799
|
`;
|
|
2797
2800
|
}
|
|
2798
2801
|
};
|
|
2799
|
-
var getColorsByStyleVariant = (styleVariant, color = "neutral700") => {
|
|
2802
|
+
var getColorsByStyleVariant = (styleVariant, color = "neutral700", background2) => {
|
|
2800
2803
|
switch (styleVariant) {
|
|
2801
2804
|
case "SOLID":
|
|
2802
2805
|
return react$1.css`
|
|
@@ -2805,7 +2808,7 @@ var getColorsByStyleVariant = (styleVariant, color = "neutral700") => {
|
|
|
2805
2808
|
`;
|
|
2806
2809
|
case "TINT":
|
|
2807
2810
|
return react$1.css`
|
|
2808
|
-
background: ${exports.colorTokens[getNextColor(color, -2)]};
|
|
2811
|
+
background: ${background2 ? exports.colorTokens[background2] : exports.colorTokens[getNextColor(color, -2)]};
|
|
2809
2812
|
color: ${exports.colorTokens[color]};
|
|
2810
2813
|
`;
|
|
2811
2814
|
case "LINE":
|
|
@@ -2828,7 +2831,7 @@ var StyledTag = styled6__default.default.div`
|
|
|
2828
2831
|
cursor: default;
|
|
2829
2832
|
gap: 2px;
|
|
2830
2833
|
${({ sizeVar }) => getTagStyleBySize(sizeVar)};
|
|
2831
|
-
${({ color, styleVar }) => getColorsByStyleVariant(styleVar, color)};
|
|
2834
|
+
${({ color, styleVar, background: background2 }) => getColorsByStyleVariant(styleVar, color, background2)};
|
|
2832
2835
|
${({ radius, sizeVar }) => radius && getRadiusBySize(sizeVar)};
|
|
2833
2836
|
`;
|
|
2834
2837
|
|
|
@@ -3950,9 +3953,6 @@ var PageItem = styled6__default.default.button`
|
|
|
3950
3953
|
height: 32px;
|
|
3951
3954
|
border-radius: ${exports.borderRadiusTokens.borderRadius08};
|
|
3952
3955
|
background-color: ${({ isActive }) => isActive ? exports.colorTokens.neutral300 : exports.colorTokens.neutral0};
|
|
3953
|
-
font-size: 13px;
|
|
3954
|
-
font-weight: ${({ isActive }) => isActive && "600"};
|
|
3955
|
-
line-height: 2;
|
|
3956
3956
|
cursor: pointer;
|
|
3957
3957
|
|
|
3958
3958
|
&:hover {
|
|
@@ -4029,19 +4029,19 @@ var Pagination = (_a) => {
|
|
|
4029
4029
|
/* @__PURE__ */ jsxRuntime.jsxs(StyledPagination, { "data-shoplflow": "Pagination", children: [
|
|
4030
4030
|
/* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar: "S", styleVar: "GHOST", disabled: !canPreviousPage, onClick: () => gotoPage(0), children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { iconSource: ShoplAssets.FirstPageIcon, color: "neutral400", sizeVar: "S" }) }),
|
|
4031
4031
|
/* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar: "S", styleVar: "GHOST", onClick: previousPage, disabled: !canPreviousPage, children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { iconSource: ShoplAssets.LeftArrowIcon, color: "neutral400", sizeVar: "S" }) }),
|
|
4032
|
-
showLeftEllipsis && /* @__PURE__ */ jsxRuntime.jsx(Ellipsis, { children: /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { children: "..." }) }),
|
|
4032
|
+
showLeftEllipsis && /* @__PURE__ */ jsxRuntime.jsx(Ellipsis, { children: /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "body2_700", children: "..." }) }),
|
|
4033
4033
|
[...Array(pageTotalCount)].splice(0, pageCount).map(
|
|
4034
4034
|
(_, idx) => idx + Math.floor(currentPage / pageCount) * pageCount < pageTotalCount && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4035
4035
|
PageItem,
|
|
4036
4036
|
{
|
|
4037
4037
|
isActive: currentPage === idx + Math.floor(currentPage / pageCount) * pageCount,
|
|
4038
4038
|
onClick: () => gotoPage(idx + Math.floor(currentPage / pageCount) * pageCount),
|
|
4039
|
-
children: idx + 1 + Math.floor(currentPage / pageCount) * pageCount
|
|
4039
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "body2_700", children: idx + 1 + Math.floor(currentPage / pageCount) * pageCount })
|
|
4040
4040
|
},
|
|
4041
4041
|
idx
|
|
4042
4042
|
)
|
|
4043
4043
|
),
|
|
4044
|
-
showRightEllipsis && /* @__PURE__ */ jsxRuntime.jsx(Ellipsis, { children: /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { children: "..." }) }),
|
|
4044
|
+
showRightEllipsis && /* @__PURE__ */ jsxRuntime.jsx(Ellipsis, { children: /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "body2_700", children: "..." }) }),
|
|
4045
4045
|
/* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar: "S", styleVar: "GHOST", onClick: nextPage, disabled: !canNextPage, children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { iconSource: ShoplAssets.RightArrowIcon, color: "neutral400", sizeVar: "S" }) }),
|
|
4046
4046
|
/* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar: "S", styleVar: "GHOST", disabled: !canNextPage, onClick: () => gotoPage(pageTotalCount - 1), children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { iconSource: ShoplAssets.EndPageIcon, color: "neutral400", sizeVar: "S" }) })
|
|
4047
4047
|
] }),
|