@citygross/components 0.7.187 → 0.7.188

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.
@@ -1,2 +1,7 @@
1
- export declare const PaginationButtonWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
1
+ declare type TPaginationButtonWrapper = {
2
+ show?: boolean;
3
+ };
4
+ export declare const PaginationButtonWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TPaginationButtonWrapper, never>;
5
+ export declare const LeftPaginationButtonWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TPaginationButtonWrapper, never>;
2
6
  export declare const Flex: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
7
+ export {};
@@ -43,7 +43,7 @@ function Pagination(_a) {
43
43
  var _d = React.useState(Math.floor((currentPage - 1) / numOfPaginationsToShow)), currentIndex = _d[0], setIndex = _d[1];
44
44
  var pagination = createPagination(totalItems, itemsPerPage, numOfPaginationsToShow);
45
45
  return (React__default["default"].createElement(Box.Box, null, pagination && pagination.length > 0 && (React__default["default"].createElement(Pagination_styles.Flex, null,
46
- currentIndex > 0 && (React__default["default"].createElement(Pagination_styles.PaginationButtonWrapper, null,
46
+ (currentIndex > 0 || leftIcon) && (React__default["default"].createElement(Pagination_styles.LeftPaginationButtonWrapper, { show: currentIndex > 0 },
47
47
  React__default["default"].createElement(PaginationButton.PaginationButton, { color: 'white', onClick: function () {
48
48
  setPage && setPage(currentPage - 1);
49
49
  setIndex(currentIndex - 1);
@@ -10,9 +10,11 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
10
10
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
11
11
 
12
12
  var PaginationButtonWrapper = styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n padding: 0 ", "px;\n"], ["\n padding: 0 ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; });
13
- var Flex = styled__default["default"].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: flex-start;\n justify-content: center;\n"], ["\n display: flex;\n align-items: flex-start;\n justify-content: center;\n"])));
14
- var templateObject_1, templateObject_2;
13
+ var LeftPaginationButtonWrapper = styled__default["default"](PaginationButtonWrapper)(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n padding: 0 ", "px;\n opacity: ", ";\n"], ["\n padding: 0 ", "px;\n opacity: ", ";\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) { return (props.show ? 1 : 0); });
14
+ var Flex = styled__default["default"].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: flex-start;\n justify-content: center;\n"], ["\n display: flex;\n align-items: flex-start;\n justify-content: center;\n"])));
15
+ var templateObject_1, templateObject_2, templateObject_3;
15
16
 
16
17
  exports.Flex = Flex;
18
+ exports.LeftPaginationButtonWrapper = LeftPaginationButtonWrapper;
17
19
  exports.PaginationButtonWrapper = PaginationButtonWrapper;
18
20
  //# sourceMappingURL=Pagination.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Pagination.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Pagination.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
@@ -1,7 +1,7 @@
1
1
  import React, { useState } from 'react';
2
2
  import { PaginationButton } from '../Button/PaginationButton.js';
3
3
  import { Box } from '../Box/Box.js';
4
- import { Flex, PaginationButtonWrapper } from './Pagination.styles.js';
4
+ import { Flex, LeftPaginationButtonWrapper, PaginationButtonWrapper } from './Pagination.styles.js';
5
5
 
6
6
  function createPagination(totalItems, itemsPerPage, numOfPaginationsToShow) {
7
7
  var amountOfPages = Math.ceil((totalItems || 0) / (itemsPerPage !== null && itemsPerPage !== void 0 ? itemsPerPage : 6));
@@ -35,7 +35,7 @@ function Pagination(_a) {
35
35
  var _d = useState(Math.floor((currentPage - 1) / numOfPaginationsToShow)), currentIndex = _d[0], setIndex = _d[1];
36
36
  var pagination = createPagination(totalItems, itemsPerPage, numOfPaginationsToShow);
37
37
  return (React.createElement(Box, null, pagination && pagination.length > 0 && (React.createElement(Flex, null,
38
- currentIndex > 0 && (React.createElement(PaginationButtonWrapper, null,
38
+ (currentIndex > 0 || leftIcon) && (React.createElement(LeftPaginationButtonWrapper, { show: currentIndex > 0 },
39
39
  React.createElement(PaginationButton, { color: 'white', onClick: function () {
40
40
  setPage && setPage(currentPage - 1);
41
41
  setIndex(currentIndex - 1);
@@ -2,8 +2,9 @@ import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
2
2
  import styled from 'styled-components';
3
3
 
4
4
  var PaginationButtonWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 0 ", "px;\n"], ["\n padding: 0 ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; });
5
- var Flex = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: flex-start;\n justify-content: center;\n"], ["\n display: flex;\n align-items: flex-start;\n justify-content: center;\n"])));
6
- var templateObject_1, templateObject_2;
5
+ var LeftPaginationButtonWrapper = styled(PaginationButtonWrapper)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 0 ", "px;\n opacity: ", ";\n"], ["\n padding: 0 ", "px;\n opacity: ", ";\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; }, function (props) { return (props.show ? 1 : 0); });
6
+ var Flex = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: flex-start;\n justify-content: center;\n"], ["\n display: flex;\n align-items: flex-start;\n justify-content: center;\n"])));
7
+ var templateObject_1, templateObject_2, templateObject_3;
7
8
 
8
- export { Flex, PaginationButtonWrapper };
9
+ export { Flex, LeftPaginationButtonWrapper, PaginationButtonWrapper };
9
10
  //# sourceMappingURL=Pagination.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Pagination.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
1
+ {"version":3,"file":"Pagination.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citygross/components",
3
- "version": "0.7.187",
3
+ "version": "0.7.188",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "./build/cjs/components/src/index.js",
@@ -71,5 +71,5 @@
71
71
  "moment": "^2.29.1",
72
72
  "react-loading-skeleton": "^2.2.0"
73
73
  },
74
- "gitHead": "cfef6d6070ee32f7fe2e1418d7b356b929148f8d"
74
+ "gitHead": "432a513bd505ca76c986d1cdbce7f47c9748024d"
75
75
  }