diff --git a/assets/js/components/pdf-export/shared-react-pdf-components/PDFLink.test.tsx b/assets/js/components/pdf-export/shared-react-pdf-components/PDFLink.test.tsx
index c4ca4b60548..2bf2e63deba 100644
--- a/assets/js/components/pdf-export/shared-react-pdf-components/PDFLink.test.tsx
+++ b/assets/js/components/pdf-export/shared-react-pdf-components/PDFLink.test.tsx
@@ -48,7 +48,7 @@ function renderLink(
}
describe( 'PDFLink', () => {
- it( 'links to the href with no underline', () => {
+ it( 'should link to the href with no underline', () => {
const tree = renderLink( {
href: 'https://example.com/dashboard',
children: 'View dashboard',
@@ -62,7 +62,7 @@ describe( 'PDFLink', () => {
expect( tree.props.style ).not.toHaveProperty( 'flexGrow' );
} );
- it( 'uses the link color when no style sets a color', () => {
+ it( 'should use the link color when no style sets a color', () => {
const linkJSON = JSON.stringify(
renderLink( {
href: 'https://example.com/dashboard',
@@ -74,7 +74,7 @@ describe( 'PDFLink', () => {
expect( linkJSON ).toContain( PDF_COLORS.CONTENT_SECONDARY );
} );
- it( 'renders the trailing icon after the link text', () => {
+ it( 'should render the trailing icon after the link text', () => {
const tree = renderLink( {
href: 'https://example.com/dashboard',
trailingIcon: (
@@ -90,7 +90,7 @@ describe( 'PDFLink', () => {
expect( JSON.stringify( tree ) ).toContain( 'M1 2 3 4' );
} );
- it( 'renders only the link text when no icon is passed', () => {
+ it( 'should render only the link text when no icon is passed', () => {
const tree = renderLink( {
href: 'https://example.com/dashboard',
children: 'View dashboard',
@@ -99,7 +99,7 @@ describe( 'PDFLink', () => {
expect( tree.children ).toHaveLength( 1 );
} );
- it( 'uses the color from the style prop', () => {
+ it( 'should use the color from the style prop', () => {
const linkJSON = JSON.stringify(
renderLink( {
href: 'https://example.com/dashboard',
@@ -111,7 +111,7 @@ describe( 'PDFLink', () => {
expect( linkJSON ).toContain( '#6c726e' );
} );
- it( 'renders plain text in the default color when the href is an empty string', () => {
+ it( 'should render plain text in the default color when the href is an empty string', () => {
// An empty `href` is means a row with no link, so the text
// should render as plain text instead of as a link.
const tree = renderLink( { href: '', children: 'View dashboard' } );
@@ -123,7 +123,7 @@ describe( 'PDFLink', () => {
expect( treeJSON ).not.toContain( PDF_COLORS.CONTENT_SECONDARY );
} );
- it( 'renders plain text in the default color when the href is undefined', () => {
+ it( 'should render plain text in the default color when the href is undefined', () => {
// An undefined/missing `href` should renders plain text,
// the same as an empty string above.
const tree = renderLink( {
@@ -138,7 +138,7 @@ describe( 'PDFLink', () => {
expect( treeJSON ).not.toContain( PDF_COLORS.CONTENT_SECONDARY );
} );
- it( 'renders plain text in the default color when the href is null', () => {
+ it( 'should render plain text in the default color when the href is null', () => {
const tree = renderLink( { href: null, children: 'View dashboard' } );
expect( tree.type ).toBe( 'pdf-text' );
@@ -148,7 +148,7 @@ describe( 'PDFLink', () => {
expect( treeJSON ).not.toContain( PDF_COLORS.CONTENT_SECONDARY );
} );
- it( 'truncates the linked text to one line when truncateContent is set', () => {
+ it( 'should truncate the linked text to one line when truncateContent is set', () => {
const tree = renderLink( {
href: 'https://example.com/dashboard',
truncateContent: true,
@@ -171,7 +171,7 @@ describe( 'PDFLink', () => {
);
} );
- it( 'truncates the plain text to one line when truncateContent is set and href is empty', () => {
+ it( 'should truncate the plain text to one line when truncateContent is set and href is empty', () => {
const json = JSON.stringify(
renderLink( {
href: '',
@@ -184,7 +184,7 @@ describe( 'PDFLink', () => {
expect( json ).toContain( '"textOverflow":"ellipsis"' );
} );
- it( 'omits the trailing icon when the href is empty', () => {
+ it( 'should omit the trailing icon when the href is empty', () => {
const tree = renderLink( {
href: '',
trailingIcon: (
@@ -197,4 +197,27 @@ describe( 'PDFLink', () => {
expect( JSON.stringify( tree ) ).not.toContain( 'M1 2 3 4' );
} );
+
+ it( 'should pass the hyphenation callback to the text of a link and of plain text', () => {
+ function hyphenationCallback( word: string ) {
+ return [ word ];
+ }
+
+ const linkTree = renderLink( {
+ href: 'https://example.com/dashboard',
+ hyphenationCallback,
+ children: 'View dashboard',
+ } );
+ const [ linkText ] =
+ linkTree.children as TestRenderer.ReactTestRendererJSON[];
+
+ expect( linkText.props.hyphenationCallback ).toBe(
+ hyphenationCallback
+ );
+
+ expect(
+ renderLink( { href: '', hyphenationCallback, children: 'Home' } )
+ .props.hyphenationCallback
+ ).toBe( hyphenationCallback );
+ } );
} );
diff --git a/assets/js/components/pdf-export/shared-react-pdf-components/PDFLink.tsx b/assets/js/components/pdf-export/shared-react-pdf-components/PDFLink.tsx
index ae230fac0a6..9cf6bc3a859 100644
--- a/assets/js/components/pdf-export/shared-react-pdf-components/PDFLink.tsx
+++ b/assets/js/components/pdf-export/shared-react-pdf-components/PDFLink.tsx
@@ -30,6 +30,7 @@ import { FC, ReactNode } from 'react';
import { createPDFStyles } from '@/js/components/pdf-export/pdf-scale';
import { PDF_COLORS } from '@/js/components/pdf-export/pdf-theme';
import PDFTypography, {
+ PDFTypographyProps,
PDFTypographySize,
PDFTypographyType,
} from './PDFTypography';
@@ -60,6 +61,8 @@ export interface PDFLinkProps {
style?: Style | Style[];
/** Ends the text in an ellipsis when it's too long, and limits it to one line unless the text's own `maxLines` sets another limit. */
truncateContent?: boolean;
+ /** Callback that splits each word into the parts a line can break between. */
+ hyphenationCallback?: PDFTypographyProps[ 'hyphenationCallback' ];
}
const PDFLink: FC< PDFLinkProps > = ( {
@@ -69,6 +72,7 @@ const PDFLink: FC< PDFLinkProps > = ( {
trailingIcon,
style,
truncateContent,
+ hyphenationCallback,
children,
} ) => {
if ( ! href ) {
@@ -78,6 +82,7 @@ const PDFLink: FC< PDFLinkProps > = ( {
size={ size }
style={ style }
truncateContent={ truncateContent }
+ hyphenationCallback={ hyphenationCallback }
>
{ children }
@@ -96,6 +101,7 @@ const PDFLink: FC< PDFLinkProps > = ( {
size={ size }
style={ style ? [ linkColor ].concat( style ) : linkColor }
truncateContent={ truncateContent }
+ hyphenationCallback={ hyphenationCallback }
>
{ children }
diff --git a/assets/js/components/pdf-export/shared-react-pdf-components/PDFTypography.test.tsx b/assets/js/components/pdf-export/shared-react-pdf-components/PDFTypography.test.tsx
index 234c56f5dfe..783e5346352 100644
--- a/assets/js/components/pdf-export/shared-react-pdf-components/PDFTypography.test.tsx
+++ b/assets/js/components/pdf-export/shared-react-pdf-components/PDFTypography.test.tsx
@@ -130,6 +130,22 @@ describe( 'PDFTypography', () => {
} );
} );
+ it( 'should pass the hyphenation callback to the Text', () => {
+ function hyphenationCallback( word: string ) {
+ return [ word ];
+ }
+ const tree = TestRenderer.create(
+
+ Vacoas-Phoenix
+
+ ).toJSON();
+ if ( ! tree || Array.isArray( tree ) ) {
+ throw new Error( 'Unexpected render output.' );
+ }
+
+ expect( tree.props.hyphenationCallback ).toBe( hyphenationCallback );
+ } );
+
it( 'truncates the text to one line with an ellipsis when truncateContent is true', () => {
const json = renderJSON(
diff --git a/assets/js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx b/assets/js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx
index 90ad62d47e3..d5957ea36ae 100644
--- a/assets/js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx
+++ b/assets/js/components/pdf-export/shared-react-pdf-components/PDFTypography.tsx
@@ -22,7 +22,7 @@
*/
import { Text, View } from '@react-pdf/renderer';
import type { Style } from '@react-pdf/stylesheet';
-import { FC } from 'react';
+import { ComponentProps, FC } from 'react';
/**
* Internal dependencies
@@ -57,6 +57,10 @@ export interface PDFTypographyProps {
maxLines?: number;
/** Ends the text in an ellipsis when it's too long, and limits it to one line unless `maxLines` sets another limit. */
truncateContent?: boolean;
+ /** Callback that splits each word into the parts a line can break between. */
+ hyphenationCallback?: ComponentProps<
+ typeof Text
+ >[ 'hyphenationCallback' ];
}
const PDFTypography: FC< PDFTypographyProps > = ( {
@@ -65,6 +69,7 @@ const PDFTypography: FC< PDFTypographyProps > = ( {
style,
maxLines,
truncateContent = false,
+ hyphenationCallback,
children,
} ) => {
const baseStyles: Style[] = [
@@ -85,7 +90,10 @@ const PDFTypography: FC< PDFTypographyProps > = ( {
}
const text = (
-
+
{ children }
);
diff --git a/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceCardHeader.test.tsx b/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceCardHeader.test.tsx
new file mode 100644
index 00000000000..bb6a173d5af
--- /dev/null
+++ b/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceCardHeader.test.tsx
@@ -0,0 +1,132 @@
+/**
+ * PDFAudienceCardHeader tests.
+ *
+ * Site Kit by Google, Copyright 2026 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * External dependencies
+ */
+import { ComponentProps } from 'react';
+import TestRenderer from 'react-test-renderer';
+
+/**
+ * Internal dependencies
+ */
+import { scalePDFValue } from '@/js/components/pdf-export/pdf-scale';
+import { PDF_PARTIAL_DATA_BADGE_HEIGHT } from '@/js/components/pdf-export/shared-react-pdf-components/PDFPartialDataBadge';
+import {
+ flattenPDFStyle,
+ renderJSON,
+ renderPDFStyle,
+} from '@/js/components/pdf-export/test-utils';
+import PDFAudienceCardHeader from './PDFAudienceCardHeader';
+
+/**
+ * Renders the header and returns its title row.
+ *
+ * @since n.e.x.t
+ *
+ * @param {Object} props Props for the header.
+ * @return {Object} The row holding the audience name and the badge.
+ */
+function renderTitleRow(
+ props: ComponentProps< typeof PDFAudienceCardHeader >
+) {
+ const tree = TestRenderer.create(
+
+ ).toJSON() as TestRenderer.ReactTestRendererJSON;
+
+ const [ titleRow ] = tree.children as TestRenderer.ReactTestRendererJSON[];
+
+ return titleRow;
+}
+
+describe( 'PDFAudienceCardHeader', () => {
+ it( 'should render the audience name', () => {
+ expect(
+ renderJSON(
+
+ )
+ ).toContain( 'New visitors' );
+ } );
+
+ it( 'should show the Partial data badge only when the audience is in a partial data state', () => {
+ expect(
+ renderJSON(
+
+ )
+ ).toContain( 'Partial data' );
+
+ expect(
+ renderJSON(
+
+ )
+ ).not.toContain( 'Partial data' );
+ } );
+
+ it( 'should fill its grid cell', () => {
+ expect(
+ renderPDFStyle(
+
+ )
+ ).toMatchObject( { flexGrow: 1 } );
+ } );
+
+ it( 'should wrap a long name in the width the badge leaves, with a gap before the badge', () => {
+ const titleRow = renderTitleRow( {
+ audienceName:
+ 'Visitors who completed a purchase in the last thirty days',
+ isAudiencePartialData: true,
+ } );
+ const [ name, badge ] =
+ titleRow.children as TestRenderer.ReactTestRendererJSON[];
+
+ expect( flattenPDFStyle( titleRow.props.style ) ).toMatchObject( {
+ columnGap: scalePDFValue( 10 ),
+ } );
+ expect( flattenPDFStyle( name.props.style ) ).toMatchObject( {
+ flex: 1,
+ } );
+ expect( JSON.stringify( badge ) ).toContain( 'Partial data' );
+ } );
+
+ it( 'should reserve the Partial data badge height on the title row with or without a badge', () => {
+ const minHeight = scalePDFValue( PDF_PARTIAL_DATA_BADGE_HEIGHT );
+
+ for ( const isAudiencePartialData of [ true, false ] ) {
+ const titleRow = renderTitleRow( {
+ audienceName: 'New visitors',
+ isAudiencePartialData,
+ } );
+
+ expect( flattenPDFStyle( titleRow.props.style ) ).toMatchObject( {
+ minHeight,
+ } );
+ }
+ } );
+} );
diff --git a/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceCardHeader.tsx b/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceCardHeader.tsx
new file mode 100644
index 00000000000..42f5f7e9b18
--- /dev/null
+++ b/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceCardHeader.tsx
@@ -0,0 +1,77 @@
+/**
+ * Header for the Your visitor groups PDF audience card.
+ *
+ * Site Kit by Google, Copyright 2026 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * External dependencies
+ */
+import { View } from '@react-pdf/renderer';
+import { FC } from 'react';
+
+/**
+ * Internal dependencies
+ */
+import { createPDFStyles } from '@/js/components/pdf-export/pdf-scale';
+import { PDF_COLORS } from '@/js/components/pdf-export/pdf-theme';
+import PDFPartialDataBadge, {
+ PDF_PARTIAL_DATA_BADGE_HEIGHT,
+} from '@/js/components/pdf-export/shared-react-pdf-components/PDFPartialDataBadge';
+import PDFTypography from '@/js/components/pdf-export/shared-react-pdf-components/PDFTypography';
+import { audienceCardStyles } from './pdfAudienceCardStyles';
+
+const styles = createPDFStyles( {
+ // Fills its grid cell, so the dividers line up across the cards.
+ header: {
+ flexGrow: 1,
+ paddingVertical: 25,
+ paddingHorizontal: 25,
+ borderBottomWidth: 1,
+ borderBottomColor: PDF_COLORS.SURFACES_SURFACE_1,
+ },
+ // `minHeight` includes padding, so it sits on this row, not the header.
+ titleRow: {
+ minHeight: PDF_PARTIAL_DATA_BADGE_HEIGHT,
+ columnGap: 10,
+ },
+} );
+
+interface PDFAudienceCardHeaderProps {
+ /** The audience display name. */
+ audienceName: string;
+ /** Whether to show the Partial data badge beside the audience name. */
+ isAudiencePartialData: boolean;
+}
+
+const PDFAudienceCardHeader: FC< PDFAudienceCardHeaderProps > = ( {
+ audienceName,
+ isAudiencePartialData,
+} ) => {
+ return (
+
+
+
+
+ { audienceName }
+
+
+ { isAudiencePartialData && }
+
+
+ );
+};
+
+export default PDFAudienceCardHeader;
diff --git a/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceCardSection.test.tsx b/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceCardSection.test.tsx
new file mode 100644
index 00000000000..8ba669ac682
--- /dev/null
+++ b/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceCardSection.test.tsx
@@ -0,0 +1,63 @@
+/**
+ * PDFAudienceCardSection tests.
+ *
+ * Site Kit by Google, Copyright 2026 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Internal dependencies
+ */
+import { PDFAudienceMetricIconCities } from '@/js/components/pdf-export/pdf-icons';
+import { scalePDFValue } from '@/js/components/pdf-export/pdf-scale';
+import {
+ renderPDFChildStyles,
+ renderPDFStyle,
+} from '@/js/components/pdf-export/test-utils';
+import PDFAudienceCardSection from './PDFAudienceCardSection';
+
+describe( 'PDFAudienceCardSection', () => {
+ it( 'should fill its grid cell with a divider below', () => {
+ expect(
+ renderPDFStyle(
+
+ )
+ ).toMatchObject( {
+ flexGrow: 1,
+ borderBottomWidth: scalePDFValue( 1 ),
+ } );
+ } );
+
+ it( 'should drop the divider when it is the last section', () => {
+ expect(
+ renderPDFStyle(
+
+ )
+ ).toMatchObject( { borderBottomWidth: 0 } );
+ } );
+
+ it( 'should center the icon on the section content, like the dashboard tile', () => {
+ const [ content ] = renderPDFChildStyles(
+
+ );
+
+ expect( content ).toMatchObject( {
+ flexDirection: 'row',
+ alignItems: 'center',
+ } );
+ } );
+} );
diff --git a/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceCardSection.tsx b/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceCardSection.tsx
new file mode 100644
index 00000000000..a2b7e37dcd2
--- /dev/null
+++ b/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceCardSection.tsx
@@ -0,0 +1,64 @@
+/**
+ * Section for the Your visitor groups PDF audience card.
+ *
+ * Site Kit by Google, Copyright 2026 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * External dependencies
+ */
+import { View } from '@react-pdf/renderer';
+import { FC } from 'react';
+
+/**
+ * Internal dependencies
+ */
+import { PDFIcon } from '@/js/components/pdf-export/types';
+import { audienceCardStyles } from './pdfAudienceCardStyles';
+
+interface PDFAudienceCardSectionProps {
+ /** The section's icon. */
+ Icon: PDFIcon;
+ /** Whether the section is the last one in the card, which drops the divider. */
+ isLast?: boolean;
+}
+
+const PDFAudienceCardSection: FC< PDFAudienceCardSectionProps > = ( {
+ Icon,
+ isLast = false,
+ children,
+} ) => {
+ return (
+
+
+
+
+
+ { children }
+
+
+ );
+};
+
+export default PDFAudienceCardSection;
diff --git a/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceCitiesRow.test.tsx b/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceCitiesRow.test.tsx
new file mode 100644
index 00000000000..281ce08d931
--- /dev/null
+++ b/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceCitiesRow.test.tsx
@@ -0,0 +1,112 @@
+/**
+ * PDFAudienceCitiesRow tests.
+ *
+ * Site Kit by Google, Copyright 2026 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * External dependencies
+ */
+import TestRenderer from 'react-test-renderer';
+
+/**
+ * Internal dependencies
+ */
+import { renderJSON } from '@/js/components/pdf-export/test-utils';
+import PDFAudienceCitiesRow from './PDFAudienceCitiesRow';
+
+/**
+ * Gets the hyphenation callback the given city name's text renders with.
+ *
+ * @since n.e.x.t
+ *
+ * @param {string} name The city name.
+ * @return {Function|undefined} The text's hyphenation callback, if any.
+ */
+function getCityNameHyphenationCallback( name: string ) {
+ const renderer = TestRenderer.create(
+
+ );
+ const [ text ] = renderer.root.findAllByProps( { children: name } );
+
+ return text.props.hyphenationCallback;
+}
+
+describe( 'PDFAudienceCitiesRow', () => {
+ it( 'should render each top city with its name and percentage', () => {
+ const json = renderJSON(
+
+ );
+
+ expect( json ).toContain( 'Cities with the most visitors' );
+ expect( json ).toContain( 'Dublin' );
+ expect( json ).toContain( '38.8%' );
+ expect( json ).toContain( 'London' );
+ expect( json ).toContain( 'New York' );
+ } );
+
+ it( 'should show a no data message when there are no top cities', () => {
+ expect(
+ renderJSON( )
+ ).toContain( 'No data to show yet' );
+ } );
+
+ it( 'should truncate a long city name to one line with an ellipsis', () => {
+ const json = renderJSON(
+
+ );
+
+ expect( json ).toContain( 'Municipal District of Bandon - Kinsale' );
+ // `@react-pdf` wraps text by default, so the city name caps at one line
+ // with an ellipsis.
+ expect( json ).toContain( '"maxLines":1' );
+ expect( json ).toContain( '"textOverflow":"ellipsis"' );
+ } );
+
+ it( 'should let a city name with no space wrap between any two characters', () => {
+ const hyphenationCallback =
+ getCityNameHyphenationCallback( 'Vacoas-Phoenix' );
+
+ // `@react-pdf` breaks a line at an empty part without adding a hyphen.
+ expect( hyphenationCallback( 'Cork' ) ).toEqual( [
+ 'C',
+ '',
+ 'o',
+ '',
+ 'r',
+ '',
+ 'k',
+ ] );
+ } );
+
+ it( 'should keep a city name with a space wrapping only at its spaces', () => {
+ expect(
+ getCityNameHyphenationCallback( 'Beau Bassin-Rose Hill' )
+ ).toBeUndefined();
+ } );
+} );
diff --git a/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceCitiesRow.tsx b/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceCitiesRow.tsx
new file mode 100644
index 00000000000..27443bf3104
--- /dev/null
+++ b/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceCitiesRow.tsx
@@ -0,0 +1,118 @@
+/**
+ * Cities row for the Your visitor groups PDF audience card.
+ *
+ * Site Kit by Google, Copyright 2026 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * External dependencies
+ */
+import { View } from '@react-pdf/renderer';
+import type { Style } from '@react-pdf/stylesheet';
+import { FC } from 'react';
+
+/**
+ * WordPress dependencies
+ */
+import { __ } from '@wordpress/i18n';
+
+/**
+ * Internal dependencies
+ */
+import { PDFAudienceMetricIconCities } from '@/js/components/pdf-export/pdf-icons';
+import { createPDFStyles } from '@/js/components/pdf-export/pdf-scale';
+import { PDF_TYPOGRAPHY } from '@/js/components/pdf-export/pdf-typography';
+import PDFTypography from '@/js/components/pdf-export/shared-react-pdf-components/PDFTypography';
+import { numFmt } from '@/js/util';
+import type { AudienceTileTopCity } from './buildPDFAudienceCard';
+import PDFAudienceCardSection from './PDFAudienceCardSection';
+import { audienceCardStyles } from './pdfAudienceCardStyles';
+import PDFAudienceTileNoData from './PDFAudienceTileNoData';
+import { getTruncationHyphenationCallback } from './pdfTextTruncation';
+
+const styles = createPDFStyles( {
+ citiesRow: {
+ flexDirection: 'row',
+ columnGap: 10,
+ marginTop: 12,
+ },
+ city: {
+ flex: 1,
+ overflow: 'hidden',
+ },
+ cityName: {
+ maxLines: 1,
+ textOverflow: 'ellipsis',
+ },
+ cityPercentage: {
+ marginTop: 2,
+ },
+} );
+
+// Leaves room for the ellipsis.
+const cityNameStyle: Style[] = [
+ styles.cityName,
+ { paddingRight: PDF_TYPOGRAPHY.title.small.fontSize },
+];
+
+interface PDFAudienceCitiesRowProps {
+ /** Up to three top cities. */
+ topCities: AudienceTileTopCity[];
+}
+
+const PDFAudienceCitiesRow: FC< PDFAudienceCitiesRowProps > = ( {
+ topCities,
+} ) => {
+ return (
+
+
+
+ { __( 'Cities with the most visitors', 'google-site-kit' ) }
+
+
+ { ! topCities.length && }
+ { topCities.map( ( city ) => (
+
+
+ { city.name }
+
+
+ { numFmt( city.percentage, {
+ style: 'percent',
+ maximumFractionDigits: 1,
+ } ) }
+
+
+ ) ) }
+
+
+
+ );
+};
+
+export default PDFAudienceCitiesRow;
diff --git a/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceMetricRow.tsx b/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceMetricRow.tsx
index 264ac82c405..be17f5ba07f 100644
--- a/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceMetricRow.tsx
+++ b/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceMetricRow.tsx
@@ -1,7 +1,7 @@
/**
* Metric row for the Your visitor groups PDF audience card.
*
- * `PDFYourVisitorGroupsTile` renders one row per audience metric.
+ * `PDFYourVisitorGroups` renders one row per audience metric.
*
* Site Kit by Google, Copyright 2026 Google LLC
*
@@ -35,25 +35,10 @@ import PDFTypography from '@/js/components/pdf-export/shared-react-pdf-component
import { PDFChangeType, PDFIcon } from '@/js/components/pdf-export/types';
import { calculateChange, numFmt } from '@/js/util';
import type { AudienceTileMetric } from './buildPDFAudienceCard';
+import PDFAudienceCardSection from './PDFAudienceCardSection';
+import { audienceCardStyles } from './pdfAudienceCardStyles';
const styles = createPDFStyles( {
- // Each metric row is inset from the card edges and draws a divider below it.
- row: {
- flexDirection: 'row',
- alignItems: 'center',
- marginHorizontal: 24,
- paddingVertical: 12,
- borderBottomWidth: 1,
- borderBottomColor: PDF_COLORS.SURFACES_SURFACE_1,
- },
- iconColumn: {
- width: 52,
- alignItems: 'center',
- marginRight: 4,
- },
- body: {
- flex: 1,
- },
metricValue: {
lineHeight: 32 / 28,
},
@@ -114,11 +99,8 @@ const PDFAudienceMetricRow: FC< PDFAudienceMetricRowProps > = ( {
const chip = getChangeChip( metric );
return (
-
-
-
-
-
+
+ = ( {
changeType={ chip.changeType }
/>
) }
-
+
);
};
diff --git a/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceTileNoData.tsx b/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceTileNoData.tsx
new file mode 100644
index 00000000000..f0e4d331bd4
--- /dev/null
+++ b/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceTileNoData.tsx
@@ -0,0 +1,42 @@
+/**
+ * No data message for the Your visitor groups PDF audience card.
+ *
+ * Site Kit by Google, Copyright 2026 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * External dependencies
+ */
+import { FC } from 'react';
+
+/**
+ * WordPress dependencies
+ */
+import { __ } from '@wordpress/i18n';
+
+/**
+ * Internal dependencies
+ */
+import PDFTypography from '@/js/components/pdf-export/shared-react-pdf-components/PDFTypography';
+
+const PDFAudienceTileNoData: FC = () => {
+ return (
+
+ { __( 'No data to show yet', 'google-site-kit' ) }
+
+ );
+};
+
+export default PDFAudienceTileNoData;
diff --git a/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceTopContentRow.test.tsx b/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceTopContentRow.test.tsx
new file mode 100644
index 00000000000..ac175353bd1
--- /dev/null
+++ b/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFAudienceTopContentRow.test.tsx
@@ -0,0 +1,207 @@
+/**
+ * PDFAudienceTopContentRow tests.
+ *
+ * Site Kit by Google, Copyright 2026 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * External dependencies
+ */
+import { ComponentProps } from 'react';
+import TestRenderer from 'react-test-renderer';
+
+/**
+ * Internal dependencies
+ */
+import { scalePDFValue } from '@/js/components/pdf-export/pdf-scale';
+import PDFLink from '@/js/components/pdf-export/shared-react-pdf-components/PDFLink';
+import {
+ flattenPDFStyle,
+ renderJSON,
+ renderPDFStyle,
+} from '@/js/components/pdf-export/test-utils';
+import PDFAudienceTopContentRow from './PDFAudienceTopContentRow';
+import { splitIntoCharacters } from './pdfTextTruncation';
+
+const TOP_CONTENT = [
+ {
+ title: 'First post title',
+ pageviews: 847,
+ serviceURL: 'https://example.com/analytics-report/first-post',
+ },
+ {
+ title: 'Second post title',
+ pageviews: 596,
+ serviceURL: 'https://example.com/analytics-report/second-post',
+ },
+];
+
+/**
+ * Builds a `PDFAudienceTopContentRow` element with default props.
+ *
+ * @since n.e.x.t
+ *
+ * @param {Object} props Props that override the defaults.
+ * @return {Element} The element.
+ */
+function buildRow(
+ props: Partial< ComponentProps< typeof PDFAudienceTopContentRow > > = {}
+) {
+ return (
+
+ );
+}
+
+/**
+ * Finds every node in a rendered tree that matches the predicate, in render
+ * order.
+ *
+ * @since n.e.x.t
+ *
+ * @param {Object} node The rendered tree, or a node within it.
+ * @param {Function} predicate Whether a node matches.
+ * @return {Array.