@micromag/screen-urbania-recommendation 0.3.496 → 0.3.497

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.
Files changed (3) hide show
  1. package/es/index.js +11 -1
  2. package/lib/index.js +10 -0
  3. package/package.json +14 -14
package/es/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { FormattedMessage, defineMessage } from 'react-intl';
1
+ import { useIntl, FormattedMessage, defineMessage } from 'react-intl';
2
2
  import _objectSpread from '@babel/runtime/helpers/objectSpread2';
3
3
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
4
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
@@ -75,6 +75,7 @@ var UrbaniaRecommendation = function UrbaniaRecommendation(_ref) {
75
75
  current = _ref.current,
76
76
  active = _ref.active,
77
77
  className = _ref.className;
78
+ var intl = useIntl();
78
79
  var trackScreenEvent = useTrackScreenEvent();
79
80
  var _useScreenSize = useScreenSize(),
80
81
  width = _useScreenSize.width,
@@ -390,6 +391,15 @@ var UrbaniaRecommendation = function UrbaniaRecommendation(_ref) {
390
391
  className: classNames([styles.visualButton, _defineProperty({}, styles.transitioning, visualModalTransitioning)]),
391
392
  onClick: onClickVisual,
392
393
  disabled: isPreview || backgroundAnimationStarted || visualModalOpened,
394
+ focusable: current && !isPreview && !visualModalOpened,
395
+ "aria-label": intl.formatMessage({
396
+ id: "XHO5Ua",
397
+ defaultMessage: [{
398
+ "type": 0,
399
+ "value": "Expand visual"
400
+ }]
401
+ }),
402
+ "aria-pressed": visualModalOpened,
393
403
  style: {
394
404
  transform: visualModalTransitioning ? "scale(".concat(width / textContainerWidth, ")") : null
395
405
  }
package/lib/index.js CHANGED
@@ -79,6 +79,7 @@ var UrbaniaRecommendation = function UrbaniaRecommendation(_ref) {
79
79
  current = _ref.current,
80
80
  active = _ref.active,
81
81
  className = _ref.className;
82
+ var intl = reactIntl.useIntl();
82
83
  var trackScreenEvent = hooks.useTrackScreenEvent();
83
84
  var _useScreenSize = contexts.useScreenSize(),
84
85
  width = _useScreenSize.width,
@@ -394,6 +395,15 @@ var UrbaniaRecommendation = function UrbaniaRecommendation(_ref) {
394
395
  className: classNames([styles.visualButton, _defineProperty({}, styles.transitioning, visualModalTransitioning)]),
395
396
  onClick: onClickVisual,
396
397
  disabled: isPreview || backgroundAnimationStarted || visualModalOpened,
398
+ focusable: current && !isPreview && !visualModalOpened,
399
+ "aria-label": intl.formatMessage({
400
+ id: "XHO5Ua",
401
+ defaultMessage: [{
402
+ "type": 0,
403
+ "value": "Expand visual"
404
+ }]
405
+ }),
406
+ "aria-pressed": visualModalOpened,
397
407
  style: {
398
408
  transform: visualModalTransitioning ? "scale(".concat(width / textContainerWidth, ")") : null
399
409
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-urbania-recommendation",
3
- "version": "0.3.496",
3
+ "version": "0.3.497",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -61,18 +61,18 @@
61
61
  },
62
62
  "dependencies": {
63
63
  "@babel/runtime": "^7.13.10",
64
- "@micromag/core": "^0.3.491",
65
- "@micromag/element-background": "^0.3.491",
66
- "@micromag/element-button": "^0.3.491",
67
- "@micromag/element-container": "^0.3.491",
68
- "@micromag/element-footer": "^0.3.496",
69
- "@micromag/element-header": "^0.3.496",
70
- "@micromag/element-heading": "^0.3.491",
71
- "@micromag/element-layout": "^0.3.491",
72
- "@micromag/element-scroll": "^0.3.491",
73
- "@micromag/element-text": "^0.3.491",
74
- "@micromag/element-visual": "^0.3.491",
75
- "@micromag/transforms": "^0.3.491",
64
+ "@micromag/core": "^0.3.497",
65
+ "@micromag/element-background": "^0.3.497",
66
+ "@micromag/element-button": "^0.3.497",
67
+ "@micromag/element-container": "^0.3.497",
68
+ "@micromag/element-footer": "^0.3.497",
69
+ "@micromag/element-header": "^0.3.497",
70
+ "@micromag/element-heading": "^0.3.497",
71
+ "@micromag/element-layout": "^0.3.497",
72
+ "@micromag/element-scroll": "^0.3.497",
73
+ "@micromag/element-text": "^0.3.497",
74
+ "@micromag/element-visual": "^0.3.497",
75
+ "@micromag/transforms": "^0.3.497",
76
76
  "classnames": "^2.2.6",
77
77
  "lodash": "^4.17.21",
78
78
  "prop-types": "^15.7.2",
@@ -83,5 +83,5 @@
83
83
  "access": "public",
84
84
  "registry": "https://registry.npmjs.org/"
85
85
  },
86
- "gitHead": "f13d557c21ad604187a57413ef65cfc96430042b"
86
+ "gitHead": "94e795f19f551f20411fb12fada0906c5cdb0d4b"
87
87
  }