@citygross/components 0.7.217 → 0.7.219

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.
@@ -10,7 +10,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
10
10
 
11
11
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
12
12
 
13
- var BaseRadioListItemContainer = styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n padding: ", "px;\n align-items: center;\n cursor: ", ";\n flex-wrap: wrap;\n border-radius: ", "px;\n background: ", ";\n transition: background-color 250ms ease;\n border: 1px solid\n ", ";\n > p:first-of-type {\n margin-left: ", "px;\n }\n"], ["\n padding: ", "px;\n align-items: center;\n cursor: ", ";\n flex-wrap: wrap;\n border-radius: ", "px;\n background: ", ";\n transition: background-color 250ms ease;\n border: 1px solid\n ", ";\n > p:first-of-type {\n margin-left: ", "px;\n }\n"])), function (props) { var _a; return (props.noPadding ? 0 : (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs2); }, function (props) { return (props.isDisabled ? 'cursor' : 'pointer'); }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.small; }, function (props) {
13
+ var BaseRadioListItemContainer = styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n padding: ", "px;\n align-items: center;\n cursor: ", ";\n flex-wrap: wrap;\n border-radius: ", "px;\n background: ", ";\n border: 1px solid\n ", ";\n > p:first-of-type {\n margin-left: ", "px;\n }\n &:hover {\n ", ";\n }\n &:active {\n ", ";\n }\n"], ["\n padding: ", "px;\n align-items: center;\n cursor: ", ";\n flex-wrap: wrap;\n border-radius: ", "px;\n background: ", ";\n border: 1px solid\n ", ";\n > p:first-of-type {\n margin-left: ", "px;\n }\n &:hover {\n ", ";\n }\n &:active {\n ", ";\n }\n"])), function (props) { var _a; return (props.noPadding ? 0 : (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs2); }, function (props) { return (props.isDisabled ? 'cursor' : 'pointer'); }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.small; }, function (props) {
14
14
  var _a, _b, _c, _d;
15
15
  return props.isDisabled
16
16
  ? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lightest
@@ -24,7 +24,11 @@ var BaseRadioListItemContainer = styled__default["default"].div(templateObject_1
24
24
  return props.selected
25
25
  ? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlue
26
26
  : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.medium;
27
- }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
27
+ }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) {
28
+ var _a;
29
+ return !props.selected &&
30
+ "\n background:".concat((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lightest);
31
+ }, function (props) { var _a; return "".concat(!props.isDisabled && "background: ".concat((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lighter)); });
28
32
  var BaseRadioItemLeftWrapper = styled__default["default"].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n display: flex;\n flex: 5;\n align-items: flex-start;\n ", ";\n"], ["\n display: flex;\n flex: 5;\n align-items: flex-start;\n ", ";\n"])), function (props) { return props.flexGrow && "flex-grow: ".concat(props.flexGrow); });
29
33
  var StyledH3 = styled__default["default"](typography.H3).attrs({ as: 'label' })(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n cursor: pointer;\n white-space: nowrap;\n display: block;\n line-height: ", "px;\n ", ";\n"], ["\n cursor: pointer;\n white-space: nowrap;\n display: block;\n line-height: ", "px;\n ", ";\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.lineHeight.m1; }, function (props) { var _a; return props.isDisabled && "color:".concat((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.dark); });
30
34
  var RadioRightWrapper = styled__default["default"].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n display: flex;\n gap: ", "px;\n justify-content: flex-end;\n text-align: right;\n font-size: ", "px;\n"], ["\n display: flex;\n gap: ", "px;\n justify-content: flex-end;\n text-align: right;\n font-size: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s2; });
@@ -1 +1 @@
1
- {"version":3,"file":"RadioListItem.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"RadioListItem.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -38,10 +38,19 @@ var Slider = function (_a) {
38
38
  });
39
39
  return sections;
40
40
  }, [slotsLength, resizeSlides]);
