@citygross/components 0.8.77 → 0.8.79

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.
@@ -14,5 +14,6 @@ export declare type TCartCard = {
14
14
  onDelete?: () => void;
15
15
  quanitytSelector?: React.ReactNode;
16
16
  titleLineClamp?: number;
17
+ titleLink?: React.ReactNode;
17
18
  };
18
- export declare const CartCard: ({ markings, title, description, showDelete, maxReachedWarning, value, price, image, onDelete, maxValue, secondaryDescription, quanitytSelector, titleLineClamp }: TCartCard) => JSX.Element;
19
+ export declare const CartCard: ({ markings, title, description, showDelete, maxReachedWarning, value, price, image, titleLink, onDelete, maxValue, secondaryDescription, quanitytSelector, titleLineClamp, }: TCartCard) => JSX.Element;
@@ -12,4 +12,5 @@ export declare type TSideModal = {
12
12
  maxHeight?: string;
13
13
  fullViewportHeight?: boolean;
14
14
  };
15
- export declare const SideModal: ({ onBackdropClick, background, overlayBackground, width, isVisible, slideFrom, querySelector, maxWidth, maxHeight, children }: TSideModal) => React.ReactPortal | null;
15
+ export declare const SideModal: React.ForwardRefExoticComponent<TSideModal & React.RefAttributes<HTMLDivElement>>;
16
+ export default SideModal;
@@ -80,8 +80,7 @@ require('styled-components');
80
80
  require('../SearchBar/SearchBar.styles.js');
81
81
  require('../Nav/Nav.styles.js');
82
82
  require('../NavMainLink/NavMainLink.styled.js');
83
- require('framer-motion');
84
- require('../SideModal/SideModal.styles.js');
83
+ require('../SideModal/SideModal.js');
85
84
  require('../IconText/IconText.styles.js');
86
85
  require('../Dropdown/Dropdown.styles.js');
87
86
  require('../SearchListItem/SearchListItem.styles.js');
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -13,14 +13,14 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
13
13
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
14
14
 
