@automattic/jetpack-components 1.12.16 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/build/components/action-popover/index.js +1 -5
  3. package/build/components/alert/index.js +1 -2
  4. package/build/components/automattic-byline-logo/index.js +1 -3
  5. package/build/components/automattic-for-agencies-logo/index.d.ts +1 -1
  6. package/build/components/automattic-icon-logo/index.d.ts +1 -1
  7. package/build/components/automattic-icon-logo/index.js +1 -3
  8. package/build/components/boost-score-bar/index.js +1 -6
  9. package/build/components/boost-score-graph/background.js +1 -13
  10. package/build/components/boost-score-graph/tooltip.js +3 -23
  11. package/build/components/button/index.js +2 -4
  12. package/build/components/contextual-upgrade-trigger/index.js +1 -6
  13. package/build/components/decorative-card/index.js +1 -2
  14. package/build/components/details-viewer/index.js +2 -4
  15. package/build/components/dialog/index.js +1 -3
  16. package/build/components/diff-viewer/index.js +4 -10
  17. package/build/components/donut-meter/index.js +2 -4
  18. package/build/components/dot-pager/index.js +1 -3
  19. package/build/components/gravatar/index.d.ts +1 -1
  20. package/build/components/icon-tooltip/index.js +1 -3
  21. package/build/components/icons/index.js +4 -12
  22. package/build/components/jetpack-footer/index.js +2 -6
  23. package/build/components/jetpack-footer/style.scss +1 -0
  24. package/build/components/jetpack-logo/index.js +1 -4
  25. package/build/components/jetpack-protect-logo/index.js +1 -4
  26. package/build/components/jetpack-search-logo/index.js +1 -5
  27. package/build/components/jetpack-vaultpress-backup-logo/index.js +1 -6
  28. package/build/components/jetpack-videopress-logo/index.js +1 -4
  29. package/build/components/loading-placeholder/index.d.ts +1 -1
  30. package/build/components/marked-lines/index.js +2 -4
  31. package/build/components/navigator-modal/footer.js +1 -2
  32. package/build/components/navigator-modal/header.d.ts +1 -1
  33. package/build/components/navigator-modal/header.js +1 -3
  34. package/build/components/navigator-modal/screen.js +1 -3
  35. package/build/components/notice/index.js +1 -2
  36. package/build/components/popover/index.js +1 -3
  37. package/build/components/pricing-card/index.js +1 -7
  38. package/build/components/pricing-table/index.js +10 -18
  39. package/build/components/pricing-table/types.d.ts +8 -0
  40. package/build/components/product-offer/icons-card.js +1 -2
  41. package/build/components/product-offer/index.js +1 -6
  42. package/build/components/product-offer/product-offer-header.js +1 -3
  43. package/build/components/product-price/index.js +3 -11
  44. package/build/components/product-price/price.js +1 -2
  45. package/build/components/record-meter-bar/index.js +5 -20
  46. package/build/components/split-button/index.js +1 -3
  47. package/build/components/stat-card/index.js +1 -4
  48. package/build/components/status/index.js +1 -3
  49. package/build/components/swipeable/index.js +3 -7
  50. package/build/components/testimonials/testimonial.js +1 -11
  51. package/build/components/text/constants.d.ts +12 -12
  52. package/build/components/upsell-banner/index.js +2 -7
  53. package/build/index.d.ts +0 -1
  54. package/build/index.js +0 -1
  55. package/components/jetpack-footer/style.scss +1 -0
  56. package/components/pricing-table/index.tsx +5 -4
  57. package/components/pricing-table/types.ts +9 -0
  58. package/index.ts +0 -1
  59. package/package.json +17 -19
  60. package/build/components/number-slider/index.d.ts +0 -12
  61. package/build/components/number-slider/index.js +0 -43
  62. package/build/components/number-slider/style.scss +0 -68
  63. package/build/components/number-slider/types.d.ts +0 -50
  64. package/build/components/number-slider/types.js +0 -1
  65. package/components/number-slider/index.tsx +0 -86
  66. package/components/number-slider/style.scss +0 -68
  67. package/components/number-slider/types.ts +0 -58
@@ -27,12 +27,6 @@ const PricingCard = ({ currencyCode = 'USD', priceDetails = __('/month, paid yea
27
27
  const currencyObjectAfter = getCurrencyObject(props.priceAfter, currencyCode);
28
28
  return (_jsxs("div", { className: "jp-components__pricing-card", children: [props.icon && (_jsx("div", { className: "jp-components__pricing-card__icon", children: 'string' === typeof props.icon ? (_jsx("img", { src: props.icon, alt: sprintf(
29
29
  /* translators: %s: the product name */
30
- __('Icon for the product %s', 'jetpack-components'), props.title) })) : (props.icon) })), _jsx("h1", { className: "jp-components__pricing-card__title", children: props.title }), _jsxs("div", { className: "jp-components__pricing-card__pricing", children: [props.priceAfter === 0 && _jsx(LoadingPlaceholder, { width: "100%", height: 48 }), props.priceBefore !== props.priceAfter && props.priceAfter > 0 && (_jsxs("div", { className: "jp-components__pricing-card__price-before", children: [
31
- _jsx("span", { className: "jp-components__pricing-card__currency", children: currencyObjectBefore.symbol }), _jsx("span", { className: "jp-components__pricing-card__price", children: currencyObjectBefore.integer }), showPriceDecimals(currencyObjectBefore) && (_jsxs("span", { className: "jp-components__pricing-card__price-decimal", children: [' ', currencyObjectBefore.fraction] })), _jsx("div", { className: "jp-components__pricing-card__price-strikethrough" })
32
- ] })), props.priceAfter > 0 && (_jsxs(_Fragment, { children: [
33
- _jsxs("div", { className: "jp-components__pricing-card__price-after", children: [
34
- _jsx("span", { className: "jp-components__pricing-card__currency", children: currencyObjectAfter.symbol }), _jsx("span", { className: "jp-components__pricing-card__price", children: currencyObjectAfter.integer }), showPriceDecimals(currencyObjectAfter) && (_jsx("span", { className: "jp-components__pricing-card__price-decimal", children: currencyObjectAfter.fraction }))] }), _jsx("span", { className: "jp-components__pricing-card__price-details", children: priceDetails })
35
- ] }))] }), props.children && (_jsx("div", { className: "jp-components__pricing-card__extra-content-wrapper", children: props.children })), props.tosText && _jsx("div", { className: "jp-components__pricing-card__tos", children: props.tosText }), props.ctaText && (_jsxs(_Fragment, { children: [!props.tosText && (_jsx("div", { className: "jp-components__pricing-card__tos", children: _jsx(TermsOfService, { agreeButtonLabel: props.ctaText }) })), _jsx("div", { className: "jp-components__pricing-card__cta", children: _jsx(Button, { variant: "solid", className: "jp-components__pricing-card__button", onClick: props.onCtaClick, children: props.ctaText }) })
36
- ] })), props.infoText && (_jsx("div", { className: "jp-components__pricing-card__info", children: props.infoText }))] }));
30
+ __('Icon for the product %s', 'jetpack-components'), props.title) })) : (props.icon) })), _jsx("h1", { className: "jp-components__pricing-card__title", children: props.title }), _jsxs("div", { className: "jp-components__pricing-card__pricing", children: [props.priceAfter === 0 && _jsx(LoadingPlaceholder, { width: "100%", height: 48 }), props.priceBefore !== props.priceAfter && props.priceAfter > 0 && (_jsxs("div", { className: "jp-components__pricing-card__price-before", children: [_jsx("span", { className: "jp-components__pricing-card__currency", children: currencyObjectBefore.symbol }), _jsx("span", { className: "jp-components__pricing-card__price", children: currencyObjectBefore.integer }), showPriceDecimals(currencyObjectBefore) && (_jsxs("span", { className: "jp-components__pricing-card__price-decimal", children: [' ', currencyObjectBefore.fraction] })), _jsx("div", { className: "jp-components__pricing-card__price-strikethrough" })] })), props.priceAfter > 0 && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "jp-components__pricing-card__price-after", children: [_jsx("span", { className: "jp-components__pricing-card__currency", children: currencyObjectAfter.symbol }), _jsx("span", { className: "jp-components__pricing-card__price", children: currencyObjectAfter.integer }), showPriceDecimals(currencyObjectAfter) && (_jsx("span", { className: "jp-components__pricing-card__price-decimal", children: currencyObjectAfter.fraction }))] }), _jsx("span", { className: "jp-components__pricing-card__price-details", children: priceDetails })] }))] }), props.children && (_jsx("div", { className: "jp-components__pricing-card__extra-content-wrapper", children: props.children })), props.tosText && _jsx("div", { className: "jp-components__pricing-card__tos", children: props.tosText }), props.ctaText && (_jsxs(_Fragment, { children: [!props.tosText && (_jsx("div", { className: "jp-components__pricing-card__tos", children: _jsx(TermsOfService, { agreeButtonLabel: props.ctaText }) })), _jsx("div", { className: "jp-components__pricing-card__cta", children: _jsx(Button, { variant: "solid", className: "jp-components__pricing-card__button", onClick: props.onCtaClick, children: props.ctaText }) })] })), props.infoText && (_jsx("div", { className: "jp-components__pricing-card__info", children: props.infoText }))] }));
37
31
  };
