@automattic/jetpack-components 1.1.7 → 1.1.9
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 +10 -0
- package/build/components/action-button/index.d.ts +2 -3
- package/build/components/action-button/index.js +1 -8
- package/build/components/action-popover/types.d.ts +4 -3
- package/build/components/admin-page/index.d.ts +3 -3
- package/build/components/admin-page/index.js +1 -1
- package/build/components/admin-page/types.d.ts +3 -2
- package/build/components/admin-section/basic/index.d.ts +3 -3
- package/build/components/admin-section/basic/index.js +1 -1
- package/build/components/admin-section/hero/index.d.ts +3 -3
- package/build/components/admin-section/hero/index.js +1 -1
- package/build/components/admin-section/types.d.ts +2 -1
- package/build/components/alert/index.d.ts +9 -9
- package/build/components/alert/index.js +7 -7
- package/build/components/automattic-byline-logo/index.d.ts +3 -3
- package/build/components/automattic-byline-logo/index.js +1 -1
- package/build/components/automattic-byline-logo/types.d.ts +2 -2
- package/build/components/automattic-for-agencies-logo/index.d.ts +3 -3
- package/build/components/automattic-for-agencies-logo/index.js +1 -1
- package/build/components/automattic-icon-logo/index.d.ts +3 -3
- package/build/components/automattic-icon-logo/index.js +1 -1
- package/build/components/badge/index.d.ts +4 -4
- package/build/components/badge/index.js +1 -1
- package/build/components/boost-score-graph/index.d.ts +2 -2
- package/build/components/boost-score-graph/index.js +1 -1
- package/build/components/boost-score-graph/uplot-line-chart.d.ts +3 -3
- package/build/components/boost-score-graph/uplot-line-chart.js +1 -1
- package/build/components/boost-score-graph/use-resize.d.ts +4 -4
- package/build/components/boost-score-graph/use-resize.js +2 -2
- package/build/components/button/index.d.ts +2 -3
- package/build/components/button/index.js +1 -7
- package/build/components/button/types.d.ts +4 -4
- package/build/components/chip/index.d.ts +3 -3
- package/build/components/chip/index.js +1 -1
- package/build/components/contextual-upgrade-trigger/index.d.ts +2 -2
- package/build/components/copy-to-clipboard/index.d.ts +2 -2
- package/build/components/decorative-card/index.d.ts +3 -3
- package/build/components/decorative-card/index.js +2 -2
- package/build/components/dialog/index.d.ts +10 -10
- package/build/components/dialog/index.js +6 -6
- package/build/components/donut-meter/index.d.ts +3 -3
- package/build/components/donut-meter/index.js +1 -1
- package/build/components/icon-tooltip/index.d.ts +3 -3
- package/build/components/icon-tooltip/index.js +1 -1
- package/build/components/icon-tooltip/types.d.ts +2 -1
- package/build/components/icons/index.d.ts +51 -51
- package/build/components/icons/index.js +4 -4
- package/build/components/icons/types.d.ts +2 -2
- package/build/components/indeterminate-progress-bar/index.d.ts +3 -3
- package/build/components/indeterminate-progress-bar/index.js +1 -1
- package/build/components/jetpack-footer/index.d.ts +3 -3
- package/build/components/jetpack-footer/index.js +1 -1
- package/build/components/jetpack-logo/index.d.ts +2 -2
- package/build/components/jetpack-protect-logo/index.d.ts +2 -2
- package/build/components/jetpack-search-logo/index.d.ts +2 -2
- package/build/components/jetpack-vaultpress-backup-logo/index.d.ts +2 -2
- package/build/components/jetpack-videopress-logo/index.d.ts +2 -2
- package/build/components/layout/col/index.d.ts +3 -3
- package/build/components/layout/col/index.js +1 -1
- package/build/components/layout/container/index.d.ts +1 -2
- package/build/components/layout/container/index.js +3 -3
- package/build/components/layout/types.d.ts +3 -2
- package/build/components/loading-placeholder/index.d.ts +2 -2
- package/build/components/notice/index.d.ts +12 -12
- package/build/components/notice/index.js +8 -8
- package/build/components/number-slider/index.d.ts +3 -3
- package/build/components/number-slider/index.js +3 -3
- package/build/components/number-slider/types.d.ts +2 -2
- package/build/components/popover/index.d.ts +5 -4
- package/build/components/pricing-card/index.d.ts +3 -3
- package/build/components/pricing-card/index.js +1 -1
- package/build/components/pricing-card/types.d.ts +6 -6
- package/build/components/pricing-table/index.d.ts +5 -5
- package/build/components/pricing-table/types.d.ts +7 -6
- package/build/components/product-offer/icons-card.d.ts +3 -3
- package/build/components/product-offer/icons-card.js +1 -1
- package/build/components/product-offer/index.d.ts +3 -3
- package/build/components/product-offer/index.js +1 -1
- package/build/components/product-offer/product-offer-header.d.ts +3 -3
- package/build/components/product-offer/product-offer-header.js +1 -1
- package/build/components/product-offer/types.d.ts +2 -1
- package/build/components/product-price/index.d.ts +3 -3
- package/build/components/product-price/index.js +1 -1
- package/build/components/product-price/price.d.ts +3 -3
- package/build/components/product-price/price.js +1 -1
- package/build/components/product-price/types.d.ts +2 -1
- package/build/components/progress-bar/index.d.ts +3 -3
- package/build/components/progress-bar/index.js +1 -1
- package/build/components/qr-code/index.d.ts +5 -5
- package/build/components/qr-code/index.js +1 -1
- package/build/components/radio-control/index.d.ts +4 -3
- package/build/components/record-meter-bar/index.d.ts +3 -3
- package/build/components/record-meter-bar/index.js +1 -1
- package/build/components/spinner/index.js +0 -1
- package/build/components/split-button/index.d.ts +2 -2
- package/build/components/split-button/types.d.ts +3 -5
- package/build/components/stat-card/index.d.ts +1 -1
- package/build/components/stat-card/index.js +1 -1
- package/build/components/stat-card/types.d.ts +2 -1
- package/build/components/status/index.d.ts +2 -1
- package/build/components/swipeable/index.js +1 -1
- package/build/components/terms-of-service/index.d.ts +2 -1
- package/build/components/text/index.d.ts +9 -9
- package/build/components/text/index.js +4 -4
- package/build/components/text/types.d.ts +5 -5
- package/build/components/theme-provider/index.d.ts +3 -3
- package/build/components/theme-provider/index.js +1 -1
- package/build/components/theme-provider/types.d.ts +2 -1
- package/build/components/toggle-control/index.d.ts +4 -3
- package/build/components/upsell-banner/index.d.ts +3 -3
- package/build/components/upsell-banner/index.js +1 -1
- package/components/action-button/index.jsx +1 -8
- package/components/action-popover/index.tsx +0 -1
- package/components/action-popover/types.ts +4 -3
- package/components/admin-page/index.tsx +3 -3
- package/components/admin-page/types.ts +3 -2
- package/components/admin-section/basic/index.tsx +3 -3
- package/components/admin-section/hero/index.tsx +3 -3
- package/components/admin-section/types.ts +3 -1
- package/components/alert/index.tsx +9 -14
- package/components/automattic-byline-logo/index.tsx +3 -3
- package/components/automattic-byline-logo/types.ts +2 -2
- package/components/automattic-for-agencies-logo/index.tsx +3 -3
- package/components/automattic-icon-logo/index.tsx +3 -3
- package/components/badge/index.tsx +4 -4
- package/components/boost-score-graph/index.tsx +2 -2
- package/components/boost-score-graph/uplot-line-chart.tsx +5 -4
- package/components/boost-score-graph/use-resize.ts +6 -5
- package/components/button/index.tsx +3 -8
- package/components/button/types.ts +4 -4
- package/components/chip/index.tsx +3 -3
- package/components/contextual-upgrade-trigger/index.tsx +2 -2
- package/components/copy-to-clipboard/index.tsx +4 -4
- package/components/decorative-card/index.tsx +3 -7
- package/components/details-viewer/index.tsx +0 -1
- package/components/dialog/index.tsx +10 -10
- package/components/donut-meter/index.tsx +3 -3
- package/components/dot-pager/index.tsx +1 -1
- package/components/icon-tooltip/index.tsx +3 -3
- package/components/icon-tooltip/types.ts +3 -1
- package/components/icons/index.tsx +23 -32
- package/components/icons/types.ts +2 -2
- package/components/indeterminate-progress-bar/index.tsx +3 -3
- package/components/jetpack-footer/index.tsx +5 -5
- package/components/jetpack-logo/index.tsx +2 -2
- package/components/jetpack-protect-logo/index.tsx +2 -2
- package/components/jetpack-search-logo/index.tsx +2 -2
- package/components/jetpack-vaultpress-backup-logo/index.tsx +2 -2
- package/components/jetpack-videopress-logo/index.tsx +2 -2
- package/components/layout/col/index.tsx +3 -3
- package/components/layout/container/index.tsx +6 -6
- package/components/layout/types.ts +4 -2
- package/components/loading-placeholder/index.tsx +2 -2
- package/components/notice/index.tsx +12 -12
- package/components/number-slider/index.tsx +6 -5
- package/components/number-slider/types.ts +2 -2
- package/components/popover/index.tsx +5 -4
- package/components/pricing-card/index.tsx +3 -3
- package/components/pricing-card/types.ts +6 -6
- package/components/pricing-table/index.tsx +6 -5
- package/components/pricing-table/types.ts +7 -6
- package/components/product-offer/icons-card.tsx +4 -3
- package/components/product-offer/index.tsx +3 -3
- package/components/product-offer/product-offer-header.tsx +3 -3
- package/components/product-offer/types.ts +2 -1
- package/components/product-price/index.tsx +3 -3
- package/components/product-price/price.tsx +3 -3
- package/components/product-price/types.ts +3 -1
- package/components/progress-bar/index.tsx +3 -3
- package/components/qr-code/index.tsx +5 -5
- package/components/radio-control/index.tsx +4 -3
- package/components/record-meter-bar/index.tsx +4 -3
- package/components/spinner/README.md +2 -2
- package/components/spinner/index.jsx +0 -1
- package/components/split-button/index.tsx +2 -2
- package/components/split-button/types.ts +3 -5
- package/components/stat-card/index.tsx +2 -2
- package/components/stat-card/types.ts +3 -1
- package/components/status/index.tsx +2 -1
- package/components/swipeable/index.tsx +4 -3
- package/components/terms-of-service/index.tsx +3 -2
- package/components/text/index.tsx +9 -12
- package/components/text/types.ts +4 -4
- package/components/theme-provider/index.tsx +4 -3
- package/components/theme-provider/types.ts +3 -1
- package/components/toggle-control/index.tsx +4 -3
- package/components/upsell-banner/index.tsx +3 -3
- package/components/zendesk-chat/README.md +0 -1
- package/package.json +16 -16
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
### This is a list detailing changes for the Jetpack RNA Components package releases.
|
|
4
4
|
|
|
5
|
+
## [1.1.9] - 2025-07-03
|
|
6
|
+
### Changed
|
|
7
|
+
- Update package dependencies. [#44151]
|
|
8
|
+
|
|
9
|
+
## [1.1.8] - 2025-07-01
|
|
10
|
+
### Changed
|
|
11
|
+
- Internal updates.
|
|
12
|
+
|
|
5
13
|
## [1.1.7] - 2025-06-30
|
|
6
14
|
### Changed
|
|
7
15
|
- Update dependencies.
|
|
@@ -1450,6 +1458,8 @@
|
|
|
1450
1458
|
### Changed
|
|
1451
1459
|
- Update node version requirement to 14.16.1
|
|
1452
1460
|
|
|
1461
|
+
[1.1.9]: https://github.com/Automattic/jetpack-components/compare/1.1.8...1.1.9
|
|
1462
|
+
[1.1.8]: https://github.com/Automattic/jetpack-components/compare/1.1.7...1.1.8
|
|
1453
1463
|
[1.1.7]: https://github.com/Automattic/jetpack-components/compare/1.1.6...1.1.7
|
|
1454
1464
|
[1.1.6]: https://github.com/Automattic/jetpack-components/compare/1.1.5...1.1.6
|
|
1455
1465
|
[1.1.5]: https://github.com/Automattic/jetpack-components/compare/1.1.4...1.1.5
|
|
@@ -7,9 +7,9 @@ export default ActionButton;
|
|
|
7
7
|
* It is useful to async actions when the user has to wait the result of a request or process.
|
|
8
8
|
*
|
|
9
9
|
* @param {object} props - The properties.
|
|
10
|
-
* @return {
|
|
10
|
+
* @return {import('react').ReactNode} The `ActionButton` component.
|
|
11
11
|
*/
|
|
12
|
-
declare function ActionButton(props: object):
|
|
12
|
+
declare function ActionButton(props: object): import("react").ReactNode;
|
|
13
13
|
declare namespace ActionButton {
|
|
14
14
|
namespace propTypes {
|
|
15
15
|
let label: any;
|
|
@@ -22,4 +22,3 @@ declare namespace ActionButton {
|
|
|
22
22
|
let isExternalLink: any;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
import React from 'react';
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* External dependencies
|
|
4
|
-
*/
|
|
5
2
|
import { Spinner } from '@wordpress/components';
|
|
6
3
|
import { __ } from '@wordpress/i18n';
|
|
7
4
|
import clsx from 'clsx';
|
|
8
5
|
import PropTypes from 'prop-types';
|
|
9
|
-
/**
|
|
10
|
-
* Internal dependencies
|
|
11
|
-
*/
|
|
12
|
-
import React from 'react';
|
|
13
6
|
import Button from "../button/index.js";
|
|
14
7
|
import styles from './style.module.scss';
|
|
15
8
|
/**
|
|
@@ -20,7 +13,7 @@ import styles from './style.module.scss';
|
|
|
20
13
|
* It is useful to async actions when the user has to wait the result of a request or process.
|
|
21
14
|
*
|
|
22
15
|
* @param {object} props - The properties.
|
|
23
|
-
* @return {
|
|
16
|
+
* @return {import('react').ReactNode} The `ActionButton` component.
|
|
24
17
|
*/
|
|
25
18
|
const ActionButton = props => {
|
|
26
19
|
const { label, onClick, isLoading = false, loadingText, isDisabled, displayError = false, errorMessage = __('An error occurred. Please try again.', 'jetpack-components'), variant = 'primary', isExternalLink = false, customClass, } = props;
|
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
* Types
|
|
3
3
|
*/
|
|
4
4
|
import type { Popover } from '@wordpress/components';
|
|
5
|
-
|
|
5
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
6
|
+
export type ActionPopoverProps = ComponentProps<typeof Popover> & {
|
|
6
7
|
anchor?: Element;
|
|
7
8
|
offset?: number;
|
|
8
9
|
} & {
|
|
9
10
|
hideCloseButton?: boolean;
|
|
10
11
|
title: string;
|
|
11
|
-
children:
|
|
12
|
+
children: ReactNode;
|
|
12
13
|
step?: number;
|
|
13
14
|
totalSteps?: number;
|
|
14
|
-
buttonContent?:
|
|
15
|
+
buttonContent?: ReactNode;
|
|
15
16
|
buttonDisabled?: boolean;
|
|
16
17
|
buttonHref?: string;
|
|
17
18
|
buttonExternalLink?: boolean;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { AdminPageProps } from './types.ts';
|
|
2
|
-
import type
|
|
2
|
+
import type { FC } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* This is the base structure for any admin page. It comes with Header and Footer.
|
|
5
5
|
*
|
|
6
6
|
* All content must be passed as children wrapped in as many <AdminSection> elements as needed.
|
|
7
7
|
*
|
|
8
8
|
* @param {AdminPageProps} props - Component properties.
|
|
9
|
-
* @return {
|
|
9
|
+
* @return {ReactNode} AdminPage component.
|
|
10
10
|
*/
|
|
11
|
-
declare const AdminPage:
|
|
11
|
+
declare const AdminPage: FC<AdminPageProps>;
|
|
12
12
|
export default AdminPage;
|
|
@@ -14,7 +14,7 @@ import styles from './style.module.scss';
|
|
|
14
14
|
* All content must be passed as children wrapped in as many <AdminSection> elements as needed.
|
|
15
15
|
*
|
|
16
16
|
* @param {AdminPageProps} props - Component properties.
|
|
17
|
-
* @return {
|
|
17
|
+
* @return {ReactNode} AdminPage component.
|
|
18
18
|
*/
|
|
19
19
|
const AdminPage = ({ children, className, moduleName = __('Jetpack', 'jetpack-components'), moduleNameHref, showHeader = true, showFooter = true, useInternalLinks = false, showBackground = true, sandboxedDomain = '', apiRoot = '', apiNonce = '', optionalMenuItems, header, }) => {
|
|
20
20
|
useEffect(() => {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { JetpackFooterMenuItem } from '../jetpack-footer/types.ts';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
2
3
|
export type AdminPageProps = {
|
|
3
4
|
/**
|
|
4
5
|
* The page content
|
|
5
6
|
*/
|
|
6
|
-
children:
|
|
7
|
+
children: ReactNode;
|
|
7
8
|
/**
|
|
8
9
|
* Name of the module, e.g. 'Jetpack Search' that will be displayed in the footer.
|
|
9
10
|
*/
|
|
@@ -15,7 +16,7 @@ export type AdminPageProps = {
|
|
|
15
16
|
/**
|
|
16
17
|
* Custom header. Optional
|
|
17
18
|
*/
|
|
18
|
-
header?:
|
|
19
|
+
header?: ReactNode;
|
|
19
20
|
/**
|
|
20
21
|
* Whether or not to display the Footer
|
|
21
22
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { AdminSectionBaseProps } from '../types.ts';
|
|
2
|
+
import type { FC } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* This is the wrapper component to build sections within your admin page.
|
|
5
5
|
*
|
|
6
6
|
* @param {AdminSectionBaseProps} props - Component properties.
|
|
7
|
-
* @return {
|
|
7
|
+
* @return {ReactNode} AdminSection component.
|
|
8
8
|
*/
|
|
9
|
-
declare const AdminSection:
|
|
9
|
+
declare const AdminSection: FC<AdminSectionBaseProps>;
|
|
10
10
|
export default AdminSection;
|
|
@@ -4,7 +4,7 @@ import styles from './style.module.scss';
|
|
|
4
4
|
* This is the wrapper component to build sections within your admin page.
|
|
5
5
|
*
|
|
6
6
|
* @param {AdminSectionBaseProps} props - Component properties.
|
|
7
|
-
* @return {
|
|
7
|
+
* @return {ReactNode} AdminSection component.
|
|
8
8
|
*/
|
|
9
9
|
const AdminSection = ({ children }) => {
|
|
10
10
|
return _jsx("div", { className: styles.section, children: children });
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { AdminSectionBaseProps } from '../types.ts';
|
|
2
|
+
import type { FC } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* The wrapper component for a Hero Section to be used in admin pages.
|
|
5
5
|
*
|
|
6
6
|
* @param {AdminSectionBaseProps} props - Component properties.
|
|
7
|
-
* @return {
|
|
7
|
+
* @return {Component} AdminSectionHero component.
|
|
8
8
|
*/
|
|
9
|
-
declare const AdminSectionHero:
|
|
9
|
+
declare const AdminSectionHero: FC<AdminSectionBaseProps>;
|
|
10
10
|
export default AdminSectionHero;
|
|
@@ -4,7 +4,7 @@ import styles from './style.module.scss';
|
|
|
4
4
|
* The wrapper component for a Hero Section to be used in admin pages.
|
|
5
5
|
*
|
|
6
6
|
* @param {AdminSectionBaseProps} props - Component properties.
|
|
7
|
-
* @return {
|
|
7
|
+
* @return {Component} AdminSectionHero component.
|
|
8
8
|
*/
|
|
9
9
|
const AdminSectionHero = ({ children }) => {
|
|
10
10
|
return _jsx("div", { className: styles['section-hero'], children: children });
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ReactNode, FC } from 'react';
|
|
2
2
|
type AlertProps = {
|
|
3
3
|
/** The severity of the alert. */
|
|
4
4
|
level: 'error' | 'warning' | 'info' | 'success';
|
|
5
5
|
/** Show/Hide icon */
|
|
6
6
|
showIcon?: boolean;
|
|
7
7
|
/** Children to be rendered inside the alert. */
|
|
8
|
-
children:
|
|
8
|
+
children: ReactNode;
|
|
9
9
|
/** Wrapper class name */
|
|
10
10
|
className?: string;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* Alert component
|
|
14
14
|
*
|
|
15
|
-
* @param {object}
|
|
16
|
-
* @param {string}
|
|
17
|
-
* @param {boolean}
|
|
18
|
-
* @param {string}
|
|
19
|
-
* @param {
|
|
20
|
-
* @return {
|
|
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
21
|
*/
|
|
22
|
-
declare const Alert:
|
|
22
|
+
declare const Alert: FC<AlertProps>;
|
|
23
23
|
export default Alert;
|
|
@@ -19,14 +19,14 @@ const getIconByLevel = (level) => {
|
|
|
19
19
|
/**
|
|
20
20
|
* Alert component
|
|
21
21
|
*
|
|
22
|
-
* @param {object}
|
|
23
|
-
* @param {string}
|
|
24
|
-
* @param {boolean}
|
|
25
|
-
* @param {string}
|
|
26
|
-
* @param {
|
|
27
|
-
* @return {
|
|
22
|
+
* @param {object} props - The component properties.
|
|
23
|
+
* @param {string} props.level - The alert level: error, warning, info, success.
|
|
24
|
+
* @param {boolean} props.showIcon - Whether to show the alert icon.
|
|
25
|
+
* @param {string} props.className - The wrapper class name.
|
|
26
|
+
* @param {Component} props.children - The alert content.
|
|
27
|
+
* @return {ReactElement} The `Alert` component.
|
|
28
28
|
*/
|
|
29
|
-
const Alert = ({ level = 'warning', children, showIcon = true, className
|
|
29
|
+
const Alert = ({ level = 'warning', children, showIcon = true, className }) => {
|
|
30
30
|
const classes = clsx(styles.container, styles[`is-${level}`], className);
|
|
31
31
|
return (_jsxs("div", { className: classes, children: [showIcon && (_jsx("div", { className: styles['icon-wrapper'], children: _jsx(Icon, { icon: getIconByLevel(level), className: styles.icon }) })), _jsx("div", { children: children })] }));
|
|
32
32
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { AutomatticBylineLogoProps } from './types.ts';
|
|
2
|
+
import type { FC } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* Automattic "By line" Logo component.
|
|
5
5
|
*
|
|
6
6
|
* @param {AutomatticBylineLogoProps} props - Component properties.
|
|
7
|
-
* @return {
|
|
7
|
+
* @return {ReactNode} AutomatticBylineLogo component.
|
|
8
8
|
*/
|
|
9
|
-
declare const AutomatticBylineLogo:
|
|
9
|
+
declare const AutomatticBylineLogo: FC<AutomatticBylineLogoProps>;
|
|
10
10
|
export default AutomatticBylineLogo;
|
|
@@ -5,7 +5,7 @@ import clsx from 'clsx';
|
|
|
5
5
|
* Automattic "By line" Logo component.
|
|
6
6
|
*
|
|
7
7
|
* @param {AutomatticBylineLogoProps} props - Component properties.
|
|
8
|
-
* @return {
|
|
8
|
+
* @return {ReactNode} AutomatticBylineLogo component.
|
|
9
9
|
*/
|
|
10
10
|
const AutomatticBylineLogo = ({ title = __('An Automattic Airline', 'jetpack-components'), height = 7, className, ...otherProps }) => {
|
|
11
11
|
return (_jsxs("svg", { role: "img", x: "0", y: "0", viewBox: "0 0 935 38.2", enableBackground: "new 0 0 935 38.2", "aria-labelledby": "jp-automattic-byline-logo-title", height: height, className: clsx('jp-automattic-byline-logo', className), ...otherProps, children: [_jsx("desc", { id: "jp-automattic-byline-logo-title", children: title }), _jsx("path", { d: "M317.1 38.2c-12.6 0-20.7-9.1-20.7-18.5v-1.2c0-9.6 8.2-18.5 20.7-18.5 12.6 0 20.8 8.9 20.8 18.5v1.2C337.9 29.1 329.7 38.2 317.1 38.2zM331.2 18.6c0-6.9-5-13-14.1-13s-14 6.1-14 13v0.9c0 6.9 5 13.1 14 13.1s14.1-6.2 14.1-13.1V18.6zM175 36.8l-4.7-8.8h-20.9l-4.5 8.8h-7L157 1.3h5.5L182 36.8H175zM159.7 8.2L152 23.1h15.7L159.7 8.2zM212.4 38.2c-12.7 0-18.7-6.9-18.7-16.2V1.3h6.6v20.9c0 6.6 4.3 10.5 12.5 10.5 8.4 0 11.9-3.9 11.9-10.5V1.3h6.7V22C231.4 30.8 225.8 38.2 212.4 38.2zM268.6 6.8v30h-6.7v-30h-15.5V1.3h37.7v5.5H268.6zM397.3 36.8V8.7l-1.8 3.1 -14.9 25h-3.3l-14.7-25 -1.8-3.1v28.1h-6.5V1.3h9.2l14 24.4 1.7 3 1.7-3 13.9-24.4h9.1v35.5H397.3zM454.4 36.8l-4.7-8.8h-20.9l-4.5 8.8h-7l19.2-35.5h5.5l19.5 35.5H454.4zM439.1 8.2l-7.7 14.9h15.7L439.1 8.2zM488.4 6.8v30h-6.7v-30h-15.5V1.3h37.7v5.5H488.4zM537.3 6.8v30h-6.7v-30h-15.5V1.3h37.7v5.5H537.3zM569.3 36.8V4.6c2.7 0 3.7-1.4 3.7-3.4h2.8v35.5L569.3 36.8 569.3 36.8zM628 11.3c-3.2-2.9-7.9-5.7-14.2-5.7 -9.5 0-14.8 6.5-14.8 13.3v0.7c0 6.7 5.4 13 15.3 13 5.9 0 10.8-2.8 13.9-5.7l4 4.2c-3.9 3.8-10.5 7.1-18.3 7.1 -13.4 0-21.6-8.7-21.6-18.3v-1.2c0-9.6 8.9-18.7 21.9-18.7 7.5 0 14.3 3.1 18 7.1L628 11.3zM321.5 12.4c1.2 0.8 1.5 2.4 0.8 3.6l-6.1 9.4c-0.8 1.2-2.4 1.6-3.6 0.8l0 0c-1.2-0.8-1.5-2.4-0.8-3.6l6.1-9.4C318.7 11.9 320.3 11.6 321.5 12.4L321.5 12.4z" }), _jsx("path", { d: "M37.5 36.7l-4.7-8.9H11.7l-4.6 8.9H0L19.4 0.8H25l19.7 35.9H37.5zM22 7.8l-7.8 15.1h15.9L22 7.8zM82.8 36.7l-23.3-24 -2.3-2.5v26.6h-6.7v-36H57l22.6 24 2.3 2.6V0.8h6.7v35.9H82.8z" }), _jsx("path", { d: "M719.9 37l-4.8-8.9H694l-4.6 8.9h-7.1l19.5-36h5.6l19.8 36H719.9zM704.4 8l-7.8 15.1h15.9L704.4 8zM733 37V1h6.8v36H733zM781 37c-1.8 0-2.6-2.5-2.9-5.8l-0.2-3.7c-0.2-3.6-1.7-5.1-8.4-5.1h-12.8V37H750V1h19.6c10.8 0 15.7 4.3 15.7 9.9 0 3.9-2 7.7-9 9 7 0.5 8.5 3.7 8.6 7.9l0.1 3c0.1 2.5 0.5 4.3 2.2 6.1V37H781zM778.5 11.8c0-2.6-2.1-5.1-7.9-5.1h-13.8v10.8h14.4c5 0 7.3-2.4 7.3-5.2V11.8zM794.8 37V1h6.8v30.4h28.2V37H794.8zM836.7 37V1h6.8v36H836.7zM886.2 37l-23.4-24.1 -2.3-2.5V37h-6.8V1h6.5l22.7 24.1 2.3 2.6V1h6.8v36H886.2zM902.3 37V1H935v5.6h-26v9.2h20v5.5h-20v10.1h26V37H902.3z" })] }));
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* Automattic for Agencies Logo component
|
|
4
4
|
*
|
|
5
5
|
* @param {object} props - Component props
|
|
6
6
|
* @param {string} props.color - Color code for the logo text
|
|
7
|
-
* @return {
|
|
7
|
+
* @return {ReactElement} Component template
|
|
8
8
|
*/
|
|
9
9
|
export default function AutomatticForAgenciesLogo({ color, }: {
|
|
10
10
|
color: string;
|
|
11
|
-
}):
|
|
11
|
+
}): ReactElement;
|
|
@@ -5,7 +5,7 @@ import { Path, SVG } from '@wordpress/components';
|
|
|
5
5
|
*
|
|
6
6
|
* @param {object} props - Component props
|
|
7
7
|
* @param {string} props.color - Color code for the logo text
|
|
8
|
-
* @return {
|
|
8
|
+
* @return {ReactElement} Component template
|
|
9
9
|
*/
|
|
10
10
|
export default function AutomatticForAgenciesLogo({ color = '#FFFFFF', }) {
|
|
11
11
|
return (_jsx(SVG, { clipRule: "evenodd", fillRule: "evenodd", width: "251", height: "47", viewBox: "0 0 251 47", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx(Path, { d: "M20.256 17H17.04L14.928 13.04L5.544 13.04L3.504 17H0.336L8.976 1.016L11.472 1.016L20.256 17ZM13.752 10.856L10.152 4.136L6.672 10.856L13.752 10.856ZM42.7174 10.352C42.7174 14.312 40.1734 17.624 34.1494 17.624C28.4134 17.624 25.7494 14.504 25.7494 10.352L25.7494 1.016H28.7254L28.7254 10.4C28.7254 13.352 30.6694 15.104 34.3654 15.104C38.1574 15.104 39.7174 13.352 39.7174 10.4V1.016L42.7174 1.016V10.352ZM66.6443 3.512L59.6603 3.512V17H56.6603V3.512L49.6763 3.512V1.016L66.6443 1.016V3.512ZM91.1207 9.296C91.1207 13.544 87.4487 17.624 81.7607 17.624C76.0967 17.624 72.4247 13.544 72.4247 9.296V8.768C72.4247 4.448 76.0967 0.439999 81.7607 0.439999C87.4487 0.439999 91.1207 4.448 91.1207 8.768V9.296ZM88.0967 9.2V8.816C88.0967 5.72 85.8407 2.96 81.7607 2.96C77.6807 2.96 75.4487 5.72 75.4487 8.816V9.2C75.4487 12.296 77.6807 15.104 81.7607 15.104C85.8407 15.104 88.0967 12.296 88.0967 9.2ZM120.609 17H117.609V4.352L116.817 5.744L110.121 17H108.657L102.033 5.744L101.241 4.352V17H98.3128V1.016H102.465L108.777 11.984L109.521 13.328L110.265 11.984L116.505 1.016L120.609 1.016V17ZM146.748 17H143.532L141.42 13.04H132.036L129.996 17H126.828L135.468 1.016H137.964L146.748 17ZM140.244 10.856L136.644 4.136L133.164 10.856L140.244 10.856ZM166.919 3.512L159.935 3.512V17L156.935 17V3.512L149.951 3.512V1.016L166.919 1.016V3.512ZM190.136 3.512H183.152V17H180.152V3.512H173.168V1.016L190.136 1.016V3.512ZM200.346 17H197.346V1.016L200.346 1.016V17ZM225.532 3.632L223.66 5.528C222.22 4.208 220.108 2.96 217.252 2.96C212.98 2.96 210.58 5.888 210.58 8.936V9.248C210.58 12.272 213.004 15.104 217.468 15.104C220.132 15.104 222.34 13.832 223.732 12.536L225.532 14.432C223.78 16.16 220.804 17.624 217.276 17.624C211.228 17.624 207.556 13.688 207.556 9.368V8.84C207.556 4.52 211.564 0.439999 217.42 0.439999C220.804 0.439999 223.876 1.856 225.532 3.632ZM16.512 32.512H5.256L5.256 37.096H13.632V39.472H5.256L5.256 46H2.28L2.28 30.016H16.512V32.512ZM40.8426 38.296C40.8426 42.544 37.1706 46.624 31.4826 46.624C25.8186 46.624 22.1466 42.544 22.1466 38.296V37.768C22.1466 33.448 25.8186 29.44 31.4826 29.44C37.1706 29.44 40.8426 33.448 40.8426 37.768V38.296ZM37.8186 38.2V37.816C37.8186 34.72 35.5626 31.96 31.4826 31.96C27.4026 31.96 25.1706 34.72 25.1706 37.816V38.2C25.1706 41.296 27.4026 44.104 31.4826 44.104C35.5626 44.104 37.8186 41.296 37.8186 38.2ZM64.5227 46H61.8107C60.9947 46 60.6347 44.872 60.5387 43.432L60.4427 41.8C60.3467 40.216 59.6987 39.544 56.6987 39.544H51.0347V46H48.0347V30.016H56.7467C61.5467 30.016 63.7067 31.936 63.7067 34.408C63.7067 36.16 62.8187 37.816 59.6987 38.392C62.8187 38.632 63.4907 40.048 63.5147 41.92L63.5387 43.24C63.5627 44.344 63.7547 45.136 64.5227 45.928V46ZM60.6827 34.984V34.792C60.6827 33.64 59.7467 32.512 57.1787 32.512H51.0347V37.312H57.4427C59.6507 37.312 60.6827 36.256 60.6827 34.984ZM101.054 46H97.8384L95.7264 42.04L86.3424 42.04L84.3024 46H81.1344L89.7744 30.016H92.2704L101.054 46ZM94.5504 39.856L90.9504 33.136L87.4704 39.856H94.5504ZM123.597 46H121.677L121.221 43.84C119.685 45.616 117.501 46.624 114.789 46.624C109.125 46.624 105.453 42.736 105.453 38.296V38.008C105.453 33.472 109.461 29.44 115.317 29.44C118.917 29.44 121.845 30.928 123.429 32.632L121.557 34.528C120.117 33.208 117.885 31.96 115.293 31.96C110.829 31.96 108.477 34.816 108.477 37.936V38.2C108.477 41.32 110.997 44.104 115.077 44.104C118.173 44.104 120.381 42.208 120.381 40.288V40.12H115.461V37.744H123.597V46ZM145.697 46L131.177 46V30.016L145.697 30.016V32.512L134.177 32.512V36.616H143.033V39.04H134.177V43.504L145.697 43.504V46ZM170.003 46H167.411L157.019 35.296L156.011 34.168V46H153.011V30.016H155.891L165.971 40.696L167.003 41.848V30.016H170.003V46ZM195.19 32.632L193.318 34.528C191.878 33.208 189.766 31.96 186.91 31.96C182.638 31.96 180.238 34.888 180.238 37.936V38.248C180.238 41.272 182.662 44.104 187.126 44.104C189.79 44.104 191.998 42.832 193.39 41.536L195.19 43.432C193.438 45.16 190.462 46.624 186.934 46.624C180.886 46.624 177.214 42.688 177.214 38.368V37.84C177.214 33.52 181.222 29.44 187.078 29.44C190.462 29.44 193.534 30.856 195.19 32.632ZM205.164 46L202.164 46V30.016L205.164 30.016V46ZM227.855 46H213.335V30.016H227.855V32.512H216.335V36.616H225.191V39.04H216.335V43.504H227.855V46ZM251.009 41.512C251.009 44.632 247.601 46.624 242.849 46.624C239.609 46.624 236.609 45.736 234.137 44.56L235.241 42.184C237.761 43.432 240.425 44.176 242.993 44.176C246.449 44.176 247.985 43.048 247.985 41.824C247.985 38.008 234.593 40.552 234.593 34.696C234.593 31.72 237.809 29.44 242.873 29.44C246.017 29.44 248.945 30.544 250.745 31.72L249.113 33.736C247.625 32.776 245.177 31.888 242.777 31.888C239.657 31.888 237.593 32.944 237.593 34.312C237.593 37.792 251.009 35.464 251.009 41.512Z", fill: color }) }));
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* Automattic Icon Logo component
|
|
4
4
|
*
|
|
5
5
|
* @param {object} props - Component props
|
|
6
6
|
* @param {string} props.innerColor - Color code for the line in the middle of the logo.
|
|
7
7
|
* @param {string} props.outerColor - Color code for the logo's outer
|
|
8
|
-
* @return {
|
|
8
|
+
* @return {ReactElement} Component template
|
|
9
9
|
*/
|
|
10
10
|
export default function AutomatticIconLogo({ innerColor, outerColor, }: {
|
|
11
11
|
innerColor: string;
|
|
12
12
|
outerColor: string;
|
|
13
|
-
}):
|
|
13
|
+
}): ReactElement;
|
|
@@ -6,7 +6,7 @@ import { Path, SVG } from '@wordpress/components';
|
|
|
6
6
|
* @param {object} props - Component props
|
|
7
7
|
* @param {string} props.innerColor - Color code for the line in the middle of the logo.
|
|
8
8
|
* @param {string} props.outerColor - Color code for the logo's outer
|
|
9
|
-
* @return {
|
|
9
|
+
* @return {ReactElement} Component template
|
|
10
10
|
*/
|
|
11
11
|
export default function AutomatticIconLogo({ innerColor = '#00A3E0', outerColor = '#FFFFFF', }) {
|
|
12
12
|
return (_jsxs(SVG, { clipRule: "evenodd", fill: "none", fillRule: "evenodd", height: "43", viewBox: "0 0 47 43", width: "47", xmlns: "http://www.w3.org/2000/svg", children: [_jsx(Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M39.3164 20.9589C39.3164 13.2129 33.656 6.30469 23.4214 6.30469C13.1867 6.30469 7.58624 13.2129 7.58624 20.9589V21.9206C7.58624 29.6677 13.1867 36.6942 23.4214 36.6942C33.656 36.6942 39.3164 29.6677 39.3164 21.9206V20.9589ZM23.4214 43C9.21187 43 0 32.7913 0 22.1604V20.8407C0 10.0285 9.21187 0 23.4214 0C37.6919 0 46.9038 10.0285 46.9038 20.8407V22.1604C46.9038 32.7913 37.6919 43 23.4214 43Z", fill: innerColor }), _jsx(Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M28.4548 14.1897C29.752 15.0401 30.1158 16.8077 29.2739 18.1343L22.712 28.4682C21.8691 29.7959 20.1348 30.1799 18.8397 29.3295C17.5446 28.477 17.1765 26.7137 18.0205 25.386L24.5824 15.0522C25.4253 13.7256 27.1597 13.3404 28.4548 14.1897Z", fill: outerColor })] }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ReactNode, FC } from 'react';
|
|
2
2
|
type BadgeProps = {
|
|
3
|
-
children?:
|
|
3
|
+
children?: ReactNode;
|
|
4
4
|
className?: string;
|
|
5
5
|
variant?: 'success' | 'warning' | 'danger';
|
|
6
6
|
[key: string]: unknown;
|
|
@@ -13,7 +13,7 @@ type BadgeProps = {
|
|
|
13
13
|
* @param {JSX.Element} props.children - Badge text or content.
|
|
14
14
|
* @param {string} props.className - Additional class name to pass to the Badge component.
|
|
15
15
|
*
|
|
16
|
-
* @return {
|
|
16
|
+
* @return {ReactElement} The `Badge` component.
|
|
17
17
|
*/
|
|
18
|
-
declare const Badge:
|
|
18
|
+
declare const Badge: FC<BadgeProps>;
|
|
19
19
|
export default Badge;
|
|
@@ -9,7 +9,7 @@ import styles from './style.module.scss';
|
|
|
9
9
|
* @param {JSX.Element} props.children - Badge text or content.
|
|
10
10
|
* @param {string} props.className - Additional class name to pass to the Badge component.
|
|
11
11
|
*
|
|
12
|
-
* @return {
|
|
12
|
+
* @return {ReactElement} The `Badge` component.
|
|
13
13
|
*/
|
|
14
14
|
const Badge = ({ children, className, variant, ...props }) => {
|
|
15
15
|
const classes = clsx(styles.badge, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { FunctionComponent } from 'react';
|
|
2
2
|
import './style.scss';
|
|
3
3
|
export interface Period {
|
|
4
4
|
timestamp: number;
|
|
@@ -38,7 +38,7 @@ export type ScoreGraphAlignedData = [
|
|
|
38
38
|
* @param {string} props.title - Title for the chart.
|
|
39
39
|
* @param {Period[]} props.periods - The periods to display in the chart.
|
|
40
40
|
* @param {boolean} [props.isLoading=false] - Whether the component is in a loading state.
|
|
41
|
-
* @return {
|
|
41
|
+
* @return {ReactElement} The JSX element representing the BoostScoreGraph component, or null if loading.
|
|
42
42
|
*/
|
|
43
43
|
export declare const BoostScoreGraph: FunctionComponent<BoostScoreGraphProps>;
|
|
44
44
|
export default BoostScoreGraph;
|
|
@@ -10,7 +10,7 @@ import './style.scss';
|
|
|
10
10
|
* @param {string} props.title - Title for the chart.
|
|
11
11
|
* @param {Period[]} props.periods - The periods to display in the chart.
|
|
12
12
|
* @param {boolean} [props.isLoading=false] - Whether the component is in a loading state.
|
|
13
|
-
* @return {
|
|
13
|
+
* @return {ReactElement} The JSX element representing the BoostScoreGraph component, or null if loading.
|
|
14
14
|
*/
|
|
15
15
|
export const BoostScoreGraph = ({ periods = [], annotations = [], startDate = 0, endDate = 0, title, isPlaceholder = false, }) => {
|
|
16
16
|
// Sort periods by timestamp
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import uPlot from 'uplot';
|
|
3
2
|
import { type Annotation, Period } from './index.tsx';
|
|
4
3
|
import './style-uplot.scss';
|
|
4
|
+
import type { RefObject } from 'react';
|
|
5
5
|
interface UplotChartProps {
|
|
6
6
|
periods: Period[];
|
|
7
7
|
annotations?: Annotation[];
|
|
8
8
|
options?: Partial<uPlot.Options>;
|
|
9
|
-
legendContainer?:
|
|
9
|
+
legendContainer?: RefObject<HTMLDivElement>;
|
|
10
10
|
solidFill?: boolean;
|
|
11
11
|
period?: string;
|
|
12
12
|
range?: {
|
|
@@ -21,7 +21,7 @@ interface UplotChartProps {
|
|
|
21
21
|
* @param {{ startDate: number, endDate: number }} props.range - The date range of the chart.
|
|
22
22
|
* @param {Period[]} props.periods - The periods to display in the chart.
|
|
23
23
|
* @param {Annotation[]} props.annotations - The annotations to display in the chart.
|
|
24
|
-
* @return {
|
|
24
|
+
* @return {ReactElement} The JSX element representing the UplotLineChart component.
|
|
25
25
|
*/
|
|
26
26
|
export default function UplotLineChart({ range, periods, annotations }: UplotChartProps): import("react/jsx-runtime").JSX.Element;
|
|
27
27
|
export {};
|
|
@@ -73,7 +73,7 @@ function getColor(score, opacity = 'FF') {
|
|
|
73
73
|
* @param {{ startDate: number, endDate: number }} props.range - The date range of the chart.
|
|
74
74
|
* @param {Period[]} props.periods - The periods to display in the chart.
|
|
75
75
|
* @param {Annotation[]} props.annotations - The annotations to display in the chart.
|
|
76
|
-
* @return {
|
|
76
|
+
* @return {ReactElement} The JSX element representing the UplotLineChart component.
|
|
77
77
|
*/
|
|
78
78
|
export default function UplotLineChart({ range, periods, annotations = [] }) {
|
|
79
79
|
const uplot = useRef(null);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import uPlot from 'uplot';
|
|
2
|
+
import type { RefObject } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* Custom hook to handle resizing of uPlot charts.
|
|
5
5
|
*
|
|
6
|
-
* @param {
|
|
7
|
-
* @param {
|
|
6
|
+
* @param {RefObject<uPlot>} uplotRef - The ref object for the uPlot instance.
|
|
7
|
+
* @param {RefObject<HTMLDivElement>} containerRef - The ref object for the container div.
|
|
8
8
|
*/
|
|
9
|
-
export default function useResize(uplotRef:
|
|
9
|
+
export default function useResize(uplotRef: RefObject<uPlot>, containerRef: RefObject<HTMLDivElement>): void;
|
|
@@ -4,8 +4,8 @@ const THROTTLE_DURATION = 400; // in ms
|
|
|
4
4
|
/**
|
|
5
5
|
* Custom hook to handle resizing of uPlot charts.
|
|
6
6
|
*
|
|
7
|
-
* @param {
|
|
8
|
-
* @param {
|
|
7
|
+
* @param {RefObject<uPlot>} uplotRef - The ref object for the uPlot instance.
|
|
8
|
+
* @param {RefObject<HTMLDivElement>} containerRef - The ref object for the container div.
|
|
9
9
|
*/
|
|
10
10
|
export default function useResize(uplotRef, containerRef) {
|
|
11
11
|
useEffect(() => {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { ButtonProps } from './types.ts';
|
|
3
2
|
/**
|
|
4
3
|
* Button component
|
|
5
4
|
*
|
|
6
5
|
* @param {ButtonProps} props - Component Props
|
|
7
|
-
* @return {
|
|
6
|
+
* @return {ReactNode} Rendered button
|
|
8
7
|
*/
|
|
9
|
-
declare const Button:
|
|
8
|
+
declare const Button: import("react").ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
10
9
|
export default Button;
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* External dependencies
|
|
4
|
-
*/
|
|
5
2
|
import { Button as WPButton, Spinner, VisuallyHidden } from '@wordpress/components';
|
|
6
3
|
import { __ } from '@wordpress/i18n';
|
|
7
4
|
import { Icon, external } from '@wordpress/icons';
|
|
8
5
|
import clsx from 'clsx';
|
|
9
6
|
import { forwardRef } from 'react';
|
|
10
|
-
/**
|
|
11
|
-
* Internal dependencies
|
|
12
|
-
*/
|
|
13
7
|
import styles from './style.module.scss';
|
|
14
8
|
/**
|
|
15
9
|
* Button component
|
|
16
10
|
*
|
|
17
11
|
* @param {ButtonProps} props - Component Props
|
|
18
|
-
* @return {
|
|
12
|
+
* @return {ReactNode} Rendered button
|
|
19
13
|
*/
|
|
20
14
|
const Button = forwardRef((props, ref) => {
|
|
21
15
|
const { children, variant = 'primary', size = 'normal', weight = 'bold', icon, iconSize, disabled, isDestructive, isLoading, isExternalLink, className: propsClassName, text, fullWidth, ...componentProps } = props;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Button } from '@wordpress/components';
|
|
2
|
-
import type
|
|
2
|
+
import type { ComponentProps, ForwardedRef, ReactNode } from 'react';
|
|
3
3
|
type JetpackButtonBaseProps = {
|
|
4
4
|
className?: string;
|
|
5
|
-
children?:
|
|
5
|
+
children?: ReactNode;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
isDestructive?: boolean;
|
|
8
8
|
isLoading?: boolean;
|
|
@@ -12,8 +12,8 @@ type JetpackButtonBaseProps = {
|
|
|
12
12
|
variant?: 'primary' | 'secondary' | 'link' | 'tertiary';
|
|
13
13
|
weight?: 'bold' | 'regular';
|
|
14
14
|
fullWidth?: boolean;
|
|
15
|
-
ref?:
|
|
15
|
+
ref?: ForwardedRef<unknown>;
|
|
16
16
|
};
|
|
17
|
-
type WPButtonProps = Omit<
|
|
17
|
+
type WPButtonProps = Omit<ComponentProps<typeof Button>, 'size' | 'variant'>;
|
|
18
18
|
export type ButtonProps = JetpackButtonBaseProps & WPButtonProps;
|
|
19
19
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { FC } from 'react';
|
|
2
2
|
type ChipProps = {
|
|
3
3
|
text?: string;
|
|
4
4
|
type?: 'new' | 'info';
|
|
@@ -9,7 +9,7 @@ type ChipProps = {
|
|
|
9
9
|
* @param {object} props - The component properties.
|
|
10
10
|
* @param {string} props.type - The type new or info
|
|
11
11
|
* @param {string} props.text - Chip text
|
|
12
|
-
* @return {
|
|
12
|
+
* @return {ReactElement} The `Chip` component.
|
|
13
13
|
*/
|
|
14
|
-
declare const Chip:
|
|
14
|
+
declare const Chip: FC<ChipProps>;
|
|
15
15
|
export default Chip;
|
|
@@ -7,7 +7,7 @@ import styles from './style.module.scss';
|
|
|
7
7
|
* @param {object} props - The component properties.
|
|
8
8
|
* @param {string} props.type - The type new or info
|
|
9
9
|
* @param {string} props.text - Chip text
|
|
10
|
-
* @return {
|
|
10
|
+
* @return {ReactElement} The `Chip` component.
|
|
11
11
|
*/
|
|
12
12
|
const Chip = ({ type = 'info', text }) => {
|
|
13
13
|
const classes = clsx(styles.chip, styles[`is-${type}`]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CutBaseProps } from './types.ts';
|
|
2
|
-
import type
|
|
3
|
-
declare const ContextualUpgradeTrigger:
|
|
2
|
+
import type { FC } from 'react';
|
|
3
|
+
declare const ContextualUpgradeTrigger: FC<CutBaseProps>;
|
|
4
4
|
export default ContextualUpgradeTrigger;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CopyToClipboardProps } from './types.ts';
|
|
2
|
-
import type
|
|
3
|
-
export declare const CopyToClipboard:
|
|
2
|
+
import type { FC } from 'react';
|
|
3
|
+
export declare const CopyToClipboard: FC<CopyToClipboardProps>;
|
|
4
4
|
export default CopyToClipboard;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { DecorativeCardProps } from './types.ts';
|
|
2
|
-
import type
|
|
2
|
+
import type { FC } from 'react';
|
|
3
3
|
import './style.scss';
|
|
4
4
|
/**
|
|
5
5
|
* A decorative card used in the disconnection flow.
|
|
6
6
|
*
|
|
7
7
|
* @param {DecorativeCardProps} props - The properties.
|
|
8
|
-
* @return {
|
|
8
|
+
* @return {ReactNode} - The DecorativeCard component.
|
|
9
9
|
*/
|
|
10
|
-
declare const DecorativeCard:
|
|
10
|
+
declare const DecorativeCard: FC<DecorativeCardProps>;
|
|
11
11
|
export default DecorativeCard;
|
|
@@ -4,9 +4,9 @@ import './style.scss';
|
|
|
4
4
|
* A decorative card used in the disconnection flow.
|
|
5
5
|
*
|
|
6
6
|
* @param {DecorativeCardProps} props - The properties.
|
|
7
|
-
* @return {
|
|
7
|
+
* @return {ReactNode} - The DecorativeCard component.
|
|
8
8
|
*/
|
|
9
|
-
const DecorativeCard = ({ format = 'horizontal', icon, imageUrl
|
|
9
|
+
const DecorativeCard = ({ format = 'horizontal', icon, imageUrl }) => {
|
|
10
10
|
return (_jsxs("div", { className: 'jp-components__decorative-card ' +
|
|
11
11
|
(format ? 'jp-components__decorative-card--' + format : ''), children: [_jsx("div", { className: "jp-components__decorative-card__image", style: { backgroundImage: imageUrl ? `url( ${imageUrl} )` : '' } }), _jsx("div", { className: "jp-components__decorative-card__content", children: _jsx("div", { className: "jp-components__decorative-card__lines" }) }), icon ? (_jsx("div", { className: "jp-components__decorative-card__icon-container", children: _jsx("span", { className: 'jp-components__decorative-card__icon jp-components__decorative-card__icon--' + icon }) })) : null] }));
|
|
12
12
|
};
|