@citygross/components 0.16.13 → 0.16.15

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.
@@ -83,11 +83,7 @@ function CartSummary(_a) {
83
83
  ((groceries === null || groceries === void 0 ? void 0 : groceries.length) > 0 || (cateredMeals === null || cateredMeals === void 0 ? void 0 : cateredMeals.length) > 0) && (React__default["default"].createElement(CartSummary_styles.CartLine, { role: "listitem" },
84
84
  React__default["default"].createElement(typography.BodyText, null,
85
85
  itemsLabel,
86
- React__default["default"].createElement(CartSummary_styles.QuantitySpan, null,
87
- "\u00A0(",
88
- ((_h = sumOfGroceries === null || sumOfGroceries === void 0 ? void 0 : sumOfGroceries.quantity) !== null && _h !== void 0 ? _h : 0) +
89
- ((_j = sumOfCateredMeals === null || sumOfCateredMeals === void 0 ? void 0 : sumOfCateredMeals.quantity) !== null && _j !== void 0 ? _j : 0),
90
- ")")),
86
+ React__default["default"].createElement(CartSummary_styles.QuantitySpan, null, " (".concat(((_h = sumOfGroceries === null || sumOfGroceries === void 0 ? void 0 : sumOfGroceries.quantity) !== null && _h !== void 0 ? _h : 0) + ((_j = sumOfCateredMeals === null || sumOfCateredMeals === void 0 ? void 0 : sumOfCateredMeals.quantity) !== null && _j !== void 0 ? _j : 0), ")"))),
91
87
  React__default["default"].createElement(CartSummary_styles.AmountWrapper, null,
92
88
  (sumOfGroceries === null || sumOfGroceries === void 0 ? void 0 : sumOfGroceries.cancelledAmount) > 0 && (React__default["default"].createElement(typography.BodyText, { lineThrough: true, color: (_k = index.theme === null || index.theme === void 0 ? void 0 : index.theme.palette) === null || _k === void 0 ? void 0 : _k.dark }, utils.formatPrice(((_l = sumOfGroceries === null || sumOfGroceries === void 0 ? void 0 : sumOfGroceries.cancelledAmount) !== null && _l !== void 0 ? _l : 0) +
93
89
  ((_m = sumOfCateredMeals === null || sumOfCateredMeals === void 0 ? void 0 : sumOfCateredMeals.cancelledAmount) !== null && _m !== void 0 ? _m : 0)))),
@@ -1 +1 @@
1
- {"version":3,"file":"CartSummary.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CartSummary.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var _tslib = require('../../../../_virtual/_tslib.js');
6
6
  var React = require('react');
7
7
  var typography = require('@citygross/typography');
8
+ var designTokens = require('@citygross/design-tokens');
8
9
  var Link_styles = require('./Link.styles.js');
9
10
 
10
11
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -28,11 +29,29 @@ exports.ELinkVariant = void 0;
28
29
  ELinkVariant["TERTIARY"] = "tertiary";
29
30
  })(exports.ELinkVariant || (exports.ELinkVariant = {}));
30
31
  function Link(_a) {
31
- var asButton = _a.asButton, borderRadius = _a.borderRadius, children = _a.children, hrefPath = _a.hrefPath, icon = _a.icon, _b = _a.inverted, inverted = _b === void 0 ? false : _b, isDisabled = _a.isDisabled, noWrap = _a.noWrap, onClick = _a.onClick, _c = _a.size, size = _c === void 0 ? typography.TextTypes.TextSize.REGULAR : _c, _d = _a.target, target = _d === void 0 ? '_self' : _d, tabIndex = _a.tabIndex, _e = _a.variant, variant = _e === void 0 ? exports.ELinkVariant.PRIMARY : _e, props = _tslib.__rest(_a, ["asButton", "borderRadius", "children", "hrefPath", "icon", "inverted", "isDisabled", "noWrap", "onClick", "size", "target", "tabIndex", "variant"]);
32
+ var _b;
33
+ var asButton = _a.asButton, borderRadius = _a.borderRadius, children = _a.children, hrefPath = _a.hrefPath, icon = _a.icon, _c = _a.inverted, inverted = _c === void 0 ? false : _c, isDisabled = _a.isDisabled, noWrap = _a.noWrap, onClick = _a.onClick, _d = _a.size, size = _d === void 0 ? typography.TextTypes.TextSize.REGULAR : _d, _e = _a.target, target = _e === void 0 ? '_self' : _e, tabIndex = _a.tabIndex, _f = _a.variant, variant = _f === void 0 ? exports.ELinkVariant.PRIMARY : _f, props = _tslib.__rest(_a, ["asButton", "borderRadius", "children", "hrefPath", "icon", "inverted", "isDisabled", "noWrap", "onClick", "size", "target", "tabIndex", "variant"]);
34
+ var disabled = !!isDisabled;
35
+ var palette = designTokens.theme === null || designTokens.theme === void 0 ? void 0 : designTokens.theme.palette;
36
+ var bodyTextColor = (_b = (variant === exports.ELinkVariant.PRIMARY
37
+ ? inverted
38
+ ? disabled
39
+ ? palette === null || palette === void 0 ? void 0 : palette.disabledDarkGray
40
+ : palette === null || palette === void 0 ? void 0 : palette.white
41
+ : disabled
42
+ ? palette === null || palette === void 0 ? void 0 : palette.blueMedium
43
+ : palette === null || palette === void 0 ? void 0 : palette.brandBlue
44
+ : inverted
45
+ ? disabled
46
+ ? palette === null || palette === void 0 ? void 0 : palette.disabledDarkGray
47
+ : palette === null || palette === void 0 ? void 0 : palette.white
48
+ : disabled
49
+ ? palette === null || palette === void 0 ? void 0 : palette.disabledGray
50
+ : palette === null || palette === void 0 ? void 0 : palette.darkest)) !== null && _b !== void 0 ? _b : palette === null || palette === void 0 ? void 0 : palette.darkest;
32
51
  return asButton ? (React__default["default"].createElement(Link_styles.LinkAsButton, _tslib.__assign({ borderRadius: borderRadius, disabled: isDisabled, icon: icon, inverted: inverted, isDisabled: isDisabled, noWrap: noWrap, onClick: onClick, size: size, variant: variant }, props),
33
- React__default["default"].createElement(typography.BodyText, { size: size }, children),
52
+ React__default["default"].createElement(typography.BodyText, { size: size, color: bodyTextColor }, children),
34
53
  icon && React__default["default"].createElement(Link_styles.IconWrapper, null, icon))) : (React__default["default"].createElement(Link_styles.BaseLink, _tslib.__assign({ borderRadius: borderRadius, href: hrefPath, isDisabled: isDisabled, icon: icon, inverted: inverted, noWrap: noWrap, onClick: onClick, size: size, tabIndex: tabIndex, target: target, variant: variant }, props),
35
- React__default["default"].createElement(typography.BodyText, { size: size }, children),
54
+ React__default["default"].createElement(typography.BodyText, { size: size, color: bodyTextColor }, children),
36
55
  icon && React__default["default"].createElement(Link_styles.IconWrapper, null, icon)));
37
56
  }
38
57
 
@@ -1 +1 @@
1
- {"version":3,"file":"Link.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Link.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -75,11 +75,7 @@ function CartSummary(_a) {
75
75
  ((groceries === null || groceries === void 0 ? void 0 : groceries.length) > 0 || (cateredMeals === null || cateredMeals === void 0 ? void 0 : cateredMeals.length) > 0) && (React.createElement(CartLine, { role: "listitem" },
76
76
  React.createElement(BodyText, null,
77
77
  itemsLabel,
78
- React.createElement(QuantitySpan, null,
79
- "\u00A0(",
80
- ((_h = sumOfGroceries === null || sumOfGroceries === void 0 ? void 0 : sumOfGroceries.quantity) !== null && _h !== void 0 ? _h : 0) +
81
- ((_j = sumOfCateredMeals === null || sumOfCateredMeals === void 0 ? void 0 : sumOfCateredMeals.quantity) !== null && _j !== void 0 ? _j : 0),
82
- ")")),
78
+ React.createElement(QuantitySpan, null, " (".concat(((_h = sumOfGroceries === null || sumOfGroceries === void 0 ? void 0 : sumOfGroceries.quantity) !== null && _h !== void 0 ? _h : 0) + ((_j = sumOfCateredMeals === null || sumOfCateredMeals === void 0 ? void 0 : sumOfCateredMeals.quantity) !== null && _j !== void 0 ? _j : 0), ")"))),
83
79
  React.createElement(AmountWrapper, null,
84
80
  (sumOfGroceries === null || sumOfGroceries === void 0 ? void 0 : sumOfGroceries.cancelledAmount) > 0 && (React.createElement(BodyText, { lineThrough: true, color: (_k = theme_1 === null || theme_1 === void 0 ? void 0 : theme_1.palette) === null || _k === void 0 ? void 0 : _k.dark }, formatPrice(((_l = sumOfGroceries === null || sumOfGroceries === void 0 ? void 0 : sumOfGroceries.cancelledAmount) !== null && _l !== void 0 ? _l : 0) +
85
81
  ((_m = sumOfCateredMeals === null || sumOfCateredMeals === void 0 ? void 0 : sumOfCateredMeals.cancelledAmount) !== null && _m !== void 0 ? _m : 0)))),
@@ -1 +1 @@
1
- {"version":3,"file":"CartSummary.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CartSummary.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,7 @@
1
1
  import { __rest, __assign } from '../../../../_virtual/_tslib.js';
2
2
  import React from 'react';
3
3
  import { TextTypes, BodyText } from '@citygross/typography';
4
+ import { theme } from '@citygross/design-tokens';
4
5
  import { LinkAsButton, IconWrapper, BaseLink } from './Link.styles.js';
5
6
 
6
7
  var LinkSize;
@@ -20,11 +21,29 @@ var ELinkVariant;
20
21
  ELinkVariant["TERTIARY"] = "tertiary";
21
22
  })(ELinkVariant || (ELinkVariant = {}));
22
23
  function Link(_a) {
23
- var asButton = _a.asButton, borderRadius = _a.borderRadius, children = _a.children, hrefPath = _a.hrefPath, icon = _a.icon, _b = _a.inverted, inverted = _b === void 0 ? false : _b, isDisabled = _a.isDisabled, noWrap = _a.noWrap, onClick = _a.onClick, _c = _a.size, size = _c === void 0 ? TextTypes.TextSize.REGULAR : _c, _d = _a.target, target = _d === void 0 ? '_self' : _d, tabIndex = _a.tabIndex, _e = _a.variant, variant = _e === void 0 ? ELinkVariant.PRIMARY : _e, props = __rest(_a, ["asButton", "borderRadius", "children", "hrefPath", "icon", "inverted", "isDisabled", "noWrap", "onClick", "size", "target", "tabIndex", "variant"]);
24
+ var _b;
25
+ var asButton = _a.asButton, borderRadius = _a.borderRadius, children = _a.children, hrefPath = _a.hrefPath, icon = _a.icon, _c = _a.inverted, inverted = _c === void 0 ? false : _c, isDisabled = _a.isDisabled, noWrap = _a.noWrap, onClick = _a.onClick, _d = _a.size, size = _d === void 0 ? TextTypes.TextSize.REGULAR : _d, _e = _a.target, target = _e === void 0 ? '_self' : _e, tabIndex = _a.tabIndex, _f = _a.variant, variant = _f === void 0 ? ELinkVariant.PRIMARY : _f, props = __rest(_a, ["asButton", "borderRadius", "children", "hrefPath", "icon", "inverted", "isDisabled", "noWrap", "onClick", "size", "target", "tabIndex", "variant"]);
26
+ var disabled = !!isDisabled;
27
+ var palette = theme === null || theme === void 0 ? void 0 : theme.palette;
28
+ var bodyTextColor = (_b = (variant === ELinkVariant.PRIMARY
29
+ ? inverted
30
+ ? disabled
31
+ ? palette === null || palette === void 0 ? void 0 : palette.disabledDarkGray
32
+ : palette === null || palette === void 0 ? void 0 : palette.white
33
+ : disabled
34
+ ? palette === null || palette === void 0 ? void 0 : palette.blueMedium
35
+ : palette === null || palette === void 0 ? void 0 : palette.brandBlue
36
+ : inverted
37
+ ? disabled
38
+ ? palette === null || palette === void 0 ? void 0 : palette.disabledDarkGray
39
+ : palette === null || palette === void 0 ? void 0 : palette.white
40
+ : disabled
41
+ ? palette === null || palette === void 0 ? void 0 : palette.disabledGray
42
+ : palette === null || palette === void 0 ? void 0 : palette.darkest)) !== null && _b !== void 0 ? _b : palette === null || palette === void 0 ? void 0 : palette.darkest;
24
43
  return asButton ? (React.createElement(LinkAsButton, __assign({ borderRadius: borderRadius, disabled: isDisabled, icon: icon, inverted: inverted, isDisabled: isDisabled, noWrap: noWrap, onClick: onClick, size: size, variant: variant }, props),
25
- React.createElement(BodyText, { size: size }, children),
44
+ React.createElement(BodyText, { size: size, color: bodyTextColor }, children),
26
45
  icon && React.createElement(IconWrapper, null, icon))) : (React.createElement(BaseLink, __assign({ borderRadius: borderRadius, href: hrefPath, isDisabled: isDisabled, icon: icon, inverted: inverted, noWrap: noWrap, onClick: onClick, size: size, tabIndex: tabIndex, target: target, variant: variant }, props),
27
- React.createElement(BodyText, { size: size }, children),
46
+ React.createElement(BodyText, { size: size, color: bodyTextColor }, children),
28
47
  icon && React.createElement(IconWrapper, null, icon)));
29
48
  }
30
49
 
@@ -1 +1 @@
1
- {"version":3,"file":"Link.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Link.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citygross/components",
3
- "version": "0.16.13",
3
+ "version": "0.16.15",
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": "b6c31a3d925202b2d3a33794d4ec8aa5e840506c"
77
+ "gitHead": "d1de4ca07eccff4fab144dfd0d1ee82a070ab6c9"
78
78
  }