38
32
  export default PricingCard;
@@ -30,8 +30,8 @@ const getItemLabels = (isComingSoon, isIncluded, featureNameLabel) => {
30
30
  };
31
31
  };
32
32
  export const PricingTableItem = ({ isIncluded = false, isComingSoon = false, index = 0, label = null, tooltipInfo, tooltipTitle, tooltipClassName = '', }) => {
33
- const isLg = useViewportMatch('large');
34
- const item = useContext(PricingTableContext)[index];
33
+ const { items, isLg } = useContext(PricingTableContext);
34
+ const item = items[index];
35
35
  const isExplicitlyEmpty = label === '';
36
36
  const showTick = isComingSoon || isIncluded;
37
37
  const featureNameLabel = item.name;
@@ -44,11 +44,9 @@ export const PricingTableItem = ({ isIncluded = false, isComingSoon = false, ind
44
44
  if (isExplicitlyEmpty) {
45
45
  return (_jsx("div", { className: clsx(styles.item, styles.value, styles.empty) }));
46
46
  }
47
- return (_jsxs("div", { className: clsx(styles.item, styles.value), children: [
48
- _jsx(Icon, { className: clsx(styles.icon, showTick ? styles['icon-check'] : styles['icon-cross']), size: 32, icon: showTick ? check : closeSmall }), _jsx(Text, { variant: "body-small", children: label || defaultLabel }), showTooltip && (_jsx(IconTooltip, { title: tooltipTitle ? tooltipTitle : defaultTooltipTitle, iconClassName: styles['popover-icon'], className: clsx(styles.popover, tooltipClassName), placement: 'bottom-end', iconSize: 14, offset: 4, wide: Boolean(tooltipTitle && tooltipInfo), inline: false, shift: true, children: _jsx(Text, { variant: "body-small", component: "div", children: tooltipInfo || defaultTooltipInfo }) }))] }));
47
+ return (_jsxs("div", { className: clsx(styles.item, styles.value), children: [_jsx(Icon, { className: clsx(styles.icon, showTick ? styles['icon-check'] : styles['icon-cross']), size: 32, icon: showTick ? check : closeSmall }), _jsx(Text, { variant: "body-small", children: label || defaultLabel }), showTooltip && (_jsx(IconTooltip, { title: tooltipTitle ? tooltipTitle : defaultTooltipTitle, iconClassName: styles['popover-icon'], className: clsx(styles.popover, tooltipClassName), placement: 'bottom-end', iconSize: 14, offset: 4, wide: Boolean(tooltipTitle && tooltipInfo), inline: false, shift: true, children: _jsx(Text, { variant: "body-small", component: "div", children: tooltipInfo || defaultTooltipInfo }) }))] }));
49
48
  };
50
- export const PricingTableHeader = ({ title, children }) => (_jsxs("div", { className: styles.headerContainer, children: [title && (_jsx(Text, { variant: "headline-small", className: styles.title, children: title })), _jsx("div", { className: styles.header, children: children })
51
- ] }));
49
+ export const PricingTableHeader = ({ title, children }) => (_jsxs("div", { className: styles.headerContainer, children: [title && (_jsx(Text, { variant: "headline-small", className: styles.title, children: title })), _jsx("div", { className: styles.header, children: children })] }));
52
50
  export const PricingTableColumn = ({ primary = false, children, className, }) => {
53
51
  let index = 0;
54
52
  return (_jsx("div", { className: clsx(styles.card, { [styles['is-primary']]: primary }, className), children: Children.map(children, child => {
@@ -60,15 +58,12 @@ export const PricingTableColumn = ({ primary = false, children, className, }) =>
60
58
  return item;
61
59
  }) }));
62
60
  };
63
- const PricingTable = ({ title, headerLogo, items, children, showIntroOfferDisclaimer = false, }) => {
64
- const isLg = useViewportMatch('large');
65
- return (_jsxs(PricingTableContext.Provider, { value: items, children: [
66
- _jsx("div", { className: clsx(styles.container, { [styles['is-viewport-large']]: isLg }), style: {
61
+ const PricingTable = ({ title, headerLogo, items, children, showIntroOfferDisclaimer = false, breakpoint = 'large', }) => {
62
+ const isLg = useViewportMatch(breakpoint);
63
+ return (_jsxs(PricingTableContext.Provider, { value: { items, isLg }, children: [_jsx("div", { className: clsx(styles.container, { [styles['is-viewport-large']]: isLg }), style: {
67
64
  '--rows': items.length + 1,
68
65
  '--columns': Children.toArray(children).length + 1,
69
- }, children: _jsxs("div", { className: styles.table, children: [
70
- _jsxs("div", { children: [headerLogo && _jsx("div", { className: styles['header-logo'], children: headerLogo }), _jsx(Text, { variant: "headline-small", className: styles.tableTitle, children: title })
71
- ] }), isLg &&
66
+ }, children: _jsxs("div", { className: styles.table, children: [_jsxs("div", { children: [headerLogo && _jsx("div", { className: styles['header-logo'], children: headerLogo }), _jsx(Text, { variant: "headline-small", className: styles.tableTitle, children: title })] }), isLg &&
72
67
  items.map((item, i) => {
73
68
  // Skip rendering feature names that are empty
74
69
  if (!item.name) {
@@ -76,10 +71,7 @@ const PricingTable = ({ title, headerLogo, items, children, showIntroOfferDiscla
76
71
  }
77
72
  return (_jsxs("div", { className: clsx(styles.item, styles.feature, {
78
73
  [styles['last-feature']]: i === items.length - 1,
79
- }), children: [
80
- _jsx(Text, { variant: "body-small", children: _jsx("strong", { children: item.name }) }), item.tooltipInfo && (_jsx(IconTooltip, { title: item.tooltipTitle, iconClassName: styles['popover-icon'], className: styles.popover, placement: item.tooltipPlacement ? item.tooltipPlacement : 'bottom-end', iconSize: 14, offset: 4, wide: Boolean(item.tooltipTitle && item.tooltipInfo), inline: false, shift: true, children: _jsx(Text, { variant: "body-small", children: item.tooltipInfo }) }))] }, i));
81
- }), children] }) }), _jsx("div", { className: styles['tos-container'], children: _jsxs("div", { className: styles.tos, children: [showIntroOfferDisclaimer && (_jsx(Text, { variant: "body-small", children: __('Reduced pricing is a limited offer for the first year and renews at regular price.', 'jetpack-components') })), _jsx(TermsOfService, { multipleButtons: true })
82
- ] }) })
83
- ] }));
74
+ }), children: [_jsx(Text, { variant: "body-small", children: _jsx("strong", { children: item.name }) }), item.tooltipInfo && (_jsx(IconTooltip, { title: item.tooltipTitle, iconClassName: styles['popover-icon'], className: styles.popover, placement: item.tooltipPlacement ? item.tooltipPlacement : 'bottom-end', iconSize: 14, offset: 4, wide: Boolean(item.tooltipTitle && item.tooltipInfo), inline: false, shift: true, children: _jsx(Text, { variant: "body-small", children: item.tooltipInfo }) }))] }, i));
75
+ }), children] }) }), _jsx("div", { className: styles['tos-container'], children: _jsxs("div", { className: styles.tos, children: [showIntroOfferDisclaimer && (_jsx(Text, { variant: "body-small", children: __('Reduced pricing is a limited offer for the first year and renews at regular price.', 'jetpack-components') })), _jsx(TermsOfService, { multipleButtons: true })] }) })] }));
84
76
  };
