@automattic/jetpack-components 1.4.16 → 1.6.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 +31 -0
- package/build/components/action-button/index.d.ts +4 -14
- package/build/components/action-button/index.js +2 -2
- package/build/components/action-popover/index.js +10 -6
- package/build/components/admin-page/index.d.ts +1 -0
- package/build/components/admin-page/index.js +26 -6
- package/build/components/admin-page/style.module.scss +33 -0
- package/build/components/admin-page/types.d.ts +32 -1
- package/build/components/alert/index.js +2 -1
- package/build/components/automattic-byline-logo/index.js +3 -1
- package/build/components/automattic-for-agencies-logo/index.d.ts +1 -1
- package/build/components/automattic-icon-logo/index.d.ts +1 -1
- package/build/components/automattic-icon-logo/index.js +3 -1
- package/build/components/boost-score-bar/index.js +7 -2
- package/build/components/boost-score-graph/background.js +13 -1
- package/build/components/boost-score-graph/index.js +3 -3
- package/build/components/boost-score-graph/tooltip.js +23 -3
- package/build/components/boost-score-graph/tooltips-plugin.js +1 -1
- package/build/components/boost-score-graph/uplot-line-chart.js +7 -7
- package/build/components/button/index.js +5 -3
- package/build/components/contextual-upgrade-trigger/index.js +8 -3
- package/build/components/copy-to-clipboard/index.js +2 -2
- package/build/components/decorative-card/index.js +2 -1
- package/build/components/details-viewer/index.js +5 -3
- package/build/components/dialog/index.js +7 -5
- package/build/components/diff-viewer/index.js +12 -6
- package/build/components/donut-meter/index.js +4 -2
- package/build/components/dot-pager/index.js +4 -2
- package/build/components/global-notices/global-notices.js +1 -1
- package/build/components/global-notices/index.js +2 -2
- package/build/components/gridicon/index.js +4 -2
- package/build/components/icon-tooltip/index.js +5 -3
- package/build/components/icons/index.js +12 -4
- package/build/components/icons/style.module.scss +4 -0
- package/build/components/jetpack-footer/index.js +17 -12
- package/build/components/jetpack-logo/index.js +5 -2
- package/build/components/jetpack-protect-logo/index.js +5 -2
- package/build/components/jetpack-search-logo/index.js +6 -2
- package/build/components/jetpack-vaultpress-backup-logo/index.js +7 -2
- package/build/components/jetpack-videopress-logo/index.js +5 -2
- package/build/components/layout/use-breakpoint-match/index.d.ts +1 -3
- package/build/components/loading-placeholder/index.d.ts +1 -1
- package/build/components/marked-lines/index.js +5 -3
- package/build/components/navigator-modal/footer.js +3 -2
- package/build/components/navigator-modal/header.js +4 -2
- package/build/components/navigator-modal/index.js +2 -2
- package/build/components/navigator-modal/screen.js +5 -3
- package/build/components/notice/index.js +2 -1
- package/build/components/popover/index.js +3 -1
- package/build/components/pricing-card/index.js +9 -3
- package/build/components/pricing-table/index.js +18 -10
- package/build/components/product-offer/icons-card.js +3 -2
- package/build/components/product-offer/index.js +14 -9
- package/build/components/product-offer/product-offer-header.js +4 -2
- package/build/components/product-price/index.js +15 -7
- package/build/components/product-price/price.js +4 -3
- package/build/components/record-meter-bar/index.js +20 -5
- package/build/components/spinner/index.d.ts +8 -8
- package/build/components/split-button/index.js +3 -1
- package/build/components/stat-card/index.js +5 -2
- package/build/components/status/index.js +4 -2
- package/build/components/swipeable/index.d.ts +3 -3
- package/build/components/swipeable/index.js +8 -4
- package/build/components/terms-of-service/index.js +2 -2
- package/build/components/testimonials/index.js +2 -2
- package/build/components/testimonials/testimonial.js +11 -1
- package/build/components/text/index.js +2 -2
- package/build/components/upsell-banner/index.js +7 -2
- package/build/components/zendesk-chat/index.js +1 -1
- package/build/index.js +66 -66
- package/components/admin-page/index.tsx +67 -13
- package/components/admin-page/style.module.scss +33 -0
- package/components/admin-page/types.ts +39 -1
- package/components/icons/style.module.scss +4 -0
- package/components/jetpack-footer/index.tsx +1 -1
- package/package.json +20 -19
- package/tools/copy-scss-to-build.mjs +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { forwardRef, useMemo } from 'react';
|
|
4
|
-
import { BOX_MODEL_VALUES, VARIANTS_MAPPING } from
|
|
4
|
+
import { BOX_MODEL_VALUES, VARIANTS_MAPPING } from './constants.js';
|
|
5
5
|
import styles from './style.module.scss';
|
|
6
6
|
/**
|
|
7
7
|
* Text component.
|
|
@@ -50,4 +50,4 @@ export const H3 = ({ children, weight = 'bold', ...componentProps }) => {
|
|
|
50
50
|
* @return {ReactElement} - JSX.Element
|
|
51
51
|
*/
|
|
52
52
|
export const Title = ({ children, size = 'medium', ...componentProps }) => (_jsx(Text, { variant: `title-${size}`, mb: 1, ...componentProps, children: children }));
|
|
53
|
-
export * from
|
|
53
|
+
export * from './constants.js';
|
|
@@ -14,8 +14,13 @@ import './style.scss';
|
|
|
14
14
|
*/
|
|
15
15
|
const UpsellBanner = props => {
|
|
16
16
|
const { icon, title, description, primaryCtaLabel, primaryCtaURL, primaryCtaIsExternalLink, primaryCtaOnClick, secondaryCtaLabel, secondaryCtaURL, secondaryCtaIsExternalLink, secondaryCtaOnClick, } = props;
|
|
17
|
-
return (_jsx(Card, { isRounded: true, size: "large", children: _jsxs(CardBody, { className: "upsell-banner", size: "large", children: [icon && (_jsx("div", { className: "upsell-banner--icon", children: _jsx("img", { src: icon, alt: "" }) })), _jsxs("div", { className: "upsell-banner--content", children: [
|
|
17
|
+
return (_jsx(Card, { isRounded: true, size: "large", children: _jsxs(CardBody, { className: "upsell-banner", size: "large", children: [icon && (_jsx("div", { className: "upsell-banner--icon", children: _jsx("img", { src: icon, alt: "" }) })), _jsxs("div", { className: "upsell-banner--content", children: [
|
|
18
|
+
_jsxs("div", { className: "upsell-banner--content-info", children: [
|
|
19
|
+
_jsx("h3", { children: title }), _jsx("p", { children: createInterpolateElement(description, {
|
|
18
20
|
br: _jsx("br", {}),
|
|
19
|
-
}) })
|
|
21
|
+
}) })
|
|
22
|
+
] }), _jsxs("div", { className: "upsell-banner--content-cta", children: [secondaryCtaLabel && secondaryCtaURL && (_jsx(Button, { className: "upsell-banner--content-cta-button secondary", href: secondaryCtaURL, onClick: secondaryCtaOnClick ?? undefined, isExternalLink: secondaryCtaIsExternalLink, children: secondaryCtaLabel })), primaryCtaLabel && primaryCtaURL && (_jsx(Button, { className: "upsell-banner--content-cta-button primary", href: primaryCtaURL, onClick: primaryCtaOnClick ?? undefined, isExternalLink: primaryCtaIsExternalLink, children: primaryCtaLabel }))] })
|
|
23
|
+
] })
|
|
24
|
+
] }) }));
|
|
20
25
|
};
|
|
21
26
|
export default UpsellBanner;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useCallback } from 'react';
|
|
3
|
-
import { chatKey } from
|
|
3
|
+
import { chatKey } from './constants.js';
|
|
4
4
|
export const ZendeskChat = ({ jwt_token }) => {
|
|
5
5
|
const authenticateUser = useCallback(() => {
|
|
6
6
|
if (typeof window !== 'undefined' && typeof window.zE === 'function') {
|
package/build/index.js
CHANGED
|
@@ -12,69 +12,69 @@ GNU General Public License for more details.
|
|
|
12
12
|
You should have received a copy of the GNU General Public License
|
|
13
13
|
along with this program; if not, see <https://www.gnu.org/licenses/>.
|
|
14
14
|
*/
|
|
15
|
-
export { default as JetpackLogo } from
|
|
16
|
-
export { default as JetpackSearchLogo } from
|
|
17
|
-
export { default as JetpackProtectLogo } from
|
|
18
|
-
export { default as JetpackVaultPressBackupLogo } from
|
|
19
|
-
export { default as JetpackVideoPressLogo } from
|
|
20
|
-
export { default as getRedirectUrl } from
|
|
21
|
-
export { default as getProductCheckoutUrl } from
|
|
22
|
-
export { isFirstMonthTrial } from
|
|
23
|
-
export { default as AutomatticBylineLogo } from
|
|
24
|
-
export { default as AutomatticIconLogo } from
|
|
25
|
-
export { default as AutomatticForAgenciesLogo } from
|
|
26
|
-
export { default as JetpackFooter } from
|
|
27
|
-
export { default as Spinner } from
|
|
28
|
-
export { default as Gridicon } from
|
|
29
|
-
export { default as IconTooltip } from
|
|
30
|
-
export { default as ActionButton } from
|
|
31
|
-
export { default as PricingCard } from
|
|
32
|
-
export { default as NumberSlider } from
|
|
33
|
-
export { default as AdminSection } from
|
|
34
|
-
export { default as AdminSectionHero } from
|
|
35
|
-
export { default as AdminPage } from
|
|
36
|
-
export { default as DecorativeCard } from
|
|
37
|
-
export { default as Col } from
|
|
38
|
-
export { default as Testimonials } from
|
|
39
|
-
export { default as Container } from
|
|
40
|
-
export { default as useBreakpointMatch } from
|
|
41
|
-
export { default as CopyToClipboard } from
|
|
42
|
-
export * from
|
|
43
|
-
export { default as SplitButton } from
|
|
44
|
-
export { default as ThemeProvider } from
|
|
45
|
-
export { default as Text, H2, H3, Title } from
|
|
46
|
-
export { default as ToggleControl } from
|
|
47
|
-
export { default as NumberControl } from
|
|
48
|
-
export { default as QRCode } from
|
|
49
|
-
export { default as Button } from
|
|
50
|
-
export { default as LoadingPlaceholder } from
|
|
51
|
-
export { default as TermsOfService } from
|
|
52
|
-
export { default as Badge } from
|
|
53
|
-
export { default as Chip } from
|
|
54
|
-
export { default as PricingTable, PricingTableColumn, PricingTableHeader, PricingTableItem, } from
|
|
55
|
-
export { default as BoostScoreBar } from
|
|
56
|
-
export { default as BoostScoreGraph } from
|
|
57
|
-
export { default as ProductPrice } from
|
|
58
|
-
export { default as ProductOffer, IconsCard } from
|
|
59
|
-
export { default as Dialog } from
|
|
60
|
-
export { default as DotPager } from
|
|
61
|
-
export { default as DonutMeter } from
|
|
62
|
-
export { default as RecordMeterBar } from
|
|
63
|
-
export { default as ContextualUpgradeTrigger } from
|
|
64
|
-
export { default as Alert } from
|
|
65
|
-
export { default as Notice } from
|
|
66
|
-
export { default as Popover } from
|
|
67
|
-
export { default as Status } from
|
|
68
|
-
export { default as IndeterminateProgressBar } from
|
|
69
|
-
export { default as ActionPopover } from
|
|
70
|
-
export { default as ZendeskChat } from
|
|
71
|
-
export { default as ProgressBar } from
|
|
72
|
-
export { default as UpsellBanner } from
|
|
73
|
-
export { getUserLocale, cleanLocale } from
|
|
74
|
-
export { default as RadioControl } from
|
|
75
|
-
export { default as StatCard } from
|
|
76
|
-
export { default as DiffViewer } from
|
|
77
|
-
export { default as MarkedLines } from
|
|
78
|
-
export { default as DetailsViewer } from
|
|
79
|
-
export * from
|
|
80
|
-
export * from
|
|
15
|
+
export { default as JetpackLogo } from './components/jetpack-logo/index.js';
|
|
16
|
+
export { default as JetpackSearchLogo } from './components/jetpack-search-logo/index.js';
|
|
17
|
+
export { default as JetpackProtectLogo } from './components/jetpack-protect-logo/index.js';
|
|
18
|
+
export { default as JetpackVaultPressBackupLogo } from './components/jetpack-vaultpress-backup-logo/index.js';
|
|
19
|
+
export { default as JetpackVideoPressLogo } from './components/jetpack-videopress-logo/index.js';
|
|
20
|
+
export { default as getRedirectUrl } from './tools/jp-redirect/index.js';
|
|
21
|
+
export { default as getProductCheckoutUrl } from './tools/get-product-checkout-url/index.js';
|
|
22
|
+
export { isFirstMonthTrial } from './tools/pricing-utils/index.js';
|
|
23
|
+
export { default as AutomatticBylineLogo } from './components/automattic-byline-logo/index.js';
|
|
24
|
+
export { default as AutomatticIconLogo } from './components/automattic-icon-logo/index.js';
|
|
25
|
+
export { default as AutomatticForAgenciesLogo } from './components/automattic-for-agencies-logo/index.js';
|
|
26
|
+
export { default as JetpackFooter } from './components/jetpack-footer/index.js';
|
|
27
|
+
export { default as Spinner } from './components/spinner/index.js';
|
|
28
|
+
export { default as Gridicon } from './components/gridicon/index.js';
|
|
29
|
+
export { default as IconTooltip } from './components/icon-tooltip/index.js';
|
|
30
|
+
export { default as ActionButton } from './components/action-button/index.js';
|
|
31
|
+
export { default as PricingCard } from './components/pricing-card/index.js';
|
|
32
|
+
export { default as NumberSlider } from './components/number-slider/index.js';
|
|
33
|
+
export { default as AdminSection } from './components/admin-section/basic/index.js';
|
|
34
|
+
export { default as AdminSectionHero } from './components/admin-section/hero/index.js';
|
|
35
|
+
export { default as AdminPage } from './components/admin-page/index.js';
|
|
36
|
+
export { default as DecorativeCard } from './components/decorative-card/index.js';
|
|
37
|
+
export { default as Col } from './components/layout/col/index.js';
|
|
38
|
+
export { default as Testimonials } from './components/testimonials/index.js';
|
|
39
|
+
export { default as Container } from './components/layout/container/index.js';
|
|
40
|
+
export { default as useBreakpointMatch } from './components/layout/use-breakpoint-match/index.js';
|
|
41
|
+
export { default as CopyToClipboard } from './components/copy-to-clipboard/index.js';
|
|
42
|
+
export * from './components/icons/index.js';
|
|
43
|
+
export { default as SplitButton } from './components/split-button/index.js';
|
|
44
|
+
export { default as ThemeProvider } from './components/theme-provider/index.js';
|
|
45
|
+
export { default as Text, H2, H3, Title } from './components/text/index.js';
|
|
46
|
+
export { default as ToggleControl } from './components/toggle-control/index.js';
|
|
47
|
+
export { default as NumberControl } from './components/number-control/index.js';
|
|
48
|
+
export { default as QRCode } from './components/qr-code/index.js';
|
|
49
|
+
export { default as Button } from './components/button/index.js';
|
|
50
|
+
export { default as LoadingPlaceholder } from './components/loading-placeholder/index.js';
|
|
51
|
+
export { default as TermsOfService } from './components/terms-of-service/index.js';
|
|
52
|
+
export { default as Badge } from './components/badge/index.js';
|
|
53
|
+
export { default as Chip } from './components/chip/index.js';
|
|
54
|
+
export { default as PricingTable, PricingTableColumn, PricingTableHeader, PricingTableItem, } from './components/pricing-table/index.js';
|
|
55
|
+
export { default as BoostScoreBar } from './components/boost-score-bar/index.js';
|
|
56
|
+
export { default as BoostScoreGraph } from './components/boost-score-graph/index.js';
|
|
57
|
+
export { default as ProductPrice } from './components/product-price/index.js';
|
|
58
|
+
export { default as ProductOffer, IconsCard } from './components/product-offer/index.js';
|
|
59
|
+
export { default as Dialog } from './components/dialog/index.js';
|
|
60
|
+
export { default as DotPager } from './components/dot-pager/index.js';
|
|
61
|
+
export { default as DonutMeter } from './components/donut-meter/index.js';
|
|
62
|
+
export { default as RecordMeterBar } from './components/record-meter-bar/index.js';
|
|
63
|
+
export { default as ContextualUpgradeTrigger } from './components/contextual-upgrade-trigger/index.js';
|
|
64
|
+
export { default as Alert } from './components/alert/index.js';
|
|
65
|
+
export { default as Notice } from './components/notice/index.js';
|
|
66
|
+
export { default as Popover } from './components/popover/index.js';
|
|
67
|
+
export { default as Status } from './components/status/index.js';
|
|
68
|
+
export { default as IndeterminateProgressBar } from './components/indeterminate-progress-bar/index.js';
|
|
69
|
+
export { default as ActionPopover } from './components/action-popover/index.js';
|
|
70
|
+
export { default as ZendeskChat } from './components/zendesk-chat/index.js';
|
|
71
|
+
export { default as ProgressBar } from './components/progress-bar/index.js';
|
|
72
|
+
export { default as UpsellBanner } from './components/upsell-banner/index.js';
|
|
73
|
+
export { getUserLocale, cleanLocale } from './lib/locale/index.js';
|
|
74
|
+
export { default as RadioControl } from './components/radio-control/index.js';
|
|
75
|
+
export { default as StatCard } from './components/stat-card/index.js';
|
|
76
|
+
export { default as DiffViewer } from './components/diff-viewer/index.js';
|
|
77
|
+
export { default as MarkedLines } from './components/marked-lines/index.js';
|
|
78
|
+
export { default as DetailsViewer } from './components/details-viewer/index.js';
|
|
79
|
+
export * from './components/global-notices/index.js';
|
|
80
|
+
export * from './components/navigator-modal/index.js';
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import restApi from '@automattic/jetpack-api';
|
|
2
|
+
import { Page } from '@wordpress/admin-ui';
|
|
3
|
+
import '@wordpress/admin-ui/build-style/style.css';
|
|
4
|
+
import {
|
|
5
|
+
__experimentalHeading as Heading, // eslint-disable-line @wordpress/no-unsafe-wp-apis
|
|
6
|
+
__experimentalHStack as HStack, // eslint-disable-line @wordpress/no-unsafe-wp-apis
|
|
7
|
+
} from '@wordpress/components';
|
|
2
8
|
import { __, sprintf } from '@wordpress/i18n';
|
|
3
9
|
import clsx from 'clsx';
|
|
4
10
|
import { useEffect, useCallback } from 'react';
|
|
@@ -21,7 +27,7 @@ import type { FC, ReactNode } from 'react';
|
|
|
21
27
|
const AdminPage: FC< AdminPageProps > = ( {
|
|
22
28
|
children,
|
|
23
29
|
className,
|
|
24
|
-
moduleName =
|
|
30
|
+
moduleName = 'Jetpack' /** "Jetpack" is a product name, do not translate. */,
|
|
25
31
|
moduleNameHref,
|
|
26
32
|
showHeader = true,
|
|
27
33
|
showFooter = true,
|
|
@@ -32,6 +38,13 @@ const AdminPage: FC< AdminPageProps > = ( {
|
|
|
32
38
|
apiNonce = '',
|
|
33
39
|
optionalMenuItems,
|
|
34
40
|
header,
|
|
41
|
+
title,
|
|
42
|
+
subTitle,
|
|
43
|
+
logo,
|
|
44
|
+
actions,
|
|
45
|
+
breadcrumbs,
|
|
46
|
+
tabs,
|
|
47
|
+
showBottomBorder = true,
|
|
35
48
|
} ) => {
|
|
36
49
|
useEffect( () => {
|
|
37
50
|
restApi.setApiRoot( apiRoot );
|
|
@@ -40,6 +53,7 @@ const AdminPage: FC< AdminPageProps > = ( {
|
|
|
40
53
|
|
|
41
54
|
const rootClassName = clsx( styles[ 'admin-page' ], className, {
|
|
42
55
|
[ styles.background ]: showBackground,
|
|
56
|
+
[ styles[ 'without-bottom-border' ] ]: tabs || ! showBottomBorder,
|
|
43
57
|
} );
|
|
44
58
|
|
|
45
59
|
const testConnection = useCallback( async () => {
|
|
@@ -60,6 +74,57 @@ const AdminPage: FC< AdminPageProps > = ( {
|
|
|
60
74
|
}
|
|
61
75
|
}, [] );
|
|
62
76
|
|
|
77
|
+
// Compose the title with logo for the admin-ui Page header.
|
|
78
|
+
// Note: The inner Heading causes a double h2 wrapping because Page's Header
|
|
79
|
+
// also wraps title in a Heading. This is a known issue — the inner Heading is
|
|
80
|
+
// needed until https://github.com/WordPress/gutenberg/pull/75899 fixes
|
|
81
|
+
// non-string title rendering in admin-ui. Once that lands, remove the Heading
|
|
82
|
+
// here and pass the plain HStack with a string child.
|
|
83
|
+
const composedTitle = title ? (
|
|
84
|
+
<HStack spacing={ 2 } justify="left">
|
|
85
|
+
{ logo || <JetpackLogo showText={ false } height={ 20 } /> }
|
|
86
|
+
<Heading as="h2" level={ 3 } weight={ 500 } truncate>
|
|
87
|
+
{ title }
|
|
88
|
+
</Heading>
|
|
89
|
+
</HStack>
|
|
90
|
+
) : undefined;
|
|
91
|
+
|
|
92
|
+
const footer = showFooter && (
|
|
93
|
+
<Container className={ styles[ 'admin-page-footer' ] } horizontalSpacing={ 5 }>
|
|
94
|
+
<Col>
|
|
95
|
+
<JetpackFooter
|
|
96
|
+
moduleName={ moduleName }
|
|
97
|
+
moduleNameHref={ moduleNameHref }
|
|
98
|
+
menu={ optionalMenuItems }
|
|
99
|
+
useInternalLinks={ useInternalLinks }
|
|
100
|
+
/>
|
|
101
|
+
</Col>
|
|
102
|
+
</Container>
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
// When title or breadcrumbs are provided, use admin-ui Page for the full page layout.
|
|
106
|
+
if ( showHeader && ( composedTitle || breadcrumbs ) ) {
|
|
107
|
+
return (
|
|
108
|
+
<div className={ rootClassName }>
|
|
109
|
+
<Page
|
|
110
|
+
ariaLabel={ title }
|
|
111
|
+
breadcrumbs={ breadcrumbs }
|
|
112
|
+
title={ composedTitle }
|
|
113
|
+
subTitle={ subTitle }
|
|
114
|
+
actions={ actions }
|
|
115
|
+
showSidebarToggle={ false }
|
|
116
|
+
>
|
|
117
|
+
{ tabs }
|
|
118
|
+
<Container fluid horizontalSpacing={ 0 }>
|
|
119
|
+
<Col>{ children }</Col>
|
|
120
|
+
</Container>
|
|
121
|
+
{ footer }
|
|
122
|
+
</Page>
|
|
123
|
+
</div>
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Legacy path: no title provided, render the classic header.
|
|
63
128
|
return (
|
|
64
129
|
<div className={ rootClassName }>
|
|
65
130
|
{ showHeader && (
|
|
@@ -85,18 +150,7 @@ const AdminPage: FC< AdminPageProps > = ( {
|
|
|
85
150
|
<Container fluid horizontalSpacing={ 0 }>
|
|
86
151
|
<Col>{ children }</Col>
|
|
87
152
|
</Container>
|
|
88
|
-
{
|
|
89
|
-
<Container horizontalSpacing={ 5 }>
|
|
90
|
-
<Col>
|
|
91
|
-
<JetpackFooter
|
|
92
|
-
moduleName={ moduleName }
|
|
93
|
-
moduleNameHref={ moduleNameHref }
|
|
94
|
-
menu={ optionalMenuItems }
|
|
95
|
-
useInternalLinks={ useInternalLinks }
|
|
96
|
-
/>
|
|
97
|
-
</Col>
|
|
98
|
-
</Container>
|
|
99
|
-
) }
|
|
153
|
+
{ footer }
|
|
100
154
|
</div>
|
|
101
155
|
);
|
|
102
156
|
};
|
|
@@ -9,12 +9,39 @@
|
|
|
9
9
|
background-color: var(--jp-white);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
// Remove the admin-ui header border when tabs are present,
|
|
13
|
+
// or when showBottomBorder is false.
|
|
14
|
+
// Ideally admin-ui would expose a prop or CSS custom property for this:
|
|
15
|
+
// https://github.com/WordPress/gutenberg/issues/75428
|
|
16
|
+
&.without-bottom-border :global(.admin-ui-page__header) {
|
|
17
|
+
border-bottom: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Disable sticky header until we make it work better across all pages.
|
|
21
|
+
// JETPACK-1386
|
|
22
|
+
:global(.admin-ui-page__header) {
|
|
23
|
+
position: relative;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Normalize admin headers: implementation of admin-ui needs to
|
|
27
|
+
// comprehend old wp-admin floating containers, such as Hello Dolly.
|
|
28
|
+
:global(.admin-ui-page) {
|
|
29
|
+
clear: both;
|
|
30
|
+
}
|
|
31
|
+
|
|
12
32
|
.admin-page-header {
|
|
13
33
|
display: flex;
|
|
14
34
|
align-items: center;
|
|
15
35
|
gap: 8px;
|
|
16
36
|
}
|
|
17
37
|
|
|
38
|
+
// Ensure footer Container padding is included in its max-width,
|
|
39
|
+
// preventing horizontal scroll when the content area is narrower
|
|
40
|
+
// than the Container's max-width + padding (JETPACK-1424).
|
|
41
|
+
.admin-page-footer {
|
|
42
|
+
box-sizing: border-box;
|
|
43
|
+
}
|
|
44
|
+
|
|
18
45
|
.sandbox-domain-badge {
|
|
19
46
|
background: #d63638;
|
|
20
47
|
text-transform: uppercase;
|
|
@@ -26,3 +53,9 @@
|
|
|
26
53
|
color: #fff;
|
|
27
54
|
}
|
|
28
55
|
}
|
|
56
|
+
|
|
57
|
+
// Make Hello Dolly background white for Jetpack admin pages.
|
|
58
|
+
:global(.jetpack-admin-page #dolly) {
|
|
59
|
+
background-color: #fff;
|
|
60
|
+
}
|
|
61
|
+
|
|
@@ -18,10 +18,42 @@ export type AdminPageProps = {
|
|
|
18
18
|
showHeader?: boolean;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* Custom header. Optional
|
|
21
|
+
* Custom header. Optional.
|
|
22
|
+
* @deprecated Use `title` and `subTitle` props instead for the unified header.
|
|
22
23
|
*/
|
|
23
24
|
header?: ReactNode;
|
|
24
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Product title displayed in the unified header (e.g. "Social", "Backup").
|
|
28
|
+
* When provided, renders the admin-ui Page header instead of the legacy header slot.
|
|
29
|
+
*/
|
|
30
|
+
title?: string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Optional tagline displayed below the title in the unified header.
|
|
34
|
+
*/
|
|
35
|
+
subTitle?: ReactNode;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Custom logo element for the unified header. Defaults to JetpackLogo icon.
|
|
39
|
+
*/
|
|
40
|
+
logo?: ReactNode;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Action elements displayed on the right side of the unified header.
|
|
44
|
+
*/
|
|
45
|
+
actions?: ReactNode;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Breadcrumb navigation displayed next to the title in the unified header.
|
|
49
|
+
*/
|
|
50
|
+
breadcrumbs?: ReactNode;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Tab navigation displayed below the title/tagline in the unified header.
|
|
54
|
+
*/
|
|
55
|
+
tabs?: ReactNode;
|
|
56
|
+
|
|
25
57
|
/**
|
|
26
58
|
* Whether or not to display the Footer
|
|
27
59
|
*/
|
|
@@ -71,4 +103,10 @@ export type AdminPageProps = {
|
|
|
71
103
|
* Class name to be applied to the root element of the component.
|
|
72
104
|
*/
|
|
73
105
|
className?: string;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Show bottom border of the header. Defaults to true.
|
|
109
|
+
* Hidden when `tabs` is used.
|
|
110
|
+
*/
|
|
111
|
+
showBottomBorder?: boolean;
|
|
74
112
|
};
|
|
@@ -33,7 +33,7 @@ const ExternalIcon: FC = () => (
|
|
|
33
33
|
* @return {ReactNode} JetpackFooter component.
|
|
34
34
|
*/
|
|
35
35
|
const JetpackFooter: FC< JetpackFooterProps > = ( {
|
|
36
|
-
moduleName =
|
|
36
|
+
moduleName = 'Jetpack' /** "Jetpack" is a product name, do not translate. */,
|
|
37
37
|
className,
|
|
38
38
|
moduleNameHref = 'https://jetpack.com',
|
|
39
39
|
menu,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/jetpack-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Jetpack Components Package",
|
|
5
5
|
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/components/#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -34,41 +34,42 @@
|
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "pnpm run clean && pnpm run compile-ts && pnpm run copy-scss",
|
|
36
36
|
"clean": "rm -rf build/",
|
|
37
|
-
"compile-ts": "
|
|
37
|
+
"compile-ts": "tsgo --pretty --project tsconfig.build.json",
|
|
38
38
|
"copy-scss": "node ./tools/copy-scss-to-build.mjs",
|
|
39
39
|
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
40
40
|
"test-coverage": "pnpm run test --coverage",
|
|
41
|
-
"typecheck": "
|
|
41
|
+
"typecheck": "tsgo --noEmit"
|
|
42
42
|
},
|
|
43
43
|
"browserslist": [
|
|
44
44
|
"extends @wordpress/browserslist-config"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@automattic/format-currency": "1.0.1",
|
|
48
|
-
"@automattic/jetpack-api": "^1.0.
|
|
49
|
-
"@automattic/jetpack-boost-score-api": "^1.0.
|
|
50
|
-
"@automattic/jetpack-script-data": "^0.6.
|
|
51
|
-
"@automattic/number-formatters": "^1.1.
|
|
48
|
+
"@automattic/jetpack-api": "^1.0.19",
|
|
49
|
+
"@automattic/jetpack-boost-score-api": "^1.0.33",
|
|
50
|
+
"@automattic/jetpack-script-data": "^0.6.1",
|
|
51
|
+
"@automattic/number-formatters": "^1.1.2",
|
|
52
52
|
"@babel/runtime": "^7",
|
|
53
|
-
"@wordpress/
|
|
54
|
-
"@wordpress/
|
|
55
|
-
"@wordpress/
|
|
56
|
-
"@wordpress/
|
|
57
|
-
"@wordpress/
|
|
58
|
-
"@wordpress/
|
|
59
|
-
"@wordpress/
|
|
60
|
-
"@wordpress/
|
|
61
|
-
"@wordpress/
|
|
53
|
+
"@wordpress/admin-ui": "1.9.0",
|
|
54
|
+
"@wordpress/browserslist-config": "6.41.0",
|
|
55
|
+
"@wordpress/components": "32.3.0",
|
|
56
|
+
"@wordpress/compose": "7.41.0",
|
|
57
|
+
"@wordpress/data": "10.41.0",
|
|
58
|
+
"@wordpress/date": "5.41.0",
|
|
59
|
+
"@wordpress/element": "6.41.0",
|
|
60
|
+
"@wordpress/i18n": "6.14.0",
|
|
61
|
+
"@wordpress/icons": "11.8.0",
|
|
62
|
+
"@wordpress/notices": "5.41.0",
|
|
62
63
|
"clsx": "2.1.1",
|
|
63
64
|
"prop-types": "^15.7.2",
|
|
64
65
|
"qrcode.react": "4.2.0",
|
|
65
66
|
"react-slider": "2.0.5",
|
|
66
|
-
"social-logos": "^3.3.
|
|
67
|
+
"social-logos": "^3.3.11",
|
|
67
68
|
"uplot": "1.6.31",
|
|
68
69
|
"uplot-react": "1.1.4"
|
|
69
70
|
},
|
|
70
71
|
"devDependencies": {
|
|
71
|
-
"@automattic/jetpack-base-styles": "^1.0.
|
|
72
|
+
"@automattic/jetpack-base-styles": "^1.0.19",
|
|
72
73
|
"@babel/core": "7.29.0",
|
|
73
74
|
"@babel/preset-react": "7.28.5",
|
|
74
75
|
"@jest/globals": "30.2.0",
|
|
@@ -81,13 +82,13 @@
|
|
|
81
82
|
"@types/react": "18.3.28",
|
|
82
83
|
"@types/react-dom": "18.3.7",
|
|
83
84
|
"@types/react-slider": "1.3.6",
|
|
85
|
+
"@typescript/native-preview": "7.0.0-dev.20260225.1",
|
|
84
86
|
"jest": "30.2.0",
|
|
85
87
|
"react": "18.3.1",
|
|
86
88
|
"react-dom": "18.3.1",
|
|
87
89
|
"require-from-string": "2.0.2",
|
|
88
90
|
"storybook": "10.2.11",
|
|
89
91
|
"ts-dedent": "2.2.0",
|
|
90
|
-
"typescript": "5.9.3",
|
|
91
92
|
"webpack": "5.105.2",
|
|
92
93
|
"webpack-cli": "6.0.1"
|
|
93
94
|
},
|