@uncinc/uncinc-react-kitchen-sink 2.20.6 → 2.20.8
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/dist/components/Form/Checkbox/index.js +1 -1
- package/dist/components/Form/GenericFormElement/index.js +1 -1
- package/dist/components/Form/TextField/index.js +1 -1
- package/dist/components/Form/Textarea/index.js +1 -1
- package/dist/components/GoogleConsentCookieBanner/index.js +5 -3
- package/dist/components/Image/AdaptivePicture/index.d.ts +1 -0
- package/dist/components/Image/AdaptivePicture/index.js +4 -2
- package/dist/components/Image/Picture/index.js +5 -4
- package/package.json +1 -1
|
@@ -81,7 +81,7 @@ export var Checkbox = function Checkbox(props) {
|
|
|
81
81
|
disabled: disabled,
|
|
82
82
|
className: className,
|
|
83
83
|
required: required,
|
|
84
|
-
"aria-describedby": "".concat(errorId, " ").concat(descriptionId),
|
|
84
|
+
"aria-describedby": "".concat(error ? errorId : '', " ").concat(description ? descriptionId : '').trim() || undefined,
|
|
85
85
|
"aria-invalid": Boolean(error)
|
|
86
86
|
})), typeof title === 'string' ? ReactHtmlParser(title) : title);
|
|
87
87
|
}));
|
|
@@ -37,7 +37,7 @@ var GenericFormElement = function GenericFormElement(props) {
|
|
|
37
37
|
}), /*#__PURE__*/React.createElement("div", {
|
|
38
38
|
className: "FormElement__inner ".concat(className, "__inner")
|
|
39
39
|
}, includeFieldSet && /*#__PURE__*/React.createElement("fieldset", {
|
|
40
|
-
"aria-describedby": "".concat(errorId, " ").concat(descriptionId),
|
|
40
|
+
"aria-describedby": "".concat(error && touched ? errorId : '', " ").concat(description ? descriptionId : '').trim() || undefined,
|
|
41
41
|
"aria-invalid": Boolean(error && touched)
|
|
42
42
|
}, title && /*#__PURE__*/React.createElement("legend", null, title, !required && displayRequiredIndicator === 'optional' && /*#__PURE__*/React.createElement("span", {
|
|
43
43
|
className: "FormElement__optional ".concat(className, "__optional")
|
|
@@ -97,7 +97,7 @@ export var TextField = function TextField(props) {
|
|
|
97
97
|
name: fieldName,
|
|
98
98
|
validate: handleValidation,
|
|
99
99
|
onKeyUp: handleChange,
|
|
100
|
-
"aria-describedby": "".concat(errorId, " ").concat(descriptionId),
|
|
100
|
+
"aria-describedby": "".concat(error && isTouched ? errorId : '', " ").concat(description ? descriptionId : '').trim() || undefined,
|
|
101
101
|
"aria-invalid": Boolean(error && isTouched),
|
|
102
102
|
autoComplete: autoCompleteField ? fieldName : undefined,
|
|
103
103
|
type: revealPassword ? 'text' : inputType,
|
|
@@ -72,7 +72,7 @@ var Textarea = function Textarea(props) {
|
|
|
72
72
|
onChange(event);
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
|
-
"aria-describedby": "".concat(errorId, " ").concat(descriptionId),
|
|
75
|
+
"aria-describedby": "".concat(error && isTouched ? errorId : '', " ").concat(description ? descriptionId : '').trim() || undefined,
|
|
76
76
|
"aria-invalid": Boolean(error && isTouched)
|
|
77
77
|
})));
|
|
78
78
|
};
|
|
@@ -277,7 +277,8 @@ var CookieCompliancePopup = function CookieCompliancePopup(props) {
|
|
|
277
277
|
isOpen: !isAnswered,
|
|
278
278
|
disableClosers: true
|
|
279
279
|
}),
|
|
280
|
-
dialogHelpersProps = _useDialogHelpers.dialogHelpersProps
|
|
280
|
+
dialogHelpersProps = _useDialogHelpers.dialogHelpersProps,
|
|
281
|
+
labelId = _useDialogHelpers.labelId;
|
|
281
282
|
|
|
282
283
|
// Enable only Escape key to close, not click outside
|
|
283
284
|
useEscape({
|
|
@@ -298,7 +299,7 @@ var CookieCompliancePopup = function CookieCompliancePopup(props) {
|
|
|
298
299
|
var renderChoices = function renderChoices() {
|
|
299
300
|
return /*#__PURE__*/React.createElement("fieldset", {
|
|
300
301
|
className: "GoogleConsentCookieBanner__choices",
|
|
301
|
-
"aria-labelledby":
|
|
302
|
+
"aria-labelledby": labelId
|
|
302
303
|
}, cookieLevels.map(function (choice) {
|
|
303
304
|
return /*#__PURE__*/React.createElement("div", {
|
|
304
305
|
className: "GoogleConsentCookieBanner__category",
|
|
@@ -333,6 +334,7 @@ var CookieCompliancePopup = function CookieCompliancePopup(props) {
|
|
|
333
334
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
334
335
|
fluid: fluid
|
|
335
336
|
}, /*#__PURE__*/React.createElement("div", _extends({}, dialogHelpersProps, {
|
|
337
|
+
"aria-labelledby": labelId,
|
|
336
338
|
ref: wrapperElement,
|
|
337
339
|
className: "GoogleConsentCookieBanner__content ".concat(manualChoiceVisible ? 'GoogleConsentCookieBanner__content--full-height' : '')
|
|
338
340
|
}), /*#__PURE__*/React.createElement("div", {
|
|
@@ -340,7 +342,7 @@ var CookieCompliancePopup = function CookieCompliancePopup(props) {
|
|
|
340
342
|
}, /*#__PURE__*/React.createElement("div", {
|
|
341
343
|
className: "col-12 GoogleConsentCookieBanner__content_header"
|
|
342
344
|
}, title && /*#__PURE__*/React.createElement("h3", {
|
|
343
|
-
id:
|
|
345
|
+
id: labelId
|
|
344
346
|
}, title), /*#__PURE__*/React.createElement("button", {
|
|
345
347
|
type: "button",
|
|
346
348
|
className: "GoogleConsentCookieBanner__close-button",
|
|
@@ -6,6 +6,7 @@ interface Props extends Omit<React.ImgHTMLAttributes<HTMLImageElement>, 'src'> {
|
|
|
6
6
|
objectFit?: 'fill' | 'contain' | 'cover' | 'none' | 'scale-down';
|
|
7
7
|
aspectRatio?: number | string;
|
|
8
8
|
resizeDelay?: number;
|
|
9
|
+
role?: 'presentation' | 'none';
|
|
9
10
|
}
|
|
10
11
|
declare const AdaptivePicture: React.FC<Props>;
|
|
11
12
|
export default AdaptivePicture;
|
|
@@ -20,7 +20,8 @@ var AdaptivePicture = function AdaptivePicture(_ref) {
|
|
|
20
20
|
_ref$aspectRatio = _ref.aspectRatio,
|
|
21
21
|
aspectRatio = _ref$aspectRatio === void 0 ? 1 : _ref$aspectRatio,
|
|
22
22
|
_ref$resizeDelay = _ref.resizeDelay,
|
|
23
|
-
resizeDelay = _ref$resizeDelay === void 0 ? 100 : _ref$resizeDelay
|
|
23
|
+
resizeDelay = _ref$resizeDelay === void 0 ? 100 : _ref$resizeDelay,
|
|
24
|
+
role = _ref.role;
|
|
24
25
|
var sourcesAsArray = Array.isArray(src) ? src : [src];
|
|
25
26
|
var validatedSources = sourcesAsArray.filter(isValidImage);
|
|
26
27
|
var fallbackImage = validatedSources[0];
|
|
@@ -129,7 +130,8 @@ var AdaptivePicture = function AdaptivePicture(_ref) {
|
|
|
129
130
|
},
|
|
130
131
|
src: loadedUrl,
|
|
131
132
|
ref: imageRef,
|
|
132
|
-
alt: alt
|
|
133
|
+
alt: role === 'presentation' ? '' : alt,
|
|
134
|
+
role: role
|
|
133
135
|
});
|
|
134
136
|
};
|
|
135
137
|
export default AdaptivePicture;
|
|
@@ -4,7 +4,6 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import Immutable from 'immutable';
|
|
7
|
-
import path from 'path';
|
|
8
7
|
import PropTypes from 'prop-types';
|
|
9
8
|
import mimeTypes from './data/ext-to-mime-types.json';
|
|
10
9
|
import './style.scss';
|
|
@@ -19,15 +18,17 @@ var Picture = function Picture(_ref) {
|
|
|
19
18
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
19
|
var width = props.width,
|
|
21
20
|
height = props.height,
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
title = props.title,
|
|
22
|
+
role = props.role;
|
|
23
|
+
var alt = role === 'presentation' ? '' : props.alt;
|
|
24
24
|
var attrs = {
|
|
25
25
|
className: className,
|
|
26
26
|
typeof: 'foaf:Image',
|
|
27
27
|
width: width,
|
|
28
28
|
height: height,
|
|
29
29
|
alt: alt,
|
|
30
|
-
title: title
|
|
30
|
+
title: title,
|
|
31
|
+
role: role
|
|
31
32
|
};
|
|
32
33
|
var getMimeType = function getMimeType(url) {
|
|
33
34
|
var extension = getImageExtension(url);
|