85
77
  export default PricingTable;
@@ -26,6 +26,14 @@ export type PricingTableProps = {
26
26
  * Whether to show the intro offer disclaimer text with the ToS.
27
27
  */
28
28
  showIntroOfferDisclaimer?: boolean;
29
+ /**
30
+ * Viewport breakpoint at or above which the table renders as columns
31
+ * (below it, offers stack into blocks). Defaults to 'large' (960px).
32
+ * Interstitials hosting 3 offers can pass 'xlarge' (1080px) to stack
33
+ * earlier and avoid cramped columns. Accepts any `@wordpress/compose`
34
+ * viewport-match breakpoint name.
35
+ */
36
+ breakpoint?: 'mobile' | 'small' | 'medium' | 'large' | 'xlarge' | 'wide' | 'huge' | 'xhuge';
29
37
  };
30
38
  export type PricingTableColumnProps = {
31
39
  /**
@@ -18,7 +18,6 @@ export const IconsCard = ({ products, icon, size = 24 }) => {
18
18
  return (_jsx("div", { className: styles['product-bundle-icons'], children: products.map((product, index) => {
19
19
  const ProductIcon = getIconBySlug(product);
20
20
  const ProIcon = ProductIcon ? ProductIcon : () => null;
21
- return (_jsxs(Fragment, { children: [
22
- _jsx(ProIcon, { size: size }), index !== products.length - 1 && (_jsx(Icon, { className: styles['plus-icon'], icon: plus, size: 16 }, `icon-plugs${index * 2 + 1}`))] }, index));
21
+ return (_jsxs(Fragment, { children: [_jsx(ProIcon, { size: size }), index !== products.length - 1 && (_jsx(Icon, { className: styles['plus-icon'], icon: plus, size: 16 }, `icon-plugs${index * 2 + 1}`))] }, index));
23
22
  }) }));
24
23
  };
@@ -25,12 +25,7 @@ const ProductOffer = ({ addProductUrl, buttonDisclaimer, buttonText = '', classN
25
25
  return (_jsxs("div", { className: clsx(styles.wrapper, className, {
26
26
  [styles['is-bundle-card']]: isBundle,
27
27
  [styles['is-card']]: isCard || isBundle, // is card when is bundle.
28
- }), children: [isBundle && _jsx(ProductOfferHeader, {}), _jsxs("div", { className: styles['card-container'], children: [
29
- _jsx(IconsCard, { icon: icon, products: supportedProducts?.length ? supportedProducts : [slug], size: 32 }), _jsx(H3, { children: title }), subTitle && _jsx(Title, { mb: 3, children: subTitle }), description && _jsx(Text, { mb: 3, children: description }), _jsx("ul", { className: styles.features, children: features.map((feature, id) => (_jsxs(Text, { component: "li", variant: "body", children: [
30
- _jsx(Icon, { icon: check, size: 24, className: styles.check }), feature] }, `feature-${id}`))) }), needsPurchase && (_jsx(ProductPrice, { price: price, offPrice: offPrice, currency: currency })), isFree && _jsx(H3, { children: __('Free', 'jetpack-components') }), _jsx(Alert, { level: "error", showIcon: !!error, children: error }), buttonDisclaimer, (!isBundle || (isBundle && !hasRequiredPlan)) && (_jsx(Button, { onClick: addProductUrl ? null : onAdd, isLoading: isLoading, disabled: isLoading, variant: isLoading || !isBundle ? 'primary' : 'secondary', className: styles['add-button'], ...(addProductUrl ? { href: addProductUrl } : {}), children: buttonText || defautlButtonText })), isBundle && hasRequiredPlan && (_jsxs("div", { className: styles['product-has-required-plan'], children: [
31
- _jsx(CheckmarkIcon, { size: 36 }), _jsx(Text, { children: __('Active on your site', 'jetpack-components') })
32
- ] }))] })
33
- ] }));
28
+ }), children: [isBundle && _jsx(ProductOfferHeader, {}), _jsxs("div", { className: styles['card-container'], children: [_jsx(IconsCard, { icon: icon, products: supportedProducts?.length ? supportedProducts : [slug], size: 32 }), _jsx(H3, { children: title }), subTitle && _jsx(Title, { mb: 3, children: subTitle }), description && _jsx(Text, { mb: 3, children: description }), _jsx("ul", { className: styles.features, children: features.map((feature, id) => (_jsxs(Text, { component: "li", variant: "body", children: [_jsx(Icon, { icon: check, size: 24, className: styles.check }), feature] }, `feature-${id}`))) }), needsPurchase && (_jsx(ProductPrice, { price: price, offPrice: offPrice, currency: currency })), isFree && _jsx(H3, { children: __('Free', 'jetpack-components') }), _jsx(Alert, { level: "error", showIcon: !!error, children: error }), buttonDisclaimer, (!isBundle || (isBundle && !hasRequiredPlan)) && (_jsx(Button, { onClick: addProductUrl ? null : onAdd, isLoading: isLoading, disabled: isLoading, variant: isLoading || !isBundle ? 'primary' : 'secondary', className: styles['add-button'], ...(addProductUrl ? { href: addProductUrl } : {}), children: buttonText || defautlButtonText })), isBundle && hasRequiredPlan && (_jsxs("div", { className: styles['product-has-required-plan'], children: [_jsx(CheckmarkIcon, { size: 36 }), _jsx(Text, { children: __('Active on your site', 'jetpack-components') })] }))] })] }));
34
29
  };
35
30
  export default ProductOffer;
36
31
  export * from './icons-card.js';
@@ -10,7 +10,5 @@ import styles from './style.module.scss';
10
10
  * @return {ReactNode} ProductOfferHeader react component.
11
11
  */
12
12
  export const ProductOfferHeader = ({ title = __('Popular upgrade', 'jetpack-components'), }) => {
13
- return (_jsxs("div", { className: styles['card-header'], children: [
14
- _jsx(Icon, { icon: star, className: styles['product-bundle-icon'], size: 24 }), _jsx(Text, { variant: "label", children: title })
15
- ] }));
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 })] }));
16
14
  };
