@automattic/jetpack-components 2.2.0 → 3.0.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.
Files changed (114) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/build/components/action-button/index.d.ts +1 -1
  3. package/build/components/action-popover/index.d.ts +1 -1
  4. package/build/components/admin-page/style.module.scss +3 -3
  5. package/build/components/boost-score-graph/uplot-line-chart.d.ts +1 -1
  6. package/build/components/decorative-card/index.d.ts +1 -1
  7. package/build/components/details-viewer/index.d.ts +1 -1
  8. package/build/components/diff-viewer/index.d.ts +1 -1
  9. package/build/components/dot-pager/index.d.ts +1 -1
  10. package/build/components/global-notices/global-notices.d.ts +1 -1
  11. package/build/components/loading-placeholder/index.d.ts +1 -1
  12. package/build/components/marked-lines/index.d.ts +1 -1
  13. package/build/components/navigator-modal/footer.d.ts +1 -1
  14. package/build/components/navigator-modal/header.d.ts +1 -1
  15. package/build/components/navigator-modal/index.d.ts +1 -1
  16. package/build/components/navigator-modal/screen.d.ts +1 -1
  17. package/build/components/stat-card/index.d.ts +1 -1
  18. package/build/components/swipeable/index.d.ts +1 -1
  19. package/build/components/upsell-banner/index.d.ts +1 -0
  20. package/build/components/upsell-banner/index.js +8 -2
  21. package/build/components/upsell-banner/style.scss +8 -0
  22. package/build/components/upsell-banner/types.d.ts +4 -0
  23. package/build/index.d.ts +0 -12
  24. package/build/index.js +0 -12
  25. package/components/admin-page/style.module.scss +3 -3
  26. package/components/upsell-banner/index.tsx +19 -0
  27. package/components/upsell-banner/style.scss +8 -0
  28. package/components/upsell-banner/types.ts +4 -0
  29. package/index.ts +0 -12
  30. package/package.json +19 -19
  31. package/build/components/alert/index.d.ts +0 -23
  32. package/build/components/alert/index.js +0 -33
  33. package/build/components/alert/style.module.scss +0 -47
  34. package/build/components/chip/index.d.ts +0 -17
  35. package/build/components/chip/index.js +0 -18
  36. package/build/components/chip/style.module.scss +0 -14
  37. package/build/components/contextual-upgrade-trigger/index.d.ts +0 -19
  38. package/build/components/contextual-upgrade-trigger/index.js +0 -27
  39. package/build/components/contextual-upgrade-trigger/style.module.scss +0 -77
  40. package/build/components/contextual-upgrade-trigger/types.d.ts +0 -9
  41. package/build/components/contextual-upgrade-trigger/types.js +0 -1
  42. package/build/components/dialog/index.d.ts +0 -20
  43. package/build/components/dialog/index.js +0 -32
  44. package/build/components/dialog/style.module.scss +0 -31
  45. package/build/components/jetpack-protect-logo/index.d.ts +0 -4
  46. package/build/components/jetpack-protect-logo/index.js +0 -10
  47. package/build/components/jetpack-protect-logo/types.d.ts +0 -7
  48. package/build/components/jetpack-protect-logo/types.js +0 -1
  49. package/build/components/jetpack-search-logo/index.d.ts +0 -4
  50. package/build/components/jetpack-search-logo/index.js +0 -7
  51. package/build/components/jetpack-search-logo/types.d.ts +0 -7
  52. package/build/components/jetpack-search-logo/types.js +0 -1
  53. package/build/components/jetpack-videopress-logo/index.d.ts +0 -4
  54. package/build/components/jetpack-videopress-logo/index.js +0 -8
  55. package/build/components/jetpack-videopress-logo/types.d.ts +0 -6
  56. package/build/components/jetpack-videopress-logo/types.js +0 -1
  57. package/build/components/product-offer/icons-card.d.ts +0 -10
  58. package/build/components/product-offer/icons-card.js +0 -23
  59. package/build/components/product-offer/index.d.ts +0 -11
  60. package/build/components/product-offer/index.js +0 -31
  61. package/build/components/product-offer/product-offer-header.d.ts +0 -9
  62. package/build/components/product-offer/product-offer-header.js +0 -14
  63. package/build/components/product-offer/style.module.scss +0 -93
  64. package/build/components/product-offer/types.d.ts +0 -102
  65. package/build/components/product-offer/types.js +0 -1
  66. package/build/components/radio-control/index.d.ts +0 -24
  67. package/build/components/radio-control/index.js +0 -7
  68. package/build/components/split-button/index.d.ts +0 -4
  69. package/build/components/split-button/index.js +0 -14
  70. package/build/components/split-button/style.module.scss +0 -26
  71. package/build/components/split-button/types.d.ts +0 -5
  72. package/build/components/split-button/types.js +0 -1
  73. package/build/components/status/index.d.ts +0 -19
  74. package/build/components/status/index.js +0 -29
  75. package/build/components/status/style.module.scss +0 -82
  76. package/build/components/toggle-control/index.d.ts +0 -23
  77. package/build/components/toggle-control/index.js +0 -21
  78. package/build/components/toggle-control/styles.module.scss +0 -24
  79. package/components/alert/index.tsx +0 -60
  80. package/components/alert/style.module.scss +0 -47
  81. package/components/chip/README.md +0 -21
  82. package/components/chip/index.tsx +0 -25
  83. package/components/chip/style.module.scss +0 -14
  84. package/components/contextual-upgrade-trigger/README.md +0 -81
  85. package/components/contextual-upgrade-trigger/index.tsx +0 -59
  86. package/components/contextual-upgrade-trigger/style.module.scss +0 -77
  87. package/components/contextual-upgrade-trigger/types.ts +0 -9
  88. package/components/dialog/index.tsx +0 -70
  89. package/components/dialog/style.module.scss +0 -31
  90. package/components/jetpack-protect-logo/README.md +0 -20
  91. package/components/jetpack-protect-logo/index.tsx +0 -60
  92. package/components/jetpack-protect-logo/types.ts +0 -7
  93. package/components/jetpack-search-logo/README.md +0 -20
  94. package/components/jetpack-search-logo/index.tsx +0 -93
  95. package/components/jetpack-search-logo/types.ts +0 -7
  96. package/components/jetpack-videopress-logo/README.md +0 -19
  97. package/components/jetpack-videopress-logo/index.tsx +0 -95
  98. package/components/jetpack-videopress-logo/types.tsx +0 -6
  99. package/components/product-offer/icons-card.tsx +0 -48
  100. package/components/product-offer/index.tsx +0 -115
  101. package/components/product-offer/product-offer-header.tsx +0 -23
  102. package/components/product-offer/style.module.scss +0 -93
  103. package/components/product-offer/types.ts +0 -126
  104. package/components/radio-control/README.md +0 -5
  105. package/components/radio-control/index.tsx +0 -55
  106. package/components/split-button/index.tsx +0 -48
  107. package/components/split-button/style.module.scss +0 -26
  108. package/components/split-button/types.ts +0 -12
  109. package/components/status/README.md +0 -42
  110. package/components/status/index.tsx +0 -52
  111. package/components/status/style.module.scss +0 -82
  112. package/components/toggle-control/README.md +0 -5
  113. package/components/toggle-control/index.tsx +0 -80
  114. package/components/toggle-control/styles.module.scss +0 -24