41
+ function findIndex(number, arr) {
42
+ return arr.find(function (element, index) {
43
+ return (element <= number &&
44
+ (arr[index + 1] === undefined || number < arr[index + 1]));
45
+ });
46
+ }
41
47
  React.useEffect(function () {
42
48
  var _a;
43
- (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.slickGoTo(selected || 0);
44
- }, [selected]);
49
+ var selectedIndex = findIndex(selected, pageSections);
50
+ if (selectedIndex !== currentPage) {
51
+ (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.slickGoTo(selectedIndex || 0);
52
+ }
53
+ }, [selected, pageSections, currentPage]);
45
54
  var settings = {
46
55
  speed: 500,
47
56
  slidesToShow: defaultSlides,
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Slider.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
2
2
  import { H3, BodyText } from '@citygross/typography';
3
3
  import styled from 'styled-components';
4
4
 
5
- var BaseRadioListItemContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", "px;\n align-items: center;\n cursor: ", ";\n flex-wrap: wrap;\n border-radius: ", "px;\n background: ", ";\n transition: background-color 250ms ease;\n border: 1px solid\n ", ";\n > p:first-of-type {\n margin-left: ", "px;\n }\n"], ["\n padding: ", "px;\n align-items: center;\n cursor: ", ";\n flex-wrap: wrap;\n border-radius: ", "px;\n background: ", ";\n transition: background-color 250ms ease;\n border: 1px solid\n ", ";\n > p:first-of-type {\n margin-left: ", "px;\n }\n"])), function (props) { var _a; return (props.noPadding ? 0 : (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs2); }, function (props) { return (props.isDisabled ? 'cursor' : 'pointer'); }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.small; }, function (props) {
5
+ var BaseRadioListItemContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", "px;\n align-items: center;\n cursor: ", ";\n flex-wrap: wrap;\n border-radius: ", "px;\n background: ", ";\n border: 1px solid\n ", ";\n > p:first-of-type {\n margin-left: ", "px;\n }\n &:hover {\n ", ";\n }\n &:active {\n ", ";\n }\n"], ["\n padding: ", "px;\n align-items: center;\n cursor: ", ";\n flex-wrap: wrap;\n border-radius: ", "px;\n background: ", ";\n border: 1px solid\n ", ";\n > p:first-of-type {\n margin-left: ", "px;\n }\n &:hover {\n ", ";\n }\n &:active {\n ", ";\n }\n"])), function (props) { var _a; return (props.noPadding ? 0 : (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs2); }, function (props) { return (props.isDisabled ? 'cursor' : 'pointer'); }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.small; }, function (props) {
6
6
  var _a, _b, _c, _d;
7
7
  return props.isDisabled
8
8
  ? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lightest
@@ -16,7 +16,11 @@ var BaseRadioListItemContainer = styled.div(templateObject_1 || (templateObject_
16
16
  return props.selected
17
17
  ? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlue
18
18
  : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.medium;
19
- }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
19
+ }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) {
20
+ var _a;
21
+ return !props.selected &&
22
+ "\n background:".concat((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lightest);
23
+ }, function (props) { var _a; return "".concat(!props.isDisabled && "background: ".concat((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lighter)); });
20
24
  var BaseRadioItemLeftWrapper = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex: 5;\n align-items: flex-start;\n ", ";\n"], ["\n display: flex;\n flex: 5;\n align-items: flex-start;\n ", ";\n"])), function (props) { return props.flexGrow && "flex-grow: ".concat(props.flexGrow); });
21
25
  var StyledH3 = styled(H3).attrs({ as: 'label' })(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n cursor: pointer;\n white-space: nowrap;\n display: block;\n line-height: ", "px;\n ", ";\n"], ["\n cursor: pointer;\n white-space: nowrap;\n display: block;\n line-height: ", "px;\n ", ";\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.lineHeight.m1; }, function (props) { var _a; return props.isDisabled && "color:".concat((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.dark); });
22
26
  var RadioRightWrapper = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n gap: ", "px;\n justify-content: flex-end;\n text-align: right;\n font-size: ", "px;\n"], ["\n display: flex;\n gap: ", "px;\n justify-content: flex-end;\n text-align: right;\n font-size: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s2; });
@@ -1 +1 @@
1
- {"version":3,"file":"RadioListItem.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"RadioListItem.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -29,10 +29,19 @@ var Slider = function (_a) {
29
29
  });
30
30
  return sections;
31
31
  }, [slotsLength, resizeSlides]);
32
+ function findIndex(number, arr) {
33
+ return arr.find(function (element, index) {
34
+ return (element <= number &&
35
+ (arr[index + 1] === undefined || number < arr[index + 1]));
36
+ });
37
+ }
32
38
  useEffect(function () {
33
39
  var _a;
34
- (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.slickGoTo(selected || 0);
35
- }, [selected]);
40
+ var selectedIndex = findIndex(selected, pageSections);
41
+ if (selectedIndex !== currentPage) {
42
+ (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.slickGoTo(selectedIndex || 0);
43
+ }
44
+ }, [selected, pageSections, currentPage]);
36
45
  var settings = {
37
46
  speed: 500,
38
47
  slidesToShow: defaultSlides,
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Slider.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citygross/components",
3
- "version": "0.7.217",
3
+ "version": "0.7.219",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "./build/cjs/components/src/index.js",
@@ -74,5 +74,5 @@
74
74
  "react-slick": "^0.30.1",
75
75
  "slick-carousel": "^1.8.1"
76
76
  },
77
- "gitHead": "7621194141295ba299f1901a505c7210f1f0d8a0"
77
+ "gitHead": "cffe59ae5d10d38265252b4b18e137bfcb56404e"
78
78
  }