@@ -27,19 +27,11 @@ const ProductPrice = ({ price, offPrice, currency = '', showNotOffPrice = true,
27
27
  const showDiscountLabel = !hideDiscountLabel && discount && discount > 0;
28
28
  const discountElt = showDiscountLabel ? discount + __('% off', 'jetpack-components') : null;
29
29
  if (variant === 'simple') {
30
- return (_jsxs("div", { className: styles.simple, children: [
31
- _jsxs("div", { className: styles.currentPrice, children: [
32
- _jsx(Price, { value: offPrice ?? price, currency: currency, isOff: !isNotConvenientPrice, hidePriceFraction: hidePriceFraction, inline: true }), _jsx("div", { children: legend })
33
- ] }), showNotOffPrice && (_jsxs("div", { className: styles.originalPrice, children: [
34
- _jsx(Price, { value: price, currency: currency, isOff: false, hidePriceFraction: hidePriceFraction, inline: true }), _jsx("div", { children: discount &&
30
+ return (_jsxs("div", { className: styles.simple, children: [_jsxs("div", { className: styles.currentPrice, children: [_jsx(Price, { value: offPrice ?? price, currency: currency, isOff: !isNotConvenientPrice, hidePriceFraction: hidePriceFraction, inline: true }), _jsx("div", { children: legend })] }), showNotOffPrice && (_jsxs("div", { className: styles.originalPrice, children: [_jsx(Price, { value: price, currency: currency, isOff: false, hidePriceFraction: hidePriceFraction, inline: true }), _jsx("div", { children: discount &&
35
31
  discount > 0 &&
36
- discount + __('% off the first year', 'jetpack-components') })
37
- ] }))] }));
32
+ discount + __('% off the first year', 'jetpack-components') })] }))] }));
38
33
  }
39
- return (_jsxs(_Fragment, { children: [
40
- _jsx("div", { className: styles.container, children: _jsxs("div", { className: clsx(styles['price-container'], 'product-price_container'), children: [
41
- _jsx(Price, { value: offPrice ?? price, currency: currency, isOff: !isNotConvenientPrice, hidePriceFraction: hidePriceFraction }), showNotOffPrice && (_jsx(Price, { value: price, currency: currency, isOff: false, hidePriceFraction: hidePriceFraction })), discountElt && (_jsx(Text, { className: clsx(styles['promo-label'], 'product-price_promo_label'), children: discountElt }))] }) }), _jsxs("div", { className: styles.footer, children: [children ? (children) : (_jsx(Text, { className: clsx(styles.legend, 'product-price_legend'), children: legend })), promoLabel && (_jsx(Text, { className: clsx(styles['promo-label'], 'product-price_promo_label'), children: promoLabel }))] })
42
- ] }));
34
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: styles.container, children: _jsxs("div", { className: clsx(styles['price-container'], 'product-price_container'), children: [_jsx(Price, { value: offPrice ?? price, currency: currency, isOff: !isNotConvenientPrice, hidePriceFraction: hidePriceFraction }), showNotOffPrice && (_jsx(Price, { value: price, currency: currency, isOff: false, hidePriceFraction: hidePriceFraction })), discountElt && (_jsx(Text, { className: clsx(styles['promo-label'], 'product-price_promo_label'), children: discountElt }))] }) }), _jsxs("div", { className: styles.footer, children: [children ? (children) : (_jsx(Text, { className: clsx(styles.legend, 'product-price_legend'), children: legend })), promoLabel && (_jsx(Text, { className: clsx(styles['promo-label'], 'product-price_promo_label'), children: promoLabel }))] })] }));
43
35
  };
44
36
  export default ProductPrice;
45
37
  export * from './price.js';
@@ -16,6 +16,5 @@ export const Price = ({ value, currency, isOff, hidePriceFraction, inline = fals
16
16
  });
17
17
  const { symbol, integer, fraction } = getCurrencyObject(value, currency);
18
18
  const showPriceFraction = !hidePriceFraction || !fraction.endsWith('00');
19
- return (_jsxs(Text, { className: classNames, variant: "headline-medium", component: "p", children: [inline ? (_jsxs(_Fragment, { children: [symbol, integer] })) : (_jsxs(_Fragment, { children: [
20
- _jsx(Text, { className: styles.symbol, component: "sup", variant: "title-medium", children: symbol }), integer] })), showPriceFraction && (_jsx(Text, { component: "sup", variant: "body-small", "data-testid": "PriceFraction", children: _jsx("strong", { children: fraction }) }))] }));
19
+ return (_jsxs(Text, { className: classNames, variant: "headline-medium", component: "p", children: [inline ? (_jsxs(_Fragment, { children: [symbol, integer] })) : (_jsxs(_Fragment, { children: [_jsx(Text, { className: styles.symbol, component: "sup", variant: "title-medium", children: symbol }), integer] })), showPriceFraction && (_jsx(Text, { component: "sup", variant: "body-small", "data-testid": "PriceFraction", children: _jsx("strong", { children: fraction }) }))] }));
21
20
  };
@@ -27,29 +27,14 @@ const RecordMeterBar = ({ totalCount, items = [], showLegendLabelBeforeCount = f
27
27
  }
28
28
  return items;
29
29
  }, [items, sortByCount]);
