@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.
Files changed (189) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/build/components/action-button/index.d.ts +2 -3
  3. package/build/components/action-button/index.js +1 -8
  4. package/build/components/action-popover/types.d.ts +4 -3
  5. package/build/components/admin-page/index.d.ts +3 -3
  6. package/build/components/admin-page/index.js +1 -1
  7. package/build/components/admin-page/types.d.ts +3 -2
  8. package/build/components/admin-section/basic/index.d.ts +3 -3
  9. package/build/components/admin-section/basic/index.js +1 -1
  10. package/build/components/admin-section/hero/index.d.ts +3 -3
  11. package/build/components/admin-section/hero/index.js +1 -1
  12. package/build/components/admin-section/types.d.ts +2 -1
  13. package/build/components/alert/index.d.ts +9 -9
  14. package/build/components/alert/index.js +7 -7
  15. package/build/components/automattic-byline-logo/index.d.ts +3 -3
  16. package/build/components/automattic-byline-logo/index.js +1 -1
  17. package/build/components/automattic-byline-logo/types.d.ts +2 -2
  18. package/build/components/automattic-for-agencies-logo/index.d.ts +3 -3
  19. package/build/components/automattic-for-agencies-logo/index.js +1 -1
  20. package/build/components/automattic-icon-logo/index.d.ts +3 -3
  21. package/build/components/automattic-icon-logo/index.js +1 -1
  22. package/build/components/badge/index.d.ts +4 -4
  23. package/build/components/badge/index.js +1 -1
  24. package/build/components/boost-score-graph/index.d.ts +2 -2
  25. package/build/components/boost-score-graph/index.js +1 -1
  26. package/build/components/boost-score-graph/uplot-line-chart.d.ts +3 -3
  27. package/build/components/boost-score-graph/uplot-line-chart.js +1 -1
  28. package/build/components/boost-score-graph/use-resize.d.ts +4 -4
  29. package/build/components/boost-score-graph/use-resize.js +2 -2
  30. package/build/components/button/index.d.ts +2 -3
  31. package/build/components/button/index.js +1 -7
  32. package/build/components/button/types.d.ts +4 -4
  33. package/build/components/chip/index.d.ts +3 -3
  34. package/build/components/chip/index.js +1 -1
  35. package/build/components/contextual-upgrade-trigger/index.d.ts +2 -2
  36. package/build/components/copy-to-clipboard/index.d.ts +2 -2
  37. package/build/components/decorative-card/index.d.ts +3 -3
  38. package/build/components/decorative-card/index.js +2 -2
  39. package/build/components/dialog/index.d.ts +10 -10
  40. package/build/components/dialog/index.js +6 -6
  41. package/build/components/donut-meter/index.d.ts +3 -3
  42. package/build/components/donut-meter/index.js +1 -1
  43. package/build/components/icon-tooltip/index.d.ts +3 -3
  44. package/build/components/icon-tooltip/index.js +1 -1
  45. package/build/components/icon-tooltip/types.d.ts +2 -1
  46. package/build/components/icons/index.d.ts +51 -51
  47. package/build/components/icons/index.js +4 -4
  48. package/build/components/icons/types.d.ts +2 -2
  49. package/build/components/indeterminate-progress-bar/index.d.ts +3 -3
  50. package/build/components/indeterminate-progress-bar/index.js +1 -1
  51. package/build/components/jetpack-footer/index.d.ts +3 -3
  52. package/build/components/jetpack-footer/index.js +1 -1
  53. package/build/components/jetpack-logo/index.d.ts +2 -2
  54. package/build/components/jetpack-protect-logo/index.d.ts +2 -2
  55. package/build/components/jetpack-search-logo/index.d.ts +2 -2
  56. package/build/components/jetpack-vaultpress-backup-logo/index.d.ts +2 -2
  57. package/build/components/jetpack-videopress-logo/index.d.ts +2 -2
  58. package/build/components/layout/col/index.d.ts +3 -3
  59. package/build/components/layout/col/index.js +1 -1
  60. package/build/components/layout/container/index.d.ts +1 -2
  61. package/build/components/layout/container/index.js +3 -3
  62. package/build/components/layout/types.d.ts +3 -2
  63. package/build/components/loading-placeholder/index.d.ts +2 -2
  64. package/build/components/notice/index.d.ts +12 -12
  65. package/build/components/notice/index.js +8 -8
  66. package/build/components/number-slider/index.d.ts +3 -3
  67. package/build/components/number-slider/index.js +3 -3
  68. package/build/components/number-slider/types.d.ts +2 -2
  69. package/build/components/popover/index.d.ts +5 -4
  70. package/build/components/pricing-card/index.d.ts +3 -3
  71. package/build/components/pricing-card/index.js +1 -1
  72. package/build/components/pricing-card/types.d.ts +6 -6
  73. package/build/components/pricing-table/index.d.ts +5 -5
  74. package/build/components/pricing-table/types.d.ts +7 -6
  75. package/build/components/product-offer/icons-card.d.ts +3 -3
  76. package/build/components/product-offer/icons-card.js +1 -1
  77. package/build/components/product-offer/index.d.ts +3 -3
  78. package/build/components/product-offer/index.js +1 -1
  79. package/build/components/product-offer/product-offer-header.d.ts +3 -3
  80. package/build/components/product-offer/product-offer-header.js +1 -1
  81. package/build/components/product-offer/types.d.ts +2 -1
  82. package/build/components/product-price/index.d.ts +3 -3
  83. package/build/components/product-price/index.js +1 -1
  84. package/build/components/product-price/price.d.ts +3 -3
  85. package/build/components/product-price/price.js +1 -1
  86. package/build/components/product-price/types.d.ts +2 -1
  87. package/build/components/progress-bar/index.d.ts +3 -3
  88. package/build/components/progress-bar/index.js +1 -1
  89. package/build/components/qr-code/index.d.ts +5 -5
  90. package/build/components/qr-code/index.js +1 -1
  91. package/build/components/radio-control/index.d.ts +4 -3
  92. package/build/components/record-meter-bar/index.d.ts +3 -3
  93. package/build/components/record-meter-bar/index.js +1 -1
  94. package/build/components/spinner/index.js +0 -1
  95. package/build/components/split-button/index.d.ts +2 -2
  96. package/build/components/split-button/types.d.ts +3 -5
  97. package/build/components/stat-card/index.d.ts +1 -1
  98. package/build/components/stat-card/index.js +1 -1
  99. package/build/components/stat-card/types.d.ts +2 -1
  100. package/build/components/status/index.d.ts +2 -1
  101. package/build/components/swipeable/index.js +1 -1
  102. package/build/components/terms-of-service/index.d.ts +2 -1
  103. package/build/components/text/index.d.ts +9 -9
  104. package/build/components/text/index.js +4 -4
  105. package/build/components/text/types.d.ts +5 -5
  106. package/build/components/theme-provider/index.d.ts +3 -3
  107. package/build/components/theme-provider/index.js +1 -1
  108. package/build/components/theme-provider/types.d.ts +2 -1
  109. package/build/components/toggle-control/index.d.ts +4 -3
  110. package/build/components/upsell-banner/index.d.ts +3 -3
  111. package/build/components/upsell-banner/index.js +1 -1
  112. package/components/action-button/index.jsx +1 -8
  113. package/components/action-popover/index.tsx +0 -1
  114. package/components/action-popover/types.ts +4 -3
  115. package/components/admin-page/index.tsx +3 -3
  116. package/components/admin-page/types.ts +3 -2
  117. package/components/admin-section/basic/index.tsx +3 -3
  118. package/components/admin-section/hero/index.tsx +3 -3
  119. package/components/admin-section/types.ts +3 -1
  120. package/components/alert/index.tsx +9 -14
  121. package/components/automattic-byline-logo/index.tsx +3 -3
  122. package/components/automattic-byline-logo/types.ts +2 -2
  123. package/components/automattic-for-agencies-logo/index.tsx +3 -3
  124. package/components/automattic-icon-logo/index.tsx +3 -3
  125. package/components/badge/index.tsx +4 -4
  126. package/components/boost-score-graph/index.tsx +2 -2
  127. package/components/boost-score-graph/uplot-line-chart.tsx +5 -4
  128. package/components/boost-score-graph/use-resize.ts +6 -5
  129. package/components/button/index.tsx +3 -8
  130. package/components/button/types.ts +4 -4
  131. package/components/chip/index.tsx +3 -3
  132. package/components/contextual-upgrade-trigger/index.tsx +2 -2
  133. package/components/copy-to-clipboard/index.tsx +4 -4
  134. package/components/decorative-card/index.tsx +3 -7
  135. package/components/details-viewer/index.tsx +0 -1
  136. package/components/dialog/index.tsx +10 -10
  137. package/components/donut-meter/index.tsx +3 -3
  138. package/components/dot-pager/index.tsx +1 -1
  139. package/components/icon-tooltip/index.tsx +3 -3
  140. package/components/icon-tooltip/types.ts +3 -1
  141. package/components/icons/index.tsx +23 -32
  142. package/components/icons/types.ts +2 -2
  143. package/components/indeterminate-progress-bar/index.tsx +3 -3
  144. package/components/jetpack-footer/index.tsx +5 -5
  145. package/components/jetpack-logo/index.tsx +2 -2
  146. package/components/jetpack-protect-logo/index.tsx +2 -2
  147. package/components/jetpack-search-logo/index.tsx +2 -2
  148. package/components/jetpack-vaultpress-backup-logo/index.tsx +2 -2
  149. package/components/jetpack-videopress-logo/index.tsx +2 -2
  150. package/components/layout/col/index.tsx +3 -3
  151. package/components/layout/container/index.tsx +6 -6
  152. package/components/layout/types.ts +4 -2
  153. package/components/loading-placeholder/index.tsx +2 -2
  154. package/components/notice/index.tsx +12 -12
  155. package/components/number-slider/index.tsx +6 -5
  156. package/components/number-slider/types.ts +2 -2
  157. package/components/popover/index.tsx +5 -4
  158. package/components/pricing-card/index.tsx +3 -3
  159. package/components/pricing-card/types.ts +6 -6
  160. package/components/pricing-table/index.tsx +6 -5
  161. package/components/pricing-table/types.ts +7 -6
  162. package/components/product-offer/icons-card.tsx +4 -3
  163. package/components/product-offer/index.tsx +3 -3
  164. package/components/product-offer/product-offer-header.tsx +3 -3
  165. package/components/product-offer/types.ts +2 -1
  166. package/components/product-price/index.tsx +3 -3
  167. package/components/product-price/price.tsx +3 -3
  168. package/components/product-price/types.ts +3 -1
  169. package/components/progress-bar/index.tsx +3 -3
  170. package/components/qr-code/index.tsx +5 -5
  171. package/components/radio-control/index.tsx +4 -3
  172. package/components/record-meter-bar/index.tsx +4 -3
  173. package/components/spinner/README.md +2 -2
  174. package/components/spinner/index.jsx +0 -1
  175. package/components/split-button/index.tsx +2 -2
  176. package/components/split-button/types.ts +3 -5
  177. package/components/stat-card/index.tsx +2 -2
  178. package/components/stat-card/types.ts +3 -1
  179. package/components/status/index.tsx +2 -1
  180. package/components/swipeable/index.tsx +4 -3
  181. package/components/terms-of-service/index.tsx +3 -2
  182. package/components/text/index.tsx +9 -12
  183. package/components/text/types.ts +4 -4
  184. package/components/theme-provider/index.tsx +4 -3
  185. package/components/theme-provider/types.ts +3 -1
  186. package/components/toggle-control/index.tsx +4 -3
  187. package/components/upsell-banner/index.tsx +3 -3
  188. package/components/zendesk-chat/README.md +0 -1
  189. package/package.json +16 -16
