@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
|
@@ -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 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 ? '
|
|
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 ? 'not-allowed' : '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
|
|
@@ -27,7 +27,7 @@ var BaseRadioListItemContainer = styled.div(templateObject_1 || (templateObject_
|
|
|
27
27
|
"background: ".concat((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lighter));
|
|
28
28
|
});
|
|
29
29
|
var BaseRadioItemLeftWrapper = styled.div(templateObject_2 || (templateObject_2 = __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); });
|
|
30
|
-
var StyledH3 = styled(H3).attrs({ as: 'span' })(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n cursor:
|
|
30
|
+
var StyledH3 = styled(H3).attrs({ as: 'span' })(templateObject_3 || (templateObject_3 = __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) {
|
|
31
31
|
var _a;
|
|
32
32
|
return props.isDisabled && "\n color: ".concat((_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.disabledDarkGray, ";\n text-decoration: line-through;\n ");
|
|
33
33
|
});
|
|
@@ -471,11 +471,11 @@ var makeCateringPortionsString = function (variant, cartItem, unit) {
|
|
|
471
471
|
return qString;
|
|
472
472
|
};
|
|
473
473
|
|
|
474
|
+
var focusableSelectors = 'button:not([disabled]), [href]:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
474
475
|
var focusTrap = function (_a) {
|
|
475
476
|
var _b;
|
|
476
477
|
var exitFunction = _a.exitFunction, ref = _a.ref;
|
|
477
|
-
var
|
|
478
|
-
var focusableElements = (_b = ref.current) === null || _b === void 0 ? void 0 : _b.querySelectorAll(elements);
|
|
478
|
+
var focusableElements = (_b = ref.current) === null || _b === void 0 ? void 0 : _b.querySelectorAll(focusableSelectors);
|
|
479
479
|
if (focusableElements &&
|
|
480
480
|
focusableElements.length > 0 &&
|
|
481
481
|
focusableElements[0] instanceof HTMLElement) {
|
|
@@ -484,7 +484,7 @@ var focusTrap = function (_a) {
|
|
|
484
484
|
var handleKeyDown = function (e) {
|
|
485
485
|
if (!ref.current)
|
|
486
486
|
return;
|
|
487
|
-
var focusable = Array.from(ref.current.querySelectorAll(
|
|
487
|
+
var focusable = Array.from(ref.current.querySelectorAll(focusableSelectors));
|
|
488
488
|
if (focusable.length === 0)
|
|
489
489
|
return;
|
|
490
490
|
var firstElement = focusable[0];
|
|
@@ -510,6 +510,39 @@ var focusTrap = function (_a) {
|
|
|
510
510
|
};
|
|
511
511
|
};
|
|
512
512
|
|
|
513
|
+
var toggleInert = function (_a) {
|
|
514
|
+
var elements = _a.elements, isInert = _a.isInert;
|
|
515
|
+
var snapshots = elements
|
|
516
|
+
.filter(function (element) { return Boolean(element); })
|
|
517
|
+
.map(function (element) { return ({
|
|
518
|
+
element: element,
|
|
519
|
+
hadInert: element.hasAttribute('inert')
|
|
520
|
+
}); });
|
|
521
|
+
snapshots.forEach(function (_a) {
|
|
522
|
+
var element = _a.element, hadInert = _a.hadInert;
|
|
523
|
+
if (isInert) {
|
|
524
|
+
if (!hadInert) {
|
|
525
|
+
element.setAttribute('inert', '');
|
|
526
|
+
}
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
if (!hadInert) {
|
|
530
|
+
element.removeAttribute('inert');
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
return function () {
|
|
534
|
+
snapshots.forEach(function (_a) {
|
|
535
|
+
var element = _a.element, hadInert = _a.hadInert;
|
|
536
|
+
if (hadInert) {
|
|
537
|
+
element.setAttribute('inert', '');
|
|
538
|
+
}
|
|
539
|
+
else {
|
|
540
|
+
element.removeAttribute('inert');
|
|
541
|
+
}
|
|
542
|
+
});
|
|
543
|
+
};
|
|
544
|
+
};
|
|
545
|
+
|
|
513
546
|
var formatLeadingZero = function (day) { return day.replace(/^0+/, ''); };
|
|
514
547
|
|
|
515
548
|
var formatPostalCode = function (postalCode, spaceIndex) {
|
|
@@ -18912,6 +18945,7 @@ build.capitalizedAllWords = capitalizedAllWords;
|
|
|
18912
18945
|
build.comparisonTypes = comparisonTypes;
|
|
18913
18946
|
build.emailRegex = emailRegex;
|
|
18914
18947
|
build.focusTrap = focusTrap;
|
|
18948
|
+
build.focusableSelectors = focusableSelectors;
|
|
18915
18949
|
build.formatDateToLocale = formatDateToLocale;
|
|
18916
18950
|
build.formatLeadingZero = formatLeadingZero;
|
|
18917
18951
|
build.formatPostalCode = formatPostalCode;
|
|
@@ -18925,6 +18959,7 @@ build.makeCateringPortionsString = makeCateringPortionsString;
|
|
|
18925
18959
|
build.moment = moment;
|
|
18926
18960
|
build.nameRegex = nameRegex;
|
|
18927
18961
|
build.phoneRegex = phoneRegex;
|
|
18962
|
+
build.toggleInert = toggleInert;
|
|
18928
18963
|
build.useDetectDevice = useDetectDevice;
|
|
18929
18964
|
build.useFixedModalScroll = useFixedModalScroll;
|
|
18930
18965
|
build.useOutsideClick = useOutsideClick;
|