30
- return (_jsxs("div", { className: clsx('record-meter-bar', className), children: [
31
- _jsx("div", { className: "record-meter-bar__items", "aria-hidden": "true", children: itemsToRender.map(({ count, label, backgroundColor }) => {
30
+ return (_jsxs("div", { className: clsx('record-meter-bar', className), children: [_jsx("div", { className: "record-meter-bar__items", "aria-hidden": "true", children: itemsToRender.map(({ count, label, backgroundColor }) => {
32
31
  const widthPercent = ((count / total) * 100).toPrecision(2);
33
32
  return (_jsx("div", { style: { backgroundColor, flexBasis: `${widthPercent}%` } }, label));
34
33
  }) }), _jsxs("div", { className: "record-meter-bar__legend", "aria-hidden": "true", children: [legendTitle && _jsx("div", { className: "record-meter-bar__legend--title", children: legendTitle }), _jsx("ul", { className: "record-meter-bar__legend--items", children: itemsToRender.map(({ count, label, backgroundColor }) => {
35
34
  const formattedCount = formatNumber(count);
36
- return (_jsxs("li", { className: "record-meter-bar__legend--item", children: [
37
- _jsx("div", { className: "record-meter-bar__legend--item-circle", style: { backgroundColor } }), !showLegendLabelBeforeCount && (_jsxs("span", { children: [
38
- _jsx("span", { className: "record-meter-bar__legend--item-count", children: formattedCount }), _jsx("span", { className: "record-meter-bar__legend--item-label", children: label })
39
- ] })), showLegendLabelBeforeCount && (_jsxs("span", { children: [
40
- _jsx("span", { className: "record-meter-bar__legend--item-label record-meter-bar__legend--item-label-first", children: label }), _jsxs("span", { className: "record-meter-bar__legend--item-count", children: ["(", formattedCount, ")"] })
41
- ] }))] }, label));
42
- }) })
43
- ] }), _jsxs("table", { className: "screen-reader-text", children: [
44
- _jsx("caption", { children: tableCaption || __('Summary of the records', 'jetpack-components') }), _jsxs("tbody", { children: [
45
- _jsxs("tr", { children: [
46
- _jsx("th", { scope: "col", children: recordTypeLabel || __('Record type', 'jetpack-components') }), _jsx("th", { scope: "col", children: recordCountLabel || __('Record count', 'jetpack-components') })
47
- ] }), itemsToRender.map(({ label, count }) => {
48
- return (_jsxs("tr", { children: [
49
- _jsx("td", { children: label }), _jsx("td", { children: count })
50
- ] }, label));
51
- })] })
52
- ] })
53
- ] }));
35
+ return (_jsxs("li", { className: "record-meter-bar__legend--item", children: [_jsx("div", { className: "record-meter-bar__legend--item-circle", style: { backgroundColor } }), !showLegendLabelBeforeCount && (_jsxs("span", { children: [_jsx("span", { className: "record-meter-bar__legend--item-count", children: formattedCount }), _jsx("span", { className: "record-meter-bar__legend--item-label", children: label })] })), showLegendLabelBeforeCount && (_jsxs("span", { children: [_jsx("span", { className: "record-meter-bar__legend--item-label record-meter-bar__legend--item-label-first", children: label }), _jsxs("span", { className: "record-meter-bar__legend--item-count", children: ["(", formattedCount, ")"] })] }))] }, label));
36
+ }) })] }), _jsxs("table", { className: "screen-reader-text", children: [_jsx("caption", { children: tableCaption || __('Summary of the records', 'jetpack-components') }), _jsxs("tbody", { children: [_jsxs("tr", { children: [_jsx("th", { scope: "col", children: recordTypeLabel || __('Record type', 'jetpack-components') }), _jsx("th", { scope: "col", children: recordCountLabel || __('Record count', 'jetpack-components') })] }), itemsToRender.map(({ label, count }) => {
37
+ return (_jsxs("tr", { children: [_jsx("td", { children: label }), _jsx("td", { children: count })] }, label));
38
+ })] })] })] }));
54
39
  };
55
40
  export default RecordMeterBar;
@@ -9,8 +9,6 @@ const SplitButton = ({ variant, controls, popoverProps, toggleProps, label, ...b
9
9
  className: styles.button,
10
10
  ...buttonProps,
11
11
  };
12
- return (_jsx(Flex, { className: styles['split-button'], children: _jsxs("div", { role: "group", className: "components-button-group", children: [
13
- _jsx(Button, { ...wpButtonProps }), _jsx(DropdownMenu, { toggleProps: { variant, className: styles.button, ...toggleProps }, popoverProps: { noArrow: false, ...popoverProps }, icon: _jsx(DownIcon, {}), disableOpenOnArrowDown: true, controls: controls, label: label })
14
- ] }) }));
12
+ return (_jsx(Flex, { className: styles['split-button'], children: _jsxs("div", { role: "group", className: "components-button-group", children: [_jsx(Button, { ...wpButtonProps }), _jsx(DropdownMenu, { toggleProps: { variant, className: styles.button, ...toggleProps }, popoverProps: { noArrow: false, ...popoverProps }, icon: _jsx(DownIcon, {}), disableOpenOnArrowDown: true, controls: controls, label: label })] }) }));
15
13
  };
16
14
  export default SplitButton;
@@ -19,9 +19,6 @@ import styles from './style.module.scss';
19
19
  const StatCard = ({ className, hideValue, icon, label, value, variant = 'square', }) => {
20
20
  const formattedValue = formatNumber(value);
21
21
  const compactValue = formatNumberCompact(value);
22
- return (_jsxs("div", { className: clsx(className, styles.wrapper, styles[variant]), children: [
23
- _jsx("div", { className: clsx(styles.icon), children: icon }), _jsxs("div", { className: clsx(styles.info), children: [
24
- _jsx(Text, { className: styles.label, children: label }), variant === 'square' ? (_jsx(Tooltip, { text: formattedValue, placement: "top", children: _jsx(Text, { variant: "headline-small", className: clsx(styles.value), children: hideValue ? '-' : compactValue }) })) : (_jsx(Text, { variant: "title-medium-semi-bold", className: clsx(styles.value), children: hideValue ? '-' : formattedValue }))] })
25
- ] }));
22
+ return (_jsxs("div", { className: clsx(className, styles.wrapper, styles[variant]), children: [_jsx("div", { className: clsx(styles.icon), children: icon }), _jsxs("div", { className: clsx(styles.info), children: [_jsx(Text, { className: styles.label, children: label }), variant === 'square' ? (_jsx(Tooltip, { text: formattedValue, placement: "top", children: _jsx(Text, { variant: "headline-small", className: clsx(styles.value), children: hideValue ? '-' : compactValue }) })) : (_jsx(Text, { variant: "title-medium-semi-bold", className: clsx(styles.value), children: hideValue ? '-' : formattedValue }))] })] }));
26
23
  };
27
24
  export default StatCard;
@@ -24,8 +24,6 @@ const Status = ({ className, label, status = 'inactive' }) => {
24
24
  };
25
25
  return (_jsxs(Text, { variant: "body-extra-small", className: clsx(styles.status, {
26
26
  [styles[`is-${status}`]]: status,
27
- }, className), children: [
28
- _jsx("span", { className: styles.status__indicator }), _jsx("span", { className: styles.status__label, children: label || label === '' ? label : defaultLabels[status] })
29
- ] }));
27
+ }, className), children: [_jsx("span", { className: styles.status__indicator }), _jsx("span", { className: styles.status__label, children: label || label === '' ? label : defaultLabels[status] })] }));
30
28
  };
31
29
  export default Status;
