@uncinc/uncinc-react-kitchen-sink 2.20.6 → 2.20.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.
@@ -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
- alt = props.alt,
23
- title = props.title;
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uncinc/uncinc-react-kitchen-sink",
3
- "version": "2.20.6",
3
+ "version": "2.20.7",
4
4
  "description": "Default React components that are easily extended.",
5
5
  "author": "uncinc",
6
6
  "license": "MIT",