@citygross/components 0.14.1 → 0.14.3

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.
@@ -12,5 +12,6 @@ export declare type TRadioListItemProps = styles.TBaseRadioItemInputWrapper & {
12
12
  wrapMobile?: boolean;
13
13
  children?: JSX.Element;
14
14
  additionalInfo?: JSX.Element;
15
+ ariaLabel?: string;
15
16
  };
16
- export declare function RadioListItem({ onClick, selected, flexGrow, isDisabled, transparent, noPadding, label, value, wrapMobile, additionalInfo, children }: TRadioListItemProps): JSX.Element;
17
+ export declare function RadioListItem({ onClick, selected, flexGrow, isDisabled, transparent, noPadding, label, value, wrapMobile, additionalInfo, children, ariaLabel }: TRadioListItemProps): JSX.Element;
@@ -56,7 +56,7 @@ function CartSummary(_a) {
56
56
  var summaryText = summaryParts.length > 0
57
57
  ? "".concat(summaryParts.join(', '), ". ").concat(totalLabel, " ").concat(utils.formatPrice(cartSummary.totalAmount))
58
58
  : "".concat(totalLabel, " ").concat(utils.formatPrice(cartSummary.totalAmount));
59
- var fullSummary = cartSummary.totalDiscount > 0
59
+ cartSummary.totalDiscount > 0
60
60
  ? "".concat(summaryText, ". ").concat(saveLabel, " ").concat(utils.formatPrice(cartSummary.totalDiscount))
61
61
  : summaryText;
62
62
  var ChargeLine = function (_a) {
@@ -81,7 +81,7 @@ function CartSummary(_a) {
81
81
  charge.cancelledAmount > 0 && (React__default["default"].createElement(typography.BodyText, { lineThrough: true, color: (_c = index.theme === null || index.theme === void 0 ? void 0 : index.theme.palette) === null || _c === void 0 ? void 0 : _c.dark, "aria-label": "Original price ".concat(utils.formatPrice(charge.cancelledAmount)) }, utils.formatPrice(charge.cancelledAmount))),
82
82
  React__default["default"].createElement(typography.BodyText, { "aria-label": "".concat(chargeName, " ").concat(utils.formatPrice(charge.amount)) }, utils.formatPrice(charge.amount)))));
83
83
  };