15
15
  var CartCard = function (_a) {
16
- var markings = _a.markings, title = _a.title, description = _a.description, showDelete = _a.showDelete, maxReachedWarning = _a.maxReachedWarning, value = _a.value, price = _a.price, image = _a.image, onDelete = _a.onDelete, _b = _a.maxValue, maxValue = _b === void 0 ? 999 : _b, secondaryDescription = _a.secondaryDescription, quanitytSelector = _a.quanitytSelector, _c = _a.titleLineClamp, titleLineClamp = _c === void 0 ? 1 : _c;
16
+ var markings = _a.markings, title = _a.title, description = _a.description, showDelete = _a.showDelete, maxReachedWarning = _a.maxReachedWarning, value = _a.value, price = _a.price, image = _a.image, titleLink = _a.titleLink, onDelete = _a.onDelete, _b = _a.maxValue, maxValue = _b === void 0 ? 999 : _b, secondaryDescription = _a.secondaryDescription, quanitytSelector = _a.quanitytSelector, _c = _a.titleLineClamp, titleLineClamp = _c === void 0 ? 1 : _c;
17
17
  return (React__default["default"].createElement(CartCard_styles.CartCardContainer, null,
18
18
  React__default["default"].createElement(CartCard_styles.CartCardImage, { src: image || fallback_grocery }),
19
19
  React__default["default"].createElement(CartCard_styles.CartCardInner, null,
20
20
  React__default["default"].createElement(CartCard_styles.CartCardInnerTop, null,
21
21
  React__default["default"].createElement(CartCard_styles.CartCardInfo, null,
22
22
  markings && (React__default["default"].createElement(CartCard_styles.MarkingsContainer, null, markings)),
23
- title && (React__default["default"].createElement(CartCard_styles.CartCardTitle, { titleLineClamp: titleLineClamp }, title)),
23
+ titleLink || title && (React__default["default"].createElement(CartCard_styles.CartCardTitle, { titleLineClamp: titleLineClamp }, title)),
24
24
  description && description),
25
25
  showDelete && (React__default["default"].createElement(CartCard_styles.CartCardDelete, null,
26
26
  React__default["default"].createElement(CgButton.CgButton, { onClick: onDelete, variant: CgButton.EButtonVariant.secondary, icon: React__default["default"].createElement(icons.Icons.Trash, { width: 16, height: 16 }) })))),
@@ -12,14 +12,13 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
12
12
 
13
13
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
14
14
 
15
- var SideModal = function (_a) {
15
+ var SideModal = React.forwardRef(function (_a, ref) {
16
16
  var _b, _c;
17
17
  var onBackdropClick = _a.onBackdropClick, _d = _a.background, background = _d === void 0 ? '#fff' : _d, _e = _a.overlayBackground, overlayBackground = _e === void 0 ? (_c = (_b = designTokens.theme.palette) === null || _b === void 0 ? void 0 : _b.darkOverlay) !== null && _c !== void 0 ? _c : '' : _e, _f = _a.width, width = _f === void 0 ? 375 : _f, isVisible = _a.isVisible, slideFrom = _a.slideFrom, _g = _a.querySelector, querySelector = _g === void 0 ? '#root' : _g, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight, children = _a.children;
18
- var ref = React.useRef(null);
19
18
  var domSafe = typeof document !== 'undefined';
20
19
  return domSafe
21
20
  ? reactDom.createPortal(React__default["default"].createElement(framerMotion.AnimatePresence, null, isVisible && (React__default["default"].createElement(SideModal_styles.SideModalOverlay, { ref: ref, onMouseDown: function (e) {
22
- if (ref && e.target === (ref === null || ref === void 0 ? void 0 : ref.current)) {
21
+ if (e.target === e.currentTarget) {
23
22
  onBackdropClick();
24
23
  }
25
24
  }, overlayBackground: overlayBackground, initial: { opacity: 0 }, maxHeight: maxHeight, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: {
@@ -27,7 +26,9 @@ var SideModal = function (_a) {
27
26
  } },
28
27
  React__default["default"].createElement(SideModal_styles.SideModalContainer, { slideFrom: slideFrom, maxHeight: maxHeight, maxWidth: maxWidth, transition: { type: 'just' }, width: width, onClick: function (e) { return e.stopPropagation(); }, background: background, initial: { x: slideFrom === 'left' ? '-100%' : '100%' }, animate: { x: 0 }, exit: { x: slideFrom === 'left' ? '-100%' : '100%' } }, children)))), document.querySelector(querySelector) || document.body)
29
28
  : null;
30
- };
29
+ });
30
+ SideModal.displayName = 'SideModal';
31
31
 
32
32
  exports.SideModal = SideModal;
33
+ exports["default"] = SideModal;
33
34
  //# sourceMappingURL=SideModal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SideModal.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SideModal.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -80,8 +80,7 @@ require('styled-components');
80
80
  require('../SearchBar/SearchBar.styles.js');
81
81
  require('../Nav/Nav.styles.js');
82
82
  require('../NavMainLink/NavMainLink.styled.js');
83
- require('framer-motion');
84
- require('../SideModal/SideModal.styles.js');
83
+ require('../SideModal/SideModal.js');
85
84
  require('../IconText/IconText.styles.js');
86
85
  require('../Dropdown/Dropdown.styles.js');
87
86
  require('../SearchListItem/SearchListItem.styles.js');
@@ -1 +1 @@
1
- {"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -76,8 +76,7 @@ import 'styled-components';
76
76
  import '../SearchBar/SearchBar.styles.js';
77
77
  import '../Nav/Nav.styles.js';
78
78
  import '../NavMainLink/NavMainLink.styled.js';
79
- import 'framer-motion';
80
- import '../SideModal/SideModal.styles.js';
79
+ import '../SideModal/SideModal.js';
81
80
  import '../IconText/IconText.styles.js';
82
81
  import '../Dropdown/Dropdown.styles.js';
83
82
  import '../SearchListItem/SearchListItem.styles.js';
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -5,14 +5,14 @@ import { Icons } from '@citygross/icons';
5
5
  import { CgButton, EButtonVariant } from '../CgButton/CgButton.js';
6
6
 
7
7
  var CartCard = function (_a) {
8
- var markings = _a.markings, title = _a.title, description = _a.description, showDelete = _a.showDelete, maxReachedWarning = _a.maxReachedWarning, value = _a.value, price = _a.price, image = _a.image, onDelete = _a.onDelete, _b = _a.maxValue, maxValue = _b === void 0 ? 999 : _b, secondaryDescription = _a.secondaryDescription, quanitytSelector = _a.quanitytSelector, _c = _a.titleLineClamp, titleLineClamp = _c === void 0 ? 1 : _c;
8
+ var markings = _a.markings, title = _a.title, description = _a.description, showDelete = _a.showDelete, maxReachedWarning = _a.maxReachedWarning, value = _a.value, price = _a.price, image = _a.image, titleLink = _a.titleLink, onDelete = _a.onDelete, _b = _a.maxValue, maxValue = _b === void 0 ? 999 : _b, secondaryDescription = _a.secondaryDescription, quanitytSelector = _a.quanitytSelector, _c = _a.titleLineClamp, titleLineClamp = _c === void 0 ? 1 : _c;
9
9
  return (React.createElement(CartCardContainer, null,
10
10
  React.createElement(CartCardImage, { src: image || FallbackIcon }),
11
11
  React.createElement(CartCardInner, null,
12
12
  React.createElement(CartCardInnerTop, null,
13
13
  React.createElement(CartCardInfo, null,
14
14
  markings && (React.createElement(MarkingsContainer, null, markings)),
15
- title && (React.createElement(CartCardTitle, { titleLineClamp: titleLineClamp }, title)),
15
+ titleLink || title && (React.createElement(CartCardTitle, { titleLineClamp: titleLineClamp }, title)),
16
16
  description && description),
17
17
  showDelete && (React.createElement(CartCardDelete, null,
18
18
  React.createElement(CgButton, { onClick: onDelete, variant: EButtonVariant.secondary, icon: React.createElement(Icons.Trash, { width: 16, height: 16 }) })))),
@@ -1,17 +1,16 @@
1
- import React, { useRef } from 'react';
1
+ import React, { forwardRef } from 'react';
2
2
  import { AnimatePresence } from 'framer-motion';
3
3
  import { createPortal } from 'react-dom';
4
4
  import { SideModalOverlay, SideModalContainer } from './SideModal.styles.js';
5
5
  import { theme } from '@citygross/design-tokens';
6
6
 
7
- var SideModal = function (_a) {
7
+ var SideModal = forwardRef(function (_a, ref) {
8
8
  var _b, _c;
9
9
  var onBackdropClick = _a.onBackdropClick, _d = _a.background, background = _d === void 0 ? '#fff' : _d, _e = _a.overlayBackground, overlayBackground = _e === void 0 ? (_c = (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.darkOverlay) !== null && _c !== void 0 ? _c : '' : _e, _f = _a.width, width = _f === void 0 ? 375 : _f, isVisible = _a.isVisible, slideFrom = _a.slideFrom, _g = _a.querySelector, querySelector = _g === void 0 ? '#root' : _g, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight, children = _a.children;
10
- var ref = useRef(null);
11
10
  var domSafe = typeof document !== 'undefined';
12
11
  return domSafe
13
12
  ? createPortal(React.createElement(AnimatePresence, null, isVisible && (React.createElement(SideModalOverlay, { ref: ref, onMouseDown: function (e) {
14
- if (ref && e.target === (ref === null || ref === void 0 ? void 0 : ref.current)) {
13
+ if (e.target === e.currentTarget) {
15
14
  onBackdropClick();
16
15
  }
17
16
  }, overlayBackground: overlayBackground, initial: { opacity: 0 }, maxHeight: maxHeight, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: {
@@ -19,7 +18,8 @@ var SideModal = function (_a) {
19
18
  } },
20
19
  React.createElement(SideModalContainer, { slideFrom: slideFrom, maxHeight: maxHeight, maxWidth: maxWidth, transition: { type: 'just' }, width: width, onClick: function (e) { return e.stopPropagation(); }, background: background, initial: { x: slideFrom === 'left' ? '-100%' : '100%' }, animate: { x: 0 }, exit: { x: slideFrom === 'left' ? '-100%' : '100%' } }, children)))), document.querySelector(querySelector) || document.body)
21
20
  : null;
22
- };
21
+ });
22
+ SideModal.displayName = 'SideModal';
23
23
 
24
- export { SideModal };
24
+ export { SideModal, SideModal as default };
25
25
  //# sourceMappingURL=SideModal.js.map
@@ -76,8 +76,7 @@ import 'styled-components';
76
76
  import '../SearchBar/SearchBar.styles.js';
77
77
  import '../Nav/Nav.styles.js';
78
78
  import '../NavMainLink/NavMainLink.styled.js';
79
- import 'framer-motion';
80
- import '../SideModal/SideModal.styles.js';
79
+ import '../SideModal/SideModal.js';
81
80
  import '../IconText/IconText.styles.js';
82
81
  import '../Dropdown/Dropdown.styles.js';
83
82
  import '../SearchListItem/SearchListItem.styles.js';
@@ -1 +1 @@
1
- {"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citygross/components",
3
- "version": "0.8.77",
3
+ "version": "0.8.79",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "./build/cjs/components/src/index.js",
@@ -76,5 +76,5 @@
76
76
  "react-slick": "^0.30.1",
77
77
  "slick-carousel": "^1.8.1"
78
78
  },
79
- "gitHead": "877c78104efccf9c506efb12f9ad8bab28ff3370"
79
+ "gitHead": "8a6ee958630fa06314e9b8fc2dde167d49e08354"
80
80
  }