@@ -275,16 +275,14 @@ export const Swipeable = ({ hasDynamicHeight = false, children, currentPage = 0,
275
275
  return null;
276
276
  }, [handleDragStart, handleDrag, handleDragEnd]);
277
277
  const offset = getOffset(currentPage);
278
- return (_jsxs(_Fragment, { children: [
279
- _createElement("div", { ...getTouchEvents(), className: "swipeable__container", ref: pagesRef, ...otherProps,
278
+ return (_jsxs(_Fragment, { children: [_createElement("div", { ...getTouchEvents(), className: "swipeable__container", ref: pagesRef, ...otherProps,
280
279
  // Ensure that state is reset when the window is resized
281
280
  key: containerWidth?.toString() },
282
281
  _jsxs("div", { className: clsx('swipeable__pages', containerClassName), style: {
283
282
  ...pagesStyle,
284
283
  width: getPagesWidth(containerWidth, numPages + 2),
285
284
  transform: `translate3d(${offset}px, 0px, 0px)`,
286
- }, onTransitionEnd: handleTransitionEnd, children: [
287
- _jsx("div", { style: { width: `${containerWidth}px` }, className: clsx('swipeable__page', pageClassName, {
285
+ }, onTransitionEnd: handleTransitionEnd, children: [_jsx("div", { style: { width: `${containerWidth}px` }, className: clsx('swipeable__page', pageClassName, {
288
286
  'is-clone': true,
289
287
  'is-prev': currentPage === 0,
290
288
  }), children: Children.toArray(children)[numPages - 1] }, `clone-prev-${numPages - 1}`), Children.map(children, (child, index) => (_jsx("div", { style: { width: `${containerWidth}px` }, className: clsx('swipeable__page', pageClassName, {
@@ -294,8 +292,6 @@ export const Swipeable = ({ hasDynamicHeight = false, children, currentPage = 0,
294
292
  }), "data-testid": `swipeable-page-${index + 1}`, children: child }, `page-${index}`))), _jsx("div", { style: { width: `${containerWidth}px` }, className: clsx('swipeable__page', pageClassName, {
295
293
  'is-clone': true,
296
294
  'is-next': currentPage === numPages - 1,
297
- }), children: Children.toArray(children)[0] }, `clone-next-0`)
298
- ] })), _jsx("div", { ref: resizeObserverRef, className: "swipeable__resize-observer" })
299
- ] }));
295
+ }), children: Children.toArray(children)[0] }, `clone-next-0`)] })), _jsx("div", { ref: resizeObserverRef, className: "swipeable__resize-observer" })] }));
300
296
  };
301
297
  export default Swipeable;
@@ -2,16 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import clsx from 'clsx';
3
3
  import './style.scss';
