@automattic/jetpack-components 0.48.3 → 0.49.0

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/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  ### This is a list detailing changes for the Jetpack RNA Components package releases.
4
4
 
5
+ ## [0.49.0] - 2024-02-27
6
+ ### Added
7
+ - Components: add AI icon [#35965]
8
+
9
+ ## [0.48.4] - 2024-02-22
10
+ ### Added
11
+ - Adding accesible text for external links on connection page and footer [#35733]
12
+
13
+ ### Changed
14
+ - Updated package dependencies. [#35793]
15
+
16
+ ### Fixed
17
+ - Jetpack Logo: prevent VoiceOver on Safari from reading SVG content [#35752]
18
+
5
19
  ## [0.48.3] - 2024-02-19
6
20
  ### Added
7
21
  - Added support for annotations in graph [#34978]
@@ -945,6 +959,8 @@
945
959
  ### Changed
946
960
  - Update node version requirement to 14.16.1
947
961
 
962
+ [0.49.0]: https://github.com/Automattic/jetpack-components/compare/0.48.4...0.49.0
963
+ [0.48.4]: https://github.com/Automattic/jetpack-components/compare/0.48.3...0.48.4
948
964
  [0.48.3]: https://github.com/Automattic/jetpack-components/compare/0.48.2...0.48.3
949
965
  [0.48.2]: https://github.com/Automattic/jetpack-components/compare/0.48.1...0.48.2
950
966
  [0.48.1]: https://github.com/Automattic/jetpack-components/compare/0.48.0...0.48.1
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { Button as WPButton, Spinner } from '@wordpress/components';
4
+ import { Button as WPButton, Spinner, VisuallyHidden } from '@wordpress/components';
5
+ import { __ } from '@wordpress/i18n';
5
6
  import { Icon, external } from '@wordpress/icons';
6
7
  import classNames from 'classnames';
7
8
  import React, { forwardRef } from 'react';
@@ -49,7 +50,15 @@ const Button = forwardRef< HTMLInputElement, ButtonProps >( ( props, ref ) => {
49
50
 
50
51
  const externalIconSize = size === 'normal' ? 20 : 16;
51
52
  const externalIcon = isExternalLink && (
52
- <Icon size={ externalIconSize } icon={ external } className={ styles[ 'external-icon' ] } />
53
+ <>
54
+ <Icon size={ externalIconSize } icon={ external } className={ styles[ 'external-icon' ] } />
55
+ <VisuallyHidden as="span">
56
+ {
57
+ /* translators: accessibility text */
58
+ __( '(opens in a new tab)', 'jetpack' )
59
+ }
60
+ </VisuallyHidden>
61
+ </>
53
62
  );
54
63
  const externalTarget = isExternalLink ? '_blank' : undefined;
55
64
 
@@ -16,6 +16,7 @@ Available slugs are:
16
16
  * star
17
17
  * videopress
18
18
  * jetpack
19
+ * ai
19
20
 
20
21
  ```es6
21
22
  import {
@@ -43,6 +44,7 @@ return (
43
44
  * VideopressIcon
44
45
  * JetpackIcon
45
46
  * ShareIcon
47
+ * AiIcon
46
48
 
47
49
  ```es6
48
50
  import {
@@ -57,6 +59,7 @@ import {
57
59
  VideoPressIcon,
58
60
  JetpackIcon,
59
61
  ShareIcon,
62
+ AiIcon,
60
63
  } from '@automattic/jetpack-components';
61
64
 
62
65
  return (
@@ -72,6 +75,7 @@ return (
72
75
  <VideoPressIcon />
73
76
  <JetpackIcon />
74
77
  <ShareIcon />
78
+ <AiIcon />
75
79
  </div>
76
80
  )
77
81
  ```
@@ -212,6 +212,28 @@ export const ShareIcon: React.FC< BaseIconProps > = ( { size = 16, className, co
212
212
  );
213
213
  };
214
214
 
215
+ export const AiIcon: React.FC< BaseIconProps > = ( {
216
+ size = 24,
217
+ color = '#069e08', // JP green
218
+ } ) => {
219
+ return (
220
+ <IconWrapper color={ color } size={ size } viewBox={ '0 0 32 32' }>
221
+ <Path
222
+ className="spark-first"
223
+ d="M9.33301 5.33325L10.4644 8.20188L13.333 9.33325L10.4644 10.4646L9.33301 13.3333L8.20164 10.4646L5.33301 9.33325L8.20164 8.20188L9.33301 5.33325Z"
224
+ />
225
+ <Path
226
+ className="spark-second"
227
+ d="M21.3333 5.33333L22.8418 9.15817L26.6667 10.6667L22.8418 12.1752L21.3333 16L19.8248 12.1752L16 10.6667L19.8248 9.15817L21.3333 5.33333Z"
228
+ />
229
+ <Path
230
+ className="spark-third"
231
+ d="M14.6667 13.3333L16.5523 18.1144L21.3333 20L16.5523 21.8856L14.6667 26.6667L12.781 21.8856L8 20L12.781 18.1144L14.6667 13.3333Z"
232
+ />
233
+ </IconWrapper>
234
+ );
235
+ };
236
+
215
237
  const jetpackIcons = {
216
238
  'anti-spam': AntiSpamIcon,
217
239
  backup: BackupIcon,
@@ -226,6 +248,7 @@ const jetpackIcons = {
226
248
  videopress: VideopressIcon,
227
249
  jetpack: JetpackIcon,
228
250
  share: ShareIcon,
251
+ ai: AiIcon,
229
252
  };
230
253
 
231
254
  const iconsMap = {
@@ -16,6 +16,18 @@ const JetpackIcon: React.FC = () => (
16
16
  <JetpackLogo logoColor="#000" showText={ false } height={ 16 } aria-hidden="true" />
17
17
  );
18
18
 
19
+ const ExternalIcon: React.FC = () => (
20
+ <>
21
+ <Icon icon={ external } size={ 16 } />
22
+ <span className="jp-dashboard-footer__accessible-external-link">
23
+ {
24
+ /* translators: accessibility text */
25
+ __( '(opens in a new tab)', 'jetpack' )
26
+ }
27
+ </span>
28
+ </>
29
+ );
30
+
19
31
  /**
20
32
  * JetpackFooter component displays a tiny Jetpack logo with the product name on the left and the Automattic Airline "by line" on the right.
21
33
  *
@@ -139,7 +151,7 @@ const JetpackFooter: React.FC< JetpackFooterProps > = ( {
139
151
  tabIndex={ isButton ? 0 : undefined }
140
152
  >
141
153
  { item.label }
142
- { isExternalLink && <Icon icon={ external } size={ 16 } /> }
154
+ { isExternalLink && <ExternalIcon /> }
143
155
  </a>
144
156
  </li>
145
157
  );
@@ -71,6 +71,19 @@
71
71
  }
72
72
  }
73
73
 
74
+ .jp-dashboard-footer__accessible-external-link {
75
+ border: 0px;
76
+ clip: rect(1px, 1px, 1px, 1px);
77
+ clip-path: inset(50%);
78
+ height: 1px;
79
+ margin: -1px;
80
+ overflow: hidden;
81
+ padding: 0px;
82
+ position: absolute;
83
+ width: 1px;
84
+ overflow-wrap: normal;
85
+ }
86
+
74
87
  .jp-dashboard-footer__jp-item {
75
88
  padding-inline-end: 1rem;
76
89
 
@@ -22,8 +22,10 @@ const JetpackLogo: React.FC< JetpackLogoProps > = ( {
22
22
  aria-labelledby="jetpack-logo-title"
23
23
  height={ height }
24
24
  { ...otherProps }
25
+ // role="img" is required to prevent VoiceOver on Safari reading the content of the SVG
26
+ role="img"
25
27
  >
26
- <desc id="jetpack-logo-title">{ __( 'Jetpack Logo', 'jetpack' ) }</desc>
28
+ <title id="jetpack-logo-title">{ __( 'Jetpack Logo', 'jetpack' ) }</title>
27
29
  <path
28
30
  fill={ logoColor }
29
31
  d="M16,0C7.2,0,0,7.2,0,16s7.2,16,16,16s16-7.2,16-16S24.8,0,16,0z M15,19H7l8-16V19z M17,29V13h8L17,29z"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/jetpack-components",
3
- "version": "0.48.3",
3
+ "version": "0.49.0",
4
4
  "description": "Jetpack Components Package",
5
5
  "author": "Automattic",
6
6
  "license": "GPL-2.0-or-later",
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@automattic/format-currency": "1.0.1",
18
- "@automattic/jetpack-boost-score-api": "^0.1.23",
18
+ "@automattic/jetpack-boost-score-api": "^0.1.24",
19
19
  "@babel/runtime": "^7",
20
20
  "@wordpress/browserslist-config": "5.34.0",
21
21
  "@wordpress/components": "26.0.0",
@@ -38,9 +38,9 @@
38
38
  "@babel/core": "7.23.5",
39
39
  "@babel/preset-react": "7.23.3",
40
40
  "@jest/globals": "29.4.3",
41
- "@storybook/addon-actions": "7.6.5",
42
- "@storybook/blocks": "7.6.5",
43
- "@storybook/react": "7.6.5",
41
+ "@storybook/addon-actions": "7.6.17",
42
+ "@storybook/blocks": "7.6.17",
43
+ "@storybook/react": "7.6.17",
44
44
  "@testing-library/dom": "9.3.4",
45
45
  "@testing-library/react": "14.2.0",
46
46
  "@testing-library/user-event": "14.5.2",