84
- return (React__default["default"].createElement(CartSummary_styles.CartSummaryContainer, { role: "region", tabIndex: 0, "aria-label": cartSummary.title ? "".concat(cartSummary.title, ". ").concat(fullSummary) : "Cart Summary. ".concat(fullSummary) },
84
+ return (React__default["default"].createElement(CartSummary_styles.CartSummaryContainer, { role: "region" },
85
85
  React__default["default"].createElement(CartSummary_styles.CartPaymentContainer, null,
86
86
  cartSummary.title && (React__default["default"].createElement(CartSummary_styles.CartSummaryTitle, null,
87
87
  React__default["default"].createElement(typography.H3, null, cartSummary.title),
@@ -82,7 +82,7 @@ var ErrorLabel = styled__default["default"].label(templateObject_4 || (templateO
82
82
  var theme = _a.theme;
83
83
  return (_c = (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.size) === null || _c === void 0 ? void 0 : _c.s2;
84
84
  });
85
- var OptionInputWrapper = styled__default["default"].div(templateObject_5 || (templateObject_5 = _tslib.__makeTemplateObject(["\n cursor: ", ";\n display: inline-flex;\n align-items: center;\n gap: ", "px;\n padding: ", "px;\n\n &:has(input:focus-visible) {\n border-radius: ", "px;\n box-shadow: ", ";\n }\n\n > p {\n line-height: 1;\n }\n"], ["\n cursor: ", ";\n display: inline-flex;\n align-items: center;\n gap: ", "px;\n padding: ", "px;\n\n &:has(input:focus-visible) {\n border-radius: ", "px;\n box-shadow: ", ";\n }\n\n > p {\n line-height: 1;\n }\n"])), function (_a) {
85
+ var OptionInputWrapper = styled__default["default"].div(templateObject_5 || (templateObject_5 = _tslib.__makeTemplateObject(["\n cursor: ", ";\n display: inline-flex;\n align-items: center;\n gap: ", "px;\n padding: ", "px;\n position: relative;\n\n &:has(input:focus-visible) {\n border-radius: ", "px;\n box-shadow: ", ";\n }\n\n > p {\n line-height: 1;\n }\n"], ["\n cursor: ", ";\n display: inline-flex;\n align-items: center;\n gap: ", "px;\n padding: ", "px;\n position: relative;\n\n &:has(input:focus-visible) {\n border-radius: ", "px;\n box-shadow: ", ";\n }\n\n > p {\n line-height: 1;\n }\n"])), function (_a) {
86
86
  var disabled = _a.disabled;
87
87
  return (disabled ? 'not-allowed' : 'pointer');
88
88
  }, function (_a) {
@@ -22,7 +22,7 @@ exports.EListItemAlignment = void 0;
22
22
  })(exports.EListItemAlignment || (exports.EListItemAlignment = {}));
23
23
  var ListItem = function (_a) {
24
24
  var _b = _a.alignment, alignment = _b === void 0 ? exports.EListItemAlignment.CENTER : _b, children = _a.children, checkboxes = _a.checkboxes, fallBackImage = _a.fallBackImage, imageAutoHeight = _a.imageAutoHeight, item = _a.item, isSmall = _a.isSmall, _c = _a.loading, loading = _c === void 0 ? false : _c, _d = _a.showPriceStripe, showPriceStripe = _d === void 0 ? false : _d, smallSkeleton = _a.smallSkeleton;
25
- return (React__default["default"].createElement(ListItem_styles.ListItemContainer, { tabIndex: 0, "aria-label": (item === null || item === void 0 ? void 0 : item.name) ? "Product ".concat(item.name) : undefined },
25
+ return (React__default["default"].createElement(ListItem_styles.ListItemContainer, null,
26
26
  React__default["default"].createElement(ListItem_styles.ListLeft, { alignment: alignment },
27
27
  React__default["default"].createElement(ListItem_styles.ListImageContainer, { isSmall: isSmall },
28
28
  React__default["default"].createElement(ListItem_styles.ListImage, { autoHeight: imageAutoHeight, src: item === null || item === void 0 ? void 0 : item.image, alt: item === null || item === void 0 ? void 0 : item.name, isSmall: isSmall, onError: function (e) {
@@ -10,9 +10,10 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
10
10
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
11
11
 
12
12
  function RadioListItem(_a) {
13
- var onClick = _a.onClick, selected = _a.selected, _b = _a.flexGrow, flexGrow = _b === void 0 ? 1 : _b, isDisabled = _a.isDisabled, transparent = _a.transparent, noPadding = _a.noPadding, label = _a.label, value = _a.value, wrapMobile = _a.wrapMobile, additionalInfo = _a.additionalInfo, children = _a.children;
14
- return (React__default["default"].createElement(RadioListItem_styles.BaseRadioListItemContainer, { tabIndex: 0, role: 'checkbox', transparent: transparent, isDisabled: isDisabled, noPadding: noPadding, selected: selected, onClick: isDisabled ? function () { } : function () { return onClick(value); }, onKeyDown: function (event) {
15
- if (event.key === 'Enter' && !isDisabled) {
13
+ var onClick = _a.onClick, selected = _a.selected, _b = _a.flexGrow, flexGrow = _b === void 0 ? 1 : _b, isDisabled = _a.isDisabled, transparent = _a.transparent, noPadding = _a.noPadding, label = _a.label, value = _a.value, wrapMobile = _a.wrapMobile, additionalInfo = _a.additionalInfo, children = _a.children, ariaLabel = _a.ariaLabel;
14
+ return (React__default["default"].createElement(RadioListItem_styles.BaseRadioListItemContainer, { tabIndex: isDisabled ? -1 : 0, role: "radio", "aria-checked": selected, "aria-disabled": isDisabled, "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : label, "aria-live": "polite", transparent: transparent, isDisabled: isDisabled, noPadding: noPadding, selected: selected, onClick: isDisabled ? function () { } : function () { return onClick(value); }, onKeyDown: function (event) {
15
+ if ((event.key === 'Enter' || event.key === ' ') && !isDisabled) {
16
+ event.preventDefault();
16
17
  onClick(value);
17
18
  }
18
19
  } },
@@ -1 +1 @@
1
- {"version":3,"file":"RadioListItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"RadioListItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -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 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) {
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 width: 100%;\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 width: 100%;\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
@@ -48,7 +48,7 @@ function CartSummary(_a) {
48
48
  var summaryText = summaryParts.length > 0
49
49
  ? "".concat(summaryParts.join(', '), ". ").concat(totalLabel, " ").concat(formatPrice(cartSummary.totalAmount))
50
50
  : "".concat(totalLabel, " ").concat(formatPrice(cartSummary.totalAmount));
51
- var fullSummary = cartSummary.totalDiscount > 0
51
+ cartSummary.totalDiscount > 0
52
52
  ? "".concat(summaryText, ". ").concat(saveLabel, " ").concat(formatPrice(cartSummary.totalDiscount))
53
53
  : summaryText;
54
54
  var ChargeLine = function (_a) {
@@ -73,7 +73,7 @@ function CartSummary(_a) {
73
73
  charge.cancelledAmount > 0 && (React.createElement(BodyText, { lineThrough: true, color: (_c = theme_1 === null || theme_1 === void 0 ? void 0 : theme_1.palette) === null || _c === void 0 ? void 0 : _c.dark, "aria-label": "Original price ".concat(formatPrice(charge.cancelledAmount)) }, formatPrice(charge.cancelledAmount))),
74
74
  React.createElement(BodyText, { "aria-label": "".concat(chargeName, " ").concat(formatPrice(charge.amount)) }, formatPrice(charge.amount)))));
75
75
  };
76
- return (React.createElement(CartSummaryContainer, { role: "region", tabIndex: 0, "aria-label": cartSummary.title ? "".concat(cartSummary.title, ". ").concat(fullSummary) : "Cart Summary. ".concat(fullSummary) },
76
+ return (React.createElement(CartSummaryContainer, { role: "region" },
77
77
  React.createElement(CartPaymentContainer, null,
78
78
  cartSummary.title && (React.createElement(CartSummaryTitle, null,
79
79
  React.createElement(H3, null, cartSummary.title),
@@ -74,7 +74,7 @@ var ErrorLabel = styled.label(templateObject_4 || (templateObject_4 = __makeTemp
74
74
  var theme = _a.theme;
75
75
  return (_c = (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.size) === null || _c === void 0 ? void 0 : _c.s2;
76
76
  });
77
- var OptionInputWrapper = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n cursor: ", ";\n display: inline-flex;\n align-items: center;\n gap: ", "px;\n padding: ", "px;\n\n &:has(input:focus-visible) {\n border-radius: ", "px;\n box-shadow: ", ";\n }\n\n > p {\n line-height: 1;\n }\n"], ["\n cursor: ", ";\n display: inline-flex;\n align-items: center;\n gap: ", "px;\n padding: ", "px;\n\n &:has(input:focus-visible) {\n border-radius: ", "px;\n box-shadow: ", ";\n }\n\n > p {\n line-height: 1;\n }\n"])), function (_a) {
77
+ var OptionInputWrapper = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n cursor: ", ";\n display: inline-flex;\n align-items: center;\n gap: ", "px;\n padding: ", "px;\n position: relative;\n\n &:has(input:focus-visible) {\n border-radius: ", "px;\n box-shadow: ", ";\n }\n\n > p {\n line-height: 1;\n }\n"], ["\n cursor: ", ";\n display: inline-flex;\n align-items: center;\n gap: ", "px;\n padding: ", "px;\n position: relative;\n\n &:has(input:focus-visible) {\n border-radius: ", "px;\n box-shadow: ", ";\n }\n\n > p {\n line-height: 1;\n }\n"])), function (_a) {
78
78
  var disabled = _a.disabled;
79
79
  return (disabled ? 'not-allowed' : 'pointer');
80
80
  }, function (_a) {
@@ -13,7 +13,7 @@ var EListItemAlignment;
13
13
  })(EListItemAlignment || (EListItemAlignment = {}));
14
14
  var ListItem = function (_a) {
15
15
  var _b = _a.alignment, alignment = _b === void 0 ? EListItemAlignment.CENTER : _b, children = _a.children, checkboxes = _a.checkboxes, fallBackImage = _a.fallBackImage, imageAutoHeight = _a.imageAutoHeight, item = _a.item, isSmall = _a.isSmall, _c = _a.loading, loading = _c === void 0 ? false : _c, _d = _a.showPriceStripe, showPriceStripe = _d === void 0 ? false : _d, smallSkeleton = _a.smallSkeleton;
16
- return (React.createElement(ListItemContainer, { tabIndex: 0, "aria-label": (item === null || item === void 0 ? void 0 : item.name) ? "Product ".concat(item.name) : undefined },
16
+ return (React.createElement(ListItemContainer, null,
17
17
  React.createElement(ListLeft, { alignment: alignment },
18
18
  React.createElement(ListImageContainer, { isSmall: isSmall },
19
19
  React.createElement(ListImage, { autoHeight: imageAutoHeight, src: item === null || item === void 0 ? void 0 : item.image, alt: item === null || item === void 0 ? void 0 : item.name, isSmall: isSmall, onError: function (e) {
@@ -2,9 +2,10 @@ import React from 'react';
2
2
  import { BaseRadioListItemContainer, RadioFlex, BaseRadioItemLeftWrapper, LabelContentWrapper, StyledH3, RadioRightWrapper } from './RadioListItem.styles.js';
3
3
 
4
4
  function RadioListItem(_a) {
5
- var onClick = _a.onClick, selected = _a.selected, _b = _a.flexGrow, flexGrow = _b === void 0 ? 1 : _b, isDisabled = _a.isDisabled, transparent = _a.transparent, noPadding = _a.noPadding, label = _a.label, value = _a.value, wrapMobile = _a.wrapMobile, additionalInfo = _a.additionalInfo, children = _a.children;
6
- return (React.createElement(BaseRadioListItemContainer, { tabIndex: 0, role: 'checkbox', transparent: transparent, isDisabled: isDisabled, noPadding: noPadding, selected: selected, onClick: isDisabled ? function () { } : function () { return onClick(value); }, onKeyDown: function (event) {
7
- if (event.key === 'Enter' && !isDisabled) {
5
+ var onClick = _a.onClick, selected = _a.selected, _b = _a.flexGrow, flexGrow = _b === void 0 ? 1 : _b, isDisabled = _a.isDisabled, transparent = _a.transparent, noPadding = _a.noPadding, label = _a.label, value = _a.value, wrapMobile = _a.wrapMobile, additionalInfo = _a.additionalInfo, children = _a.children, ariaLabel = _a.ariaLabel;
6
+ return (React.createElement(BaseRadioListItemContainer, { tabIndex: isDisabled ? -1 : 0, role: "radio", "aria-checked": selected, "aria-disabled": isDisabled, "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : label, "aria-live": "polite", transparent: transparent, isDisabled: isDisabled, noPadding: noPadding, selected: selected, onClick: isDisabled ? function () { } : function () { return onClick(value); }, onKeyDown: function (event) {
7
+ if ((event.key === 'Enter' || event.key === ' ') && !isDisabled) {
8
+ event.preventDefault();
8
9
  onClick(value);
9
10
  }
10
11
  } },
@@ -1 +1 @@
1
- {"version":3,"file":"RadioListItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"RadioListItem.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 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) {
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 width: 100%;\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 width: 100%;\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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citygross/components",
3
- "version": "0.14.1",
3
+ "version": "0.14.3",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "./build/cjs/components/src/index.js",
@@ -75,5 +75,5 @@
75
75
  "react-slick": "^0.30.1",
76
76
  "slick-carousel": "^1.8.1"
77
77
  },
78
- "gitHead": "9cd386e7e3379dd334507dc20128b9aa39c6ad0e"
78
+ "gitHead": "287719ceadb682952742e10dc6a70be2acb046ed"
79
79
  }