4
4
  const Testimonial = ({ quote, author, profession, img, hidden }) => {
5
- return (_jsxs("div", { className: clsx('testimonial', hidden ? 'hidden' : 'show'), children: [
6
- _jsx("img", { className: "testimonial__author-img", src: img, alt: author }), _jsxs("div", { className: "testimonial__content", children: [
7
- _jsxs("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "testimonial__quote-icon", children: [
8
- _jsx("path", { d: "M14.6667 24L6.66675 24L6.66675 16L14.6667 16L14.6667 24Z", fill: "#1E1E1E" }), _jsx("path", { d: "M26.6667 24L18.6667 24L18.6667 16L26.6667 16L26.6667 24Z", fill: "#1E1E1E" }), _jsx("path", { d: "M6.66675 24.0001C6.66675 19.5573 6.66675 14.9337 6.66675 10.6686C6.66675 6.40254 10.0001 6.67016 12.0001 6.66987", stroke: "#1E1E1E", strokeWidth: "1.5" }), _jsx("path", { d: "M18.6668 24.0001C18.6667 19.5573 18.6667 14.9337 18.6667 10.6686C18.6667 6.40254 22.0001 6.67016 24.0001 6.66987", stroke: "#1E1E1E", strokeWidth: "1.5" })
9
- ] }), _jsxs("div", { className: "testimonial__text-block", children: [
10
- _jsxs("blockquote", { className: "testimonial__quote", children: ["\u201C", quote, "\u201D"] }), _jsxs("figcaption", { children: [
11
- _jsx("span", { className: "testimonial__author", children: author }), _jsx("span", { className: "testimonial__profession", children: profession })
12
- ] })
13
- ] })
14
- ] })
15
- ] }, author));
5
+ return (_jsxs("div", { className: clsx('testimonial', hidden ? 'hidden' : 'show'), children: [_jsx("img", { className: "testimonial__author-img", src: img, alt: author }), _jsxs("div", { className: "testimonial__content", children: [_jsxs("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "testimonial__quote-icon", children: [_jsx("path", { d: "M14.6667 24L6.66675 24L6.66675 16L14.6667 16L14.6667 24Z", fill: "#1E1E1E" }), _jsx("path", { d: "M26.6667 24L18.6667 24L18.6667 16L26.6667 16L26.6667 24Z", fill: "#1E1E1E" }), _jsx("path", { d: "M6.66675 24.0001C6.66675 19.5573 6.66675 14.9337 6.66675 10.6686C6.66675 6.40254 10.0001 6.67016 12.0001 6.66987", stroke: "#1E1E1E", strokeWidth: "1.5" }), _jsx("path", { d: "M18.6668 24.0001C18.6667 19.5573 18.6667 14.9337 18.6667 10.6686C18.6667 6.40254 22.0001 6.67016 24.0001 6.66987", stroke: "#1E1E1E", strokeWidth: "1.5" })] }), _jsxs("div", { className: "testimonial__text-block", children: [_jsxs("blockquote", { className: "testimonial__quote", children: ["\u201C", quote, "\u201D"] }), _jsxs("figcaption", { children: [_jsx("span", { className: "testimonial__author", children: author }), _jsx("span", { className: "testimonial__profession", children: profession })] })] })] })] }, author));
16
6
  };
17
7
  export { Testimonial };
@@ -1,14 +1,14 @@
1
1
  export declare const VARIANTS_MAPPING: {
2
- readonly 'headline-medium': "h1";
3
- readonly 'headline-small': "h2";
4
- readonly 'headline-small-regular': "h2";
5
- readonly 'title-medium': "h3";
6
- readonly 'title-medium-semi-bold': "h3";
7
- readonly 'title-small': "h4";
8
- readonly body: "p";
9
- readonly 'body-small': "p";
10
- readonly 'body-extra-small': "p";
11
- readonly 'body-extra-small-bold': "p";
12
- readonly label: "p";
2
+ readonly 'headline-medium': 'h1';
3
+ readonly 'headline-small': 'h2';
4
+ readonly 'headline-small-regular': 'h2';
5
+ readonly 'title-medium': 'h3';
6
+ readonly 'title-medium-semi-bold': 'h3';
7
+ readonly 'title-small': 'h4';
8
+ readonly body: 'p';
9
+ readonly 'body-small': 'p';
10
+ readonly 'body-extra-small': 'p';
11
+ readonly 'body-extra-small-bold': 'p';
12
+ readonly label: 'p';
13
13
  };
14
- export declare const BOX_MODEL_VALUES: readonly ["mt", "mr", "mb", "ml", "mx", "my", "m", "pt", "pr", "pb", "pl", "px", "py", "p"];
14
+ export declare const BOX_MODEL_VALUES: readonly ['mt', 'mr', 'mb', 'ml', 'mx', 'my', 'm', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'p'];
@@ -14,13 +14,8 @@ import './style.scss';
14
14
  */
15
15
  const UpsellBanner = props => {
16
16
  const { icon, title, description, primaryCtaLabel, primaryCtaURL, primaryCtaIsExternalLink, primaryCtaOnClick, secondaryCtaLabel, secondaryCtaURL, secondaryCtaIsExternalLink, secondaryCtaOnClick, } = props;
17
- return (_jsx(Card, { isRounded: true, size: "large", children: _jsxs(CardBody, { className: "upsell-banner", size: "large", children: [icon && (_jsx("div", { className: "upsell-banner--icon", children: _jsx("img", { src: icon, alt: "" }) })), _jsxs("div", { className: "upsell-banner--content", children: [
18
- _jsxs("div", { className: "upsell-banner--content-info", children: [
19
- _jsx("h3", { children: title }), _jsx("p", { children: createInterpolateElement(description, {
17
+ return (_jsx(Card, { isRounded: true, size: "large", children: _jsxs(CardBody, { className: "upsell-banner", size: "large", children: [icon && (_jsx("div", { className: "upsell-banner--icon", children: _jsx("img", { src: icon, alt: "" }) })), _jsxs("div", { className: "upsell-banner--content", children: [_jsxs("div", { className: "upsell-banner--content-info", children: [_jsx("h3", { children: title }), _jsx("p", { children: createInterpolateElement(description, {
20
18
  br: _jsx("br", {}),
21
- }) })
22
- ] }), _jsxs("div", { className: "upsell-banner--content-cta", children: [secondaryCtaLabel && secondaryCtaURL && (_jsx(Button, { className: "upsell-banner--content-cta-button secondary", href: secondaryCtaURL, onClick: secondaryCtaOnClick ?? undefined, isExternalLink: secondaryCtaIsExternalLink, children: secondaryCtaLabel })), primaryCtaLabel && primaryCtaURL && (_jsx(Button, { className: "upsell-banner--content-cta-button primary", href: primaryCtaURL, onClick: primaryCtaOnClick ?? undefined, isExternalLink: primaryCtaIsExternalLink, children: primaryCtaLabel }))] })
23
- ] })
24
- ] }) }));
19
+ }) })] }), _jsxs("div", { className: "upsell-banner--content-cta", children: [secondaryCtaLabel && secondaryCtaURL && (_jsx(Button, { className: "upsell-banner--content-cta-button secondary", href: secondaryCtaURL, onClick: secondaryCtaOnClick ?? undefined, isExternalLink: secondaryCtaIsExternalLink, children: secondaryCtaLabel })), primaryCtaLabel && primaryCtaURL && (_jsx(Button, { className: "upsell-banner--content-cta-button primary", href: primaryCtaURL, onClick: primaryCtaOnClick ?? undefined, isExternalLink: primaryCtaIsExternalLink, children: primaryCtaLabel }))] })] })] }) }));
25
20
  };
26
21
  export default UpsellBanner;
package/build/index.d.ts CHANGED
@@ -15,7 +15,6 @@ export type { GravatarProps } from './components/gravatar/index.tsx';
15
15
  export { default as IconTooltip } from './components/icon-tooltip/index.tsx';
16
16
  export { default as ActionButton } from './components/action-button/index.tsx';
17
17
  export { default as PricingCard } from './components/pricing-card/index.tsx';
18
- export { default as NumberSlider } from './components/number-slider/index.tsx';
19
18
  export { default as AdminSection } from './components/admin-section/basic/index.tsx';
20
19
  export { default as AdminSectionHero } from './components/admin-section/hero/index.tsx';
21
20
  export { default as AdminPage } from './components/admin-page/index.tsx';
package/build/index.js CHANGED
@@ -28,7 +28,6 @@ export { default as Gravatar } from './components/gravatar/index.js';
28
28
  export { default as IconTooltip } from './components/icon-tooltip/index.js';
29
29
  export { default as ActionButton } from './components/action-button/index.js';
30
30
  export { default as PricingCard } from './components/pricing-card/index.js';
31
- export { default as NumberSlider } from './components/number-slider/index.js';
32
31
  export { default as AdminSection } from './components/admin-section/basic/index.js';
33
32
  export { default as AdminSectionHero } from './components/admin-section/hero/index.js';
34
33
  export { default as AdminPage } from './components/admin-page/index.js';
@@ -7,6 +7,7 @@
7
7
  font-size: var(--wpds-typography-font-size-md, 13px);
8
8
  padding: var(--wpds-dimension-padding-xl) var(--wpds-dimension-padding-2xl);
9
9
  width: 100%;
10
+ display: flex;
10
11
 
11
12
  .jetpack-footer__menu-item {
12
13
 
@@ -59,8 +59,8 @@ export const PricingTableItem: FC< PricingTableItemProps > = ( {
59
59
  tooltipTitle,
60
60
  tooltipClassName = '',
61
61
  } ) => {
62
- const isLg = useViewportMatch( 'large' );
63
- const item = useContext( PricingTableContext )[ index ];
62
+ const { items, isLg } = useContext( PricingTableContext );
63
+ const item = items[ index ];
64
64
  const isExplicitlyEmpty = label === '';
65
65
  const showTick = isComingSoon || isIncluded;
66
66
 
@@ -157,11 +157,12 @@ const PricingTable: FC< PricingTableProps > = ( {
157
157
  items,
158
158
  children,
159
159
  showIntroOfferDisclaimer = false,
160
+ breakpoint = 'large',
160
161
  } ) => {
161
- const isLg = useViewportMatch( 'large' );
162
+ const isLg = useViewportMatch( breakpoint );
162
163
 
163
164
  return (
164
- <PricingTableContext.Provider value={ items }>
165
+ <PricingTableContext.Provider value={ { items, isLg } }>
165
166
  <div
166
167
  className={ clsx( styles.container, { [ styles[ 'is-viewport-large' ] ]: isLg } ) }
167
168
  style={
@@ -31,6 +31,15 @@ export type PricingTableProps = {
31
31
  * Whether to show the intro offer disclaimer text with the ToS.
32
32
  */
33
33
  showIntroOfferDisclaimer?: boolean;
34
+
35
+ /**
36
+ * Viewport breakpoint at or above which the table renders as columns
37
+ * (below it, offers stack into blocks). Defaults to 'large' (960px).
38
+ * Interstitials hosting 3 offers can pass 'xlarge' (1080px) to stack
39
+ * earlier and avoid cramped columns. Accepts any `@wordpress/compose`
40
+ * viewport-match breakpoint name.
41
+ */
42
+ breakpoint?: 'mobile' | 'small' | 'medium' | 'large' | 'xlarge' | 'wide' | 'huge' | 'xhuge';
34
43
  };
35
44
 
36
45
  export type PricingTableColumnProps = {
package/index.ts CHANGED
@@ -30,7 +30,6 @@ export type { GravatarProps } from './components/gravatar/index.tsx';
30
30
  export { default as IconTooltip } from './components/icon-tooltip/index.tsx';
31
31
  export { default as ActionButton } from './components/action-button/index.tsx';
32
32
  export { default as PricingCard } from './components/pricing-card/index.tsx';
33
- export { default as NumberSlider } from './components/number-slider/index.tsx';
34
33
  export { default as AdminSection } from './components/admin-section/basic/index.tsx';
35
34
  export { default as AdminSectionHero } from './components/admin-section/hero/index.tsx';
36
35
  export { default as AdminPage } from './components/admin-page/index.tsx';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/jetpack-components",
3
- "version": "1.12.16",
3
+ "version": "2.0.0",
4
4
  "description": "Jetpack Components Package",
5
5
  "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/components/#readme",
6
6
  "bugs": {
@@ -73,35 +73,34 @@
73
73
  ],
74
74
  "dependencies": {
75
75
  "@automattic/format-currency": "1.0.1",
76
- "@automattic/jetpack-api": "^1.0.31",
77
- "@automattic/jetpack-boost-score-api": "^1.0.54",
78
- "@automattic/jetpack-script-data": "^0.6.5",
79
- "@automattic/number-formatters": "^1.2.6",
76
+ "@automattic/jetpack-api": "^1.0.32",
77
+ "@automattic/jetpack-boost-score-api": "^1.0.55",
78
+ "@automattic/jetpack-script-data": "^0.6.6",
79
+ "@automattic/number-formatters": "^1.2.7",
80
80
  "@babel/runtime": "^7",
81
81
  "@gravatar-com/hovercards": "0.16.0",
82
82
  "@wordpress/admin-ui": "2.5.0",
83
- "@wordpress/browserslist-config": "6.50.0",
84
- "@wordpress/components": "36.1.0",
85
- "@wordpress/compose": "8.3.0",
86
- "@wordpress/data": "10.50.0",
87
- "@wordpress/date": "5.50.0",
88
- "@wordpress/element": "8.2.0",
89
- "@wordpress/i18n": "6.23.0",
83
+ "@wordpress/browserslist-config": "6.51.0",
84
+ "@wordpress/components": "37.0.0",
85
+ "@wordpress/compose": "8.4.0",
86
+ "@wordpress/data": "10.51.0",
87
+ "@wordpress/date": "5.51.0",
88
+ "@wordpress/element": "8.3.0",
89
+ "@wordpress/i18n": "6.24.0",
90
90
  "@wordpress/icons": "15.1.0",
91
- "@wordpress/notices": "5.50.0",
91
+ "@wordpress/notices": "5.51.0",
92
92
  "@wordpress/theme": "0.17.0",
93
93
  "@wordpress/ui": "0.17.0",
94
94
  "clsx": "2.1.1",
95
95
  "js-sha256": "0.11.1",
96
96
  "prop-types": "^15.7.2",
97
97
  "qrcode.react": "4.2.0",
98
- "react-slider": "2.0.5",
99
- "social-logos": "^3.3.17",
98
+ "social-logos": "^3.3.18",
100
99
  "uplot": "1.6.31",
101
100
  "uplot-react": "1.1.4"
102
101
  },
103
102
  "devDependencies": {
104
- "@automattic/jetpack-base-styles": "^1.2.9",
103
+ "@automattic/jetpack-base-styles": "^1.2.10",
105
104
  "@babel/core": "7.29.7",
106
105
  "@jest/globals": "30.4.1",
107
106
  "@storybook/addon-docs": "10.4.6",
@@ -112,15 +111,14 @@
112
111
  "@types/jest": "30.0.0",
113
112
  "@types/react": "18.3.28",
114
113
  "@types/react-dom": "18.3.7",
115
- "@types/react-slider": "1.3.6",
116
- "@typescript/native-preview": "7.0.0-dev.20260225.1",
114
+ "@typescript/native-preview": "7.0.0-dev.20260707.2",
117
115
  "jest": "30.4.2",
118
116
  "react": "18.3.1",
119
117
  "react-dom": "18.3.1",
120
118
  "require-from-string": "2.0.2",
121
119
  "storybook": "10.4.6",
122
120
  "ts-dedent": "2.2.0",
123
- "typescript": "5.9.3",
121
+ "typescript": "6.0.3",
124
122
  "webpack": "5.107.2",
125
123
  "webpack-cli": "6.0.1"
126
124
  },
@@ -1,12 +0,0 @@
1
- import { NumberSliderProps } from './types.ts';
2
- import type { FC } from 'react';
3
- import './style.scss';
4
- /**
5
- * Generate Number Slider
6
- * More support from the original ReactSlider component: https://zillow.github.io/react-slider/
7
- *
8
- * @param {NumberSliderProps} props - Props
9
- * @return {ReactElement} - JSX element
10
- */
11
- declare const NumberSlider: FC<NumberSliderProps>;
12
- export default NumberSlider;
@@ -1,43 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import clsx from 'clsx';
3
- import { useState } from 'react';
4
- import ReactSlider from 'react-slider';
5
- import './style.scss';
6
- /**
7
- * Generate Number Slider
8
- * More support from the original ReactSlider component: https://zillow.github.io/react-slider/
9
- *
10
- * @param {NumberSliderProps} props - Props
11
- * @return {ReactElement} - JSX element
12
- */
13
- const NumberSlider = ({ className, maxValue = 100, minValue = 0, step = 1, value, onChange, onBeforeChange, onAfterChange, renderThumb, }) => {
14
- const [isThumbHolding, setIsThumbHolding] = useState(false);
15
- const componentClassName = clsx('jp-components-number-slider', className, {
16
- 'jp-components-number-slider--is-holding': isThumbHolding,
17
- });
18
- const onBeforeChangeCallback = beforeValue => {
19
- setIsThumbHolding(true);
20
- if (typeof onBeforeChange === 'function') {
21
- onBeforeChange(beforeValue);
22
- }
23
- };
24
- const onAfterChangeCallback = afterValue => {
25
- setIsThumbHolding(false);
26
- if (typeof onAfterChange === 'function') {
27
- onAfterChange(afterValue);
28
- }
29
- };
30
- const renderThumbCallback = renderThumb
31
- ? renderThumb
32
- : (props, state) => {
33
- const { key, ...otherProps } = props;
34
- return (_jsx("div", { ...otherProps, children: state.valueNow }, key));
35
- };
36
- /**
37
- * Type casting to prevent TypeScript error:
38
- * TS2604: JSX element type 'ReactSlider' does not have any construct or call signatures.
39
- */
40
- const TypedReactSlider = ReactSlider;
41
- return (_jsx("div", { className: componentClassName, "data-testid": "number-slider", children: _jsx(TypedReactSlider, { className: "jp-components-number-slider__control", thumbClassName: "jp-components-number-slider__thumb", thumbActiveClassName: "jp-components-number-slider__thumb--is-active", trackClassName: "jp-components-number-slider__track", value: value, max: maxValue, min: minValue, step: step, renderThumb: renderThumbCallback, onChange: onChange, onBeforeChange: onBeforeChangeCallback, onAfterChange: onAfterChangeCallback }) }));
42
- };
43
- export default NumberSlider;