@citygross/components 0.7.212 → 0.7.214

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.
Files changed (23) hide show
  1. package/build/@types/components/Button/Button.styles.d.ts +4 -0
  2. package/build/@types/components/Button/IconButton.d.ts +2 -1
  3. package/build/@types/components/Slider/Slider.d.ts +2 -2
  4. package/build/@types/components/Slider/Slider.stories.d.ts +1 -1
  5. package/build/cjs/components/src/components/Button/Button.styles.js +4 -1
  6. package/build/cjs/components/src/components/Button/Button.styles.js.map +1 -1
  7. package/build/cjs/components/src/components/Button/IconButton.js +2 -2
  8. package/build/cjs/components/src/components/DeliverySlotItem/DeliverySlotItem.js +1 -51
  9. package/build/cjs/components/src/components/DeliverySlotItem/DeliverySlotItem.js.map +1 -1
  10. package/build/cjs/components/src/components/DeliverySlotItem/DeliverySlotItem.styles.js +4 -4
  11. package/build/cjs/components/src/components/Slider/Slider.js +5 -6
  12. package/build/cjs/components/src/components/Slider/Slider.js.map +1 -1
  13. package/build/cjs/components/src/components/Slider/Slider.styles.js +3 -3
  14. package/build/es/components/src/components/Button/Button.styles.js +4 -1
  15. package/build/es/components/src/components/Button/Button.styles.js.map +1 -1
  16. package/build/es/components/src/components/Button/IconButton.js +2 -2
  17. package/build/es/components/src/components/DeliverySlotItem/DeliverySlotItem.js +1 -51
  18. package/build/es/components/src/components/DeliverySlotItem/DeliverySlotItem.js.map +1 -1
  19. package/build/es/components/src/components/DeliverySlotItem/DeliverySlotItem.styles.js +4 -4
  20. package/build/es/components/src/components/Slider/Slider.js +5 -6
  21. package/build/es/components/src/components/Slider/Slider.js.map +1 -1
  22. package/build/es/components/src/components/Slider/Slider.styles.js +3 -3
  23. package/package.json +2 -2
@@ -29,6 +29,7 @@ export declare type TBaseSmallButton = Omit<TButton, 'size' | 'flexReverse' | 'f
29
29
  width?: number;
30
30
  height?: number;
31
31
  color?: string;
32
+ opacity?: string;
32
33
  border?: string;
33
34
  shadow?: boolean;
34
35
  };
@@ -59,6 +60,7 @@ export declare const BaseIconButton: import("styled-components").StyledComponent
59
60
  width?: number | undefined;
60
61
  height?: number | undefined;
61
62
  color?: string | undefined;
63
+ opacity?: string | undefined;
62
64
  border?: string | undefined;
63
65
  shadow?: boolean | undefined;
64
66
  }, never>;
@@ -66,6 +68,7 @@ export declare const BasePaginationButton: import("styled-components").StyledCom
66
68
  width?: number | undefined;
67
69
  height?: number | undefined;
68
70
  color?: string | undefined;
71
+ opacity?: string | undefined;
69
72
  border?: string | undefined;
70
73
  shadow?: boolean | undefined;
71
74
  }, never>;
@@ -78,6 +81,7 @@ export declare const NavButton: import("styled-components").StyledComponent<"but
78
81
  width?: number | undefined;
79
82
  height?: number | undefined;
80
83
  color?: string | undefined;
84
+ opacity?: string | undefined;
81
85
  border?: string | undefined;
82
86
  shadow?: boolean | undefined;
83
87
  } & TNavButton, never>;
@@ -7,5 +7,6 @@ export declare type TIconButton = styles.TBaseSmallButton & {
7
7
  buttonBadge?: string;
8
8
  badgeBackground?: string;
9
9
  tabIndex?: number;
10
+ opacity?: string;
10
11
  };
11
- export declare function IconButton({ color, height, icon, isDisabled, loading, noWrap, onClick, border, shadow, width, buttonBadge, badgeBackground, tabIndex, ...props }: TIconButton): JSX.Element;
12
+ export declare function IconButton({ color, height, icon, isDisabled, loading, noWrap, onClick, border, shadow, width, buttonBadge, badgeBackground, tabIndex, opacity, ...props }: TIconButton): JSX.Element;
@@ -17,6 +17,6 @@ export declare type TSlider = {
17
17
  iconColor?: TButtonColor;
18
18
  responsiveSettings: TSliderResponsive[];
19
19
  slotsLength: number;
20
- initialSlot?: number;
20
+ selected?: number;
21
21
  };
22
- export declare const Slider: ({ children, slotsLength, iconHeight, iconWidth, iconColor, initialSlot, responsiveSettings }: TSlider) => JSX.Element;
22
+ export declare const Slider: ({ children, slotsLength, iconHeight, iconWidth, iconColor, responsiveSettings, selected }: TSlider) => JSX.Element;
@@ -2,7 +2,7 @@
2
2
  import { Story } from '@storybook/react';
3
3
  import { TSlider } from './Slider';
4
4
  declare const _default: {
5
- component: ({ children, slotsLength, iconHeight, iconWidth, iconColor, initialSlot, responsiveSettings }: TSlider) => JSX.Element;
5
+ component: ({ children, slotsLength, iconHeight, iconWidth, iconColor, responsiveSettings, selected }: TSlider) => JSX.Element;
6
6
  title: string;
7
7
  };
8
8
  export default _default;
