@citygross/components 0.15.8 → 0.16.0
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.
- package/build/@types/components/ListItem/ListItem.d.ts +1 -0
- package/build/cjs/components/src/components/FormElements/Checkbox/Checkbox.js +1 -1
- package/build/cjs/components/src/components/ListItem/ListItem.js +14 -11
- package/build/cjs/components/src/components/ListItem/ListItem.js.map +1 -1
- package/build/es/components/src/components/FormElements/Checkbox/Checkbox.js +1 -1
- package/build/es/components/src/components/ListItem/ListItem.js +14 -11
- package/build/es/components/src/components/ListItem/ListItem.js.map +1 -1
- package/package.json +2 -2
|
@@ -22,7 +22,7 @@ var Checkbox = function (_a) {
|
|
|
22
22
|
React__default["default"].createElement(FormElement_styles.HiddenInput, _tslib.__assign({ checked: checked, disabled: disabled, type: "checkbox" }, props)),
|
|
23
23
|
React__default["default"].createElement(Checkbox_styles.CheckboxContainer, { attributes: attributes },
|
|
24
24
|
React__default["default"].createElement(Checkbox_styles.IconContainer, null,
|
|
25
|
-
React__default["default"].createElement(icons.Icons.CheckMark, { color: iconColor }))),
|
|
25
|
+
React__default["default"].createElement(icons.Icons.CheckMark, { color: iconColor, "aria-hidden": "true" }))),
|
|
26
26
|
hideLabel ? (React__default["default"].createElement(ScreenReader.ScreenReader, { string: label })) : (React__default["default"].createElement(typography.BodyText, { color: labelColor }, label))));
|
|
27
27
|
};
|
|
28
28
|
|
|
@@ -10,6 +10,7 @@ var ProductHeader = require('../ProductHeader/ProductHeader.js');
|
|
|
10
10
|
var PriceStripe = require('../PriceStripe/PriceStripe.js');
|
|
11
11
|
var ListItem_styles = require('./ListItem.styles.js');
|
|
12
12
|
var PriceTag_types = require('../PriceTag/PriceTag.types.js');
|
|
13
|
+
var Fieldset = require('../Fieldset/Fieldset.js');
|
|
13
14
|
|
|
14
15
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
16
|
|
|
@@ -40,7 +41,7 @@ function buildCheckboxContext(item) {
|
|
|
40
41
|
return "".concat(productPart).concat(pricePart).concat(quantityPart);
|
|
41
42
|
}
|
|
42
43
|
var ListItem = function (_a) {
|
|
43
|
-
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;
|
|
44
|
+
var _b = _a.alignment, alignment = _b === void 0 ? exports.EListItemAlignment.CENTER : _b, children = _a.children, checkboxes = _a.checkboxes, fallBackImage = _a.fallBackImage, checkboxLegendLabel = _a.checkboxLegendLabel, 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;
|
|
44
45
|
var checkboxContext = checkboxes && checkboxes.length > 0 && ((item === null || item === void 0 ? void 0 : item.name) || (item === null || item === void 0 ? void 0 : item.subtitle))
|
|
45
46
|
? buildCheckboxContext(item)
|
|
46
47
|
: '';
|
|
@@ -64,16 +65,18 @@ var ListItem = function (_a) {
|
|
|
64
65
|
checkboxes && checkboxes.length > 0 && (React__default["default"].createElement(Skeleton__default["default"], { height: 20, width: smallSkeleton ? 150 : 200, count: checkboxes.length, style: { marginTop: '8px' } })))) : (React__default["default"].createElement(React.Fragment, null,
|
|
65
66
|
showPriceStripe && (React__default["default"].createElement(PriceStripe.PriceStripe, { size: PriceTag_types.EPriceSize.SMALL, variant: PriceTag_types.EPriceVariant.PRIO })),
|
|
66
67
|
React__default["default"].createElement(ProductHeader.ProductHeader, { location: ProductHeader.EProductHeader.LIST_ITEM, subtitle: item === null || item === void 0 ? void 0 : item.subtitle, title: item === null || item === void 0 ? void 0 : item.name }),
|
|
67
|
-
checkboxes && checkboxes.length > 0 && (React__default["default"].createElement(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
68
|
+
checkboxes && checkboxes.length > 0 && (React__default["default"].createElement(Fieldset.Fieldset, null,
|
|
69
|
+
checkboxLegendLabel && (React__default["default"].createElement("legend", null, checkboxLegendLabel)),
|
|
70
|
+
React__default["default"].createElement(ListItem_styles.CheckboxContainer, null, checkboxes.map(function (checkbox, index) {
|
|
71
|
+
var ariaLabel = checkboxContext
|
|
72
|
+
? "".concat(checkbox.label, ". ").concat(checkboxContext)
|
|
73
|
+
: checkbox.label;
|
|
74
|
+
return (React__default["default"].createElement(Checkbox.Checkbox, { key: index, checked: checkbox.checked, disabled: checkbox.disabled, label: checkbox.label, name: checkbox.name, "aria-label": ariaLabel, onChange: function (e) {
|
|
75
|
+
if (checkbox.onChange) {
|
|
76
|
+
checkbox.onChange(e.target.checked);
|
|
77
|
+
}
|
|
78
|
+
}, value: checkbox.value, alignItems: "flex-start" }));
|
|
79
|
+
})))))),
|
|
77
80
|
(item === null || item === void 0 ? void 0 : item.secondaryDescription) && item.secondaryDescription)),
|
|
78
81
|
children && (React__default["default"].createElement(ListItem_styles.ListRight, { alignment: alignment }, children))));
|
|
79
82
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -14,7 +14,7 @@ var Checkbox = function (_a) {
|
|
|
14
14
|
React.createElement(HiddenInput, __assign({ checked: checked, disabled: disabled, type: "checkbox" }, props)),
|
|
15
15
|
React.createElement(CheckboxContainer, { attributes: attributes },
|
|
16
16
|
React.createElement(IconContainer, null,
|
|
17
|
-
React.createElement(Icons.CheckMark, { color: iconColor }))),
|
|
17
|
+
React.createElement(Icons.CheckMark, { color: iconColor, "aria-hidden": "true" }))),
|
|
18
18
|
hideLabel ? (React.createElement(ScreenReader, { string: label })) : (React.createElement(BodyText, { color: labelColor }, label))));
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -6,6 +6,7 @@ import { ProductHeader, EProductHeader } from '../ProductHeader/ProductHeader.js
|
|
|
6
6
|
import { PriceStripe } from '../PriceStripe/PriceStripe.js';
|
|
7
7
|
import { ListItemContainer, ListLeft, ListImageContainer, ListImage, ItemInformationContainer, CheckboxContainer, ListRight } from './ListItem.styles.js';
|
|
8
8
|
import { EPriceSize, EPriceVariant } from '../PriceTag/PriceTag.types.js';
|
|
9
|
+
import { Fieldset } from '../Fieldset/Fieldset.js';
|
|
9
10
|
|
|
10
11
|
var EListItemAlignment;
|
|
11
12
|
(function (EListItemAlignment) {
|
|
@@ -31,7 +32,7 @@ function buildCheckboxContext(item) {
|
|
|
31
32
|
return "".concat(productPart).concat(pricePart).concat(quantityPart);
|
|
32
33
|
}
|
|
33
34
|
var ListItem = function (_a) {
|
|
34
|
-
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;
|
|
35
|
+
var _b = _a.alignment, alignment = _b === void 0 ? EListItemAlignment.CENTER : _b, children = _a.children, checkboxes = _a.checkboxes, fallBackImage = _a.fallBackImage, checkboxLegendLabel = _a.checkboxLegendLabel, 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;
|
|
35
36
|
var checkboxContext = checkboxes && checkboxes.length > 0 && ((item === null || item === void 0 ? void 0 : item.name) || (item === null || item === void 0 ? void 0 : item.subtitle))
|
|
36
37
|
? buildCheckboxContext(item)
|
|
37
38
|
: '';
|
|
@@ -55,16 +56,18 @@ var ListItem = function (_a) {
|
|
|
55
56
|
checkboxes && checkboxes.length > 0 && (React.createElement(Skeleton, { height: 20, width: smallSkeleton ? 150 : 200, count: checkboxes.length, style: { marginTop: '8px' } })))) : (React.createElement(Fragment, null,
|
|
56
57
|
showPriceStripe && (React.createElement(PriceStripe, { size: EPriceSize.SMALL, variant: EPriceVariant.PRIO })),
|
|
57
58
|
React.createElement(ProductHeader, { location: EProductHeader.LIST_ITEM, subtitle: item === null || item === void 0 ? void 0 : item.subtitle, title: item === null || item === void 0 ? void 0 : item.name }),
|
|
58
|
-
checkboxes && checkboxes.length > 0 && (React.createElement(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
59
|
+
checkboxes && checkboxes.length > 0 && (React.createElement(Fieldset, null,
|
|
60
|
+
checkboxLegendLabel && (React.createElement("legend", null, checkboxLegendLabel)),
|
|
61
|
+
React.createElement(CheckboxContainer, null, checkboxes.map(function (checkbox, index) {
|
|
62
|
+
var ariaLabel = checkboxContext
|
|
63
|
+
? "".concat(checkbox.label, ". ").concat(checkboxContext)
|
|
64
|
+
: checkbox.label;
|
|
65
|
+
return (React.createElement(Checkbox, { key: index, checked: checkbox.checked, disabled: checkbox.disabled, label: checkbox.label, name: checkbox.name, "aria-label": ariaLabel, onChange: function (e) {
|
|
66
|
+
if (checkbox.onChange) {
|
|
67
|
+
checkbox.onChange(e.target.checked);
|
|
68
|
+
}
|
|
69
|
+
}, value: checkbox.value, alignItems: "flex-start" }));
|
|
70
|
+
})))))),
|
|
68
71
|
(item === null || item === void 0 ? void 0 : item.secondaryDescription) && item.secondaryDescription)),
|
|
69
72
|
children && (React.createElement(ListRight, { alignment: alignment }, children))));
|
|
70
73
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citygross/components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
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": "
|
|
78
|
+
"gitHead": "680db5bc2f749bb2efe1d1dcf34f54b32efa1a04"
|
|
79
79
|
}
|