@automattic/jetpack-components 1.3.13 → 1.4.1

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,17 @@
2
2
 
3
3
  ### This is a list detailing changes for the Jetpack RNA Components package releases.
4
4
 
5
+ ## [1.4.1] - 2025-12-11
6
+ ### Changed
7
+ - Improve scrolling for navigator modal sidebar and content. [#46252]
8
+
9
+ ## [1.4.0] - 2025-12-08
10
+ ### Added
11
+ - Jetpack Logo: Add support for customized title in shared component. [#46162]
12
+
13
+ ### Changed
14
+ - Make `NavigatorModal` responsive using container queries. [#46102]
15
+
5
16
  ## [1.3.13] - 2025-12-01
6
17
  ### Added
7
18
  - Add NavigatorModal component. [#46101]
@@ -1576,6 +1587,8 @@
1576
1587
  ### Changed
1577
1588
  - Update node version requirement to 14.16.1
1578
1589
 
1590
+ [1.4.1]: https://github.com/Automattic/jetpack-components/compare/1.4.0...1.4.1
1591
+ [1.4.0]: https://github.com/Automattic/jetpack-components/compare/1.3.13...1.4.0
1579
1592
  [1.3.13]: https://github.com/Automattic/jetpack-components/compare/1.3.12...1.3.13
1580
1593
  [1.3.12]: https://github.com/Automattic/jetpack-components/compare/1.3.11...1.3.12
1581
1594
  [1.3.11]: https://github.com/Automattic/jetpack-components/compare/1.3.10...1.3.11
@@ -1,10 +1,11 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { __ } from '@wordpress/i18n';
3
3
  import clsx from 'clsx';
4
- const JetpackLogo = ({ logoColor = '#069e08', showText = true, className, height = 32, ...otherProps }) => {
4
+ const JetpackLogo = ({ logoColor = '#069e08', showText = true, className, height = 32, title, ...otherProps }) => {
5
5
  const viewBox = showText ? '0 0 118 32' : '0 0 32 32';
6
+ const logoTitle = title ?? __('Jetpack Logo', 'jetpack-components');
6
7
  return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", x: "0px", y: "0px", viewBox: viewBox, className: clsx('jetpack-logo', className), "aria-labelledby": "jetpack-logo-title", height: height, ...otherProps,
7
8
  // role="img" is required to prevent VoiceOver on Safari reading the content of the SVG
8
- role: "img", children: [_jsx("title", { id: "jetpack-logo-title", children: __('Jetpack Logo', 'jetpack-components') }), _jsx("path", { fill: logoColor, 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" }), showText && (_jsxs(_Fragment, { children: [_jsx("path", { d: "M41.3,26.6c-0.5-0.7-0.9-1.4-1.3-2.1c2.3-1.4,3-2.5,3-4.6V8h-3V6h6v13.4C46,22.8,45,24.8,41.3,26.6z" }), _jsx("path", { d: "M65,18.4c0,1.1,0.8,1.3,1.4,1.3c0.5,0,2-0.2,2.6-0.4v2.1c-0.9,0.3-2.5,0.5-3.7,0.5c-1.5,0-3.2-0.5-3.2-3.1V12H60v-2h2.1V7.1 H65V10h4v2h-4V18.4z" }), _jsx("path", { d: "M71,10h3v1.3c1.1-0.8,1.9-1.3,3.3-1.3c2.5,0,4.5,1.8,4.5,5.6s-2.2,6.3-5.8,6.3c-0.9,0-1.3-0.1-2-0.3V28h-3V10z M76.5,12.3 c-0.8,0-1.6,0.4-2.5,1.2v5.9c0.6,0.1,0.9,0.2,1.8,0.2c2,0,3.2-1.3,3.2-3.9C79,13.4,78.1,12.3,76.5,12.3z" }), _jsx("path", { d: "M93,22h-3v-1.5c-0.9,0.7-1.9,1.5-3.5,1.5c-1.5,0-3.1-1.1-3.1-3.2c0-2.9,2.5-3.4,4.2-3.7l2.4-0.3v-0.3c0-1.5-0.5-2.3-2-2.3 c-0.7,0-2.3,0.5-3.7,1.1L84,11c1.2-0.4,3-1,4.4-1c2.7,0,4.6,1.4,4.6,4.7L93,22z M90,16.4l-2.2,0.4c-0.7,0.1-1.4,0.5-1.4,1.6 c0,0.9,0.5,1.4,1.3,1.4s1.5-0.5,2.3-1V16.4z" }), _jsx("path", { d: "M104.5,21.3c-1.1,0.4-2.2,0.6-3.5,0.6c-4.2,0-5.9-2.4-5.9-5.9c0-3.7,2.3-6,6.1-6c1.4,0,2.3,0.2,3.2,0.5V13 c-0.8-0.3-2-0.6-3.2-0.6c-1.7,0-3.2,0.9-3.2,3.6c0,2.9,1.5,3.8,3.3,3.8c0.9,0,1.9-0.2,3.2-0.7V21.3z" }), _jsx("path", { d: "M110,15.2c0.2-0.3,0.2-0.8,3.8-5.2h3.7l-4.6,5.7l5,6.3h-3.7l-4.2-5.8V22h-3V6h3V15.2z" }), _jsx("path", { d: "M58.5,21.3c-1.5,0.5-2.7,0.6-4.2,0.6c-3.6,0-5.8-1.8-5.8-6c0-3.1,1.9-5.9,5.5-5.9s4.9,2.5,4.9,4.9c0,0.8,0,1.5-0.1,2h-7.3 c0.1,2.5,1.5,2.8,3.6,2.8c1.1,0,2.2-0.3,3.4-0.7C58.5,19,58.5,21.3,58.5,21.3z M56,15c0-1.4-0.5-2.9-2-2.9c-1.4,0-2.3,1.3-2.4,2.9 C51.6,15,56,15,56,15z" })] }))] }));
9
+ role: "img", children: [_jsx("title", { id: "jetpack-logo-title", children: logoTitle }), _jsx("path", { fill: logoColor, 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" }), showText && (_jsxs(_Fragment, { children: [_jsx("path", { d: "M41.3,26.6c-0.5-0.7-0.9-1.4-1.3-2.1c2.3-1.4,3-2.5,3-4.6V8h-3V6h6v13.4C46,22.8,45,24.8,41.3,26.6z" }), _jsx("path", { d: "M65,18.4c0,1.1,0.8,1.3,1.4,1.3c0.5,0,2-0.2,2.6-0.4v2.1c-0.9,0.3-2.5,0.5-3.7,0.5c-1.5,0-3.2-0.5-3.2-3.1V12H60v-2h2.1V7.1 H65V10h4v2h-4V18.4z" }), _jsx("path", { d: "M71,10h3v1.3c1.1-0.8,1.9-1.3,3.3-1.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));
9
10
  };
10
11
  export default JetpackLogo;
@@ -4,4 +4,5 @@ export type JetpackLogoProps = {
4
4
  height?: number;
5
5
  showText?: boolean;
6
6
  logoColor?: string;
7
+ title?: string;
7
8
  };
@@ -13,6 +13,5 @@ import styles from './styles.module.scss';
13
13
  */
14
14
  export function Screen({ path, className, title, sidebar, isScreenLocked, footerContent, footerActions, ...props }) {
15
15
  const hasFooter = Boolean(footerContent || (footerActions && footerActions.length));
16
- return (_jsx(Navigator.Screen, { path: path, className: clsx(styles.screen, className), children: _jsxs(Flex, { direction: "column", gap: 0, children: [_jsx(Header, { title: title, isScreenLocked: isScreenLocked }), _jsx("div", { className: styles.body, children: _jsxs(Flex, { gap: 0, align: "start", children: [sidebar ? _jsx("div", { className: styles.sidebar, children: sidebar }) : null, _jsx("div", { className: styles.content, children: ('children' in props && props.children) ||
17
- ('content' in props && props.content) })] }) }), hasFooter ? (_jsx(Footer, { actions: footerActions, isScreenLocked: isScreenLocked, children: footerContent })) : null] }) }));
16
+ return (_jsx(Navigator.Screen, { path: path, className: clsx(styles.screen, className), children: _jsxs(Flex, { direction: "column", gap: 0, children: [_jsx(Header, { title: title, isScreenLocked: isScreenLocked }), _jsxs(Flex, { gap: 0, align: "start", className: styles.body, children: [sidebar ? _jsx("div", { className: styles.sidebar, children: sidebar }) : null, _jsx("div", { className: styles.content, children: ('children' in props && props.children) || ('content' in props && props.content) })] }), hasFooter ? (_jsx(Footer, { actions: footerActions, isScreenLocked: isScreenLocked, children: footerContent })) : null] }) }));
18
17
  }
@@ -8,9 +8,11 @@ const JetpackLogo: FC< JetpackLogoProps > = ( {
8
8
  showText = true,
9
9
  className,
10
10
  height = 32,
11
+ title,
11
12
  ...otherProps
12
13
  } ) => {
13
14
  const viewBox = showText ? '0 0 118 32' : '0 0 32 32';
15
+ const logoTitle = title ?? __( 'Jetpack Logo', 'jetpack-components' );
14
16
 
15
17
  return (
16
18
  <svg
@@ -25,7 +27,7 @@ const JetpackLogo: FC< JetpackLogoProps > = ( {
25
27
  // role="img" is required to prevent VoiceOver on Safari reading the content of the SVG
26
28
  role="img"
27
29
  >
28
- <title id="jetpack-logo-title">{ __( 'Jetpack Logo', 'jetpack-components' ) }</title>
30
+ <title id="jetpack-logo-title">{ logoTitle }</title>
29
31
  <path
30
32
  fill={ logoColor }
31
33
  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"
@@ -4,4 +4,5 @@ export type JetpackLogoProps = {
4
4
  height?: number;
5
5
  showText?: boolean;
6
6
  logoColor?: string;
7
+ title?: string;
7
8
  };
@@ -77,15 +77,12 @@ export function Screen( {
77
77
  <Flex direction="column" gap={ 0 }>
78
78
  <Header title={ title } isScreenLocked={ isScreenLocked } />
79
79
 
80
- <div className={ styles.body }>
81
- <Flex gap={ 0 } align="start">
82
- { sidebar ? <div className={ styles.sidebar }>{ sidebar }</div> : null }
83
- <div className={ styles.content }>
84
- { ( 'children' in props && props.children ) ||
85
- ( 'content' in props && props.content ) }
86
- </div>
87
- </Flex>
88
- </div>
80
+ <Flex gap={ 0 } align="start" className={ styles.body }>
81
+ { sidebar ? <div className={ styles.sidebar }>{ sidebar }</div> : null }
82
+ <div className={ styles.content }>
83
+ { ( 'children' in props && props.children ) || ( 'content' in props && props.content ) }
84
+ </div>
85
+ </Flex>
89
86
  { hasFooter ? (
90
87
  <Footer actions={ footerActions } isScreenLocked={ isScreenLocked }>
91
88
  { footerContent }
@@ -1,9 +1,15 @@
1
1
  @use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb;
2
2
 
3
3
  .modal {
4
+ container-type: inline-size;
5
+ container-name: navigator-modal;
6
+
4
7
  width: 80rem;
5
- height: 40rem;
6
- max-height: 90%;
8
+
9
+ @include gb.break-medium() {
10
+ height: 40rem;
11
+ max-height: 90%;
12
+ }
7
13
 
8
14
  :global(.components-modal__content) {
9
15
  padding: 0;
@@ -46,25 +52,47 @@
46
52
  }
47
53
 
48
54
  .body {
49
- display: flex;
50
55
  height: 100%;
51
56
  overflow: auto;
57
+ flex-direction: column;
58
+
59
+ @container navigator-modal (width >= #{gb.$break-small}) {
60
+
61
+ & {
62
+ flex-direction: row;
63
+ }
64
+ }
52
65
  }
53
66
 
54
67
  .sidebar {
55
- height: 100%;
68
+ width: 100%;
56
69
  display: flex;
57
70
  flex-direction: column;
58
71
  gap: 1.5rem;
59
- max-width: 22rem;
60
- flex-shrink: 0;
61
- border-inline-end: 1px solid gb.$gray-300;
72
+
73
+ @container navigator-modal (width >= #{gb.$break-small}) {
74
+
75
+ & {
76
+ flex-basis: 30%;
77
+ height: 100%;
78
+ flex-shrink: 0;
79
+ border-inline-end: 1px solid gb.$gray-300;
80
+ overflow: auto;
81
+ }
82
+ }
62
83
  }
63
84
 
64
85
  .content {
86
+ width: 100%;
65
87
  height: 100%;
66
88
  flex: 1;
67
- overflow: auto;
89
+
90
+ @container navigator-modal (width >= #{gb.$break-small}) {
91
+
92
+ & {
93
+ overflow: auto;
94
+ }
95
+ }
68
96
  }
69
97
 
70
98
  .footer {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/jetpack-components",
3
- "version": "1.3.13",
3
+ "version": "1.4.1",
4
4
  "description": "Jetpack Components Package",
5
5
  "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/components/#readme",
6
6
  "bugs": {
@@ -42,7 +42,7 @@
42
42
  "dependencies": {
43
43
  "@automattic/format-currency": "1.0.1",
44
44
  "@automattic/jetpack-api": "^1.0.12",
45
- "@automattic/jetpack-boost-score-api": "^1.0.19",
45
+ "@automattic/jetpack-boost-score-api": "^1.0.21",
46
46
  "@automattic/jetpack-script-data": "^0.5.4",
47
47
  "@automattic/number-formatters": "^1.0.15",
48
48
  "@babel/runtime": "^7",
@@ -59,7 +59,7 @@
59
59
  "prop-types": "^15.7.2",
60
60
  "qrcode.react": "4.2.0",
61
61
  "react-slider": "2.0.5",
62
- "social-logos": "^3.3.4",
62
+ "social-logos": "^3.3.5",
63
63
  "uplot": "1.6.31",
64
64
  "uplot-react": "1.1.4"
65
65
  },