@@ -144,7 +144,10 @@ var BaseIconButtonCSS = styled.css(templateObject_11 || (templateObject_11 = _ts
144
144
  ? "box-shadow: inset 0px 0px 0px 1px ".concat(props.border)
145
145
  : '';
146
146
  }, function (props) { var _a, _b; return !props.noShadow && ((_b = (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.boxShadow) === null || _b === void 0 ? void 0 : _b.iconButtonHover); });
147
- var BaseIconButton = styled__default["default"](BaseButton)(templateObject_12 || (templateObject_12 = _tslib.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), BaseIconButtonCSS);
147
+ var BaseIconButton = styled__default["default"](BaseButton)(templateObject_12 || (templateObject_12 = _tslib.__makeTemplateObject(["\n ", "\n ", ";\n"], ["\n ", "\n ", ";\n"])), BaseIconButtonCSS, function (_a) {
148
+ var opacity = _a.opacity;
149
+ return opacity && "opacity: ".concat(opacity);
150
+ });
148
151
  var BasePaginationButton = styled__default["default"](BaseButton)(templateObject_13 || (templateObject_13 = _tslib.__makeTemplateObject(["\n height: ", "px;\n width: ", "px;\n min-width: ", "px;\n text-align: center;\n ", ";\n display: inline-flex;\n align-items: center;\n justify-content: center;\n"], ["\n height: ", "px;\n width: ", "px;\n min-width: ", "px;\n text-align: center;\n ", ";\n display: inline-flex;\n align-items: center;\n justify-content: center;\n"])), function (props) { return props.height || 36; }, function (props) { return props.width || 36; }, function (props) { return props.width || 36; }, function (props) {
149
152
  var _a, _b, _c;
150
153
  return props.color !== ((_b = (_a = props === null || props === void 0 ? void 0 : props.theme) === null || _a === void 0 ? void 0 : _a.palette) === null || _b === void 0 ? void 0 : _b.white)
@@ -1 +1 @@
1
- {"version":3,"file":"Button.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Button.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -12,8 +12,8 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
12
12
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
13
13
 
14
14
  function IconButton(_a) {
15
- var _b = _a.color, color = _b === void 0 ? 'darkest' : _b, height = _a.height, icon = _a.icon, isDisabled = _a.isDisabled, loading = _a.loading, noWrap = _a.noWrap, onClick = _a.onClick, border = _a.border, shadow = _a.shadow, width = _a.width, buttonBadge = _a.buttonBadge, badgeBackground = _a.badgeBackground, tabIndex = _a.tabIndex, props = _tslib.__rest(_a, ["color", "height", "icon", "isDisabled", "loading", "noWrap", "onClick", "border", "shadow", "width", "buttonBadge", "badgeBackground", "tabIndex"]);
16
- return (React__default["default"].createElement(Button_styles.BaseIconButton, _tslib.__assign({ tabIndex: tabIndex, color: designTokens.theme && designTokens.theme.palette ? designTokens.theme === null || designTokens.theme === void 0 ? void 0 : designTokens.theme.palette[color] : '#333333', height: height, icon: icon, isDisabled: loading || isDisabled, loading: loading || null, noWrap: noWrap, onClick: function (e) { return onClick && onClick(e); }, width: width, border: border, shadow: shadow }, props),
15
+ var _b = _a.color, color = _b === void 0 ? 'darkest' : _b, height = _a.height, icon = _a.icon, isDisabled = _a.isDisabled, loading = _a.loading, noWrap = _a.noWrap, onClick = _a.onClick, border = _a.border, shadow = _a.shadow, width = _a.width, buttonBadge = _a.buttonBadge, badgeBackground = _a.badgeBackground, tabIndex = _a.tabIndex, opacity = _a.opacity, props = _tslib.__rest(_a, ["color", "height", "icon", "isDisabled", "loading", "noWrap", "onClick", "border", "shadow", "width", "buttonBadge", "badgeBackground", "tabIndex", "opacity"]);
16
+ return (React__default["default"].createElement(Button_styles.BaseIconButton, _tslib.__assign({ tabIndex: tabIndex, color: designTokens.theme && designTokens.theme.palette ? designTokens.theme === null || designTokens.theme === void 0 ? void 0 : designTokens.theme.palette[color] : '#333333', height: height, icon: icon, isDisabled: loading || isDisabled, loading: loading || null, noWrap: noWrap, onClick: function (e) { return onClick && onClick(e); }, width: width, opacity: opacity, border: border, shadow: shadow }, props),
17
17
  loading && (React__default["default"].createElement(Button_styles.Loading, null,
18
18
  React__default["default"].createElement(Button_styles.LoadingContainer, null,
19
19
  React__default["default"].createElement(Button_styles.LoadingSpinner, null)))),
@@ -22,57 +22,7 @@ function DeliverySlotItem(_a) {
22
22
  setWeekDay(momentDate.format('dddd').toLocaleLowerCase());
23
23
  }, [width]);
24
24
  var slotRef = React.useRef(null);
25
- var _c = React.useState(true), isVisible = _c[0], setIsVisible = _c[1];
26
- var callbackFn = function (entries) {
27
- var entry = entries[0];
28
- // gets zoom level
29
- var zoomLevel = window.devicePixelRatio ||
30
- window.screen.availWidth / document.documentElement.clientWidth;
31
- // if zoom is over 200% or less than 50%
32
- // observer gets buggy when zoom level is too high
33
- if (zoomLevel > 2 || zoomLevel < 0.5) {
34
- setIsVisible(true);
35
- return;
36
- }
37
- if (!entry) {
38
- return setIsVisible(true);
39
- }
40
- // check if the slot is within 3px of in view(Height)
41
- var isInHeight = Math.floor(entry.boundingClientRect.height) -
42
- Math.floor(entry.intersectionRect.height) <
43
- 3;
44
- // if no observer cant find height of element
45
- if (entry.intersectionRect.height === 0) {
46
- setIsVisible(entry === null || entry === void 0 ? void 0 : entry.isIntersecting);
47
- return;
48
- }
49
- // check if intersecting when slot is in 3px of viewHeight
50
- if (isInHeight)
51
- setIsVisible(entry.isIntersecting);
52
- };
53
- var options = {
54
- root: null,
55
- rootMargin: '0px',
56
- threshold: 0.9
57
- };
58
- React.useEffect(function () {
59
- if (!('IntersectionObserver' in window) ||
60
- !('IntersectionObserverEntry' in window) ||
61
- !('intersectionRatio' in window.IntersectionObserverEntry.prototype)) {
62
- return;
63
- }
64
- var observer = new IntersectionObserver(callbackFn, options);
65
- if (!observer)
66
- return;
67
- if (slotRef.current)
68
- observer.observe(slotRef === null || slotRef === void 0 ? void 0 : slotRef.current);
69
- return function () {
70
- if (observer) {
71
- observer.disconnect();
72
- }
73
- };
74
- }, [slotRef, options]);
75
- return (React__default["default"].createElement(DeliverySlotItem_styles.DeliverySlotItemContainer, { onClick: onSelect, isVisible: isVisible, ref: slotRef, selected: selected },
25
+ return (React__default["default"].createElement(DeliverySlotItem_styles.DeliverySlotItemContainer, { onClick: onSelect, ref: slotRef, selected: selected },
76
26
  React__default["default"].createElement(DeliverySlotItem_styles.DeliverySlotContainer, { selected: selected },
77
27
  React__default["default"].createElement(DeliverySlotItem_styles.DeliverySlotHeaderText, null,
78
28
  React__default["default"].createElement(typography.BodyText, { fontWeight: 'medium' }, utils.capitalizeFirstLetter(weekDay)),
@@ -1 +1 @@
1
- {"version":3,"file":"DeliverySlotItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"DeliverySlotItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -9,7 +9,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
9
9
 
10
10
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
11
11
 
12
- var DeliverySlotItemContainer = styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-self: center;\n opacity: ", ";\n transition: opacity ", ";\n min-width: ", "px;\n height: 100%;\n border: solid 1px\n ", ";\n border-radius: ", "px;\n overflow: hidden;\n min-height: ", "px;\n\n @media (min-width: ", "px) {\n min-width: ", "px;\n }\n\n &:hover {\n cursor: pointer;\n }\n"], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-self: center;\n opacity: ", ";\n transition: opacity ", ";\n min-width: ", "px;\n height: 100%;\n border: solid 1px\n ", ";\n border-radius: ", "px;\n overflow: hidden;\n min-height: ", "px;\n\n @media (min-width: ", "px) {\n min-width: ", "px;\n }\n\n &:hover {\n cursor: pointer;\n }\n"])), function (props) { return (props.isVisible ? 1 : 0.4); }, function (props) { var _a, _b; return (_b = (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.transition) === null || _b === void 0 ? void 0 : _b.t1; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.deliverySlotItemWidth; }, function (props) {
12
+ var DeliverySlotItemContainer = styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-self: center;\n transition: opacity ", ";\n min-width: ", "px;\n height: 100%;\n border: solid 1px\n ", ";\n border-radius: ", "px;\n overflow: hidden;\n min-height: ", "px;\n\n @media (min-width: ", "px) {\n min-width: ", "px;\n }\n\n &:hover {\n cursor: pointer;\n }\n"], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-self: center;\n transition: opacity ", ";\n min-width: ", "px;\n height: 100%;\n border: solid 1px\n ", ";\n border-radius: ", "px;\n overflow: hidden;\n min-height: ", "px;\n\n @media (min-width: ", "px) {\n min-width: ", "px;\n }\n\n &:hover {\n cursor: pointer;\n }\n"])), function (props) { var _a, _b; return (_b = (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.transition) === null || _b === void 0 ? void 0 : _b.t1; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.deliverySlotItemWidth; }, function (props) {
13
13
  var _a, _b;
14
14
  return props.selected
15
15
  ? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlue
@@ -17,7 +17,7 @@ var DeliverySlotItemContainer = styled__default["default"].div(templateObject_1
17
17
  }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.small; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.deliverySlotItemHeight; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.deliverySlotItemWidthDesktop; });
18
18
  styled__default["default"].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n display: flex;\n width: 100%;\n"], ["\n display: flex;\n width: 100%;\n"])));
19
19
  var DeliverySlotHeaderText = styled__default["default"].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n"], ["\n display: flex;\n justify-content: space-between;\n"])));
20
- var DeliverySlotContainer = styled__default["default"].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n padding: ", "px;\n flex: 1;\n width: stretch;\n background: ", ";\n &:hover {\n cursor: pointer;\n ", ";\n }\n"], ["\n padding: ", "px;\n flex: 1;\n width: stretch;\n background: ", ";\n &:hover {\n cursor: pointer;\n ", ";\n }\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs2; }, function (props) {
20
+ var DeliverySlotContainer = styled__default["default"].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n padding: ", "px;\n flex: 1;\n width: stretch;\n background: ", ";\n &:hover {\n cursor: pointer;\n ", ";\n }\n &:active {\n background: ", "};\n }\n\n user-select: none;\n"], ["\n padding: ", "px;\n flex: 1;\n width: stretch;\n background: ", ";\n &:hover {\n cursor: pointer;\n ", ";\n }\n &:active {\n background: ", "};\n }\n\n user-select: none;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs2; }, function (props) {
21
21
  var _a, _b;
22
22
  return props.selected
23
23
  ? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.blueLight
@@ -25,8 +25,8 @@ var DeliverySlotContainer = styled__default["default"].div(templateObject_4 || (
25
25
  }, function (props) {
26
26
  var _a;
27
27
  return !props.selected &&
28
- "\n background:".concat((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lighter);
29
- });
28
+ "\n background:".concat((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lightest);
29
+ }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lighter; });
30
30
  var DeliverySlotBody = styled__default["default"].div(templateObject_5 || (templateObject_5 = _tslib.__makeTemplateObject(["\n margin-top: ", "px;\n margin-bottom: ", "px;\n"], ["\n margin-top: ", "px;\n margin-bottom: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxxs; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; });
31
31
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
32
32
 
@@ -17,8 +17,8 @@ var SlickSlider__default = /*#__PURE__*/_interopDefaultLegacy(SlickSlider);
17
17
 
18
18
  var defaultSlides = 5;
19
19
  var Slider = function (_a) {
20
- var children = _a.children, slotsLength = _a.slotsLength, _b = _a.iconHeight, iconHeight = _b === void 0 ? 32 : _b, _c = _a.iconWidth, iconWidth = _c === void 0 ? 32 : _c, _d = _a.iconColor, iconColor = _d === void 0 ? 'darkest' : _d, _e = _a.initialSlot, initialSlot = _e === void 0 ? 0 : _e, responsiveSettings = _a.responsiveSettings;
21
- var _f = React.useState(initialSlot), currentPage = _f[0], setCurrentPage = _f[1];
20
+ var children = _a.children, slotsLength = _a.slotsLength, _b = _a.iconHeight, iconHeight = _b === void 0 ? 32 : _b, _c = _a.iconWidth, iconWidth = _c === void 0 ? 32 : _c, _d = _a.iconColor, iconColor = _d === void 0 ? 'darkest' : _d, responsiveSettings = _a.responsiveSettings, _e = _a.selected, selected = _e === void 0 ? 0 : _e;
21
+ var _f = React.useState(selected), currentPage = _f[0], setCurrentPage = _f[1];
22
22
  var width = utils.useWindowSize().width;
23
23
  var ref = React.useRef(null);
24
24
  var resizeSlides = React.useMemo(function () {
@@ -40,16 +40,15 @@ var Slider = function (_a) {
40
40
  }, [slotsLength, resizeSlides]);
41
41
  React.useEffect(function () {
42
42
  var _a;
43
- if (initialSlot && (ref === null || ref === void 0 ? void 0 : ref.current))
44
- (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.slickGoTo(initialSlot);
45
- }, [initialSlot, ref === null || ref === void 0 ? void 0 : ref.current]);
43
+ (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.slickGoTo(selected || 0);
44
+ }, [selected]);
46
45
  var settings = {
47
46
  speed: 500,
48
47
  slidesToShow: defaultSlides,
49
48
  slidesToScroll: defaultSlides,
50
49
  infinite: false,
51
50
  touchTreshold: 100,
52
- initialSlide: initialSlot,
51
+ initialSlide: 0,
53
52
  touchMove: true,
54
53
  arrows: false,
55
54
  beforeChange: function (_, next) {
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Slider.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -9,10 +9,10 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
9
9
 
10
10
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
11
11
 
12
- var Container = styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n position: relative;\n\n .slick-track {\n display: flex;\n overflow: hidden;\n flex-wrap: nowrap;\n align-items: stretch;\n gap: ", "px;\n }\n .slick-list {\n @media (min-width: ", "px) {\n overflow: hidden;\n }\n }\n .slick-slide {\n height: unset;\n min-height: unset;\n > div {\n height: 100%;\n }\n }\n"], ["\n position: relative;\n\n .slick-track {\n display: flex;\n overflow: hidden;\n flex-wrap: nowrap;\n align-items: stretch;\n gap: ", "px;\n }\n .slick-list {\n @media (min-width: ", "px) {\n overflow: hidden;\n }\n }\n .slick-slide {\n height: unset;\n min-height: unset;\n > div {\n height: 100%;\n }\n }\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.breakpoints) === null || _a === void 0 ? void 0 : _a.md; });
13
- var LeftIconButtonContainer = styled__default["default"].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n display: flex;\n position: absolute;\n left: -", "px;\n top: 50%;\n transform: translateY(-50%);\n z-index: 1;\n @media (max-width: ", "px) {\n display: none !important;\n }\n @media (min-width: ", "px) {\n display: block;\n }\n"], ["\n display: flex;\n position: absolute;\n left: -", "px;\n top: 50%;\n transform: translateY(-50%);\n z-index: 1;\n @media (max-width: ", "px) {\n display: none !important;\n }\n @media (min-width: ", "px) {\n display: block;\n }\n"])), function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.deliverySlotArrowOffset; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; });
12
+ var Container = styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n position: relative;\n\n .slick-track {\n display: flex;\n overflow: hidden;\n flex-wrap: nowrap;\n align-items: stretch;\n gap: ", "px;\n }\n .slick-list {\n @media (min-width: ", "px) {\n overflow: hidden;\n }\n }\n .slick-slide {\n height: unset;\n min-height: unset;\n > div {\n height: 100%;\n }\n }\n"], ["\n position: relative;\n\n .slick-track {\n display: flex;\n overflow: hidden;\n flex-wrap: nowrap;\n align-items: stretch;\n gap: ", "px;\n }\n .slick-list {\n @media (min-width: ", "px) {\n overflow: hidden;\n }\n }\n .slick-slide {\n height: unset;\n min-height: unset;\n > div {\n height: 100%;\n }\n }\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.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; });
13
+ var LeftIconButtonContainer = styled__default["default"].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n display: flex;\n position: absolute;\n left: -", "px;\n top: 50%;\n transform: translateY(-50%);\n z-index: 1;\n @media (max-width: ", "px) {\n display: none !important;\n }\n @media (min-width: ", "px) {\n display: block;\n }\n"], ["\n display: flex;\n position: absolute;\n left: -", "px;\n top: 50%;\n transform: translateY(-50%);\n z-index: 1;\n @media (max-width: ", "px) {\n display: none !important;\n }\n @media (min-width: ", "px) {\n display: block;\n }\n"])), function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.deliverySlotArrowOffset; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; });
14
14
  var RightIconButtonContainer = styled__default["default"](LeftIconButtonContainer)(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n left: unset;\n right: -", "px;\n"], ["\n left: unset;\n right: -", "px;\n"])), function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.deliverySlotArrowOffset; });
15
- styled__default["default"].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n display: flex;\n flex-direction: row;\n gap: ", "px;\n padding: 0 ", "px;\n @media (min-width: ", "px) {\n padding: 0 ", "px;\n gap: ", "px;\n }\n"], ["\n display: flex;\n flex-direction: row;\n gap: ", "px;\n padding: 0 ", "px;\n @media (min-width: ", "px) {\n padding: 0 ", "px;\n gap: ", "px;\n }\n"])), function (props) { var _a, _b; return (_a = props.itemGap) !== null && _a !== void 0 ? _a : (_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.lg; }, function (props) { var _a, _b; return (_a = props.itemGap) !== null && _a !== void 0 ? _a : (_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs; });
15
+ styled__default["default"].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n display: flex;\n flex-direction: row;\n gap: ", "px;\n padding: 0 ", "px;\n @media (min-width: ", "px) {\n padding: 0 ", "px;\n gap: ", "px;\n }\n"], ["\n display: flex;\n flex-direction: row;\n gap: ", "px;\n padding: 0 ", "px;\n @media (min-width: ", "px) {\n padding: 0 ", "px;\n gap: ", "px;\n }\n"])), function (props) { var _a, _b; return (_a = props.itemGap) !== null && _a !== void 0 ? _a : (_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.lg; }, function (props) { var _a, _b; return (_a = props.itemGap) !== null && _a !== void 0 ? _a : (_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs; });
16
16
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
17
17
 
18
18
  exports.Container = Container;
@@ -136,7 +136,10 @@ var BaseIconButtonCSS = css(templateObject_11 || (templateObject_11 = __makeTemp
136
136
  ? "box-shadow: inset 0px 0px 0px 1px ".concat(props.border)
137
137
  : '';
138
138
  }, function (props) { var _a, _b; return !props.noShadow && ((_b = (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.boxShadow) === null || _b === void 0 ? void 0 : _b.iconButtonHover); });
139
- var BaseIconButton = styled(BaseButton)(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), BaseIconButtonCSS);
139
+ var BaseIconButton = styled(BaseButton)(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n ", "\n ", ";\n"], ["\n ", "\n ", ";\n"])), BaseIconButtonCSS, function (_a) {
140
+ var opacity = _a.opacity;
141
+ return opacity && "opacity: ".concat(opacity);
142
+ });
140
143
  var BasePaginationButton = styled(BaseButton)(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n height: ", "px;\n width: ", "px;\n min-width: ", "px;\n text-align: center;\n ", ";\n display: inline-flex;\n align-items: center;\n justify-content: center;\n"], ["\n height: ", "px;\n width: ", "px;\n min-width: ", "px;\n text-align: center;\n ", ";\n display: inline-flex;\n align-items: center;\n justify-content: center;\n"])), function (props) { return props.height || 36; }, function (props) { return props.width || 36; }, function (props) { return props.width || 36; }, function (props) {
141
144
  var _a, _b, _c;
142
145
  return props.color !== ((_b = (_a = props === null || props === void 0 ? void 0 : props.theme) === null || _a === void 0 ? void 0 : _a.palette) === null || _b === void 0 ? void 0 : _b.white)
@@ -1 +1 @@
1
- {"version":3,"file":"Button.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Button.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -4,8 +4,8 @@ import { theme } from '@citygross/design-tokens';
4
4
  import { BaseIconButton, Loading, LoadingContainer, LoadingSpinner, ButtonBadge } from './Button.styles.js';
5
5
 
6
6
  function IconButton(_a) {
7
- var _b = _a.color, color = _b === void 0 ? 'darkest' : _b, height = _a.height, icon = _a.icon, isDisabled = _a.isDisabled, loading = _a.loading, noWrap = _a.noWrap, onClick = _a.onClick, border = _a.border, shadow = _a.shadow, width = _a.width, buttonBadge = _a.buttonBadge, badgeBackground = _a.badgeBackground, tabIndex = _a.tabIndex, props = __rest(_a, ["color", "height", "icon", "isDisabled", "loading", "noWrap", "onClick", "border", "shadow", "width", "buttonBadge", "badgeBackground", "tabIndex"]);
8
- return (React.createElement(BaseIconButton, __assign({ tabIndex: tabIndex, color: theme && theme.palette ? theme === null || theme === void 0 ? void 0 : theme.palette[color] : '#333333', height: height, icon: icon, isDisabled: loading || isDisabled, loading: loading || null, noWrap: noWrap, onClick: function (e) { return onClick && onClick(e); }, width: width, border: border, shadow: shadow }, props),
7
+ var _b = _a.color, color = _b === void 0 ? 'darkest' : _b, height = _a.height, icon = _a.icon, isDisabled = _a.isDisabled, loading = _a.loading, noWrap = _a.noWrap, onClick = _a.onClick, border = _a.border, shadow = _a.shadow, width = _a.width, buttonBadge = _a.buttonBadge, badgeBackground = _a.badgeBackground, tabIndex = _a.tabIndex, opacity = _a.opacity, props = __rest(_a, ["color", "height", "icon", "isDisabled", "loading", "noWrap", "onClick", "border", "shadow", "width", "buttonBadge", "badgeBackground", "tabIndex", "opacity"]);
8
+ return (React.createElement(BaseIconButton, __assign({ tabIndex: tabIndex, color: theme && theme.palette ? theme === null || theme === void 0 ? void 0 : theme.palette[color] : '#333333', height: height, icon: icon, isDisabled: loading || isDisabled, loading: loading || null, noWrap: noWrap, onClick: function (e) { return onClick && onClick(e); }, width: width, opacity: opacity, border: border, shadow: shadow }, props),
9
9
  loading && (React.createElement(Loading, null,
10
10
  React.createElement(LoadingContainer, null,
11
11
  React.createElement(LoadingSpinner, null)))),
@@ -14,57 +14,7 @@ function DeliverySlotItem(_a) {
14
14
  setWeekDay(momentDate.format('dddd').toLocaleLowerCase());
15
15
  }, [width]);
16
16
  var slotRef = useRef(null);
17
- var _c = useState(true), isVisible = _c[0], setIsVisible = _c[1];
18
- var callbackFn = function (entries) {
19
- var entry = entries[0];
20
- // gets zoom level
21
- var zoomLevel = window.devicePixelRatio ||
22
- window.screen.availWidth / document.documentElement.clientWidth;
23
- // if zoom is over 200% or less than 50%
24
- // observer gets buggy when zoom level is too high
25
- if (zoomLevel > 2 || zoomLevel < 0.5) {
26
- setIsVisible(true);
27
- return;
28
- }
29
- if (!entry) {
30
- return setIsVisible(true);
31
- }
32
- // check if the slot is within 3px of in view(Height)
33
- var isInHeight = Math.floor(entry.boundingClientRect.height) -
34
- Math.floor(entry.intersectionRect.height) <
35
- 3;
36
- // if no observer cant find height of element
37
- if (entry.intersectionRect.height === 0) {
38
- setIsVisible(entry === null || entry === void 0 ? void 0 : entry.isIntersecting);
39
- return;
40
- }
41
- // check if intersecting when slot is in 3px of viewHeight
42
- if (isInHeight)
43
- setIsVisible(entry.isIntersecting);
44
- };
45
- var options = {
46
- root: null,
47
- rootMargin: '0px',
48
- threshold: 0.9
49
- };
50
- useEffect(function () {
51
- if (!('IntersectionObserver' in window) ||
52
- !('IntersectionObserverEntry' in window) ||
53
- !('intersectionRatio' in window.IntersectionObserverEntry.prototype)) {
54
- return;
55
- }
56
- var observer = new IntersectionObserver(callbackFn, options);
57
- if (!observer)
58
- return;
59
- if (slotRef.current)
60
- observer.observe(slotRef === null || slotRef === void 0 ? void 0 : slotRef.current);
61
- return function () {
62
- if (observer) {
63
- observer.disconnect();
64
- }
65
- };
66
- }, [slotRef, options]);
67
- return (React.createElement(DeliverySlotItemContainer, { onClick: onSelect, isVisible: isVisible, ref: slotRef, selected: selected },
17
+ return (React.createElement(DeliverySlotItemContainer, { onClick: onSelect, ref: slotRef, selected: selected },
68
18
  React.createElement(DeliverySlotContainer, { selected: selected },
69
19
  React.createElement(DeliverySlotHeaderText, null,
70
20
  React.createElement(BodyText, { fontWeight: 'medium' }, capitalizeFirstLetter(weekDay)),
@@ -1 +1 @@
1
- {"version":3,"file":"DeliverySlotItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"DeliverySlotItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
2
2
  import styled from 'styled-components';
3
3
 
4
- var DeliverySlotItemContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-self: center;\n opacity: ", ";\n transition: opacity ", ";\n min-width: ", "px;\n height: 100%;\n border: solid 1px\n ", ";\n border-radius: ", "px;\n overflow: hidden;\n min-height: ", "px;\n\n @media (min-width: ", "px) {\n min-width: ", "px;\n }\n\n &:hover {\n cursor: pointer;\n }\n"], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-self: center;\n opacity: ", ";\n transition: opacity ", ";\n min-width: ", "px;\n height: 100%;\n border: solid 1px\n ", ";\n border-radius: ", "px;\n overflow: hidden;\n min-height: ", "px;\n\n @media (min-width: ", "px) {\n min-width: ", "px;\n }\n\n &:hover {\n cursor: pointer;\n }\n"])), function (props) { return (props.isVisible ? 1 : 0.4); }, function (props) { var _a, _b; return (_b = (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.transition) === null || _b === void 0 ? void 0 : _b.t1; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.deliverySlotItemWidth; }, function (props) {
4
+ var DeliverySlotItemContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-self: center;\n transition: opacity ", ";\n min-width: ", "px;\n height: 100%;\n border: solid 1px\n ", ";\n border-radius: ", "px;\n overflow: hidden;\n min-height: ", "px;\n\n @media (min-width: ", "px) {\n min-width: ", "px;\n }\n\n &:hover {\n cursor: pointer;\n }\n"], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-self: center;\n transition: opacity ", ";\n min-width: ", "px;\n height: 100%;\n border: solid 1px\n ", ";\n border-radius: ", "px;\n overflow: hidden;\n min-height: ", "px;\n\n @media (min-width: ", "px) {\n min-width: ", "px;\n }\n\n &:hover {\n cursor: pointer;\n }\n"])), function (props) { var _a, _b; return (_b = (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.transition) === null || _b === void 0 ? void 0 : _b.t1; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.deliverySlotItemWidth; }, function (props) {
5
5
  var _a, _b;
6
6
  return props.selected
7
7
  ? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlue
@@ -9,7 +9,7 @@ var DeliverySlotItemContainer = styled.div(templateObject_1 || (templateObject_1
9
9
  }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.small; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.deliverySlotItemHeight; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.deliverySlotItemWidthDesktop; });
10
10
  styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n width: 100%;\n"], ["\n display: flex;\n width: 100%;\n"])));
11
11
  var DeliverySlotHeaderText = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n"], ["\n display: flex;\n justify-content: space-between;\n"])));
12
- var DeliverySlotContainer = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n padding: ", "px;\n flex: 1;\n width: stretch;\n background: ", ";\n &:hover {\n cursor: pointer;\n ", ";\n }\n"], ["\n padding: ", "px;\n flex: 1;\n width: stretch;\n background: ", ";\n &:hover {\n cursor: pointer;\n ", ";\n }\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs2; }, function (props) {
12
+ var DeliverySlotContainer = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n padding: ", "px;\n flex: 1;\n width: stretch;\n background: ", ";\n &:hover {\n cursor: pointer;\n ", ";\n }\n &:active {\n background: ", "};\n }\n\n user-select: none;\n"], ["\n padding: ", "px;\n flex: 1;\n width: stretch;\n background: ", ";\n &:hover {\n cursor: pointer;\n ", ";\n }\n &:active {\n background: ", "};\n }\n\n user-select: none;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs2; }, function (props) {
13
13
  var _a, _b;
14
14
  return props.selected
15
15
  ? (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.blueLight
@@ -17,8 +17,8 @@ var DeliverySlotContainer = styled.div(templateObject_4 || (templateObject_4 = _
17
17
  }, function (props) {
18
18
  var _a;
19
19
  return !props.selected &&
20
- "\n background:".concat((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lighter);
21
- });
20
+ "\n background:".concat((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lightest);
21
+ }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lighter; });
22
22
  var DeliverySlotBody = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-top: ", "px;\n margin-bottom: ", "px;\n"], ["\n margin-top: ", "px;\n margin-bottom: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxxs; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs; });
23
23
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
24
24
 
@@ -8,8 +8,8 @@ import { useWindowSize } from '@citygross/utils';
8
8
 
9
9
  var defaultSlides = 5;
10
10
  var Slider = function (_a) {
11
- var children = _a.children, slotsLength = _a.slotsLength, _b = _a.iconHeight, iconHeight = _b === void 0 ? 32 : _b, _c = _a.iconWidth, iconWidth = _c === void 0 ? 32 : _c, _d = _a.iconColor, iconColor = _d === void 0 ? 'darkest' : _d, _e = _a.initialSlot, initialSlot = _e === void 0 ? 0 : _e, responsiveSettings = _a.responsiveSettings;
12
- var _f = useState(initialSlot), currentPage = _f[0], setCurrentPage = _f[1];
11
+ var children = _a.children, slotsLength = _a.slotsLength, _b = _a.iconHeight, iconHeight = _b === void 0 ? 32 : _b, _c = _a.iconWidth, iconWidth = _c === void 0 ? 32 : _c, _d = _a.iconColor, iconColor = _d === void 0 ? 'darkest' : _d, responsiveSettings = _a.responsiveSettings, _e = _a.selected, selected = _e === void 0 ? 0 : _e;
12
+ var _f = useState(selected), currentPage = _f[0], setCurrentPage = _f[1];
13
13
  var width = useWindowSize().width;
14
14
  var ref = useRef(null);
15
15
  var resizeSlides = useMemo(function () {
@@ -31,16 +31,15 @@ var Slider = function (_a) {
31
31
  }, [slotsLength, resizeSlides]);
32
32
  useEffect(function () {
33
33
  var _a;
34
- if (initialSlot && (ref === null || ref === void 0 ? void 0 : ref.current))
35
- (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.slickGoTo(initialSlot);
36
- }, [initialSlot, ref === null || ref === void 0 ? void 0 : ref.current]);
34
+ (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.slickGoTo(selected || 0);
35
+ }, [selected]);
37
36
  var settings = {
38
37
  speed: 500,
39
38
  slidesToShow: defaultSlides,
40
39
  slidesToScroll: defaultSlides,
41
40
  infinite: false,
42
41
  touchTreshold: 100,
43
- initialSlide: initialSlot,
42
+ initialSlide: 0,
44
43
  touchMove: true,
45
44
  arrows: false,
46
45
  beforeChange: function (_, next) {
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Slider.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,10 +1,10 @@
1
1
  import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
2
2
  import styled from 'styled-components';
3
3
 
4
- var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n\n .slick-track {\n display: flex;\n overflow: hidden;\n flex-wrap: nowrap;\n align-items: stretch;\n gap: ", "px;\n }\n .slick-list {\n @media (min-width: ", "px) {\n overflow: hidden;\n }\n }\n .slick-slide {\n height: unset;\n min-height: unset;\n > div {\n height: 100%;\n }\n }\n"], ["\n position: relative;\n\n .slick-track {\n display: flex;\n overflow: hidden;\n flex-wrap: nowrap;\n align-items: stretch;\n gap: ", "px;\n }\n .slick-list {\n @media (min-width: ", "px) {\n overflow: hidden;\n }\n }\n .slick-slide {\n height: unset;\n min-height: unset;\n > div {\n height: 100%;\n }\n }\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.breakpoints) === null || _a === void 0 ? void 0 : _a.md; });
5
- var LeftIconButtonContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n position: absolute;\n left: -", "px;\n top: 50%;\n transform: translateY(-50%);\n z-index: 1;\n @media (max-width: ", "px) {\n display: none !important;\n }\n @media (min-width: ", "px) {\n display: block;\n }\n"], ["\n display: flex;\n position: absolute;\n left: -", "px;\n top: 50%;\n transform: translateY(-50%);\n z-index: 1;\n @media (max-width: ", "px) {\n display: none !important;\n }\n @media (min-width: ", "px) {\n display: block;\n }\n"])), function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.deliverySlotArrowOffset; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; });
4
+ var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n\n .slick-track {\n display: flex;\n overflow: hidden;\n flex-wrap: nowrap;\n align-items: stretch;\n gap: ", "px;\n }\n .slick-list {\n @media (min-width: ", "px) {\n overflow: hidden;\n }\n }\n .slick-slide {\n height: unset;\n min-height: unset;\n > div {\n height: 100%;\n }\n }\n"], ["\n position: relative;\n\n .slick-track {\n display: flex;\n overflow: hidden;\n flex-wrap: nowrap;\n align-items: stretch;\n gap: ", "px;\n }\n .slick-list {\n @media (min-width: ", "px) {\n overflow: hidden;\n }\n }\n .slick-slide {\n height: unset;\n min-height: unset;\n > div {\n height: 100%;\n }\n }\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.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; });
5
+ var LeftIconButtonContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n position: absolute;\n left: -", "px;\n top: 50%;\n transform: translateY(-50%);\n z-index: 1;\n @media (max-width: ", "px) {\n display: none !important;\n }\n @media (min-width: ", "px) {\n display: block;\n }\n"], ["\n display: flex;\n position: absolute;\n left: -", "px;\n top: 50%;\n transform: translateY(-50%);\n z-index: 1;\n @media (max-width: ", "px) {\n display: none !important;\n }\n @media (min-width: ", "px) {\n display: block;\n }\n"])), function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.deliverySlotArrowOffset; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; });
6
6
  var RightIconButtonContainer = styled(LeftIconButtonContainer)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n left: unset;\n right: -", "px;\n"], ["\n left: unset;\n right: -", "px;\n"])), function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.deliverySlotArrowOffset; });
7
- styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n gap: ", "px;\n padding: 0 ", "px;\n @media (min-width: ", "px) {\n padding: 0 ", "px;\n gap: ", "px;\n }\n"], ["\n display: flex;\n flex-direction: row;\n gap: ", "px;\n padding: 0 ", "px;\n @media (min-width: ", "px) {\n padding: 0 ", "px;\n gap: ", "px;\n }\n"])), function (props) { var _a, _b; return (_a = props.itemGap) !== null && _a !== void 0 ? _a : (_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.lg; }, function (props) { var _a, _b; return (_a = props.itemGap) !== null && _a !== void 0 ? _a : (_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs; });
7
+ styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n gap: ", "px;\n padding: 0 ", "px;\n @media (min-width: ", "px) {\n padding: 0 ", "px;\n gap: ", "px;\n }\n"], ["\n display: flex;\n flex-direction: row;\n gap: ", "px;\n padding: 0 ", "px;\n @media (min-width: ", "px) {\n padding: 0 ", "px;\n gap: ", "px;\n }\n"])), function (props) { var _a, _b; return (_a = props.itemGap) !== null && _a !== void 0 ? _a : (_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xxs; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.lg; }, function (props) { var _a, _b; return (_a = props.itemGap) !== null && _a !== void 0 ? _a : (_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs; });
8
8
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
9
9
 
10
10
  export { Container, LeftIconButtonContainer, RightIconButtonContainer };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citygross/components",
3
- "version": "0.7.212",
3
+ "version": "0.7.214",
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": "9a1782f0cd06c87a087e0decced623d2c8ba2341"
77
+ "gitHead": "70ecdef40e249aabe52c1a7fac276483d9b9d948"
78
78
  }