@@ -1,6 +1,6 @@
1
1
  import { Popover } from '@wordpress/components';
2
2
  import clsx from 'clsx';
3
- import React, { useCallback, useState } from 'react';
3
+ import { useCallback, useState, ReactElement, FC } from 'react';
4
4
  import Button from '../button/index.tsx';
5
5
  import Gridicon from '../gridicon/index.tsx';
6
6
  import { IconTooltipProps, Placement, Position } from './types.ts';
@@ -24,9 +24,9 @@ const placementsToPositions = ( placement: Placement ): Position => {
24
24
  * Generate Icon Tooltip
25
25
  *
26
26
  * @param {IconTooltipProps} props - Props
27
- * @return {React.ReactElement} - JSX element
27
+ * @return {ReactElement} - JSX element
28
28
  */
29
- const IconTooltip: React.FC< IconTooltipProps > = ( {
29
+ const IconTooltip: FC< IconTooltipProps > = ( {
30
30
  className = '',
31
31
  iconClassName = '',
32
32
  placement = 'bottom-end',
@@ -1,3 +1,5 @@
1
+ import type { ReactNode } from 'react';
2
+
1
3
  export type Placement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end';
2
4
 
3
5
  export type Position =
@@ -47,7 +49,7 @@ export type IconTooltipProps = {
47
49
  /**
48
50
  * The main body content of Popover.
49
51
  */
50
- children?: React.ReactNode;
52
+ children?: ReactNode;
51
53
 
52
54
  /**
53
55
  * The icon square width and height size (in px) also calculate the Popover shift.
@@ -3,15 +3,15 @@ import clsx from 'clsx';
3
3
  import { SocialLogo } from 'social-logos';
4
4
  import styles from './style.module.scss';
5
5
  import { BaseIconProps } from './types.ts';
6
- import type React from 'react';
6
+ import type { ComponentProps, ComponentType, FC, ReactNode } from 'react';
7
7
 
8
8
  /**
9
9
  * Icon Wrapper component.
10
10
  *
11
11
  * @param {BaseIconProps} props - Component props.
12
- * @return {React.ReactNode} Icon Wrapper component.
12
+ * @return {ReactNode} Icon Wrapper component.
13
13
  */
14
- const IconWrapper: React.FC< BaseIconProps > = ( {
14
+ const IconWrapper: FC< BaseIconProps > = ( {
15
15
  className,
16
16
  size = 24,
17
17
  viewBox = '0 0 24 24',
@@ -38,7 +38,7 @@ const IconWrapper: React.FC< BaseIconProps > = ( {
38
38
  );
39
39
  };
40
40
 
41
- export const AntiSpamIcon: React.FC< BaseIconProps > = ( { opacity = 1, size, color } ) => (
41
+ export const AntiSpamIcon: FC< BaseIconProps > = ( { opacity = 1, size, color } ) => (
42
42
  <IconWrapper size={ size } opacity={ opacity } color={ color }>
43
43
  <Path
44
44
  d="M13.2,4.7l4.7,12.8c0.4,1.1,1,1.5,2.1,1.6c0.1,0,0.1,0,0.1,0l0.1,0.1l0.1,0.1c0,0.1,0,0.1,0,0.2c0,0.1,0,0.1,0,0.1
@@ -67,7 +67,7 @@ export const AntiSpamIcon: React.FC< BaseIconProps > = ( { opacity = 1, size, co
67
67
  </IconWrapper>
68
68
  );
69
69
 
70
- export const BackupIcon: React.FC< BaseIconProps > = ( { opacity = 1, size, color } ) => (
70
+ export const BackupIcon: FC< BaseIconProps > = ( { opacity = 1, size, color } ) => (
71
71
  <IconWrapper size={ size } opacity={ opacity } color={ color }>
72
72
  <Path
73
73
  d="M2.1,5.8c0-0.1,0-0.1,0-0.2c0-0.2,0.1-0.5,0.1-0.7c0.1-0.4,0.4-0.6,0.7-0.8l8.3-2.9c0.1-0.1,0.3-0.1,0.4-0.1l0.5,0.1
@@ -88,7 +88,7 @@ export const BackupIcon: React.FC< BaseIconProps > = ( { opacity = 1, size, colo
88
88
  </IconWrapper>
89
89
  );
90
90
 
91
- export const BoostIcon: React.FC< BaseIconProps > = ( { opacity = 1, size, color } ) => (
91
+ export const BoostIcon: FC< BaseIconProps > = ( { opacity = 1, size, color } ) => (
92
92
  <IconWrapper size={ size } opacity={ opacity } color={ color }>
93
93
  <Path
94
94
  fillRule="evenodd"
@@ -98,49 +98,44 @@ export const BoostIcon: React.FC< BaseIconProps > = ( { opacity = 1, size, color
98
98
  </IconWrapper>
99
99
  );
100
100
 
101
- export const CrmIcon: React.FC< BaseIconProps > = ( { opacity = 1, size, color } ) => (
101
+ export const CrmIcon: FC< BaseIconProps > = ( { opacity = 1, size, color } ) => (
102
102
  <IconWrapper size={ size } opacity={ opacity } color={ color }>
103
103
  <Path d="M15.5 9.5a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 1.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm-2.25 6v-2a2.75 2.75 0 0 0-2.75-2.75h-4A2.75 2.75 0 0 0 3.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5Zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0 1 20.25 15ZM9.5 8.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm1.5 0a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0Z" />
104
104
  </IconWrapper>
105
105
  );
106
106
 
107
- export const ExtrasIcon: React.FC< BaseIconProps > = ( { opacity = 1, size, color } ) => (
107
+ export const ExtrasIcon: FC< BaseIconProps > = ( { opacity = 1, size, color } ) => (
108
108
  <IconWrapper size={ size } opacity={ opacity } color={ color }>
109
109
  <Path d="M18.5 5.5V8H20V5.5h2.5V4H20V1.5h-1.5V4H16v1.5h2.5ZM12 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-6h-1.5v6a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5h6V4Z" />
110
110
  </IconWrapper>
111
111
  );
112
112
 
113
- export const ProtectIcon: React.FC< BaseIconProps > = ( {
114
- opacity = 1,
115
- size,
116
- className,
117
- color,
118
- } ) => (
113
+ export const ProtectIcon: FC< BaseIconProps > = ( { opacity = 1, size, className, color } ) => (
119
114
  <IconWrapper className={ className } size={ size } opacity={ opacity } color={ color }>
120
115
  <Path d="M12 3.17627L18.75 6.24445V10.8183C18.75 14.7173 16.2458 18.4089 12.7147 19.5735C12.2507 19.7265 11.7493 19.7265 11.2853 19.5735C7.75416 18.4089 5.25 14.7173 5.25 10.8183V6.24445L12 3.17627ZM6.75 7.21032V10.8183C6.75 14.1312 8.89514 17.2057 11.7551 18.149C11.914 18.2014 12.086 18.2014 12.2449 18.149C15.1049 17.2057 17.25 14.1312 17.25 10.8183V7.21032L12 4.82396L6.75 7.21032Z" />
121
116
  <Path d="M15.5291 10.0315L11.1818 14.358L8.47095 11.66L9.52907 10.5968L11.1818 12.2417L14.4709 8.96826L15.5291 10.0315Z" />
122
117
  </IconWrapper>
123
118
  );
124
119
 
125
- export const ScanIcon: React.FC< BaseIconProps > = ( { opacity = 1, size, color } ) => (
120
+ export const ScanIcon: FC< BaseIconProps > = ( { opacity = 1, size, color } ) => (
126
121
  <IconWrapper size={ size } opacity={ opacity } color={ color }>
127
122
  <Path d="m12 3.176 6.75 3.068v4.574c0 3.9-2.504 7.59-6.035 8.755a2.283 2.283 0 0 1-1.43 0c-3.53-1.164-6.035-4.856-6.035-8.755V6.244L12 3.176ZM6.75 7.21v3.608c0 3.313 2.145 6.388 5.005 7.33.159.053.331.053.49 0 2.86-.942 5.005-4.017 5.005-7.33V7.21L12 4.824 6.75 7.21Z" />
128
123
  </IconWrapper>
129
124
  );
130
125
 
131
- export const SearchIcon: React.FC< BaseIconProps > = ( { opacity = 1, size, color } ) => (
126
+ export const SearchIcon: FC< BaseIconProps > = ( { opacity = 1, size, color } ) => (
132
127
  <IconWrapper size={ size } opacity={ opacity } color={ color }>
133
128
  <Path d="M17.5 11.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm1.5 0a5.5 5.5 0 0 1-9.142 4.121l-3.364 2.943-.988-1.128 3.373-2.952A5.5 5.5 0 1 1 19 11.5Z" />
134
129
  </IconWrapper>
135
130
  );
136
131
 
137
- export const SocialIcon: React.FC< BaseIconProps > = ( { opacity = 1, size, color } ) => (
132
+ export const SocialIcon: FC< BaseIconProps > = ( { opacity = 1, size, color } ) => (
138
133
  <IconWrapper size={ size } opacity={ opacity } color={ color }>
139
134
  <Path d="M15.5 3.97809V18.0219L7.5 15.5977V20H6V15.1431L3.27498 14.3173C2.22086 13.9979 1.5 13.0262 1.5 11.9248V10.0752C1.5 8.97375 2.22087 8.00207 3.27498 7.68264L15.5 3.97809ZM14 16L7.5 14.0303L7.5 7.96969L14 5.99999V16ZM6 8.42423L6 13.5757L3.70999 12.8818C3.28835 12.754 3 12.3654 3 11.9248V10.0752C3 9.63462 3.28835 9.24595 3.70999 9.11818L6 8.42423ZM17.5 11.75H21.5V10.25H17.5V11.75ZM21.5 16L17.5 15V13.5L21.5 14.5V16ZM17.5 8.5L21.5 7.5V6L17.5 7V8.5Z" />
140
135
  </IconWrapper>
141
136
  );
142
137
 
143
- export const VideopressIcon: React.FC< BaseIconProps > = ( { opacity = 1, size, color } ) => (
138
+ export const VideopressIcon: FC< BaseIconProps > = ( { opacity = 1, size, color } ) => (
144
139
  <IconWrapper size={ size } opacity={ opacity } color={ color }>
145
140
  <Path
146
141
  fillRule="evenodd"
@@ -152,7 +147,7 @@ export const VideopressIcon: React.FC< BaseIconProps > = ( { opacity = 1, size,
152
147
  </IconWrapper>
153
148
  );
154
149
 
155
- export const StarIcon: React.FC< BaseIconProps > = ( {
150
+ export const StarIcon: FC< BaseIconProps > = ( {
156
151
  size,
157
152
  className = styles[ 'star-icon' ],
158
153
  color,
@@ -162,7 +157,7 @@ export const StarIcon: React.FC< BaseIconProps > = ( {
162
157
  </IconWrapper>
163
158
  );
164
159
 
165
- export const CheckmarkIcon: React.FC< BaseIconProps > = ( {
160
+ export const CheckmarkIcon: FC< BaseIconProps > = ( {
166
161
  size,
167
162
  className = styles[ 'checkmark-icon' ],
168
163
  color,
@@ -172,7 +167,7 @@ export const CheckmarkIcon: React.FC< BaseIconProps > = ( {
172
167
  </IconWrapper>
173
168
  );
174
169
 
175
- export const ClipboardIcon: React.FC< BaseIconProps > = ( {
170
+ export const ClipboardIcon: FC< BaseIconProps > = ( {
176
171
  size,
177
172
  className = styles[ 'clipboard-icon' ],
178
173
  color,
@@ -182,11 +177,7 @@ export const ClipboardIcon: React.FC< BaseIconProps > = ( {
182
177
  </IconWrapper>
183
178
  );
184
179
 
185
- export const JetpackIcon: React.FC< BaseIconProps > = ( {
186
- size,
187
- className = styles.jetpack,
188
- color,
189
- } ) => {
180
+ export const JetpackIcon: FC< BaseIconProps > = ( { size, className = styles.jetpack, color } ) => {
190
181
  return (
191
182
  <IconWrapper className={ className } size={ size } color={ color } viewBox="0 0 32 32">
192
183
  <Path
@@ -199,7 +190,7 @@ export const JetpackIcon: React.FC< BaseIconProps > = ( {
199
190
  );
200
191
  };
201
192
 
202
- export const ShareIcon: React.FC< BaseIconProps > = ( { size = 16, className, color } ) => {
193
+ export const ShareIcon: FC< BaseIconProps > = ( { size = 16, className, color } ) => {
203
194
  return (
204
195
  <IconWrapper className={ className } size={ size } color={ color } viewBox="0 0 16 16">
205
196
  <Path
@@ -212,7 +203,7 @@ export const ShareIcon: React.FC< BaseIconProps > = ( { size = 16, className, co
212
203
  );
213
204
  };
214
205
 
215
- export const AiIcon: React.FC< BaseIconProps > = ( {
206
+ export const AiIcon: FC< BaseIconProps > = ( {
216
207
  size = 24,
217
208
  color = '#069e08', // JP green
218
209
  } ) => {
@@ -234,7 +225,7 @@ export const AiIcon: React.FC< BaseIconProps > = ( {
234
225
  );
235
226
  };
236
227
 
237
- export const StatsIcon: React.FC< BaseIconProps > = ( { opacity = 1, size, color } ) => {
228
+ export const StatsIcon: FC< BaseIconProps > = ( { opacity = 1, size, color } ) => {
238
229
  return (
239
230
  <IconWrapper size={ size } opacity={ opacity } color={ color }>
240
231
  <Path
@@ -278,7 +269,7 @@ export type IconSlug = keyof IconsMap;
278
269
  * Return icon component by slug.
279
270
  *
280
271
  * @param {string} slug - Icon slug.
281
- * @return {React.ComponentType<BaseIconProps>} Icon component.
272
+ * @return {ComponentType<BaseIconProps>} Icon component.
282
273
  */
283
274
  export function getIconBySlug< Slug extends IconSlug >( slug: Slug ): IconsMap[ Slug ] {
284
275
  if ( ! iconsMap[ slug ] ) {
@@ -288,8 +279,8 @@ export function getIconBySlug< Slug extends IconSlug >( slug: Slug ): IconsMap[
288
279
  return iconsMap[ slug ];
289
280
  }
290
281
 
291
- export const SocialServiceIcon: React.FC< {
292
- serviceName: React.ComponentProps< typeof SocialLogo >[ 'icon' ];
282
+ export const SocialServiceIcon: FC< {
283
+ serviceName: ComponentProps< typeof SocialLogo >[ 'icon' ];
293
284
  className?: string;
294
285
  iconSize?: number;
295
286
  } > = ( { serviceName, className, iconSize } ) => {
@@ -1,4 +1,4 @@
1
- import type React from 'react';
1
+ import type { ReactNode } from 'react';
2
2
 
3
3
  export type BaseIconProps = {
4
4
  /**
@@ -19,7 +19,7 @@ export type BaseIconProps = {
19
19
  /**
20
20
  * Icon component children.
21
21
  */
22
- children?: React.ReactNode;
22
+ children?: ReactNode;
23
23
 
24
24
  /**
25
25
  * Icon class name. Optional.
@@ -8,15 +8,15 @@ import clsx from 'clsx';
8
8
  */
9
9
  import styles from './style.module.scss';
10
10
  import { IndeterminateProgressBarProps } from './types.ts';
11
- import type React from 'react';
11
+ import type { FC, ReactNode } from 'react';
12
12
 
13
13
  /**
14
14
  * Indeterminate Progress Bar component
15
15
  *
16
16
  * @param {IndeterminateProgressBarProps} props - Component props.
17
- * @return {React.ReactNode} - IndeterminateProgressBar react component.
17
+ * @return {ReactNode} - IndeterminateProgressBar react component.
18
18
  */
19
- const IndeterminateProgressBar: React.FC< IndeterminateProgressBarProps > = ( { className } ) => {
19
+ const IndeterminateProgressBar: FC< IndeterminateProgressBarProps > = ( { className } ) => {
20
20
  return (
21
21
  <div
22
22
  className={ clsx( className, styles[ 'indeterminate-progress-bar' ] ) }
@@ -1,7 +1,6 @@
1
1
  import { __, _x } from '@wordpress/i18n';
2
2
  import { Icon, external } from '@wordpress/icons';
3
3
  import clsx from 'clsx';
4
- import React from 'react';
5
4
  import { getRedirectUrl } from '../../index.ts';
6
5
  import getSiteAdminUrl from '../../tools/get-site-admin-url/index.ts';
7
6
  import AutomatticBylineLogo from '../automattic-byline-logo/index.tsx';
@@ -9,12 +8,13 @@ import './style.scss';
9
8
  import JetpackLogo from '../jetpack-logo/index.tsx';
10
9
  import useBreakpointMatch from '../layout/use-breakpoint-match/index.ts';
11
10
  import type { JetpackFooterProps, JetpackFooterMenuItem } from './types.ts';
11
+ import type { FC, ReactNode } from 'react';
12
12
 
13
- const JetpackIcon: React.FC = () => (
13
+ const JetpackIcon: FC = () => (
14
14
  <JetpackLogo logoColor="#000" showText={ false } height={ 16 } aria-hidden="true" />
15
15
  );
16
16
 
17
- const ExternalIcon: React.FC = () => (
17
+ const ExternalIcon: FC = () => (
18
18
  <>
19
19
  <Icon icon={ external } size={ 16 } />
20
20
  <span className="jp-dashboard-footer__accessible-external-link">
@@ -30,9 +30,9 @@ const ExternalIcon: React.FC = () => (
30
30
  * JetpackFooter component displays a tiny Jetpack logo with the product name on the left and the Automattic Airline "by line" on the right.
31
31
  *
32
32
  * @param {JetpackFooterProps} props - Component properties.
33
- * @return {React.ReactNode} JetpackFooter component.
33
+ * @return {ReactNode} JetpackFooter component.
34
34
  */
35
- const JetpackFooter: React.FC< JetpackFooterProps > = ( {
35
+ const JetpackFooter: FC< JetpackFooterProps > = ( {
36
36
  moduleName = __( 'Jetpack', 'jetpack-components' ),
37
37
  className,
38
38
  moduleNameHref = 'https://jetpack.com',
@@ -1,9 +1,9 @@
1
1
  import { __ } from '@wordpress/i18n';
2
2
  import clsx from 'clsx';
3
- import React from 'react';
4
3
  import { JetpackLogoProps } from './types.ts';
4
+ import type { FC } from 'react';
5
5
 
6
- const JetpackLogo: React.FC< JetpackLogoProps > = ( {
6
+ const JetpackLogo: FC< JetpackLogoProps > = ( {
7
7
  logoColor = '#069e08',
8
8
  showText = true,
9
9
  className,
@@ -1,9 +1,9 @@
1
1
  import { __ } from '@wordpress/i18n';
2
2
  import clsx from 'clsx';
3
- import React from 'react';
4
3
  import { JetpackProtectLogoProps } from './types.ts';
4
+ import type { FC } from 'react';
5
5
 
6
- const JetpackProtectLogo: React.FC< JetpackProtectLogoProps > = ( {
6
+ const JetpackProtectLogo: FC< JetpackProtectLogoProps > = ( {
7
7
  logoColor = '#069e08',
8
8
  showText = true,
9
9
  className,
@@ -1,9 +1,9 @@
1
1
  import { __ } from '@wordpress/i18n';
2
2
  import clsx from 'clsx';
3
- import React from 'react';
4
3
  import { JetpackSearchLogoProps } from './types.ts';
4
+ import type { FC } from 'react';
5
5
 
6
- const JetpackSearchLogo: React.FC< JetpackSearchLogoProps > = ( {
6
+ const JetpackSearchLogo: FC< JetpackSearchLogoProps > = ( {
7
7
  logoColor = '#069e08',
8
8
  showText = true,
9
9
  className,
@@ -1,9 +1,9 @@
1
1
  import { __ } from '@wordpress/i18n';
2
2
  import clsx from 'clsx';
3
- import React from 'react';
4
3
  import { JetpackLogoProps } from './types.ts';
4
+ import type { FC } from 'react';
5
5
 
6
- const JetpackVaultPressBackupLogo: React.FC< JetpackLogoProps > = ( {
6
+ const JetpackVaultPressBackupLogo: FC< JetpackLogoProps > = ( {
7
7
  showText = true,
8
8
  className,
9
9
  height = 32,
@@ -1,9 +1,9 @@
1
1
  import { __ } from '@wordpress/i18n';
2
2
  import clsx from 'clsx';
3
- import React from 'react';
4
3
  import { JetpackLogoProps } from './types.tsx';
4
+ import type { FC } from 'react';
5
5
 
6
- const JetpackVideoPressLogo: React.FC< JetpackLogoProps > = ( {
6
+ const JetpackVideoPressLogo: FC< JetpackLogoProps > = ( {
7
7
  showText = true,
8
8
  className,
9
9
  height = 32,
@@ -2,7 +2,7 @@ import clsx from 'clsx';
2
2
  import { createElement } from 'react';
3
3
  import { ColProps } from '../types.ts';
4
4
  import styles from './style.module.scss';
5
- import type React from 'react';
5
+ import type { FC, ReactElement } from 'react';
6
6
 
7
7
  const smCols = Number( styles.smCols );
8
8
  const mdCols = Number( styles.mdCols );
@@ -12,9 +12,9 @@ const lgCols = Number( styles.lgCols );
12
12
  * The basic Col component.
13
13
  *
14
14
  * @param {ColProps} props - Component properties.
15
- * @return {React.ReactElement} Col component.
15
+ * @return {ReactElement} Col component.
16
16
  */
17
- const Col: React.FC< ColProps > = props => {
17
+ const Col: FC< ColProps > = props => {
18
18
  const { children, tagName = 'div', className } = props;
19
19
 
20
20
  const sm = Math.min( smCols, typeof props.sm === 'number' ? props.sm : smCols ); // max of 4, if undefined = 4
@@ -2,14 +2,14 @@ import clsx from 'clsx';
2
2
  import { createElement, forwardRef, useMemo } from 'react';
3
3
  import { ContainerProps } from '../types.ts';
4
4
  import styles from './style.module.scss';
5
- import type React from 'react';
5
+ import type { MutableRefObject, ReactElement } from 'react';
6
6
 
7
7
  /**
8
8
  * JP Container
9
9
  *
10
- * @param {ContainerProps} props - Component properties.
11
- * @param {React.MutableRefObject} ref - Ref to the component
12
- * @return {React.ReactElement} Container component.
10
+ * @param {ContainerProps} props - Component properties.
11
+ * @param {MutableRefObject} ref - Ref to the component
12
+ * @return {ReactElement} Container component.
13
13
  */
14
14
  const Container = (
15
15
  {
@@ -20,8 +20,8 @@ const Container = (
20
20
  horizontalGap = 1,
21
21
  horizontalSpacing = 1,
22
22
  }: ContainerProps,
23
- ref: React.MutableRefObject< HTMLElement | null >
24
- ): React.ReactElement => {
23
+ ref: MutableRefObject< HTMLElement | null >
24
+ ): ReactElement => {
25
25
  const containerStyle = useMemo( () => {
26
26
  const padding = `calc( var(--horizontal-spacing) * ${ horizontalSpacing } )`;
27
27
  const rowGap = `calc( var(--horizontal-spacing) * ${ horizontalGap } )`;
@@ -1,3 +1,5 @@
1
+ import type { ReactNode } from 'react';
2
+
1
3
  type ColSpan = number | { start: number; end: number };
2
4
 
3
5
  export type ColProps = {
@@ -29,7 +31,7 @@ export type ColProps = {
29
31
  /**
30
32
  * Children to be inserted.
31
33
  */
32
- children?: React.ReactNode;
34
+ children?: ReactNode;
33
35
  };
34
36
 
35
37
  export type ContainerProps = {
@@ -61,5 +63,5 @@ export type ContainerProps = {
61
63
  /**
62
64
  * Children to be inserted.
63
65
  */
64
- children?: React.ReactNode;
66
+ children?: ReactNode;
65
67
  };
@@ -1,6 +1,6 @@
1
1
  import clsx from 'clsx';
2
- import React from 'react';
3
2
  import styles from './style.module.scss';
3
+ import type { ReactNode } from 'react';
4
4
 
5
5
  const LoadingPlaceholder = ( {
6
6
  children = null,
@@ -8,7 +8,7 @@ const LoadingPlaceholder = ( {
8
8
  height = null,
9
9
  className = '',
10
10
  }: {
11
- children?: React.ReactNode;
11
+ children?: ReactNode;
12
12
  width?: number | string;
13
13
  height?: number;
14
14
  className?: string;
@@ -1,7 +1,7 @@
1
1
  import { Icon, warning, info, check, close } from '@wordpress/icons';
2
2
  import clsx from 'clsx';
3
- import React from 'react';
4
3
  import styles from './style.module.scss';
4
+ import type { Component, FC, ReactElement, ReactNode } from 'react';
5
5
 
6
6
  type NoticeProps = {
7
7
  /** The severity of the alert. */
@@ -11,7 +11,7 @@ type NoticeProps = {
11
11
  title?: string;
12
12
 
13
13
  /** A list of action elements to show across the bottom */
14
- actions?: React.ReactNode[];
14
+ actions?: ReactNode[];
15
15
 
16
16
  /** Hide close button */
17
17
  hideCloseButton?: boolean;
@@ -20,7 +20,7 @@ type NoticeProps = {
20
20
  onClose?: () => void;
21
21
 
22
22
  /** Children to be rendered inside the alert. */
23
- children: React.ReactNode;
23
+ children: ReactNode;
24
24
  };
25
25
 
26
26
  const getIconByLevel = ( level: NoticeProps[ 'level' ] ) => {
@@ -41,16 +41,16 @@ const getIconByLevel = ( level: NoticeProps[ 'level' ] ) => {
41
41
  /**
42
42
  * Notice component
43
43
  *
44
- * @param {object} props - The component properties.
45
- * @param {string} props.level - The notice level: error, warning, info, success.
46
- * @param {boolean} props.hideCloseButton - Whether to hide the close button.
47
- * @param {Function} props.onClose - The function to call when the close button is clicked.
48
- * @param {string} props.title - The title of the notice.
49
- * @param {React.ReactNode[]} props.actions - Actions to show across the bottom of the bar.
50
- * @param {React.Component} props.children - The notice content.
51
- * @return {React.ReactElement} The `Notice` component.
44
+ * @param {object} props - The component properties.
45
+ * @param {string} props.level - The notice level: error, warning, info, success.
46
+ * @param {boolean} props.hideCloseButton - Whether to hide the close button.
47
+ * @param {Function} props.onClose - The function to call when the close button is clicked.
48
+ * @param {string} props.title - The title of the notice.
49
+ * @param {ReactNode[]} props.actions - Actions to show across the bottom of the bar.
50
+ * @param {Component} props.children - The notice content.
51
+ * @return {ReactElement} The `Notice` component.
52
52
  */
53
- const Notice: React.FC< NoticeProps > = ( {
53
+ const Notice: FC< NoticeProps > = ( {
54
54
  level = 'info',
55
55
  title,
56
56
  children,
@@ -1,7 +1,8 @@
1
1
  import clsx from 'clsx';
2
- import React from 'react';
2
+ import { useState } from 'react';
3
3
  import ReactSlider, { ReactSliderProps } from 'react-slider';
4
4
  import { NumberSliderProps } from './types.ts';
5
+ import type { ComponentType, FC, ReactElement } from 'react';
5
6
  import './style.scss';
6
7
 
7
8
  /**
@@ -9,9 +10,9 @@ import './style.scss';
9
10
  * More support from the original ReactSlider component: https://zillow.github.io/react-slider/
10
11
  *
11
12
  * @param {NumberSliderProps} props - Props
12
- * @return {React.ReactElement} - JSX element
13
+ * @return {ReactElement} - JSX element
13
14
  */
14
- const NumberSlider: React.FC< NumberSliderProps > = ( {
15
+ const NumberSlider: FC< NumberSliderProps > = ( {
15
16
  className,
16
17
  maxValue = 100,
17
18
  minValue = 0,
@@ -22,7 +23,7 @@ const NumberSlider: React.FC< NumberSliderProps > = ( {
22
23
  onAfterChange,
23
24
  renderThumb,
24
25
  } ) => {
25
- const [ isThumbHolding, setIsThumbHolding ] = React.useState( false );
26
+ const [ isThumbHolding, setIsThumbHolding ] = useState( false );
26
27
 
27
28
  const componentClassName = clsx( 'jp-components-number-slider', className, {
28
29
  'jp-components-number-slider--is-holding': isThumbHolding,
@@ -60,7 +61,7 @@ const NumberSlider: React.FC< NumberSliderProps > = ( {
60
61
  * Type casting to prevent TypeScript error:
61
62
  * TS2604: JSX element type 'ReactSlider' does not have any construct or call signatures.
62
63
  */
63
- const TypedReactSlider = ReactSlider as unknown as React.ComponentType< ReactSliderProps >;
64
+ const TypedReactSlider = ReactSlider as unknown as ComponentType< ReactSliderProps >;
64
65
 
65
66
  return (
66
67
  <div className={ componentClassName } data-testid="number-slider">
@@ -1,4 +1,4 @@
1
- import type { HTMLProps, RefCallback } from 'react';
1
+ import type { HTMLProps, RefCallback, JSX } from 'react';
2
2
 
3
3
  interface HTMLPropsWithRefCallback< T > extends HTMLProps< T > {
4
4
  ref: RefCallback< T >;
@@ -54,5 +54,5 @@ export type NumberSliderProps = {
54
54
  renderThumb?: (
55
55
  props: HTMLPropsWithRefCallback< HTMLDivElement >,
56
56
  state: { index: number; value: number | ReadonlyArray< number >; valueNow: number }
57
- ) => React.JSX.Element | null;
57
+ ) => JSX.Element | null;
58
58
  };
@@ -1,12 +1,13 @@
1
1
  import './style.scss';
2
+ import type { FC, ReactNode } from 'react';
2
3
 
3
4
  type PopoverProps = {
4
- action: React.ReactNode;
5
- icon?: React.ReactNode;
6
- children?: React.ReactNode;
5
+ action: ReactNode;
6
+ icon?: ReactNode;
7
+ children?: ReactNode;
7
8
  };
8
9
 
9
- const Popover: React.FC< PopoverProps > = ( { icon, children, action } ) => {
10
+ const Popover: FC< PopoverProps > = ( { icon, children, action } ) => {
10
11
  return (
11
12
  <div className="jp-popover">
12
13
  <div className="jp-popover__icon">{ icon }</div>
@@ -5,7 +5,7 @@ import { LoadingPlaceholder } from '@automattic/jetpack-components';
5
5
  import TermsOfService from '../terms-of-service/index.tsx';
6
6
  import type { PricingCardProps } from './types.ts';
7
7
  import type { CurrencyObject } from '@automattic/number-formatters';
8
- import type React from 'react';
8
+ import type { FC, ReactNode } from 'react';
9
9
 
10
10
  import './style.scss';
11
11
 
@@ -25,9 +25,9 @@ const showPriceDecimals = ( currencyObject: CurrencyObject ): boolean => {
25
25
  * The Pricing card component.
26
26
  *
27
27
  * @param {PricingCardProps} props -- The component props.
28
- * @return {React.ReactNode} The rendered component.
28
+ * @return {ReactNode} The rendered component.
29
29
  */
30
- const PricingCard: React.FC< PricingCardProps > = ( {
30
+ const PricingCard: FC< PricingCardProps > = ( {
31
31
  currencyCode = 'USD',
32
32
  priceDetails = __( '/month, paid yearly', 'jetpack-components' ),
33
33
  ...props
@@ -2,7 +2,7 @@
2
2
  * External dependencies
3
3
  */
4
4
  import type { Button } from '@wordpress/components';
5
- import type React from 'react';
5
+ import type { ComponentProps, ReactNode } from 'react';
6
6
 
7
7
  export type PricingCardProps = {
8
8
  /**
@@ -12,7 +12,7 @@ export type PricingCardProps = {
12
12
  /**
13
13
  * The Icon.
14
14
  */
15
- icon?: string | React.ReactNode;
15
+ icon?: string | ReactNode;
16
16
  /**
17
17
  * Price before discount.
18
18
  */
@@ -36,17 +36,17 @@ export type PricingCardProps = {
36
36
  /**
37
37
  * The CTA callback to be called on click.
38
38
  */
39
- onCtaClick?: React.ComponentProps< typeof Button >[ 'onClick' ];
39
+ onCtaClick?: ComponentProps< typeof Button >[ 'onClick' ];
40
40
  /**
41
41
  * Optional informative text.
42
42
  */
43
- infoText?: React.ReactNode;
43
+ infoText?: ReactNode;
44
44
  /**
45
45
  * The TOS copy.
46
46
  */
47
- tosText?: React.ReactNode;
47
+ tosText?: ReactNode;
48
48
  /**
49
49
  * Optional Child nodes
50
50
  */
51
- children?: React.ReactNode;
51
+ children?: ReactNode;
52
52
  };