@automattic/jetpack-components 4.0.3 → 5.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  ### This is a list detailing changes for the Jetpack RNA Components package releases.
4
4
 
5
+ ## [5.0.0] - 2026-10-19
6
+ ### Added
7
+ - Add a CheckboxCard component. [#53733]
8
+ - AdminPage: Add a `globalControls` slot for Jetpack-wide controls, shown after the page actions in the header. [#53631]
9
+
10
+ ### Changed
11
+ - Gravatar: Use the WordPress Design System neutral surface color token for the placeholder background. [#53800]
12
+ - Update package dependencies. [#53806]
13
+
14
+ ### Removed
15
+ - Remove ProgressBar component. Use Progress or Meter from @wordpress/ui instead. [#53801]
16
+
17
+ ## [4.0.4] - 2026-10-15
18
+ ### Changed
19
+ - Update package dependencies. [#53004]
20
+
5
21
  ## [4.0.3] - 2026-10-14
6
22
  ### Changed
7
23
  - Update dependencies.
@@ -1999,6 +2015,8 @@
1999
2015
  ### Changed
2000
2016
  - Update node version requirement to 14.16.1
2001
2017
 
2018
+ [5.0.0]: https://github.com/Automattic/jetpack-components/compare/4.0.4...5.0.0
2019
+ [4.0.4]: https://github.com/Automattic/jetpack-components/compare/4.0.3...4.0.4
2002
2020
  [4.0.3]: https://github.com/Automattic/jetpack-components/compare/4.0.2...4.0.3
2003
2021
  [4.0.2]: https://github.com/Automattic/jetpack-components/compare/4.0.1...4.0.2
2004
2022
  [4.0.1]: https://github.com/Automattic/jetpack-components/compare/4.0.0...4.0.1
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import restApi from '@automattic/jetpack-api';
3
3
  import { Page } from '@wordpress/admin-ui';
4
4
  import { __, sprintf } from '@wordpress/i18n';
@@ -17,7 +17,7 @@ import styles from './style.module.scss';
17
17
  * @param {AdminPageProps} props - Component properties.
18
18
  * @return {ReactNode} AdminPage component.
19
19
  */
20
- const AdminPage = ({ children, className, showHeader = true, showFooter = true, showBackground = true, sandboxedDomain = '', apiRoot = '', apiNonce = '', optionalMenuItems, header, title, subTitle, logo, actions, breadcrumbs, tabs, showBottomBorder = true, unwrapped = false, }) => {
20
+ const AdminPage = ({ children, className, showHeader = true, showFooter = true, showBackground = true, sandboxedDomain = '', apiRoot = '', apiNonce = '', optionalMenuItems, header, title, subTitle, logo, actions, globalControls, breadcrumbs, tabs, showBottomBorder = true, unwrapped = false, }) => {
21
21
  useEffect(() => {
22
22
  restApi.setApiRoot(apiRoot);
23
23
  restApi.setApiNonce(apiNonce);
@@ -44,7 +44,7 @@ const AdminPage = ({ children, className, showHeader = true, showFooter = true,
44
44
  }, []);
45
45
  // When title or breadcrumbs are provided, use admin-ui Page for the full page layout.
46
46
  if (showHeader && (title || breadcrumbs)) {
47
- return (_jsx("div", { className: rootClassName, children: _jsxs(Page, { className: "jp-admin-page__page", visual: logo || _jsx(JetpackLogo, { showText: false, height: 20 }), breadcrumbs: breadcrumbs, title: title, subTitle: subTitle, actions: actions, showSidebarToggle: false, children: [tabs, unwrapped ? (children) : (_jsx(Container, { fluid: true, horizontalSpacing: 0, children: _jsx(Col, { children: children }) })), showFooter && _jsx(JetpackFooter, { menu: optionalMenuItems })] }) }));
47
+ return (_jsx("div", { className: rootClassName, children: _jsxs(Page, { className: "jp-admin-page__page", visual: logo || _jsx(JetpackLogo, { showText: false, height: 20 }), breadcrumbs: breadcrumbs, title: title, subTitle: subTitle, actions: globalControls ? (_jsxs(_Fragment, { children: [actions, actions && (_jsx("span", { role: "separator", "aria-orientation": "vertical", className: styles['global-controls-separator'] })), globalControls] })) : (actions), showSidebarToggle: false, children: [tabs, unwrapped ? (children) : (_jsx(Container, { fluid: true, horizontalSpacing: 0, children: _jsx(Col, { children: children }) })), showFooter && _jsx(JetpackFooter, { menu: optionalMenuItems })] }) }));
48
48
  }
49
49
  // Legacy path: no title provided, render the classic header.
50
50
  return (_jsxs("div", { className: rootClassName, children: [showHeader && (_jsx(Container, { horizontalSpacing: 5, children: _jsxs(Col, { className: clsx(styles['admin-page-header'], 'jp-admin-page-header'), children: [header ? header : _jsx(JetpackLogo, {}), sandboxedDomain && (_jsx("code", { className: styles['sandbox-domain-badge'], onClick: testConnection, onKeyDown: testConnection,
@@ -97,3 +97,9 @@
97
97
  display: none;
98
98
  }
99
99
  }
100
+
101
+ .global-controls-separator {
102
+ align-self: stretch;
103
+ inline-size: 1px;
104
+ background-color: var(--wpds-color-stroke-surface-neutral-weak);
105
+ }
@@ -31,6 +31,12 @@ export type AdminPageProps = {
31
31
  * Action elements displayed on the right side of the unified header.
32
32
  */
33
33
  actions?: ReactNode;
34
+ /**
35
+ * Jetpack-wide controls, such as the connection control, shown after the page's own `actions`.
36
+ * Only rendered in the unified header, in `Page`'s actions row, so pass compact controls such as icon buttons.
37
+ * Pass `null` when there is nothing to show: any element, even an empty one, makes `Page` draw the row.
38
+ */
39
+ globalControls?: ReactNode;
34
40
  /**
35
41
  * Breadcrumb navigation displayed next to the title in the unified header.
36
42
  */
@@ -0,0 +1,19 @@
1
+ import './style.scss';
2
+ import type { CheckboxCardGridProps, CheckboxCardProps } from './types.ts';
3
+ import type { JSX } from 'react';
4
+ /**
5
+ * Lays out checkbox cards in two columns, or one on narrow screens.
6
+ *
7
+ * @param {CheckboxCardGridProps} props - Component props.
8
+ * @return {JSX.Element} The grid.
9
+ */
10
+ export declare function CheckboxCardGrid({ children, className }: CheckboxCardGridProps): JSX.Element;
11
+ /**
12
+ * A card with a checkbox, toggled by a click on its illustration.
13
+ *
14
+ * @param {CheckboxCardProps} props - Component props.
15
+ * @return {JSX.Element} The card.
16
+ */
17
+ export default function CheckboxCard({ id, name, title, illustration, checked, onChange, previewUrl, onPreviewClick, disabled, }: CheckboxCardProps): JSX.Element;
18
+ export { CheckboxCard };
19
+ export type { CheckboxCardProps, CheckboxCardGridProps };
@@ -0,0 +1,30 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback } from '@wordpress/element';
3
+ import { __ } from '@wordpress/i18n';
4
+ import { Card, Checkbox, Field, Link, Stack, Text } from '@wordpress/ui';
5
+ import clsx from 'clsx';
6
+ import './style.scss';
7
+ /**
8
+ * Lays out checkbox cards in two columns, or one on narrow screens.
9
+ *
10
+ * @param {CheckboxCardGridProps} props - Component props.
11
+ * @return {JSX.Element} The grid.
12
+ */
13
+ export function CheckboxCardGrid({ children, className }) {
14
+ return _jsx("div", { className: clsx('jp-checkbox-card-grid', className), children: children });
15
+ }
16
+ /**
17
+ * A card with a checkbox, toggled by a click on its illustration.
18
+ *
19
+ * @param {CheckboxCardProps} props - Component props.
20
+ * @return {JSX.Element} The card.
21
+ */
22
+ export default function CheckboxCard({ id, name, title, illustration, checked, onChange, previewUrl, onPreviewClick, disabled, }) {
23
+ const titleId = `${id}__title`;
24
+ const handleChange = useCallback((next) => onChange(name, next), [name, onChange]);
25
+ const handlePreviewClick = useCallback(() => {
26
+ onPreviewClick?.(name);
27
+ }, [name, onPreviewClick]);
28
+ return (_jsxs(Field.Root, { disabled: disabled, children: [_jsx(Card.Root, { className: "jp-checkbox-card", "data-checked": checked, children: _jsx(Card.Content, { children: _jsxs(Card.FullBleed, { className: "jp-checkbox-card__surface", children: [_jsx(Field.Label, { className: "jp-checkbox-card__illustration", children: illustration }), _jsx(Checkbox, { id: id, className: "jp-checkbox-card__checkbox", checked: checked, onCheckedChange: handleChange, "aria-labelledby": titleId })] }) }) }), _jsxs(Stack, { gap: "xs", direction: "column", children: [_jsx(Text, { id: titleId, variant: "body-sm", children: title }), previewUrl && (_jsx(Link, { href: previewUrl, onClick: handlePreviewClick, children: __('Preview and edit', 'jetpack-components') }))] })] }));
29
+ }
30
+ export { CheckboxCard };
@@ -0,0 +1,54 @@
1
+ @use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb;
2
+
3
+ .jp-checkbox-card-grid {
4
+ display: grid;
5
+ grid-template-columns: repeat(2, minmax(0, 1fr));
6
+ column-gap: var(--wpds-dimension-gap-md);
7
+ row-gap: var(--wpds-dimension-gap-2xl);
8
+
9
+ @media (max-width: 720px) {
10
+ grid-template-columns: minmax(0, 1fr);
11
+ }
12
+ }
13
+
14
+ .jp-checkbox-card {
15
+
16
+ &[data-checked="true"] {
17
+ border-color: var(--wpds-color-stroke-interactive-brand-active);
18
+ }
19
+
20
+ &:hover:not([data-checked="true"]) {
21
+ border-color: var(--wpds-color-stroke-surface-neutral-strong);
22
+ }
23
+
24
+ &:has(:focus-visible) {
25
+
26
+ @include gb.outset-ring__focus();
27
+ }
28
+
29
+ @media (prefers-reduced-motion: no-preference) {
30
+ transition: border-color 0.15s ease-out;
31
+ }
32
+ }
33
+
34
+ .jp-checkbox-card__surface {
35
+ position: relative;
36
+ }
37
+
38
+ .jp-checkbox-card__illustration {
39
+ display: flex;
40
+ aspect-ratio: 294 / 192;
41
+ background: var(--wpds-color-background-surface-neutral-weak);
42
+ cursor: var(--wpds-cursor-control);
43
+
44
+ > svg {
45
+ inline-size: 100%;
46
+ block-size: 100%;
47
+ }
48
+ }
49
+
50
+ .jp-checkbox-card__checkbox {
51
+ position: absolute;
52
+ inset-block-start: var(--wpds-dimension-padding-md);
53
+ inset-inline-start: var(--wpds-dimension-padding-md);
54
+ }
@@ -0,0 +1,49 @@
1
+ import type { ReactNode } from 'react';
2
+ export type CheckboxCardProps = {
3
+ /**
4
+ * Id of the checkbox; the title's id is built from it.
5
+ */
6
+ id: string;
7
+ /**
8
+ * Passed back to `onChange` and `onPreviewClick`, so one handler can serve every card.
9
+ */
10
+ name: string;
11
+ /**
12
+ * Caption under the card, and the checkbox's accessible name.
13
+ */
14
+ title: string;
15
+ /**
16
+ * Picture filling the card, drawn at a 294×192 aspect ratio.
17
+ */
18
+ illustration?: ReactNode;
19
+ /**
20
+ * Whether the card is checked.
21
+ */
22
+ checked: boolean;
23
+ /**
24
+ * Called with the card's `name` and the next checked value.
25
+ */
26
+ onChange: (name: string, next: boolean) => void;
27
+ /**
28
+ * Shows a "Preview and edit" link to this URL under the title.
29
+ */
30
+ previewUrl?: string;
31
+ /**
32
+ * Called with the card's `name` when the "Preview and edit" link is clicked.
33
+ */
34
+ onPreviewClick?: (name: string) => void;
35
+ /**
36
+ * Disables the checkbox.
37
+ */
38
+ disabled?: boolean;
39
+ };
40
+ export type CheckboxCardGridProps = {
41
+ /**
42
+ * The `CheckboxCard`s to lay out.
43
+ */
44
+ children: ReactNode;
45
+ /**
46
+ * Extra class for the grid.
47
+ */
48
+ className?: string;
49
+ };
@@ -1,5 +1,5 @@
1
1
  .jetpack-components-gravatar {
2
- background-color: var(--jp-gray-5, #dcdcde);
2
+ background-color: var(--wpds-color-background-surface-neutral-strong);
3
3
  border-radius: 50%;
4
4
  display: block;
5
5
  flex-shrink: 0; // Prevent shrinking when Gravatar is inside flex containers.
package/build/index.d.ts CHANGED
@@ -9,6 +9,8 @@ export { default as AutomatticForAgenciesLogo } from './components/automattic-fo
9
9
  export { default as JetpackFooter } from './components/jetpack-footer/index.tsx';
10
10
  export { default as Gravatar } from './components/gravatar/index.tsx';
11
11
  export type { GravatarProps } from './components/gravatar/index.tsx';
12
+ export { default as CheckboxCard, CheckboxCardGrid } from './components/checkbox-card/index.tsx';
13
+ export type { CheckboxCardProps, CheckboxCardGridProps } from './components/checkbox-card/types.ts';
12
14
  export { default as IconTooltip } from './components/icon-tooltip/index.tsx';
13
15
  export { default as ActionButton } from './components/action-button/index.tsx';
14
16
  export { default as PricingCard } from './components/pricing-card/index.tsx';
@@ -40,7 +42,6 @@ export { default as RecordMeterBar } from './components/record-meter-bar/index.t
40
42
  export { default as Popover } from './components/popover/index.tsx';
41
43
  export { default as IndeterminateProgressBar } from './components/indeterminate-progress-bar/index.tsx';
42
44
  export { default as ActionPopover } from './components/action-popover/index.tsx';
43
- export { default as ProgressBar } from './components/progress-bar/index.tsx';
44
45
  export { default as UpsellBanner } from './components/upsell-banner/index.tsx';
45
46
  export { getUserLocale, cleanLocale } from './lib/locale/index.ts';
46
47
  export { default as StatCard } from './components/stat-card/index.tsx';
package/build/index.js CHANGED
@@ -22,6 +22,7 @@ export { default as AutomatticIconLogo } from './components/automattic-icon-logo
22
22
  export { default as AutomatticForAgenciesLogo } from './components/automattic-for-agencies-logo/index.js';
23
23
  export { default as JetpackFooter } from './components/jetpack-footer/index.js';
24
24
  export { default as Gravatar } from './components/gravatar/index.js';
25
+ export { default as CheckboxCard, CheckboxCardGrid } from './components/checkbox-card/index.js';
25
26
  export { default as IconTooltip } from './components/icon-tooltip/index.js';
26
27
  export { default as ActionButton } from './components/action-button/index.js';
27
28
  export { default as PricingCard } from './components/pricing-card/index.js';
@@ -52,7 +53,6 @@ export { default as RecordMeterBar } from './components/record-meter-bar/index.j
52
53
  export { default as Popover } from './components/popover/index.js';
53
54
  export { default as IndeterminateProgressBar } from './components/indeterminate-progress-bar/index.js';
54
55
  export { default as ActionPopover } from './components/action-popover/index.js';
55
- export { default as ProgressBar } from './components/progress-bar/index.js';
56
56
  export { default as UpsellBanner } from './components/upsell-banner/index.js';
57
57
  export { getUserLocale, cleanLocale } from './lib/locale/index.js';
58
58
  export { default as StatCard } from './components/stat-card/index.js';
@@ -34,6 +34,7 @@ const AdminPage: FC< AdminPageProps > = ( {
34
34
  subTitle,
35
35
  logo,
36
36
  actions,
37
+ globalControls,
37
38
  breadcrumbs,
38
39
  tabs,
39
40
  showBottomBorder = true,
@@ -80,7 +81,23 @@ const AdminPage: FC< AdminPageProps > = ( {
80
81
  breadcrumbs={ breadcrumbs }
81
82
  title={ title }
82
83
  subTitle={ subTitle }
83
- actions={ actions }
84
+ actions={
85
+ globalControls ? (
86
+ <>
87
+ { actions }
88
+ { actions && (
89
+ <span
90
+ role="separator"
91
+ aria-orientation="vertical"
92
+ className={ styles[ 'global-controls-separator' ] }
93
+ />
94
+ ) }
95
+ { globalControls }
96
+ </>
97
+ ) : (
98
+ actions
99
+ )
100
+ }
84
101
  showSidebarToggle={ false }
85
102
  >
86
103
  { tabs }
@@ -97,3 +97,9 @@
97
97
  display: none;
98
98
  }
99
99
  }
100
+
101
+ .global-controls-separator {
102
+ align-self: stretch;
103
+ inline-size: 1px;
104
+ background-color: var(--wpds-color-stroke-surface-neutral-weak);
105
+ }
@@ -39,6 +39,13 @@ export type AdminPageProps = {
39
39
  */
40
40
  actions?: ReactNode;
41
41
 
42
+ /**
43
+ * Jetpack-wide controls, such as the connection control, shown after the page's own `actions`.
44
+ * Only rendered in the unified header, in `Page`'s actions row, so pass compact controls such as icon buttons.
45
+ * Pass `null` when there is nothing to show: any element, even an empty one, makes `Page` draw the row.
46
+ */
47
+ globalControls?: ReactNode;
48
+
42
49
  /**
43
50
  * Breadcrumb navigation displayed next to the title in the unified header.
44
51
  */
@@ -0,0 +1,79 @@
1
+ import { useCallback } from '@wordpress/element';
2
+ import { __ } from '@wordpress/i18n';
3
+ import { Card, Checkbox, Field, Link, Stack, Text } from '@wordpress/ui';
4
+ import clsx from 'clsx';
5
+ import './style.scss';
6
+ import type { CheckboxCardGridProps, CheckboxCardProps } from './types.ts';
7
+ import type { JSX } from 'react';
8
+
9
+ /**
10
+ * Lays out checkbox cards in two columns, or one on narrow screens.
11
+ *
12
+ * @param {CheckboxCardGridProps} props - Component props.
13
+ * @return {JSX.Element} The grid.
14
+ */
15
+ export function CheckboxCardGrid( { children, className }: CheckboxCardGridProps ): JSX.Element {
16
+ return <div className={ clsx( 'jp-checkbox-card-grid', className ) }>{ children }</div>;
17
+ }
18
+
19
+ /**
20
+ * A card with a checkbox, toggled by a click on its illustration.
21
+ *
22
+ * @param {CheckboxCardProps} props - Component props.
23
+ * @return {JSX.Element} The card.
24
+ */
25
+ export default function CheckboxCard( {
26
+ id,
27
+ name,
28
+ title,
29
+ illustration,
30
+ checked,
31
+ onChange,
32
+ previewUrl,
33
+ onPreviewClick,
34
+ disabled,
35
+ }: CheckboxCardProps ): JSX.Element {
36
+ const titleId = `${ id }__title`;
37
+
38
+ const handleChange = useCallback(
39
+ ( next: boolean ) => onChange( name, next ),
40
+ [ name, onChange ]
41
+ );
42
+
43
+ const handlePreviewClick = useCallback( () => {
44
+ onPreviewClick?.( name );
45
+ }, [ name, onPreviewClick ] );
46
+
47
+ return (
48
+ <Field.Root disabled={ disabled }>
49
+ <Card.Root className="jp-checkbox-card" data-checked={ checked }>
50
+ <Card.Content>
51
+ <Card.FullBleed className="jp-checkbox-card__surface">
52
+ { /* Only the illustration toggles: the title and link sit outside the label. */ }
53
+ <Field.Label className="jp-checkbox-card__illustration">{ illustration }</Field.Label>
54
+ <Checkbox
55
+ id={ id }
56
+ className="jp-checkbox-card__checkbox"
57
+ checked={ checked }
58
+ onCheckedChange={ handleChange }
59
+ aria-labelledby={ titleId }
60
+ />
61
+ </Card.FullBleed>
62
+ </Card.Content>
63
+ </Card.Root>
64
+ <Stack gap="xs" direction="column">
65
+ <Text id={ titleId } variant="body-sm">
66
+ { title }
67
+ </Text>
68
+ { previewUrl && (
69
+ <Link href={ previewUrl } onClick={ handlePreviewClick }>
70
+ { __( 'Preview and edit', 'jetpack-components' ) }
71
+ </Link>
72
+ ) }
73
+ </Stack>
74
+ </Field.Root>
75
+ );
76
+ }
77
+
78
+ export { CheckboxCard };
79
+ export type { CheckboxCardProps, CheckboxCardGridProps };
@@ -0,0 +1,54 @@
1
+ @use "@automattic/jetpack-base-styles/gutenberg-base-styles" as gb;
2
+
3
+ .jp-checkbox-card-grid {
4
+ display: grid;
5
+ grid-template-columns: repeat(2, minmax(0, 1fr));
6
+ column-gap: var(--wpds-dimension-gap-md);
7
+ row-gap: var(--wpds-dimension-gap-2xl);
8
+
9
+ @media (max-width: 720px) {
10
+ grid-template-columns: minmax(0, 1fr);
11
+ }
12
+ }
13
+
14
+ .jp-checkbox-card {
15
+
16
+ &[data-checked="true"] {
17
+ border-color: var(--wpds-color-stroke-interactive-brand-active);
18
+ }
19
+
20
+ &:hover:not([data-checked="true"]) {
21
+ border-color: var(--wpds-color-stroke-surface-neutral-strong);
22
+ }
23
+
24
+ &:has(:focus-visible) {
25
+
26
+ @include gb.outset-ring__focus();
27
+ }
28
+
29
+ @media (prefers-reduced-motion: no-preference) {
30
+ transition: border-color 0.15s ease-out;
31
+ }
32
+ }
33
+
34
+ .jp-checkbox-card__surface {
35
+ position: relative;
36
+ }
37
+
38
+ .jp-checkbox-card__illustration {
39
+ display: flex;
40
+ aspect-ratio: 294 / 192;
41
+ background: var(--wpds-color-background-surface-neutral-weak);
42
+ cursor: var(--wpds-cursor-control);
43
+
44
+ > svg {
45
+ inline-size: 100%;
46
+ block-size: 100%;
47
+ }
48
+ }
49
+
50
+ .jp-checkbox-card__checkbox {
51
+ position: absolute;
52
+ inset-block-start: var(--wpds-dimension-padding-md);
53
+ inset-inline-start: var(--wpds-dimension-padding-md);
54
+ }
@@ -0,0 +1,51 @@
1
+ import type { ReactNode } from 'react';
2
+
3
+ export type CheckboxCardProps = {
4
+ /**
5
+ * Id of the checkbox; the title's id is built from it.
6
+ */
7
+ id: string;
8
+ /**
9
+ * Passed back to `onChange` and `onPreviewClick`, so one handler can serve every card.
10
+ */
11
+ name: string;
12
+ /**
13
+ * Caption under the card, and the checkbox's accessible name.
14
+ */
15
+ title: string;
16
+ /**
17
+ * Picture filling the card, drawn at a 294×192 aspect ratio.
18
+ */
19
+ illustration?: ReactNode;
20
+ /**
21
+ * Whether the card is checked.
22
+ */
23
+ checked: boolean;
24
+ /**
25
+ * Called with the card's `name` and the next checked value.
26
+ */
27
+ onChange: ( name: string, next: boolean ) => void;
28
+ /**
29
+ * Shows a "Preview and edit" link to this URL under the title.
30
+ */
31
+ previewUrl?: string;
32
+ /**
33
+ * Called with the card's `name` when the "Preview and edit" link is clicked.
34
+ */
35
+ onPreviewClick?: ( name: string ) => void;
36
+ /**
37
+ * Disables the checkbox.
38
+ */
39
+ disabled?: boolean;
40
+ };
41
+
42
+ export type CheckboxCardGridProps = {
43
+ /**
44
+ * The `CheckboxCard`s to lay out.
45
+ */
46
+ children: ReactNode;
47
+ /**
48
+ * Extra class for the grid.
49
+ */
50
+ className?: string;
51
+ };
@@ -1,5 +1,5 @@
1
1
  .jetpack-components-gravatar {
2
- background-color: var(--jp-gray-5, #dcdcde);
2
+ background-color: var(--wpds-color-background-surface-neutral-strong);
3
3
  border-radius: 50%;
4
4
  display: block;
5
5
  flex-shrink: 0; // Prevent shrinking when Gravatar is inside flex containers.
package/index.ts CHANGED
@@ -24,6 +24,8 @@ export { default as AutomatticForAgenciesLogo } from './components/automattic-fo
24
24
  export { default as JetpackFooter } from './components/jetpack-footer/index.tsx';
25
25
  export { default as Gravatar } from './components/gravatar/index.tsx';
26
26
  export type { GravatarProps } from './components/gravatar/index.tsx';
27
+ export { default as CheckboxCard, CheckboxCardGrid } from './components/checkbox-card/index.tsx';
28
+ export type { CheckboxCardProps, CheckboxCardGridProps } from './components/checkbox-card/types.ts';
27
29
  export { default as IconTooltip } from './components/icon-tooltip/index.tsx';
28
30
  export { default as ActionButton } from './components/action-button/index.tsx';
29
31
  export { default as PricingCard } from './components/pricing-card/index.tsx';
@@ -60,7 +62,6 @@ export { default as RecordMeterBar } from './components/record-meter-bar/index.t
60
62
  export { default as Popover } from './components/popover/index.tsx';
61
63
  export { default as IndeterminateProgressBar } from './components/indeterminate-progress-bar/index.tsx';
62
64
  export { default as ActionPopover } from './components/action-popover/index.tsx';
63
- export { default as ProgressBar } from './components/progress-bar/index.tsx';
64
65
  export { default as UpsellBanner } from './components/upsell-banner/index.tsx';
65
66
  export { getUserLocale, cleanLocale } from './lib/locale/index.ts';
66
67
  export { default as StatCard } from './components/stat-card/index.tsx';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/jetpack-components",
3
- "version": "4.0.3",
3
+ "version": "5.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": {
@@ -30,6 +30,10 @@
30
30
  "types": "./build/components/button/index.d.ts",
31
31
  "default": "./build/components/button/index.js"
32
32
  },
33
+ "./checkbox-card": {
34
+ "types": "./build/components/checkbox-card/index.d.ts",
35
+ "default": "./build/components/checkbox-card/index.js"
36
+ },
33
37
  "./global-notices": {
34
38
  "types": "./build/components/global-notices/index.d.ts",
35
39
  "default": "./build/components/global-notices/index.js"
@@ -76,26 +80,26 @@
76
80
  "extends @wordpress/browserslist-config"
77
81
  ],
78
82
  "dependencies": {
79
- "@automattic/jetpack-api": "^2.2.0",
80
- "@automattic/jetpack-boost-score-api": "^1.2.0",
83
+ "@automattic/jetpack-api": "^2.2.2",
84
+ "@automattic/jetpack-boost-score-api": "^1.2.2",
81
85
  "@automattic/jetpack-script-data": "^0.6.10",
82
- "@automattic/number-formatters": "^1.2.10",
86
+ "@automattic/number-formatters": "^1.2.11",
83
87
  "@babel/runtime": "^7",
84
88
  "@gravatar-com/hovercards": "0.16.0",
85
- "@wordpress/a11y": "4.55.0",
86
- "@wordpress/admin-ui": "2.10.0",
87
- "@wordpress/browserslist-config": "6.55.0",
88
- "@wordpress/components": "40.1.0",
89
- "@wordpress/compose": "8.8.0",
90
- "@wordpress/data": "10.55.0",
91
- "@wordpress/date": "5.55.0",
92
- "@wordpress/dom": "4.55.0",
93
- "@wordpress/element": "8.7.0",
94
- "@wordpress/i18n": "6.28.0",
95
- "@wordpress/icons": "16.0.0",
96
- "@wordpress/notices": "5.55.0",
97
- "@wordpress/theme": "2.1.0",
98
- "@wordpress/ui": "0.22.0",
89
+ "@wordpress/a11y": "4.57.0",
90
+ "@wordpress/admin-ui": "2.12.0",
91
+ "@wordpress/browserslist-config": "6.57.0",
92
+ "@wordpress/components": "42.0.0",
93
+ "@wordpress/compose": "8.10.0",
94
+ "@wordpress/data": "10.57.0",
95
+ "@wordpress/date": "5.57.0",
96
+ "@wordpress/dom": "4.57.0",
97
+ "@wordpress/element": "9.0.0",
98
+ "@wordpress/i18n": "6.30.0",
99
+ "@wordpress/icons": "18.0.0",
100
+ "@wordpress/notices": "5.57.0",
101
+ "@wordpress/theme": "2.3.0",
102
+ "@wordpress/ui": "0.24.0",
99
103
  "clsx": "2.1.1",
100
104
  "js-sha256": "0.11.1",
101
105
  "prop-types": "^15.7.2",
@@ -105,19 +109,19 @@
105
109
  "uplot-react": "1.1.4"
106
110
  },
107
111
  "devDependencies": {
108
- "@automattic/jetpack-base-styles": "^1.2.17",
112
+ "@automattic/jetpack-base-styles": "^1.2.18",
109
113
  "@babel/core": "7.29.7",
110
- "@jest/globals": "30.5.1",
114
+ "@jest/globals": "30.5.2",
111
115
  "@storybook/addon-docs": "10.4.6",
112
116
  "@storybook/react": "10.4.6",
113
117
  "@testing-library/dom": "10.4.2",
114
118
  "@testing-library/react": "16.3.3",
115
- "@testing-library/user-event": "14.6.7",
119
+ "@testing-library/user-event": "14.6.8",
116
120
  "@types/jest": "30.0.0",
117
121
  "@types/react": "18.3.31",
118
122
  "@types/react-dom": "18.3.7",
119
123
  "@typescript/native-preview": "7.0.0-dev.20260707.2",
120
- "jest": "30.5.1",
124
+ "jest": "30.5.2",
121
125
  "react": "18.3.1",
122
126
  "react-dom": "18.3.1",
123
127
  "require-from-string": "2.0.2",
@@ -1,10 +0,0 @@
1
- import { ProgressBarProps } from './types.ts';
2
- import type { FC } from 'react';
3
- /**
4
- * Progress Bar component
5
- *
6
- * @param {ProgressBarProps} props - Component props.
7
- * @return {ReactNode} - ProgressBar react component.
8
- */
9
- declare const ProgressBar: FC<ProgressBarProps>;
10
- export default ProgressBar;
@@ -1,26 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * External dependencies
4
- */
5
- import clsx from 'clsx';
6
- /**
7
- * Internal dependencies
8
- */
9
- import styles from './style.module.scss';
10
- /**
11
- * Progress Bar component
12
- *
13
- * @param {ProgressBarProps} props - Component props.
14
- * @return {ReactNode} - ProgressBar react component.
15
- */
16
- const ProgressBar = ({ className, progressClassName, progress, size = 'normal', }) => {
17
- if (progress == null) {
18
- return null;
19
- }
20
- const normalizedProgress = Math.max(Math.min(progress, 1), 0);
21
- const style = {
22
- width: `${normalizedProgress * 100}%`,
23
- };
24
- return (_jsx("div", { className: clsx(className, styles.wrapper, { [styles.small]: size === 'small' }), children: _jsx("div", { className: clsx(progressClassName, styles.progress), style: style }) }));
25
- };
26
- export default ProgressBar;
@@ -1,18 +0,0 @@
1
- .wrapper {
2
- width: 100%;
3
- height: 12px;
4
- background-color: var(--jp-gray-5);
5
- border-radius: calc(var(--spacing-base) * 3);
6
- overflow: hidden;
7
-
8
- &.small {
9
- height: 3px;
10
- }
11
-
12
- .progress {
13
- height: 100%;
14
- border-radius: calc(var(--spacing-base) * 3);
15
- background-color: var(--jp-black);
16
- min-width: 12px;
17
- }
18
- }
@@ -1,18 +0,0 @@
1
- export type ProgressBarProps = {
2
- /**
3
- * Optional classname to apply to the root element.
4
- */
5
- className?: string;
6
- /**
7
- * Optional classname to apply to the progress element.
8
- */
9
- progressClassName?: string;
10
- /**
11
- * The current progress percentage, from 0 to 1.
12
- */
13
- progress: number;
14
- /**
15
- * The progress bar height.
16
- */
17
- size?: 'normal' | 'small';
18
- };
@@ -1,41 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import clsx from 'clsx';
5
- /**
6
- * Internal dependencies
7
- */
8
- import styles from './style.module.scss';
9
- import { ProgressBarProps } from './types.ts';
10
- import type { FC, ReactNode } from 'react';
11
-
12
- /**
13
- * Progress Bar component
14
- *
15
- * @param {ProgressBarProps} props - Component props.
16
- * @return {ReactNode} - ProgressBar react component.
17
- */
18
- const ProgressBar: FC< ProgressBarProps > = ( {
19
- className,
20
- progressClassName,
21
- progress,
22
- size = 'normal',
23
- } ) => {
24
- if ( progress == null ) {
25
- return null;
26
- }
27
-
28
- const normalizedProgress = Math.max( Math.min( progress, 1 ), 0 );
29
-
30
- const style = {
31
- width: `${ normalizedProgress * 100 }%`,
32
- };
33
-
34
- return (
35
- <div className={ clsx( className, styles.wrapper, { [ styles.small ]: size === 'small' } ) }>
36
- <div className={ clsx( progressClassName, styles.progress ) } style={ style }></div>
37
- </div>
38
- );
39
- };
40
-
41
- export default ProgressBar;
@@ -1,18 +0,0 @@
1
- .wrapper {
2
- width: 100%;
3
- height: 12px;
4
- background-color: var(--jp-gray-5);
5
- border-radius: calc(var(--spacing-base) * 3);
6
- overflow: hidden;
7
-
8
- &.small {
9
- height: 3px;
10
- }
11
-
12
- .progress {
13
- height: 100%;
14
- border-radius: calc(var(--spacing-base) * 3);
15
- background-color: var(--jp-black);
16
- min-width: 12px;
17
- }
18
- }
@@ -1,21 +0,0 @@
1
- export type ProgressBarProps = {
2
- /**
3
- * Optional classname to apply to the root element.
4
- */
5
- className?: string;
6
-
7
- /**
8
- * Optional classname to apply to the progress element.
9
- */
10
- progressClassName?: string;
11
-
12
- /**
13
- * The current progress percentage, from 0 to 1.
14
- */
15
- progress: number;
16
-
17
- /**
18
- * The progress bar height.
19
- */
20
- size?: 'normal' | 'small';
21
- };