@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
|
@@ -20,7 +20,7 @@ const showPriceDecimals = (currencyObject) => {
|
|
|
20
20
|
* The Pricing card component.
|
|
21
21
|
*
|
|
22
22
|
* @param {PricingCardProps} props -- The component props.
|
|
23
|
-
* @return {
|
|
23
|
+
* @return {ReactNode} The rendered component.
|
|
24
24
|
*/
|
|
25
25
|
const PricingCard = ({ currencyCode = 'USD', priceDetails = __('/month, paid yearly', 'jetpack-components'), ...props }) => {
|
|
26
26
|
const currencyObjectBefore = getCurrencyObject(props.priceBefore, currencyCode);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import type { Button } from '@wordpress/components';
|
|
5
|
-
import type
|
|
5
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
6
6
|
export type PricingCardProps = {
|
|
7
7
|
/**
|
|
8
8
|
* The Title.
|
|
@@ -11,7 +11,7 @@ export type PricingCardProps = {
|
|
|
11
11
|
/**
|
|
12
12
|
* The Icon.
|
|
13
13
|
*/
|
|
14
|
-
icon?: string |
|
|
14
|
+
icon?: string | ReactNode;
|
|
15
15
|
/**
|
|
16
16
|
* Price before discount.
|
|
17
17
|
*/
|
|
@@ -35,17 +35,17 @@ export type PricingCardProps = {
|
|
|
35
35
|
/**
|
|
36
36
|
* The CTA callback to be called on click.
|
|
37
37
|
*/
|
|
38
|
-
onCtaClick?:
|
|
38
|
+
onCtaClick?: ComponentProps<typeof Button>['onClick'];
|
|
39
39
|
/**
|
|
40
40
|
* Optional informative text.
|
|
41
41
|
*/
|
|
42
|
-
infoText?:
|
|
42
|
+
infoText?: ReactNode;
|
|
43
43
|
/**
|
|
44
44
|
* The TOS copy.
|
|
45
45
|
*/
|
|
46
|
-
tosText?:
|
|
46
|
+
tosText?: ReactNode;
|
|
47
47
|
/**
|
|
48
48
|
* Optional Child nodes
|
|
49
49
|
*/
|
|
50
|
-
children?:
|
|
50
|
+
children?: ReactNode;
|
|
51
51
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { PricingTableProps, PricingTableColumnProps, PricingTableHeaderProps, PricingTableItemProps } from './types.ts';
|
|
3
|
-
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
declare const
|
|
2
|
+
import type { FC } from 'react';
|
|
3
|
+
export declare const PricingTableItem: FC<PricingTableItemProps>;
|
|
4
|
+
export declare const PricingTableHeader: FC<PricingTableHeaderProps>;
|
|
5
|
+
export declare const PricingTableColumn: FC<PricingTableColumnProps>;
|
|
6
|
+
declare const PricingTable: FC<PricingTableProps>;
|
|
7
7
|
export default PricingTable;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Placement } from '../icon-tooltip/types.ts';
|
|
2
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
3
|
export type PricingTableProps = {
|
|
3
4
|
/**
|
|
4
5
|
* Title of the pricing table.
|
|
@@ -9,14 +10,14 @@ export type PricingTableProps = {
|
|
|
9
10
|
*/
|
|
10
11
|
items: {
|
|
11
12
|
name: string;
|
|
12
|
-
tooltipInfo?:
|
|
13
|
+
tooltipInfo?: ReactNode;
|
|
13
14
|
tooltipTitle?: string;
|
|
14
15
|
tooltipPlacement?: Placement;
|
|
15
16
|
}[];
|
|
16
17
|
/**
|
|
17
18
|
* The columns to add to the table.
|
|
18
19
|
*/
|
|
19
|
-
children:
|
|
20
|
+
children: ReactNode;
|
|
20
21
|
/**
|
|
21
22
|
* Whether to show the intro offer disclaimer text with the ToS.
|
|
22
23
|
*/
|
|
@@ -30,13 +31,13 @@ export type PricingTableColumnProps = {
|
|
|
30
31
|
/**
|
|
31
32
|
* Items to show in a column.
|
|
32
33
|
*/
|
|
33
|
-
children:
|
|
34
|
+
children: ReactElement[];
|
|
34
35
|
};
|
|
35
36
|
export type PricingTableHeaderProps = {
|
|
36
37
|
/**
|
|
37
38
|
* Items to show in a header.
|
|
38
39
|
*/
|
|
39
|
-
children:
|
|
40
|
+
children: ReactNode;
|
|
40
41
|
};
|
|
41
42
|
export type PricingTableItemProps = {
|
|
42
43
|
/**
|
|
@@ -50,12 +51,12 @@ export type PricingTableItemProps = {
|
|
|
50
51
|
/**
|
|
51
52
|
* A custom label to display instead of the default one.
|
|
52
53
|
*/
|
|
53
|
-
label?: string | number |
|
|
54
|
+
label?: string | number | ReactElement;
|
|
54
55
|
/**
|
|
55
56
|
* Index of the item, relative to other PricingTableItem components. Internal use only.
|
|
56
57
|
*/
|
|
57
58
|
index?: number;
|
|
58
|
-
tooltipInfo?:
|
|
59
|
+
tooltipInfo?: ReactNode;
|
|
59
60
|
/**
|
|
60
61
|
* Title for the popover, not required.
|
|
61
62
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { IconsCardProps } from './types.ts';
|
|
2
|
+
import type { FC } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* Icons composition for a bundle product,
|
|
5
5
|
* based on the list of supported products.
|
|
6
6
|
*
|
|
7
7
|
* @param {IconsCardProps} props - Component props.
|
|
8
|
-
* @return {
|
|
8
|
+
* @return {ReactNode} Bundle product icons react component.
|
|
9
9
|
*/
|
|
10
|
-
export declare const IconsCard:
|
|
10
|
+
export declare const IconsCard: FC<IconsCardProps>;
|
|
@@ -8,7 +8,7 @@ import styles from './style.module.scss';
|
|
|
8
8
|
* based on the list of supported products.
|
|
9
9
|
*
|
|
10
10
|
* @param {IconsCardProps} props - Component props.
|
|
11
|
-
* @return {
|
|
11
|
+
* @return {ReactNode} Bundle product icons react component.
|
|
12
12
|
*/
|
|
13
13
|
export const IconsCard = ({ products, icon, size = 24 }) => {
|
|
14
14
|
if (icon) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ProductOfferProps } from './types.ts';
|
|
2
|
-
import type
|
|
2
|
+
import type { FC } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* Product Detail component.
|
|
5
5
|
*
|
|
6
6
|
* @param {ProductOfferProps} props - Component props.
|
|
7
|
-
* @return {
|
|
7
|
+
* @return {ReactNode} - ProductOffer react component.
|
|
8
8
|
*/
|
|
9
|
-
declare const ProductOffer:
|
|
9
|
+
declare const ProductOffer: FC<ProductOfferProps>;
|
|
10
10
|
export default ProductOffer;
|
|
11
11
|
export * from './icons-card.tsx';
|
|
@@ -14,7 +14,7 @@ import styles from './style.module.scss';
|
|
|
14
14
|
* Product Detail component.
|
|
15
15
|
*
|
|
16
16
|
* @param {ProductOfferProps} props - Component props.
|
|
17
|
-
* @return {
|
|
17
|
+
* @return {ReactNode} - ProductOffer react component.
|
|
18
18
|
*/
|
|
19
19
|
const ProductOffer = ({ addProductUrl, buttonDisclaimer, buttonText = '', className, description, error = '', features, hasRequiredPlan, icon, isBundle = false, isCard, isLoading, onAdd, pricing = {}, slug, subTitle = '', supportedProducts, title = '', }) => {
|
|
20
20
|
const { isFree, price, currency, offPrice } = pricing;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ProductOfferHeaderProps } from './types.ts';
|
|
2
|
-
import type
|
|
2
|
+
import type { FC } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* Product Detail Card Header component.
|
|
5
5
|
*
|
|
6
6
|
* @param {ProductOfferHeaderProps} props - Component props.
|
|
7
|
-
* @return {
|
|
7
|
+
* @return {ReactNode} ProductOfferHeader react component.
|
|
8
8
|
*/
|
|
9
|
-
export declare const ProductOfferHeader:
|
|
9
|
+
export declare const ProductOfferHeader: FC<ProductOfferHeaderProps>;
|
|
@@ -7,7 +7,7 @@ import styles from './style.module.scss';
|
|
|
7
7
|
* Product Detail Card Header component.
|
|
8
8
|
*
|
|
9
9
|
* @param {ProductOfferHeaderProps} props - Component props.
|
|
10
|
-
* @return {
|
|
10
|
+
* @return {ReactNode} ProductOfferHeader react component.
|
|
11
11
|
*/
|
|
12
12
|
export const ProductOfferHeader = ({ title = __('Popular upgrade', 'jetpack-components'), }) => {
|
|
13
13
|
return (_jsxs("div", { className: styles['card-header'], children: [_jsx(Icon, { icon: star, className: styles['product-bundle-icon'], size: 24 }), _jsx(Text, { variant: "label", children: title })] }));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ProductPriceProps } from '../product-price/types.ts';
|
|
2
2
|
import type { JetpackIconSlug } from '../icons/index.tsx';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
3
4
|
export type ProductOfferProps = {
|
|
4
5
|
/**
|
|
5
6
|
* Product slug.
|
|
@@ -72,7 +73,7 @@ export type ProductOfferProps = {
|
|
|
72
73
|
/**
|
|
73
74
|
* Content displayed below the Add button.
|
|
74
75
|
*/
|
|
75
|
-
buttonDisclaimer?:
|
|
76
|
+
buttonDisclaimer?: ReactNode;
|
|
76
77
|
/**
|
|
77
78
|
* Error message.
|
|
78
79
|
*/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ProductPriceProps } from './types.ts';
|
|
2
|
-
import type
|
|
2
|
+
import type { FC } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* React component to render the price.
|
|
5
5
|
*
|
|
6
6
|
* @param {ProductPriceProps} props - Component props.
|
|
7
|
-
* @return {
|
|
7
|
+
* @return {ReactNode} Price react component.
|
|
8
8
|
*/
|
|
9
|
-
declare const ProductPrice:
|
|
9
|
+
declare const ProductPrice: FC<ProductPriceProps>;
|
|
10
10
|
export default ProductPrice;
|
|
11
11
|
export * from './price.tsx';
|
|
@@ -14,7 +14,7 @@ import styles from './style.module.scss';
|
|
|
14
14
|
* React component to render the price.
|
|
15
15
|
*
|
|
16
16
|
* @param {ProductPriceProps} props - Component props.
|
|
17
|
-
* @return {
|
|
17
|
+
* @return {ReactNode} Price react component.
|
|
18
18
|
*/
|
|
19
19
|
const ProductPrice = ({ price, offPrice, currency = '', showNotOffPrice = true, hideDiscountLabel = true, promoLabel = '', legend = __('/month, paid yearly', 'jetpack-components'), isNotConvenientPrice = false, hidePriceFraction = false, children, }) => {
|
|
20
20
|
if ((price == null && offPrice == null) || !currency) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { PriceProps } from './types.ts';
|
|
2
|
-
import type
|
|
2
|
+
import type { FC } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* React component to render a Price composition.
|
|
5
5
|
*
|
|
6
6
|
* @param {PriceProps} props - Component props.
|
|
7
|
-
* @return {
|
|
7
|
+
* @return {ReactNode} -Price react component.
|
|
8
8
|
*/
|
|
9
|
-
export declare const Price:
|
|
9
|
+
export declare const Price: FC<PriceProps>;
|
|
@@ -7,7 +7,7 @@ import styles from './style.module.scss';
|
|
|
7
7
|
* React component to render a Price composition.
|
|
8
8
|
*
|
|
9
9
|
* @param {PriceProps} props - Component props.
|
|
10
|
-
* @return {
|
|
10
|
+
* @return {ReactNode} -Price react component.
|
|
11
11
|
*/
|
|
12
12
|
export const Price = ({ value, currency, isOff, hidePriceFraction }) => {
|
|
13
13
|
const classNames = clsx(styles.price, 'product-price_price', {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
1
2
|
export type ProductPriceProps = {
|
|
2
3
|
/**
|
|
3
4
|
* Product price.
|
|
@@ -38,7 +39,7 @@ export type ProductPriceProps = {
|
|
|
38
39
|
/**
|
|
39
40
|
* Alternative legend with HTML syntax
|
|
40
41
|
*/
|
|
41
|
-
children?:
|
|
42
|
+
children?: ReactNode;
|
|
42
43
|
};
|
|
43
44
|
export type PriceProps = {
|
|
44
45
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ProgressBarProps } from './types.ts';
|
|
2
|
-
import type
|
|
2
|
+
import type { FC } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* Progress Bar component
|
|
5
5
|
*
|
|
6
6
|
* @param {ProgressBarProps} props - Component props.
|
|
7
|
-
* @return {
|
|
7
|
+
* @return {ReactNode} - ProgressBar react component.
|
|
8
8
|
*/
|
|
9
|
-
declare const ProgressBar:
|
|
9
|
+
declare const ProgressBar: FC<ProgressBarProps>;
|
|
10
10
|
export default ProgressBar;
|
|
@@ -11,7 +11,7 @@ import styles from './style.module.scss';
|
|
|
11
11
|
* Progress Bar component
|
|
12
12
|
*
|
|
13
13
|
* @param {ProgressBarProps} props - Component props.
|
|
14
|
-
* @return {
|
|
14
|
+
* @return {ReactNode} - ProgressBar react component.
|
|
15
15
|
*/
|
|
16
16
|
const ProgressBar = ({ className, progressClassName, progress, size = 'normal', }) => {
|
|
17
17
|
if (progress == null) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { QRCodeCanvas, QRCodeSVG } from 'qrcode.react';
|
|
2
|
-
import type
|
|
3
|
-
type QRCodeCanvasProps =
|
|
4
|
-
type QRCodeSVGProps =
|
|
2
|
+
import type { ComponentProps, FC } from 'react';
|
|
3
|
+
type QRCodeCanvasProps = ComponentProps<typeof QRCodeCanvas>;
|
|
4
|
+
type QRCodeSVGProps = ComponentProps<typeof QRCodeSVG>;
|
|
5
5
|
export type QRCodeProps = {
|
|
6
6
|
/**
|
|
7
7
|
* The value to encode.
|
|
@@ -40,7 +40,7 @@ export type QRCodeProps = {
|
|
|
40
40
|
* Renders a QR Code.
|
|
41
41
|
*
|
|
42
42
|
* @param {QRCodeProps} props - Component props
|
|
43
|
-
* @return {
|
|
43
|
+
* @return {ReactNode} - React component.
|
|
44
44
|
*/
|
|
45
|
-
declare const QRCode:
|
|
45
|
+
declare const QRCode: FC<QRCodeProps>;
|
|
46
46
|
export default QRCode;
|
|
@@ -4,7 +4,7 @@ import { QRCodeCanvas, QRCodeSVG } from 'qrcode.react';
|
|
|
4
4
|
* Renders a QR Code.
|
|
5
5
|
*
|
|
6
6
|
* @param {QRCodeProps} props - Component props
|
|
7
|
-
* @return {
|
|
7
|
+
* @return {ReactNode} - React component.
|
|
8
8
|
*/
|
|
9
9
|
const QRCode = ({ value = 'https://jetpack.com', size = 248, bgColor, fgColor, level, includeMargin, imageSettings, renderAs = 'canvas', }) => {
|
|
10
10
|
const commonProps = {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { FC, ReactNode } from 'react';
|
|
1
2
|
interface RadioControlProps {
|
|
2
3
|
/** The current value. */
|
|
3
4
|
selected: string;
|
|
@@ -6,9 +7,9 @@ interface RadioControlProps {
|
|
|
6
7
|
/** Whether or not the radio control is currently disabled. */
|
|
7
8
|
disabled?: boolean;
|
|
8
9
|
/** Additional information to display below the radio control. */
|
|
9
|
-
help?:
|
|
10
|
+
help?: ReactNode;
|
|
10
11
|
/** The label for the radio control. */
|
|
11
|
-
label?:
|
|
12
|
+
label?: ReactNode;
|
|
12
13
|
/** If true, the label will only be visible to screen readers. */
|
|
13
14
|
hideLabelFromVision?: boolean;
|
|
14
15
|
/** A list of options to show. */
|
|
@@ -19,5 +20,5 @@ interface RadioControlProps {
|
|
|
19
20
|
/** A callback function invoked when the value is changed. */
|
|
20
21
|
onChange: (value: string) => void;
|
|
21
22
|
}
|
|
22
|
-
declare const RadioControl:
|
|
23
|
+
declare const RadioControl: FC<RadioControlProps>;
|
|
23
24
|
export default RadioControl;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { FC } from 'react';
|
|
2
2
|
import './style.scss';
|
|
3
3
|
type RecordMeterBarItem = {
|
|
4
4
|
/**
|
|
@@ -56,7 +56,7 @@ export type RecordMeterBarProps = {
|
|
|
56
56
|
* Generate Record Meter bar
|
|
57
57
|
*
|
|
58
58
|
* @param {RecordMeterBarProps} props - Props
|
|
59
|
-
* @return {
|
|
59
|
+
* @return {ReactElement} - JSX element
|
|
60
60
|
*/
|
|
61
|
-
declare const RecordMeterBar:
|
|
61
|
+
declare const RecordMeterBar: FC<RecordMeterBarProps>;
|
|
62
62
|
export default RecordMeterBar;
|
|
@@ -8,7 +8,7 @@ import './style.scss';
|
|
|
8
8
|
* Generate Record Meter bar
|
|
9
9
|
*
|
|
10
10
|
* @param {RecordMeterBarProps} props - Props
|
|
11
|
-
* @return {
|
|
11
|
+
* @return {ReactElement} - JSX element
|
|
12
12
|
*/
|
|
13
13
|
const RecordMeterBar = ({ totalCount, items = [], showLegendLabelBeforeCount = false, sortByCount, className, tableCaption, legendTitle, recordTypeLabel, recordCountLabel, }) => {
|
|
14
14
|
const total = useMemo(() => {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import React from 'react';
|
|
4
3
|
import './style.scss';
|
|
5
4
|
const Spinner = ({ color = '#FFFFFF', className = '', size = 20 }) => {
|
|
6
5
|
const theClassName = className + ' jp-components-spinner';
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import type { Button, DropdownMenu } from '@wordpress/components';
|
|
5
|
-
type
|
|
6
|
-
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
type AllowedDropdownMenuProps = Pick<ComponentProps<typeof DropdownMenu>, 'controls' | 'popoverProps' | 'toggleProps' | 'label'>;
|
|
4
|
+
export type SplitButtonProps = Omit<ComponentProps<typeof Button>, 'controls'> & AllowedDropdownMenuProps & Required<Pick<AllowedDropdownMenuProps, 'controls'>>;
|
|
7
5
|
export {};
|
|
@@ -3,7 +3,7 @@ import { StatCardProps } from './types.ts';
|
|
|
3
3
|
* StatCard component
|
|
4
4
|
*
|
|
5
5
|
* @param {StatCardProps} props - Component props.
|
|
6
|
-
* @return {
|
|
6
|
+
* @return {ReactNode} - StatCard react component.
|
|
7
7
|
*/
|
|
8
8
|
declare const StatCard: ({ className, hideValue, icon, label, value, variant, }: StatCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export default StatCard;
|
|
@@ -14,7 +14,7 @@ import styles from './style.module.scss';
|
|
|
14
14
|
* StatCard component
|
|
15
15
|
*
|
|
16
16
|
* @param {StatCardProps} props - Component props.
|
|
17
|
-
* @return {
|
|
17
|
+
* @return {ReactNode} - StatCard react component.
|
|
18
18
|
*/
|
|
19
19
|
const StatCard = ({ className, hideValue, icon, label, value, variant = 'square', }) => {
|
|
20
20
|
const formattedValue = formatNumber(value);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
1
2
|
export type StatCardProps = {
|
|
2
3
|
/**
|
|
3
4
|
* Custom className to be inserted.
|
|
@@ -10,7 +11,7 @@ export type StatCardProps = {
|
|
|
10
11
|
/**
|
|
11
12
|
* The stat card icon.
|
|
12
13
|
*/
|
|
13
|
-
icon:
|
|
14
|
+
icon: JSX.Element;
|
|
14
15
|
/**
|
|
15
16
|
* The stat label.
|
|
16
17
|
*/
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
1
2
|
interface StatusProps {
|
|
2
3
|
status?: 'active' | 'error' | 'inactive' | 'action' | 'initializing';
|
|
3
4
|
label?: string;
|
|
4
5
|
className?: string;
|
|
5
6
|
}
|
|
6
|
-
declare const Status: ({ className, label, status }: StatusProps) =>
|
|
7
|
+
declare const Status: ({ className, label, status }: StatusProps) => JSX.Element;
|
|
7
8
|
export default Status;
|
|
@@ -10,7 +10,7 @@ const TRANSITION_DURATION = '300ms';
|
|
|
10
10
|
/**
|
|
11
11
|
* Custom hook to observe and handle resize events on a DOM element.
|
|
12
12
|
*
|
|
13
|
-
* @return {[
|
|
13
|
+
* @return {[Dispatch<SetStateAction<HTMLElement | null>>, ResizeObserverEntry | null]} Tuple containing setter and entry
|
|
14
14
|
*/
|
|
15
15
|
function useResizeObserver() {
|
|
16
16
|
const [observerEntry, setObserverEntry] = useState(null);
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { H3Props, TextProps, TitleProps } from './types.ts';
|
|
2
|
+
import type { FC } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* Text component.
|
|
5
5
|
*
|
|
6
6
|
* @param {TextProps} props - Component props.
|
|
7
|
-
* @return {
|
|
7
|
+
* @return {ReactElement} - JSX.Element
|
|
8
8
|
*/
|
|
9
|
-
declare const Text:
|
|
9
|
+
declare const Text: import("react").ForwardRefExoticComponent<TextProps & import("react").RefAttributes<HTMLElement>>;
|
|
10
10
|
export default Text;
|
|
11
11
|
/**
|
|
12
12
|
* Heading component - Medium size.
|
|
13
13
|
*
|
|
14
14
|
* @param {TextProps} props - Component props.
|
|
15
|
-
* @return {
|
|
15
|
+
* @return {ReactElement} - JSX.Element
|
|
16
16
|
*/
|
|
17
|
-
export declare const H2:
|
|
17
|
+
export declare const H2: FC<TextProps>;
|
|
18
18
|
/**
|
|
19
19
|
* Heading component - Small size,
|
|
20
20
|
*
|
|
21
21
|
* @param {H3Props} props - Component props.
|
|
22
|
-
* @return {
|
|
22
|
+
* @return {ReactElement} - JSX.Element
|
|
23
23
|
*/
|
|
24
|
-
export declare const H3:
|
|
24
|
+
export declare const H3: FC<H3Props>;
|
|
25
25
|
/**
|
|
26
26
|
* Title component, based on Text component.
|
|
27
27
|
*
|
|
28
28
|
* @param {TitleProps} props - Component props.
|
|
29
|
-
* @return {
|
|
29
|
+
* @return {ReactElement} - JSX.Element
|
|
30
30
|
*/
|
|
31
|
-
export declare const Title:
|
|
31
|
+
export declare const Title: FC<TitleProps>;
|
|
32
32
|
export * from './constants.ts';
|
|
@@ -7,7 +7,7 @@ import styles from './style.module.scss';
|
|
|
7
7
|
* Text component.
|
|
8
8
|
*
|
|
9
9
|
* @param {TextProps} props - Component props.
|
|
10
|
-
* @return {
|
|
10
|
+
* @return {ReactElement} - JSX.Element
|
|
11
11
|
*/
|
|
12
12
|
const Text = forwardRef(({ variant = 'body', children, component, className, ...componentProps }, ref) => {
|
|
13
13
|
const Component = component || VARIANTS_MAPPING[variant] || 'span';
|
|
@@ -30,14 +30,14 @@ export default Text;
|
|
|
30
30
|
* Heading component - Medium size.
|
|
31
31
|
*
|
|
32
32
|
* @param {TextProps} props - Component props.
|
|
33
|
-
* @return {
|
|
33
|
+
* @return {ReactElement} - JSX.Element
|
|
34
34
|
*/
|
|
35
35
|
export const H2 = ({ children, ...componentProps }) => (_jsx(Text, { variant: "headline-medium", mb: 3, ...componentProps, children: children }));
|
|
36
36
|
/**
|
|
37
37
|
* Heading component - Small size,
|
|
38
38
|
*
|
|
39
39
|
* @param {H3Props} props - Component props.
|
|
40
|
-
* @return {
|
|
40
|
+
* @return {ReactElement} - JSX.Element
|
|
41
41
|
*/
|
|
42
42
|
export const H3 = ({ children, weight = 'bold', ...componentProps }) => {
|
|
43
43
|
const variant = `headline-small${weight === 'bold' ? '' : `-${weight}`}`;
|
|
@@ -47,7 +47,7 @@ export const H3 = ({ children, weight = 'bold', ...componentProps }) => {
|
|
|
47
47
|
* Title component, based on Text component.
|
|
48
48
|
*
|
|
49
49
|
* @param {TitleProps} props - Component props.
|
|
50
|
-
* @return {
|
|
50
|
+
* @return {ReactElement} - JSX.Element
|
|
51
51
|
*/
|
|
52
52
|
export const Title = ({ children, size = 'medium', ...componentProps }) => (_jsx(Text, { variant: `title-${size}`, mb: 1, ...componentProps, children: children }));
|
|
53
53
|
export * from "./constants.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VARIANTS_MAPPING } from './constants.ts';
|
|
2
|
-
import type
|
|
2
|
+
import type { CSSProperties, ElementType, FC, ReactNode } from 'react';
|
|
3
3
|
export type SpacingValue = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
|
|
4
4
|
export type TextProps = {
|
|
5
5
|
variant?: keyof typeof VARIANTS_MAPPING;
|
|
@@ -34,12 +34,12 @@ export type TextProps = {
|
|
|
34
34
|
/** HTML Class */
|
|
35
35
|
className?: string;
|
|
36
36
|
/** The text itself that will be rendered. */
|
|
37
|
-
children:
|
|
37
|
+
children: ReactNode;
|
|
38
38
|
/** Force an specific tag (span, div) or use a custom component that will receive className and children */
|
|
39
|
-
component?:
|
|
39
|
+
component?: FC<{
|
|
40
40
|
[prop: string]: unknown;
|
|
41
|
-
}> |
|
|
42
|
-
style?:
|
|
41
|
+
}> | ElementType;
|
|
42
|
+
style?: CSSProperties;
|
|
43
43
|
};
|
|
44
44
|
export type H3Props = TextProps & {
|
|
45
45
|
/** Font weight: 'bold' (default) | 'regular'. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { ThemeProviderProps } from './types.ts';
|
|
2
|
+
import type { FC } from 'react';
|
|
3
3
|
export declare const typography: {
|
|
4
4
|
'--font-headline-medium': string;
|
|
5
5
|
'--font-headline-small': string;
|
|
@@ -74,7 +74,7 @@ export declare const spacing: {
|
|
|
74
74
|
* ThemeProvider React component.
|
|
75
75
|
*
|
|
76
76
|
* @param {ThemeProviderProps} props - Component properties.
|
|
77
|
-
* @return {
|
|
77
|
+
* @return {ReactNode} ThemeProvider component.
|
|
78
78
|
*/
|
|
79
|
-
declare const ThemeProvider:
|
|
79
|
+
declare const ThemeProvider: FC<ThemeProviderProps>;
|
|
80
80
|
export default ThemeProvider;
|
|
@@ -102,7 +102,7 @@ const setup = (root, id, withGlobalStyles) => {
|
|
|
102
102
|
* ThemeProvider React component.
|
|
103
103
|
*
|
|
104
104
|
* @param {ThemeProviderProps} props - Component properties.
|
|
105
|
-
* @return {
|
|
105
|
+
* @return {ReactNode} ThemeProvider component.
|
|
106
106
|
*/
|
|
107
107
|
const ThemeProvider = ({ children = null, targetDom, id, withGlobalStyles = true, }) => {
|
|
108
108
|
const themeWrapperRef = useRef();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
1
2
|
export type ThemeProviderProps = {
|
|
2
3
|
/**
|
|
3
4
|
* An optional id to register and identify the provider instance.
|
|
@@ -10,7 +11,7 @@ export type ThemeProviderProps = {
|
|
|
10
11
|
/**
|
|
11
12
|
* Content
|
|
12
13
|
*/
|
|
13
|
-
children?:
|
|
14
|
+
children?: ReactNode;
|
|
14
15
|
/**
|
|
15
16
|
* Inser global/reset styles
|
|
16
17
|
*/
|