@citygross/components 0.15.5 → 0.15.7
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/cjs/components/src/components/RadioListItem/RadioListItem.styles.js +2 -2
- package/build/cjs/utils/build/index.js +38 -3
- package/build/cjs/utils/build/index.js.map +1 -1
- package/build/es/components/src/components/RadioListItem/RadioListItem.styles.js +2 -2
- package/build/es/utils/build/index.js +38 -3
- package/build/es/utils/build/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -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 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 ? '
|
|
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 ? 'not-allowed' : '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
|
|
@@ -35,7 +35,7 @@ var BaseRadioListItemContainer = styled__default["default"].div(templateObject_1
|
|
|
35
35
|
"background: ".concat((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lighter));
|
|
36
36
|
});
|
|
37
37
|
var BaseRadioItemLeftWrapper = styled__default["default"].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n display: flex;\n flex: 5;\n align-items: flex-start;\n ", ";\n"], ["\n display: flex;\n flex: 5;\n align-items: flex-start;\n ", ";\n"])), function (props) { return props.flexGrow && "flex-grow: ".concat(props.flexGrow); });
|
|
38
|
-
var StyledH3 = styled__default["default"](typography.H3).attrs({ as: 'span' })(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n cursor:
|
|
38
|
+
var StyledH3 = styled__default["default"](typography.H3).attrs({ as: 'span' })(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n cursor: ", ";\n white-space: nowrap;\n display: block;\n line-height: ", "px;\n ", ";\n"], ["\n cursor: ", ";\n white-space: nowrap;\n display: block;\n line-height: ", "px;\n ", ";\n"])), function (props) { return (props.isDisabled ? 'not-allowed' : 'pointer'); }, function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.lineHeight.m1; }, function (props) {
|
|
39
39
|
var _a;
|
|
40
40
|
return props.isDisabled && "\n color: ".concat((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.disabledDarkGray, ";\n text-decoration: line-through;\n ");
|
|
41
41
|
});
|
|
@@ -478,11 +478,11 @@ var makeCateringPortionsString = function (variant, cartItem, unit) {
|
|
|
478
478
|
return qString;
|
|
479
479
|
};
|
|
480
480
|
|
|
481
|
+
var focusableSelectors = 'button:not([disabled]), [href]:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
481
482
|
var focusTrap = function (_a) {
|
|
482
483
|
var _b;
|
|
483
484
|
var exitFunction = _a.exitFunction, ref = _a.ref;
|
|
484
|
-
var
|
|
485
|
-
var focusableElements = (_b = ref.current) === null || _b === void 0 ? void 0 : _b.querySelectorAll(elements);
|
|
485
|
+
var focusableElements = (_b = ref.current) === null || _b === void 0 ? void 0 : _b.querySelectorAll(focusableSelectors);
|
|
486
486
|
if (focusableElements &&
|
|
487
487
|
focusableElements.length > 0 &&
|
|
488
488
|
focusableElements[0] instanceof HTMLElement) {
|
|
@@ -491,7 +491,7 @@ var focusTrap = function (_a) {
|
|
|
491
491
|
var handleKeyDown = function (e) {
|
|
492
492
|
if (!ref.current)
|
|
493
493
|
return;
|
|
494
|
-
var focusable = Array.from(ref.current.querySelectorAll(
|
|
494
|
+
var focusable = Array.from(ref.current.querySelectorAll(focusableSelectors));
|
|
495
495
|
if (focusable.length === 0)
|
|
496
496
|
return;
|
|
497
497
|
var firstElement = focusable[0];
|
|
@@ -517,6 +517,39 @@ var focusTrap = function (_a) {
|
|
|
517
517
|
};
|
|
518
518
|
};
|
|
519
519
|
|
|
520
|
+
var toggleInert = function (_a) {
|
|
521
|
+
var elements = _a.elements, isInert = _a.isInert;
|
|
522
|
+
var snapshots = elements
|
|
523
|
+
.filter(function (element) { return Boolean(element); })
|
|
524
|
+
.map(function (element) { return ({
|
|
525
|
+
element: element,
|
|
526
|
+
hadInert: element.hasAttribute('inert')
|
|
527
|
+
}); });
|
|
528
|
+
snapshots.forEach(function (_a) {
|
|
529
|
+
var element = _a.element, hadInert = _a.hadInert;
|
|
530
|
+
if (isInert) {
|
|
531
|
+
if (!hadInert) {
|
|
532
|
+
element.setAttribute('inert', '');
|
|
533
|
+
}
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
if (!hadInert) {
|
|
537
|
+
element.removeAttribute('inert');
|
|
538
|
+
}
|
|
539
|
+
});
|
|
540
|
+
return function () {
|
|
541
|
+
snapshots.forEach(function (_a) {
|
|
542
|
+
var element = _a.element, hadInert = _a.hadInert;
|
|
543
|
+
if (hadInert) {
|
|
544
|
+
element.setAttribute('inert', '');
|
|
545
|
+
}
|
|
546
|
+
else {
|
|
547
|
+
element.removeAttribute('inert');
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
};
|
|
551
|
+
};
|
|
552
|
+
|
|
520
553
|
var formatLeadingZero = function (day) { return day.replace(/^0+/, ''); };
|
|
521
554
|
|
|
522
555
|
var formatPostalCode = function (postalCode, spaceIndex) {
|
|
@@ -18919,6 +18952,7 @@ index.__exports.capitalizedAllWords = capitalizedAllWords;
|
|
|
18919
18952
|
index.__exports.comparisonTypes = comparisonTypes;
|
|
18920
18953
|
index.__exports.emailRegex = emailRegex;
|
|
18921
18954
|
index.__exports.focusTrap = focusTrap;
|
|
18955
|
+
index.__exports.focusableSelectors = focusableSelectors;
|
|
18922
18956
|
index.__exports.formatDateToLocale = formatDateToLocale;
|
|
18923
18957
|
index.__exports.formatLeadingZero = formatLeadingZero;
|
|
18924
18958
|
index.__exports.formatPostalCode = formatPostalCode;
|
|
@@ -18932,6 +18966,7 @@ index.__exports.makeCateringPortionsString = makeCateringPortionsString;
|
|
|
18932
18966
|
index.__exports.moment = moment;
|
|
18933
18967
|
index.__exports.nameRegex = nameRegex;
|
|
18934
18968
|
index.__exports.phoneRegex = phoneRegex;
|
|
18969
|
+
index.__exports.toggleInert = toggleInert;
|
|
18935
18970
|
index.__exports.useDetectDevice = useDetectDevice;
|
|
18936
18971
|
index.__exports.useFixedModalScroll = useFixedModalScroll;
|
|
18937
18972
|
index.__exports.useOutsideClick = useOutsideClick;
|