package/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  ### This is a list detailing changes for the Jetpack RNA Components package releases.
4
4
 
5
+ ## [3.0.0] - 2026-09-08
6
+ ### Changed
7
+ - Update package dependencies. [#51701]
8
+
9
+ ### Removed
10
+ - Remove the deprecated Chip component in favor of Badge from @wordpress/ui. [#51927]
11
+ - Remove unused components. [#51976]
12
+
13
+ ### Fixed
14
+ - Admin page: Fix the page overlapping the admin menu in right-to-left languages. [#51963]
15
+
16
+ ## [2.3.0] - 2026-09-01
17
+ ### Added
18
+ - Upsell Banner: Add an optional dismiss button. [#51441]
19
+
20
+ ### Changed
21
+ - Update package dependencies. [#51303] [#51802]
22
+
5
23
  ## [2.2.0] - 2026-08-19
6
24
  ### Added
7
25
  - Gravatar: pick a stable Color Studio background color per email for initials identity avatars via bg_color [#50578]
@@ -1905,6 +1923,8 @@
1905
1923
  ### Changed
1906
1924
  - Update node version requirement to 14.16.1
1907
1925
 
1926
+ [3.0.0]: https://github.com/Automattic/jetpack-components/compare/2.3.0...3.0.0
1927
+ [2.3.0]: https://github.com/Automattic/jetpack-components/compare/2.2.0...2.3.0
1908
1928
  [2.2.0]: https://github.com/Automattic/jetpack-components/compare/2.1.1...2.2.0
1909
1929
  [2.1.1]: https://github.com/Automattic/jetpack-components/compare/2.1.0...2.1.1
1910
1930
  [2.1.0]: https://github.com/Automattic/jetpack-components/compare/2.0.1...2.1.0
@@ -1,4 +1,4 @@
1
- declare function ActionButton(props: any): import("react/jsx-runtime").JSX.Element;
1
+ declare function ActionButton(props: any): import("react").JSX.Element;
2
2
  declare namespace ActionButton {
3
3
  var propTypes: {
4
4
  /** The button label. */
@@ -2,5 +2,5 @@
2
2
  * Types
3
3
  */
4
4
  import { ActionPopoverProps } from './types.ts';
5
- declare const ActionPopover: ({ hideCloseButton, title, children, step, totalSteps, buttonContent, buttonDisabled, buttonHref, buttonExternalLink, offset, onClose, onClick, ...otherPopoverProps }: ActionPopoverProps) => import("react/jsx-runtime").JSX.Element;
5
+ declare const ActionPopover: ({ hideCloseButton, title, children, step, totalSteps, buttonContent, buttonDisabled, buttonHref, buttonExternalLink, offset, onClose, onClick, ...otherPopoverProps }: ActionPopoverProps) => import("react").JSX.Element;
6
6
  export default ActionPopover;
@@ -1,8 +1,8 @@
1
1
  .admin-page {
2
- margin-left: -20px; // to neutralize the padding of #wpcontent.
2
+ margin-inline-start: -20px; // to neutralize the padding of #wpcontent.
3
3
 
4
4
  @media (max-width: 782px) {
5
- margin-left: -10px; // to neutralize the padding of #wpcontent.
5
+ margin-inline-start: -10px; // to neutralize the padding of #wpcontent.
6
6
  }
7
7
 
8
8
  &.background {
@@ -104,7 +104,7 @@
104
104
  // line-height: 1.6666;` — see https://github.com/WordPress/WordPress/blob/trunk/wp-content/plugins/hello.php
105
105
  // We override only the bits that need to differ from those defaults.
106
106
  float: none;
107
- text-align: right;
107
+ text-align: end;
108
108
  background: var(--wpds-color-background-surface-neutral-strong, #fff);
109
109
  font-style: italic;
110
110
  color: var(--wpds-color-foreground-content-neutral-weak, #87a6bc);
@@ -23,5 +23,5 @@ interface UplotChartProps {
23
23
  * @param {Annotation[]} props.annotations - The annotations to display in the chart.
24
24
  * @return {ReactElement} The JSX element representing the UplotLineChart component.
25
25
  */
26
- export default function UplotLineChart({ range, periods, annotations }: UplotChartProps): import("react/jsx-runtime").JSX.Element;
26
+ export default function UplotLineChart({ range, periods, annotations }: UplotChartProps): import("react").JSX.Element;
27
27
  export {};
@@ -20,5 +20,5 @@ export interface DecorativeCardProps extends Omit<ComponentProps<'div'>, 'childr
20
20
  * @param {DecorativeCardProps} props - The properties.
21
21
  * @return {import('react').ReactNode} - The DecorativeCard component.
22
22
  */
23
- declare function DecorativeCard({ format, icon, imageUrl, className, ...rest }: DecorativeCardProps): import("react/jsx-runtime").JSX.Element;
23
+ declare function DecorativeCard({ format, icon, imageUrl, className, ...rest }: DecorativeCardProps): import("react").JSX.Element;
24
24
  export default DecorativeCard;
@@ -7,5 +7,5 @@
7
7
  */
8
8
  declare const DetailsViewer: ({ details }: {
9
9
  details: any;
10
- }) => import("react/jsx-runtime").JSX.Element;
10
+ }) => import("react").JSX.Element;
11
11
  export default DetailsViewer;
@@ -1,4 +1,4 @@
1
1
  export declare const DiffViewer: ({ diff }: {
2
2
  diff: any;
3
- }) => import("react/jsx-runtime").JSX.Element;
3
+ }) => import("react").JSX.Element;
4
4
  export default DiffViewer;
@@ -10,5 +10,5 @@ type DotPagerProps = {
10
10
  tracksPrefix?: string;
11
11
  tracksFn?: (eventName: string, data?: Record<string, unknown>) => void;
12
12
  };
13
- declare const DotPager: ({ hasDynamicHeight, children, className, onPageSelected, isClickEnabled, rotateTime, tracksPrefix, tracksFn, ...props }: DotPagerProps) => import("react/jsx-runtime").JSX.Element;
13
+ declare const DotPager: ({ hasDynamicHeight, children, className, onPageSelected, isClickEnabled, rotateTime, tracksPrefix, tracksFn, ...props }: DotPagerProps) => import("react").JSX.Element;
14
14
  export default DotPager;
@@ -8,4 +8,4 @@ export type GlobalNoticesProps = {
8
8
  *
9
9
  * @return {import('react').ReactNode} The rendered notices list.
10
10
  */
11
- export declare function GlobalNotices({ maxVisibleNotices }: GlobalNoticesProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function GlobalNotices({ maxVisibleNotices }: GlobalNoticesProps): import("react").JSX.Element;
@@ -4,5 +4,5 @@ declare const LoadingPlaceholder: ({ children, width, height, className, }: {
4
4
  width?: number | string;
5
5
  height?: number;
6
6
  className?: string;
7
- }) => import("react/jsx-runtime").JSX.Element;
7
+ }) => import("react").JSX.Element;
8
8
  export default LoadingPlaceholder;
@@ -1,4 +1,4 @@
1
1
  declare const MarkedLines: ({ context }: {
2
2
  context: any;
3
- }) => import("react/jsx-runtime").JSX.Element;
3
+ }) => import("react").JSX.Element;
4
4
  export default MarkedLines;
@@ -12,4 +12,4 @@ export type FooterProps = React.HTMLAttributes<HTMLDivElement> & {
12
12
  *
13
13
  * @return The rendered footer.
14
14
  */
15
- export declare function Footer({ children, actions, isScreenLocked, className, ...props }: FooterProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function Footer({ children, actions, isScreenLocked, className, ...props }: FooterProps): import("react").JSX.Element;
@@ -26,4 +26,4 @@ export type HeaderProps = {
26
26
  *
27
27
  * @return component
28
28
  */
29
- export declare function Header({ icon, title, isScreenLocked, onGoBack: onGoBackProp, onClose: onCloseProp, }: HeaderProps): import("react/jsx-runtime").JSX.Element;
29
+ export declare function Header({ icon, title, isScreenLocked, onGoBack: onGoBackProp, onClose: onCloseProp, }: HeaderProps): import("react").JSX.Element;
@@ -11,7 +11,7 @@ type NavigatorModalProps = Omit<ModalProps, 'onRequestClose'> & TNavigatorModalC
11
11
  *
12
12
  * @return Component
13
13
  */
14
- declare function NavigatorModalMain({ children, className, initialPath, onClose, isDismissible, ...props }: NavigatorModalProps): import("react/jsx-runtime").JSX.Element;
14
+ declare function NavigatorModalMain({ children, className, initialPath, onClose, isDismissible, ...props }: NavigatorModalProps): import("react").JSX.Element;
15
15
  export declare const NavigatorModal: typeof NavigatorModalMain & {
16
16
  Screen: typeof Screen & {
17
17
  displayName: string;
@@ -42,4 +42,4 @@ export type ScreenProps = Omit<React.ComponentProps<typeof Navigator.Screen>, 'c
42
42
  *
43
43
  * @return The rendered screen.
44
44
  */
45
- export declare function Screen({ path, className, title, sidebar, headerIcon, isScreenLocked, onGoBack, onClose, footerContent, footerActions, children, content, ...props }: ScreenProps): import("react/jsx-runtime").JSX.Element;
45
+ export declare function Screen({ path, className, title, sidebar, headerIcon, isScreenLocked, onGoBack, onClose, footerContent, footerActions, children, content, ...props }: ScreenProps): import("react").JSX.Element;
@@ -5,5 +5,5 @@ import { StatCardProps } from './types.ts';
5
5
  * @param {StatCardProps} props - Component props.
6
6
  * @return {ReactNode} - StatCard react component.
7
7
  */
8
- declare const StatCard: ({ className, hideValue, icon, label, value, variant, }: StatCardProps) => import("react/jsx-runtime").JSX.Element;
8
+ declare const StatCard: ({ className, hideValue, icon, label, value, variant, }: StatCardProps) => import("react").JSX.Element;
9
9
  export default StatCard;
@@ -8,5 +8,5 @@ export declare const Swipeable: ({ hasDynamicHeight, children, currentPage, onPa
8
8
  isClickEnabled: any;
9
9
  onPageSelect: any;
10
10
  pageClassName: any;
11
- }) => import("react/jsx-runtime").JSX.Element;
11
+ }) => import("react").JSX.Element;
12
12
  export default Swipeable;
@@ -6,6 +6,7 @@ import './style.scss';
6
6
  *
7
7
  * - The primary CTA is the second button, at the right position.
8
8
  * - The secondary CTA is the first button, at the left position.
9
+ * - Passing `onDismiss` renders a close button in the top corner of the banner.
9
10
  *
10
11
  * @param {UpsellBannerProps} props - Component props.
11
12
  * @return {ReactNode} - UpsellBanner component.
@@ -1,6 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Card, CardBody } from '@wordpress/components';
3
3
  import { createInterpolateElement } from '@wordpress/element';
4
+ import { __ } from '@wordpress/i18n';
5
+ import { close } from '@wordpress/icons';
4
6
  import Button from '../button/index.js';
5
7
  import './style.scss';
6
8
  /**
@@ -8,13 +10,17 @@ import './style.scss';
8
10
  *
9
11
  * - The primary CTA is the second button, at the right position.
10
12
  * - The secondary CTA is the first button, at the left position.
13
+ * - Passing `onDismiss` renders a close button in the top corner of the banner.
11
14
  *
12
15
  * @param {UpsellBannerProps} props - Component props.
13
16
  * @return {ReactNode} - UpsellBanner component.
14
17
  */
15
18
  const UpsellBanner = props => {
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: [_jsxs("div", { className: "upsell-banner--content-info", children: [_jsx("h3", { children: title }), _jsx("p", { children: createInterpolateElement(description, {
19
+ const { icon, title, description, primaryCtaLabel, primaryCtaURL, primaryCtaIsExternalLink, primaryCtaOnClick, secondaryCtaLabel, secondaryCtaURL, secondaryCtaIsExternalLink, secondaryCtaOnClick, onDismiss, dismissLabel, } = props;
20
+ return (_jsx(Card, { isRounded: true, size: "large", children: _jsxs(CardBody, { className: "upsell-banner", size: "large", children: [onDismiss && (_jsx(Button, { className: "upsell-banner--dismiss", variant: "tertiary", size: "small", icon: close, iconSize: 16,
21
+ // Button wraps its children in a span, so the tooltip an icon-only
22
+ // WPButton would show on its own has to be asked for explicitly.
23
+ showTooltip: true, label: dismissLabel || __('Dismiss', 'jetpack-components'), onClick: onDismiss })), icon && (_jsx("div", { className: "upsell-banner--icon", children: _jsx("img", { src: icon, alt: "" }) })), _jsxs("div", { className: "upsell-banner--content", children: [_jsxs("div", { className: "upsell-banner--content-info", children: [_jsx("h3", { children: title }), _jsx("p", { children: createInterpolateElement(description, {
18
24
  br: _jsx("br", {}),
19
25
  }) })] }), _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 }))] })] })] }) }));
20
26
  };
@@ -5,6 +5,7 @@
5
5
  .upsell-banner {
6
6
  display: flex;
7
7
  flex-direction: column;
8
+ position: relative;
8
9
 
9
10
  background: rgb(249, 249, 246);
10
11
  background: linear-gradient(133deg, rgb(206, 217, 242) 0%, rgb(249, 249, 246) 10%, rgb(249, 249, 246) 80%, rgb(245, 230, 179) 100%);
@@ -18,6 +19,13 @@
18
19
  padding: 36px;
19
20
  }
20
21
 
22
+ .upsell-banner--dismiss.components-button {
23
+ position: absolute;
24
+ inset-block-start: 8px;
25
+ inset-inline-end: 8px;
26
+ color: var(--jp-gray-60);
27
+ }
28
+
21
29
  .upsell-banner--icon {
22
30
  display: flex;
23
31
  align-items: flex-start;
@@ -10,4 +10,8 @@ export type UpsellBannerProps = {
10
10
  secondaryCtaURL?: string;
11
11
  secondaryCtaIsExternalLink?: boolean;
12
12
  secondaryCtaOnClick?: () => void;
13
+ /** Renders a dismiss button in the top corner of the banner when provided. */
14
+ onDismiss?: () => void;
15
+ /** Accessible label for the dismiss button. Defaults to "Dismiss". */
16
+ dismissLabel?: string;
13
17
  };
package/build/index.d.ts CHANGED
@@ -1,8 +1,5 @@
1
1
  export { default as JetpackLogo } from './components/jetpack-logo/index.tsx';
2
- export { default as JetpackSearchLogo } from './components/jetpack-search-logo/index.tsx';
3
- export { default as JetpackProtectLogo } from './components/jetpack-protect-logo/index.tsx';
4
2
  export { default as JetpackVaultPressBackupLogo } from './components/jetpack-vaultpress-backup-logo/index.tsx';
5
- export { default as JetpackVideoPressLogo } from './components/jetpack-videopress-logo/index.tsx';
6
3
  export { default as getRedirectUrl } from './tools/jp-redirect/index.ts';
7
4
  export { default as getProductCheckoutUrl } from './tools/get-product-checkout-url/index.ts';
8
5
  export { isFirstMonthTrial } from './tools/pricing-utils/index.ts';
@@ -24,38 +21,29 @@ export { default as Testimonials } from './components/testimonials/index.tsx';
24
21
  export { default as Container } from './components/layout/container/index.tsx';
25
22
  export { default as CopyToClipboard } from './components/copy-to-clipboard/index.tsx';
26
23
  export * from './components/icons/index.tsx';
27
- export { default as SplitButton } from './components/split-button/index.tsx';
28
24
  export { default as ThemeProvider } from './components/theme-provider/index.tsx';
29
25
  export { default as Text, H2, H3, Title } from './components/text/index.tsx';
30
- export { default as ToggleControl } from './components/toggle-control/index.tsx';
31
26
  export { default as NumberControl } from './components/number-control/index.tsx';
32
27
  export { default as QRCode } from './components/qr-code/index.tsx';
33
28
  export { default as Button } from './components/button/index.tsx';
34
29
  export type { ButtonProps } from './components/button/types.ts';
35
30
  export { default as LoadingPlaceholder } from './components/loading-placeholder/index.tsx';
36
31
  export { default as TermsOfService } from './components/terms-of-service/index.tsx';
37
- export { default as Chip } from './components/chip/index.tsx';
38
32
  export { default as PricingTable, PricingTableColumn, PricingTableHeader, PricingTableItem, } from './components/pricing-table/index.tsx';
39
33
  export { default as BoostScoreBar } from './components/boost-score-bar/index.tsx';
40
34
  export { default as BoostScoreGraph } from './components/boost-score-graph/index.tsx';
41
35
  export { default as ProductPrice } from './components/product-price/index.tsx';
42
- export { default as ProductOffer, IconsCard } from './components/product-offer/index.tsx';
43
- export { default as Dialog } from './components/dialog/index.tsx';
44
36
  export { default as DotPager } from './components/dot-pager/index.tsx';
45
37
  export { default as DonutMeter } from './components/donut-meter/index.tsx';
46
38
  export { default as RecordMeterBar } from './components/record-meter-bar/index.tsx';
47
- export { default as ContextualUpgradeTrigger } from './components/contextual-upgrade-trigger/index.tsx';
48
- export { default as Alert } from './components/alert/index.tsx';
49
39
  export { default as Notice } from './components/notice/index.tsx';
50
40
  export { default as Popover } from './components/popover/index.tsx';
51
- export { default as Status } from './components/status/index.tsx';
52
41
  export { default as IndeterminateProgressBar } from './components/indeterminate-progress-bar/index.tsx';
53
42
  export { default as ActionPopover } from './components/action-popover/index.tsx';
54
43
  export { default as ZendeskChat } from './components/zendesk-chat/index.tsx';
55
44
  export { default as ProgressBar } from './components/progress-bar/index.tsx';
56
45
  export { default as UpsellBanner } from './components/upsell-banner/index.tsx';
57
46
  export { getUserLocale, cleanLocale } from './lib/locale/index.ts';
58
- export { default as RadioControl } from './components/radio-control/index.tsx';
59
47
  export { default as StatCard } from './components/stat-card/index.tsx';
60
48
  export { default as DiffViewer } from './components/diff-viewer/index.tsx';
61
49
  export { default as MarkedLines } from './components/marked-lines/index.tsx';
package/build/index.js CHANGED
@@ -13,10 +13,7 @@ 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
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
16
  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
17
  export { default as getRedirectUrl } from './tools/jp-redirect/index.js';
21
18
  export { default as getProductCheckoutUrl } from './tools/get-product-checkout-url/index.js';
22
19
  export { isFirstMonthTrial } from './tools/pricing-utils/index.js';
@@ -37,37 +34,28 @@ export { default as Testimonials } from './components/testimonials/index.js';
37
34
  export { default as Container } from './components/layout/container/index.js';
38
35
  export { default as CopyToClipboard } from './components/copy-to-clipboard/index.js';
39
36
  export * from './components/icons/index.js';
40
- export { default as SplitButton } from './components/split-button/index.js';
41
37
  export { default as ThemeProvider } from './components/theme-provider/index.js';
42
38
  export { default as Text, H2, H3, Title } from './components/text/index.js';
43
- export { default as ToggleControl } from './components/toggle-control/index.js';
44
39
  export { default as NumberControl } from './components/number-control/index.js';
45
40
  export { default as QRCode } from './components/qr-code/index.js';
46
41
  export { default as Button } from './components/button/index.js';
47
42
  export { default as LoadingPlaceholder } from './components/loading-placeholder/index.js';
48
43
  export { default as TermsOfService } from './components/terms-of-service/index.js';
49
- export { default as Chip } from './components/chip/index.js';
50
44
  export { default as PricingTable, PricingTableColumn, PricingTableHeader, PricingTableItem, } from './components/pricing-table/index.js';
51
45
  export { default as BoostScoreBar } from './components/boost-score-bar/index.js';
52
46
  export { default as BoostScoreGraph } from './components/boost-score-graph/index.js';
53
47
  export { default as ProductPrice } from './components/product-price/index.js';
54
- export { default as ProductOffer, IconsCard } from './components/product-offer/index.js';
55
- export { default as Dialog } from './components/dialog/index.js';
56
48
  export { default as DotPager } from './components/dot-pager/index.js';
57
49
  export { default as DonutMeter } from './components/donut-meter/index.js';
58
50
  export { default as RecordMeterBar } from './components/record-meter-bar/index.js';
59
- export { default as ContextualUpgradeTrigger } from './components/contextual-upgrade-trigger/index.js';
60
- export { default as Alert } from './components/alert/index.js';
61
51
  export { default as Notice } from './components/notice/index.js';
62
52
  export { default as Popover } from './components/popover/index.js';
63
- export { default as Status } from './components/status/index.js';
64
53
  export { default as IndeterminateProgressBar } from './components/indeterminate-progress-bar/index.js';
65
54
  export { default as ActionPopover } from './components/action-popover/index.js';
66
55
  export { default as ZendeskChat } from './components/zendesk-chat/index.js';
67
56
  export { default as ProgressBar } from './components/progress-bar/index.js';
68
57
  export { default as UpsellBanner } from './components/upsell-banner/index.js';
69
58
  export { getUserLocale, cleanLocale } from './lib/locale/index.js';
70
- export { default as RadioControl } from './components/radio-control/index.js';
71
59
  export { default as StatCard } from './components/stat-card/index.js';
72
60
  export { default as DiffViewer } from './components/diff-viewer/index.js';
73
61
  export { default as MarkedLines } from './components/marked-lines/index.js';
@@ -1,8 +1,8 @@
1
1
  .admin-page {
2
- margin-left: -20px; // to neutralize the padding of #wpcontent.
2
+ margin-inline-start: -20px; // to neutralize the padding of #wpcontent.
3
3
 
4
4
  @media (max-width: 782px) {
5
- margin-left: -10px; // to neutralize the padding of #wpcontent.
5
+ margin-inline-start: -10px; // to neutralize the padding of #wpcontent.
6
6
  }
7
7
 
8
8
  &.background {
@@ -104,7 +104,7 @@
104
104
  // line-height: 1.6666;` — see https://github.com/WordPress/WordPress/blob/trunk/wp-content/plugins/hello.php
105
105
  // We override only the bits that need to differ from those defaults.
106
106
  float: none;
107
- text-align: right;
107
+ text-align: end;
108
108
  background: var(--wpds-color-background-surface-neutral-strong, #fff);
109
109
  font-style: italic;
110
110
  color: var(--wpds-color-foreground-content-neutral-weak, #87a6bc);
@@ -1,5 +1,7 @@
1
1
  import { Card, CardBody } from '@wordpress/components';
2
2
  import { createInterpolateElement } from '@wordpress/element';
3
+ import { __ } from '@wordpress/i18n';
4
+ import { close } from '@wordpress/icons';
3
5
  import Button from '../button/index.tsx';
4
6
  import { UpsellBannerProps } from './types.ts';
5
7
  import type { FC, ReactNode } from 'react';
@@ -11,6 +13,7 @@ import './style.scss';
11
13
  *
12
14
  * - The primary CTA is the second button, at the right position.
13
15
  * - The secondary CTA is the first button, at the left position.
16
+ * - Passing `onDismiss` renders a close button in the top corner of the banner.
14
17
  *
15
18
  * @param {UpsellBannerProps} props - Component props.
16
19
  * @return {ReactNode} - UpsellBanner component.
@@ -28,11 +31,27 @@ const UpsellBanner: FC< UpsellBannerProps > = props => {
28
31
  secondaryCtaURL,
29
32
  secondaryCtaIsExternalLink,
30
33
  secondaryCtaOnClick,
34
+ onDismiss,
35
+ dismissLabel,
31
36
  } = props;
32
37
 
33
38
  return (
34
39
  <Card isRounded={ true } size="large">
35
40
  <CardBody className="upsell-banner" size="large">
41
+ { onDismiss && (
42
+ <Button
43
+ className="upsell-banner--dismiss"
44
+ variant="tertiary"
45
+ size="small"
46
+ icon={ close }
47
+ iconSize={ 16 }
48
+ // Button wraps its children in a span, so the tooltip an icon-only
49
+ // WPButton would show on its own has to be asked for explicitly.
50
+ showTooltip={ true }
51
+ label={ dismissLabel || __( 'Dismiss', 'jetpack-components' ) }
52
+ onClick={ onDismiss }
53
+ />
54
+ ) }
36
55
  { icon && (
37
56
  <div className="upsell-banner--icon">
38
57
  <img src={ icon } alt="" />
@@ -5,6 +5,7 @@
5
5
  .upsell-banner {
6
6
  display: flex;
7
7
  flex-direction: column;
8
+ position: relative;
8
9
 
9
10
  background: rgb(249, 249, 246);
10
11
  background: linear-gradient(133deg, rgb(206, 217, 242) 0%, rgb(249, 249, 246) 10%, rgb(249, 249, 246) 80%, rgb(245, 230, 179) 100%);
@@ -18,6 +19,13 @@
18
19
  padding: 36px;
19
20
  }
20
21
 
22
+ .upsell-banner--dismiss.components-button {
23
+ position: absolute;
24
+ inset-block-start: 8px;
25
+ inset-inline-end: 8px;
26
+ color: var(--jp-gray-60);
27
+ }
28
+
21
29
  .upsell-banner--icon {
22
30
  display: flex;
23
31
  align-items: flex-start;
@@ -10,4 +10,8 @@ export type UpsellBannerProps = {
10
10
  secondaryCtaURL?: string;
11
11
  secondaryCtaIsExternalLink?: boolean;
12
12
  secondaryCtaOnClick?: () => void;
13
+ /** Renders a dismiss button in the top corner of the banner when provided. */
14
+ onDismiss?: () => void;
15
+ /** Accessible label for the dismiss button. Defaults to "Dismiss". */
16
+ dismissLabel?: string;
13
17
  };
package/index.ts CHANGED
@@ -14,10 +14,7 @@ along with this program; if not, see <https://www.gnu.org/licenses/>.
14
14
  */
15
15
 
16
16
  export { default as JetpackLogo } from './components/jetpack-logo/index.tsx';
17
- export { default as JetpackSearchLogo } from './components/jetpack-search-logo/index.tsx';
18
- export { default as JetpackProtectLogo } from './components/jetpack-protect-logo/index.tsx';
19
17
  export { default as JetpackVaultPressBackupLogo } from './components/jetpack-vaultpress-backup-logo/index.tsx';
20
- export { default as JetpackVideoPressLogo } from './components/jetpack-videopress-logo/index.tsx';
21
18
  export { default as getRedirectUrl } from './tools/jp-redirect/index.ts';
22
19
  export { default as getProductCheckoutUrl } from './tools/get-product-checkout-url/index.ts';
23
20
  export { isFirstMonthTrial } from './tools/pricing-utils/index.ts';
@@ -39,17 +36,14 @@ export { default as Testimonials } from './components/testimonials/index.tsx';
39
36
  export { default as Container } from './components/layout/container/index.tsx';
40
37
  export { default as CopyToClipboard } from './components/copy-to-clipboard/index.tsx';
41
38
  export * from './components/icons/index.tsx';
42
- export { default as SplitButton } from './components/split-button/index.tsx';
43
39
  export { default as ThemeProvider } from './components/theme-provider/index.tsx';
44
40
  export { default as Text, H2, H3, Title } from './components/text/index.tsx';
45
- export { default as ToggleControl } from './components/toggle-control/index.tsx';
46
41
  export { default as NumberControl } from './components/number-control/index.tsx';
47
42
  export { default as QRCode } from './components/qr-code/index.tsx';
48
43
  export { default as Button } from './components/button/index.tsx';
49
44
  export type { ButtonProps } from './components/button/types.ts';
50
45
  export { default as LoadingPlaceholder } from './components/loading-placeholder/index.tsx';
51
46
  export { default as TermsOfService } from './components/terms-of-service/index.tsx';
52
- export { default as Chip } from './components/chip/index.tsx';
53
47
  export {
54
48
  default as PricingTable,
55
49
  PricingTableColumn,
@@ -59,23 +53,17 @@ export {
59
53
  export { default as BoostScoreBar } from './components/boost-score-bar/index.tsx';
60
54
  export { default as BoostScoreGraph } from './components/boost-score-graph/index.tsx';
61
55
  export { default as ProductPrice } from './components/product-price/index.tsx';
62
- export { default as ProductOffer, IconsCard } from './components/product-offer/index.tsx';
63
- export { default as Dialog } from './components/dialog/index.tsx';
64
56
  export { default as DotPager } from './components/dot-pager/index.tsx';
65
57
  export { default as DonutMeter } from './components/donut-meter/index.tsx';
66
58
  export { default as RecordMeterBar } from './components/record-meter-bar/index.tsx';
67
- export { default as ContextualUpgradeTrigger } from './components/contextual-upgrade-trigger/index.tsx';
68
- export { default as Alert } from './components/alert/index.tsx';
69
59
  export { default as Notice } from './components/notice/index.tsx';
70
60
  export { default as Popover } from './components/popover/index.tsx';
71
- export { default as Status } from './components/status/index.tsx';
72
61
  export { default as IndeterminateProgressBar } from './components/indeterminate-progress-bar/index.tsx';
73
62
  export { default as ActionPopover } from './components/action-popover/index.tsx';
74
63
  export { default as ZendeskChat } from './components/zendesk-chat/index.tsx';
75
64
  export { default as ProgressBar } from './components/progress-bar/index.tsx';
76
65
  export { default as UpsellBanner } from './components/upsell-banner/index.tsx';
77
66
  export { getUserLocale, cleanLocale } from './lib/locale/index.ts';
78
- export { default as RadioControl } from './components/radio-control/index.tsx';
79
67
  export { default as StatCard } from './components/stat-card/index.tsx';
80
68
  export { default as DiffViewer } from './components/diff-viewer/index.tsx';
81
69
  export { default as MarkedLines } from './components/marked-lines/index.tsx';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/jetpack-components",
3
- "version": "2.2.0",
3
+ "version": "3.0.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": {
@@ -73,34 +73,34 @@
73
73
  ],
74
74
  "dependencies": {
75
75
  "@automattic/format-currency": "1.0.1",
76
- "@automattic/jetpack-api": "^1.0.32",
77
- "@automattic/jetpack-boost-score-api": "^1.0.55",
76
+ "@automattic/jetpack-api": "^1.0.33",
77
+ "@automattic/jetpack-boost-score-api": "^1.0.57",
78
78
  "@automattic/jetpack-script-data": "^0.6.6",
79
- "@automattic/number-formatters": "^1.2.7",
79
+ "@automattic/number-formatters": "^1.2.8",
80
80
  "@babel/runtime": "^7",
81
81
  "@gravatar-com/hovercards": "0.16.0",
82
- "@wordpress/admin-ui": "2.7.0",
83
- "@wordpress/browserslist-config": "6.51.0",
84
- "@wordpress/components": "37.0.0",
85
- "@wordpress/compose": "8.4.0",
86
- "@wordpress/data": "10.51.0",
87
- "@wordpress/date": "5.51.0",
88
- "@wordpress/element": "8.3.0",
89
- "@wordpress/i18n": "6.24.0",
90
- "@wordpress/icons": "15.3.0",
91
- "@wordpress/notices": "5.51.0",
92
- "@wordpress/theme": "1.1.0",
93
- "@wordpress/ui": "0.19.0",
82
+ "@wordpress/admin-ui": "2.9.0",
83
+ "@wordpress/browserslist-config": "6.54.0",
84
+ "@wordpress/components": "40.0.0",
85
+ "@wordpress/compose": "8.7.0",
86
+ "@wordpress/data": "10.54.0",
87
+ "@wordpress/date": "5.54.0",
88
+ "@wordpress/element": "8.6.0",
89
+ "@wordpress/i18n": "6.27.0",
90
+ "@wordpress/icons": "15.5.0",
91
+ "@wordpress/notices": "5.54.0",
92
+ "@wordpress/theme": "2.0.0",
93
+ "@wordpress/ui": "0.21.0",
94
94
  "clsx": "2.1.1",
95
95
  "js-sha256": "0.11.1",
96
96
  "prop-types": "^15.7.2",
97
97
  "qrcode.react": "4.2.0",
98
- "social-logos": "^3.3.18",
98
+ "social-logos": "^3.3.19",
99
99
  "uplot": "1.6.31",
100
100
  "uplot-react": "1.1.4"
101
101
  },
102
102
  "devDependencies": {
103
- "@automattic/jetpack-base-styles": "^1.2.10",
103
+ "@automattic/jetpack-base-styles": "^1.2.11",
104
104
  "@babel/core": "7.29.7",
105
105
  "@jest/globals": "30.4.1",
106
106
  "@storybook/addon-docs": "10.4.6",
@@ -109,7 +109,7 @@
109
109
  "@testing-library/react": "16.3.2",
110
110
  "@testing-library/user-event": "14.6.1",
111
111
  "@types/jest": "30.0.0",
112
- "@types/react": "18.3.28",
112
+ "@types/react": "18.3.31",
113
113
  "@types/react-dom": "18.3.7",
114
114
  "@typescript/native-preview": "7.0.0-dev.20260707.2",
115
115
  "jest": "30.4.2",
@@ -1,23 +0,0 @@
1
- import type { ReactNode, FC } from 'react';
2
- type AlertProps = {
3
- /** The severity of the alert. */
4
- level: 'error' | 'warning' | 'info' | 'success';
5
- /** Show/Hide icon */
6
- showIcon?: boolean;
7
- /** Children to be rendered inside the alert. */
8
- children: ReactNode;
9
- /** Wrapper class name */
10
- className?: string;
11
- };
12
- /**
13
- * Alert component
14
- *
15
- * @param {object} props - The component properties.
16
- * @param {string} props.level - The alert level: error, warning, info, success.
17
- * @param {boolean} props.showIcon - Whether to show the alert icon.
18
- * @param {string} props.className - The wrapper class name.
19
- * @param {Component} props.children - The alert content.
20
- * @return {ReactElement} The `Alert` component.
21
- */
22
- declare const Alert: FC<AlertProps>;
23
- export default Alert;