@automattic/jetpack-components 0.68.2 → 0.69.1

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 (257) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/build/components/action-button/index.d.ts +25 -0
  3. package/build/components/action-button/index.js +48 -0
  4. package/build/components/action-popover/index.d.ts +6 -0
  5. package/build/components/action-popover/index.js +38 -0
  6. package/build/components/action-popover/types.d.ts +20 -0
  7. package/build/components/action-popover/types.js +1 -0
  8. package/build/components/admin-page/index.d.ts +12 -0
  9. package/build/components/admin-page/index.js +44 -0
  10. package/build/components/admin-page/types.d.ts +56 -0
  11. package/build/components/admin-page/types.js +1 -0
  12. package/build/components/admin-section/basic/index.d.ts +10 -0
  13. package/build/components/admin-section/basic/index.js +12 -0
  14. package/build/components/admin-section/hero/index.d.ts +10 -0
  15. package/build/components/admin-section/hero/index.js +12 -0
  16. package/build/components/admin-section/types.d.ts +8 -0
  17. package/build/components/admin-section/types.js +1 -0
  18. package/build/components/alert/index.d.ts +23 -0
  19. package/build/components/alert/index.js +33 -0
  20. package/build/components/automattic-byline-logo/index.d.ts +10 -0
  21. package/build/components/automattic-byline-logo/index.js +13 -0
  22. package/build/components/automattic-byline-logo/types.d.ts +15 -0
  23. package/build/components/automattic-byline-logo/types.js +1 -0
  24. package/build/components/automattic-for-agencies-logo/index.d.ts +11 -0
  25. package/build/components/automattic-for-agencies-logo/index.js +12 -0
  26. package/build/components/automattic-icon-logo/index.d.ts +13 -0
  27. package/build/components/automattic-icon-logo/index.js +13 -0
  28. package/build/components/badge/index.d.ts +19 -0
  29. package/build/components/badge/index.js +22 -0
  30. package/build/components/boost-score-bar/index.d.ts +5 -0
  31. package/build/components/boost-score-bar/index.js +35 -0
  32. package/build/components/boost-score-bar/types.d.ts +9 -0
  33. package/build/components/boost-score-bar/types.js +1 -0
  34. package/build/components/boost-score-graph/annotations-plugin.d.ts +16 -0
  35. package/build/components/boost-score-graph/annotations-plugin.js +58 -0
  36. package/build/components/boost-score-graph/background.d.ts +3 -0
  37. package/build/components/boost-score-graph/background.js +5 -0
  38. package/build/components/boost-score-graph/day-highlight-plugin.d.ts +13 -0
  39. package/build/components/boost-score-graph/day-highlight-plugin.js +69 -0
  40. package/build/components/boost-score-graph/get-date-format.d.ts +9 -0
  41. package/build/components/boost-score-graph/get-date-format.js +52 -0
  42. package/build/components/boost-score-graph/index.d.ts +44 -0
  43. package/build/components/boost-score-graph/index.js +42 -0
  44. package/build/components/boost-score-graph/tooltip.d.ts +3 -0
  45. package/build/components/boost-score-graph/tooltip.js +22 -0
  46. package/build/components/boost-score-graph/tooltips-plugin.d.ts +15 -0
  47. package/build/components/boost-score-graph/tooltips-plugin.js +78 -0
  48. package/build/components/boost-score-graph/uplot-line-chart.d.ts +27 -0
  49. package/build/components/boost-score-graph/uplot-line-chart.js +187 -0
  50. package/build/components/boost-score-graph/use-boost-score-transform.d.ts +14 -0
  51. package/build/components/boost-score-graph/use-boost-score-transform.js +26 -0
  52. package/build/components/boost-score-graph/use-resize.d.ts +9 -0
  53. package/build/components/boost-score-graph/use-resize.js +31 -0
  54. package/build/components/button/index.d.ts +10 -0
  55. package/build/components/button/index.js +45 -0
  56. package/build/components/button/types.d.ts +19 -0
  57. package/build/components/button/types.js +1 -0
  58. package/build/components/chip/index.d.ts +15 -0
  59. package/build/components/chip/index.js +16 -0
  60. package/build/components/contextual-upgrade-trigger/index.d.ts +4 -0
  61. package/build/components/contextual-upgrade-trigger/index.js +12 -0
  62. package/build/components/contextual-upgrade-trigger/types.d.ts +9 -0
  63. package/build/components/contextual-upgrade-trigger/types.js +1 -0
  64. package/build/components/copy-to-clipboard/index.d.ts +4 -0
  65. package/build/components/copy-to-clipboard/index.js +40 -0
  66. package/build/components/copy-to-clipboard/types.d.ts +6 -0
  67. package/build/components/copy-to-clipboard/types.js +1 -0
  68. package/build/components/decorative-card/index.d.ts +11 -0
  69. package/build/components/decorative-card/index.js +13 -0
  70. package/build/components/decorative-card/types.d.ts +14 -0
  71. package/build/components/decorative-card/types.js +1 -0
  72. package/build/components/dialog/index.d.ts +20 -0
  73. package/build/components/dialog/index.js +31 -0
  74. package/build/components/diff-viewer/index.d.ts +4 -0
  75. package/build/components/diff-viewer/index.js +33 -0
  76. package/build/components/diff-viewer/parse-filename.d.ts +29 -0
  77. package/build/components/diff-viewer/parse-filename.js +61 -0
  78. package/build/components/diff-viewer/parse-patch.d.ts +9 -0
  79. package/build/components/diff-viewer/parse-patch.js +148 -0
  80. package/build/components/donut-meter/index.d.ts +58 -0
  81. package/build/components/donut-meter/index.js +36 -0
  82. package/build/components/global-notices/global-notices.d.ts +11 -0
  83. package/build/components/global-notices/global-notices.js +19 -0
  84. package/build/components/global-notices/index.d.ts +3 -0
  85. package/build/components/global-notices/index.js +3 -0
  86. package/build/components/global-notices/use-global-notices.d.ts +10 -0
  87. package/build/components/global-notices/use-global-notices.js +30 -0
  88. package/build/components/gridicon/index.d.ts +14 -0
  89. package/build/components/gridicon/index.js +167 -0
  90. package/build/components/gridicon/types.d.ts +39 -0
  91. package/build/components/gridicon/types.js +1 -0
  92. package/build/components/icon-tooltip/index.d.ts +11 -0
  93. package/build/components/icon-tooltip/index.js +75 -0
  94. package/build/components/icon-tooltip/types.d.ts +69 -0
  95. package/build/components/icon-tooltip/types.js +1 -0
  96. package/build/components/icons/index.d.ts +70 -0
  97. package/build/components/icons/index.js +86 -0
  98. package/build/components/icons/types.d.ts +27 -0
  99. package/build/components/icons/types.js +1 -0
  100. package/build/components/indeterminate-progress-bar/index.d.ts +10 -0
  101. package/build/components/indeterminate-progress-bar/index.js +20 -0
  102. package/build/components/indeterminate-progress-bar/types.d.ts +6 -0
  103. package/build/components/indeterminate-progress-bar/types.js +1 -0
  104. package/build/components/jetpack-footer/index.d.ts +11 -0
  105. package/build/components/jetpack-footer/index.js +71 -0
  106. package/build/components/jetpack-footer/types.d.ts +47 -0
  107. package/build/components/jetpack-footer/types.js +1 -0
  108. package/build/components/jetpack-logo/index.d.ts +4 -0
  109. package/build/components/jetpack-logo/index.js +10 -0
  110. package/build/components/jetpack-logo/types.d.ts +7 -0
  111. package/build/components/jetpack-logo/types.js +1 -0
  112. package/build/components/jetpack-protect-logo/index.d.ts +4 -0
  113. package/build/components/jetpack-protect-logo/index.js +10 -0
  114. package/build/components/jetpack-protect-logo/types.d.ts +7 -0
  115. package/build/components/jetpack-protect-logo/types.js +1 -0
  116. package/build/components/jetpack-search-logo/index.d.ts +4 -0
  117. package/build/components/jetpack-search-logo/index.js +7 -0
  118. package/build/components/jetpack-search-logo/types.d.ts +7 -0
  119. package/build/components/jetpack-search-logo/types.js +1 -0
  120. package/build/components/jetpack-vaultpress-backup-logo/index.d.ts +4 -0
  121. package/build/components/jetpack-vaultpress-backup-logo/index.js +8 -0
  122. package/build/components/jetpack-vaultpress-backup-logo/types.d.ts +6 -0
  123. package/build/components/jetpack-vaultpress-backup-logo/types.js +1 -0
  124. package/build/components/jetpack-videopress-logo/index.d.ts +4 -0
  125. package/build/components/jetpack-videopress-logo/index.js +8 -0
  126. package/build/components/jetpack-videopress-logo/types.d.ts +6 -0
  127. package/build/components/jetpack-videopress-logo/types.js +1 -0
  128. package/build/components/layout/col/index.d.ts +10 -0
  129. package/build/components/layout/col/index.js +42 -0
  130. package/build/components/layout/container/index.d.ts +4 -0
  131. package/build/components/layout/container/index.js +30 -0
  132. package/build/components/layout/types.d.ts +58 -0
  133. package/build/components/layout/types.js +1 -0
  134. package/build/components/layout/use-breakpoint-match/index.d.ts +19 -0
  135. package/build/components/layout/use-breakpoint-match/index.js +50 -0
  136. package/build/components/loading-placeholder/index.d.ts +8 -0
  137. package/build/components/loading-placeholder/index.js +7 -0
  138. package/build/components/marked-lines/index.d.ts +4 -0
  139. package/build/components/marked-lines/index.js +50 -0
  140. package/build/components/notice/index.d.ts +29 -0
  141. package/build/components/notice/index.js +35 -0
  142. package/build/components/number-control/index.d.ts +10 -0
  143. package/build/components/number-control/index.js +16 -0
  144. package/build/components/number-format/index.d.ts +9 -0
  145. package/build/components/number-format/index.js +13 -0
  146. package/build/components/number-slider/index.d.ts +12 -0
  147. package/build/components/number-slider/index.js +43 -0
  148. package/build/components/number-slider/types.d.ts +50 -0
  149. package/build/components/number-slider/types.js +1 -0
  150. package/build/components/popover/index.d.ts +9 -0
  151. package/build/components/popover/index.js +6 -0
  152. package/build/components/pricing-card/index.d.ts +11 -0
  153. package/build/components/pricing-card/index.js +32 -0
  154. package/build/components/pricing-card/types.d.ts +51 -0
  155. package/build/components/pricing-card/types.js +1 -0
  156. package/build/components/pricing-table/index.d.ts +7 -0
  157. package/build/components/pricing-table/index.js +66 -0
  158. package/build/components/pricing-table/types.d.ts +68 -0
  159. package/build/components/pricing-table/types.js +1 -0
  160. package/build/components/product-offer/icons-card.d.ts +10 -0
  161. package/build/components/product-offer/icons-card.js +23 -0
  162. package/build/components/product-offer/index.d.ts +11 -0
  163. package/build/components/product-offer/index.js +31 -0
  164. package/build/components/product-offer/product-offer-header.d.ts +9 -0
  165. package/build/components/product-offer/product-offer-header.js +14 -0
  166. package/build/components/product-offer/types.d.ts +102 -0
  167. package/build/components/product-offer/types.js +1 -0
  168. package/build/components/product-price/index.d.ts +11 -0
  169. package/build/components/product-price/index.js +32 -0
  170. package/build/components/product-price/price.d.ts +9 -0
  171. package/build/components/product-price/price.js +19 -0
  172. package/build/components/product-price/types.d.ts +61 -0
  173. package/build/components/product-price/types.js +1 -0
  174. package/build/components/progress-bar/index.d.ts +10 -0
  175. package/build/components/progress-bar/index.js +26 -0
  176. package/build/components/progress-bar/types.d.ts +18 -0
  177. package/build/components/progress-bar/types.js +1 -0
  178. package/build/components/qr-code/index.d.ts +46 -0
  179. package/build/components/qr-code/index.js +21 -0
  180. package/build/components/radio-control/index.d.ts +24 -0
  181. package/build/components/radio-control/index.js +8 -0
  182. package/build/components/record-meter-bar/index.d.ts +62 -0
  183. package/build/components/record-meter-bar/index.js +40 -0
  184. package/build/components/spinner/index.d.ts +13 -0
  185. package/build/components/spinner/index.js +27 -0
  186. package/build/components/split-button/index.d.ts +4 -0
  187. package/build/components/split-button/index.js +8 -0
  188. package/build/components/split-button/types.d.ts +8 -0
  189. package/build/components/split-button/types.js +1 -0
  190. package/build/components/stat-card/index.d.ts +9 -0
  191. package/build/components/stat-card/index.js +27 -0
  192. package/build/components/stat-card/types.d.ts +29 -0
  193. package/build/components/stat-card/types.js +1 -0
  194. package/build/components/status/index.d.ts +8 -0
  195. package/build/components/status/index.js +18 -0
  196. package/build/components/terms-of-service/index.d.ts +5 -0
  197. package/build/components/terms-of-service/index.js +32 -0
  198. package/build/components/terms-of-service/types.d.ts +23 -0
  199. package/build/components/terms-of-service/types.js +1 -0
  200. package/build/components/testimonials/index.d.ts +3 -0
  201. package/build/components/testimonials/index.js +18 -0
  202. package/build/components/testimonials/testimonial.d.ts +4 -0
  203. package/build/components/testimonials/testimonial.js +7 -0
  204. package/build/components/testimonials/types.d.ts +13 -0
  205. package/build/components/testimonials/types.js +1 -0
  206. package/build/components/text/constants.d.ts +14 -0
  207. package/build/components/text/constants.js +29 -0
  208. package/build/components/text/index.d.ts +32 -0
  209. package/build/components/text/index.js +53 -0
  210. package/build/components/text/types.d.ts +50 -0
  211. package/build/components/text/types.js +1 -0
  212. package/build/components/theme-provider/index.d.ts +80 -0
  213. package/build/components/theme-provider/index.js +129 -0
  214. package/build/components/theme-provider/types.d.ts +23 -0
  215. package/build/components/theme-provider/types.js +1 -0
  216. package/build/components/threat-fixer-button/index.d.ts +17 -0
  217. package/build/components/threat-fixer-button/index.js +56 -0
  218. package/build/components/threat-severity-badge/index.d.ts +4 -0
  219. package/build/components/threat-severity-badge/index.js +13 -0
  220. package/build/components/threats-data-views/constants.d.ts +33 -0
  221. package/build/components/threats-data-views/constants.js +37 -0
  222. package/build/components/threats-data-views/index.d.ts +30 -0
  223. package/build/components/threats-data-views/index.js +413 -0
  224. package/build/components/threats-data-views/threats-status-toggle-group-control.d.ts +16 -0
  225. package/build/components/threats-data-views/threats-status-toggle-group-control.js +95 -0
  226. package/build/components/toggle-control/index.d.ts +21 -0
  227. package/build/components/toggle-control/index.js +21 -0
  228. package/build/components/upsell-banner/index.d.ts +14 -0
  229. package/build/components/upsell-banner/index.js +21 -0
  230. package/build/components/upsell-banner/types.d.ts +13 -0
  231. package/build/components/upsell-banner/types.js +1 -0
  232. package/build/components/zendesk-chat/constants.d.ts +1 -0
  233. package/build/components/zendesk-chat/constants.js +2 -0
  234. package/build/components/zendesk-chat/index.d.ts +3 -0
  235. package/build/components/zendesk-chat/index.js +27 -0
  236. package/build/components/zendesk-chat/types.d.ts +11 -0
  237. package/build/components/zendesk-chat/types.js +1 -0
  238. package/build/index.d.ts +67 -0
  239. package/build/index.js +81 -0
  240. package/build/lib/locale/index.d.ts +13 -0
  241. package/build/lib/locale/index.js +34 -0
  242. package/build/tools/get-product-checkout-url/index.d.ts +10 -0
  243. package/build/tools/get-product-checkout-url/index.js +22 -0
  244. package/build/tools/get-site-admin-url/index.d.ts +6 -0
  245. package/build/tools/get-site-admin-url/index.js +13 -0
  246. package/build/tools/jp-redirect/index.d.ts +20 -0
  247. package/build/tools/jp-redirect/index.js +50 -0
  248. package/build/tools/jp-redirect/types.d.ts +39 -0
  249. package/build/tools/jp-redirect/types.js +1 -0
  250. package/build/tools/pricing-utils/index.d.ts +8 -0
  251. package/build/tools/pricing-utils/index.js +9 -0
  252. package/build/tools/pricing-utils/types.d.ts +12 -0
  253. package/build/tools/pricing-utils/types.js +1 -0
  254. package/components/boost-score-graph/uplot-line-chart.tsx +16 -1
  255. package/components/jetpack-footer/style.scss +5 -0
  256. package/components/number-slider/index.tsx +8 -2
  257. package/package.json +19 -12
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ### This is a list detailing changes for the Jetpack RNA Components package releases.
4
4
 
5
+ ## [0.69.1] - 2025-03-18
6
+ ### Changed
7
+ - Update package dependencies. [#42509] [#42511]
8
+
9
+ ## [0.69.0] - 2025-03-17
10
+ ### Added
11
+ - Add build. [#41536]
12
+
5
13
  ## [0.68.2] - 2025-03-12
6
14
  ### Added
7
15
  - Add role to Jetpack footer. [#42156]
@@ -1310,6 +1318,8 @@
1310
1318
  ### Changed
1311
1319
  - Update node version requirement to 14.16.1
1312
1320
 
1321
+ [0.69.1]: https://github.com/Automattic/jetpack-components/compare/0.69.0...0.69.1
1322
+ [0.69.0]: https://github.com/Automattic/jetpack-components/compare/0.68.2...0.69.0
1313
1323
  [0.68.2]: https://github.com/Automattic/jetpack-components/compare/0.68.1...0.68.2
1314
1324
  [0.68.1]: https://github.com/Automattic/jetpack-components/compare/0.68.0...0.68.1
1315
1325
  [0.68.0]: https://github.com/Automattic/jetpack-components/compare/0.67.1...0.68.0
@@ -0,0 +1,25 @@
1
+ export default ActionButton;
2
+ /**
3
+ * The Jetpack Action button.
4
+ *
5
+ * This component extends the regular `Button` component and adds a `isLoading` prop that will disable and display a spinner, giving the user the feedback that some action is happening. It also provides a generic error message.
6
+ *
7
+ * It is useful to async actions when the user has to wait the result of a request or process.
8
+ *
9
+ * @param {object} props - The properties.
10
+ * @return {React.Component} The `ActionButton` component.
11
+ */
12
+ declare function ActionButton(props: object): React.Component;
13
+ declare namespace ActionButton {
14
+ namespace propTypes {
15
+ const label: any;
16
+ const onClick: any;
17
+ const isLoading: any;
18
+ const isDisabled: any;
19
+ const displayError: any;
20
+ const errorMessage: any;
21
+ const variant: any;
22
+ const isExternalLink: any;
23
+ }
24
+ }
25
+ import React from 'react';
@@ -0,0 +1,48 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * External dependencies
4
+ */
5
+ import { Spinner } from '@wordpress/components';
6
+ import { __ } from '@wordpress/i18n';
7
+ import clsx from 'clsx';
8
+ import PropTypes from 'prop-types';
9
+ /**
10
+ * Internal dependencies
11
+ */
12
+ import React from 'react';
13
+ import Button from '../button/index.js';
14
+ import styles from './style.module.scss';
15
+ /**
16
+ * The Jetpack Action button.
17
+ *
18
+ * This component extends the regular `Button` component and adds a `isLoading` prop that will disable and display a spinner, giving the user the feedback that some action is happening. It also provides a generic error message.
19
+ *
20
+ * It is useful to async actions when the user has to wait the result of a request or process.
21
+ *
22
+ * @param {object} props - The properties.
23
+ * @return {React.Component} The `ActionButton` component.
24
+ */
25
+ const ActionButton = props => {
26
+ const { label, onClick, isLoading = false, loadingText, isDisabled, displayError = false, errorMessage = __('An error occurred. Please try again.', 'jetpack-components'), variant = 'primary', isExternalLink = false, customClass, } = props;
27
+ const loadingContent = loadingText || _jsx(Spinner, {});
28
+ return (_jsxs(_Fragment, { children: [_jsx(Button, { className: clsx(styles.button, 'jp-action-button--button', customClass), label: label, onClick: onClick, variant: isExternalLink ? 'link' : variant, isExternalLink: isExternalLink, disabled: isLoading || isDisabled, children: isLoading ? loadingContent : label }), displayError && (_jsx("p", { className: clsx(styles.error, 'jp-action-button__error'), children: errorMessage }))] }));
29
+ };
30
+ ActionButton.propTypes = {
31
+ /** The button label. */
32
+ label: PropTypes.string.isRequired,
33
+ /** The callback to be called on click. */
34
+ onClick: PropTypes.func,
35
+ /** Will disable the button and display a spinner if set to true. */
36
+ isLoading: PropTypes.bool,
37
+ /** Will disable the button with no spinner. */
38
+ isDisabled: PropTypes.bool,
39
+ /** Displays an error message */
40
+ displayError: PropTypes.bool,
41
+ /** The error message string */
42
+ errorMessage: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
43
+ /** The type/variant of button */
44
+ variant: PropTypes.arrayOf(PropTypes.oneOf(['primary', 'secondary', 'link'])),
45
+ /** Will display the button as a link with an external icon. */
46
+ isExternalLink: PropTypes.bool,
47
+ };
48
+ export default ActionButton;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Types
3
+ */
4
+ import { ActionPopoverProps } from './types.js';
5
+ declare const ActionPopover: ({ hideCloseButton, title, children, step, totalSteps, buttonContent, buttonDisabled, buttonHref, buttonExternalLink, offset, onClose, onClick, ...otherPopoverProps }: ActionPopoverProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default ActionPopover;
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * External dependencies
4
+ */
5
+ import { Popover } from '@wordpress/components';
6
+ import { __, sprintf } from '@wordpress/i18n';
7
+ import { close } from '@wordpress/icons';
8
+ import Button from '../button/index.js';
9
+ import useBreakpointMatch from '../layout/use-breakpoint-match/index.js';
10
+ import Text from '../text/index.js';
11
+ /**
12
+ * Internal dependencies
13
+ */
14
+ import ThemeProvider from '../theme-provider/index.js';
15
+ import styles from './styles.module.scss';
16
+ const ActionPopover = ({ hideCloseButton = false, title, children, step = null, totalSteps = null, buttonContent = null, buttonDisabled = false, buttonHref = null, buttonExternalLink = false, offset = 32, onClose, onClick, ...otherPopoverProps }) => {
17
+ const [isSm] = useBreakpointMatch('sm');
18
+ if (!title || !children || !buttonContent) {
19
+ return null;
20
+ }
21
+ if (!otherPopoverProps.position) {
22
+ otherPopoverProps.position = isSm ? 'top center' : 'middle right';
23
+ }
24
+ const popoverProps = {
25
+ ...otherPopoverProps,
26
+ offset,
27
+ onClose,
28
+ };
29
+ const showSteps = Number.isFinite(step) && Number.isFinite(totalSteps);
30
+ let stepsText = null;
31
+ if (showSteps) {
32
+ stepsText = sprintf(
33
+ /* translators: 1 Current step, 2 Total steps */
34
+ __('%1$d of %2$d', 'jetpack-components'), step, totalSteps);
35
+ }
36
+ return (_jsx(Popover, { ...popoverProps, children: _jsx(ThemeProvider, { children: _jsxs("div", { className: styles.wrapper, children: [_jsxs("div", { className: styles.header, children: [_jsx(Text, { variant: "title-small", className: styles.title, children: title }), !hideCloseButton && (_jsx(_Fragment, { children: _jsx(Button, { size: "small", variant: "tertiary", "aria-label": "close", className: styles['close-button'], icon: close, iconSize: 16, onClick: onClose }) }))] }), children, _jsxs("div", { className: styles.footer, children: [showSteps && (_jsx(Text, { variant: "body", className: styles.steps, children: stepsText })), _jsx(Button, { variant: "primary", className: styles['action-button'], disabled: buttonDisabled, onClick: onClick, isExternalLink: buttonExternalLink, href: buttonHref, children: buttonContent })] })] }) }) }));
37
+ };
38
+ export default ActionPopover;
@@ -0,0 +1,20 @@
1
+ /// <reference types="react" resolution-mode="require"/>
2
+ /**
3
+ * Types
4
+ */
5
+ import type { Popover } from '@wordpress/components';
6
+ export type ActionPopoverProps = React.ComponentProps<typeof Popover> & {
7
+ anchor?: Element;
8
+ offset?: number;
9
+ } & {
10
+ hideCloseButton?: boolean;
11
+ title: string;
12
+ children: React.ReactNode;
13
+ step?: number;
14
+ totalSteps?: number;
15
+ buttonContent?: React.ReactNode;
16
+ buttonDisabled?: boolean;
17
+ buttonHref?: string;
18
+ buttonExternalLink?: boolean;
19
+ onClick?(): void;
20
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { AdminPageProps } from './types.js';
2
+ import type React from 'react';
3
+ /**
4
+ * This is the base structure for any admin page. It comes with Header and Footer.
5
+ *
6
+ * All content must be passed as children wrapped in as many <AdminSection> elements as needed.
7
+ *
8
+ * @param {AdminPageProps} props - Component properties.
9
+ * @return {React.ReactNode} AdminPage component.
10
+ */
11
+ declare const AdminPage: React.FC<AdminPageProps>;
12
+ export default AdminPage;
@@ -0,0 +1,44 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import restApi from '@automattic/jetpack-api';
3
+ import { __, sprintf } from '@wordpress/i18n';
4
+ import clsx from 'clsx';
5
+ import { useEffect, useCallback } from 'react';
6
+ import JetpackFooter from '../jetpack-footer/index.js';
7
+ import JetpackLogo from '../jetpack-logo/index.js';
8
+ import Col from '../layout/col/index.js';
9
+ import Container from '../layout/container/index.js';
10
+ import styles from './style.module.scss';
11
+ /**
12
+ * This is the base structure for any admin page. It comes with Header and Footer.
13
+ *
14
+ * All content must be passed as children wrapped in as many <AdminSection> elements as needed.
15
+ *
16
+ * @param {AdminPageProps} props - Component properties.
17
+ * @return {React.ReactNode} AdminPage component.
18
+ */
19
+ const AdminPage = ({ children, moduleName = __('Jetpack', 'jetpack-components'), moduleNameHref, showHeader = true, showFooter = true, useInternalLinks = false, showBackground = true, sandboxedDomain = '', apiRoot = '', apiNonce = '', optionalMenuItems, header, }) => {
20
+ useEffect(() => {
21
+ restApi.setApiRoot(apiRoot);
22
+ restApi.setApiNonce(apiNonce);
23
+ }, [apiRoot, apiNonce]);
24
+ const rootClassName = clsx(styles['admin-page'], {
25
+ [styles.background]: showBackground,
26
+ });
27
+ const testConnection = useCallback(async () => {
28
+ try {
29
+ const connectionTest = await restApi.fetchSiteConnectionTest();
30
+ // eslint-disable-next-line no-alert
31
+ window.alert(connectionTest.message);
32
+ }
33
+ catch (error) {
34
+ // eslint-disable-next-line no-alert
35
+ window.alert(sprintf(
36
+ /* translators: placeholder is an error message. */
37
+ __('There was an error testing Jetpack. Error: %s', 'jetpack-components'), error.message));
38
+ }
39
+ }, []);
40
+ return (_jsxs("div", { className: rootClassName, children: [showHeader && (_jsx(Container, { horizontalSpacing: 5, children: _jsxs(Col, { className: styles['admin-page-header'], children: [header ? header : _jsx(JetpackLogo, {}), sandboxedDomain && (_jsx("code", { className: styles['sandbox-domain-badge'], onClick: testConnection, onKeyDown: testConnection,
41
+ // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role
42
+ role: "button", tabIndex: 0, title: `Sandboxing via ${sandboxedDomain}. Click to test connection.`, children: "API Sandboxed" }))] }) })), _jsx(Container, { fluid: true, horizontalSpacing: 0, children: _jsx(Col, { children: children }) }), showFooter && (_jsx(Container, { horizontalSpacing: 5, children: _jsx(Col, { children: _jsx(JetpackFooter, { moduleName: moduleName, moduleNameHref: moduleNameHref, menu: optionalMenuItems, useInternalLinks: useInternalLinks }) }) }))] }));
43
+ };
44
+ export default AdminPage;
@@ -0,0 +1,56 @@
1
+ /// <reference types="react" resolution-mode="require"/>
2
+ import type { JetpackFooterMenuItem } from '../jetpack-footer/types.js';
3
+ export type AdminPageProps = {
4
+ /**
5
+ * The page content
6
+ */
7
+ children: React.ReactNode;
8
+ /**
9
+ * Name of the module, e.g. 'Jetpack Search' that will be displayed in the footer.
10
+ */
11
+ moduleName?: string;
12
+ /**
13
+ * Whether or not to display the Header
14
+ */
15
+ showHeader?: boolean;
16
+ /**
17
+ * Custom header. Optional
18
+ */
19
+ header?: React.ReactNode;
20
+ /**
21
+ * Whether or not to display the Footer
22
+ */
23
+ showFooter?: boolean;
24
+ /**
25
+ * Whether or not to link to Jetpack plugin admin pages.
26
+ */
27
+ useInternalLinks?: boolean;
28
+ /**
29
+ * Link that the Footer Module name will link to (optional).
30
+ */
31
+ moduleNameHref?: string;
32
+ /**
33
+ * Whether or not to display the Background Color
34
+ */
35
+ showBackground?: boolean;
36
+ /**
37
+ * URL of the site WP Admin.
38
+ */
39
+ siteAdminUrl?: string;
40
+ /**
41
+ * The domain of the sanboxed API.
42
+ */
43
+ sandboxedDomain?: string;
44
+ /**
45
+ * The root URL of the API.
46
+ */
47
+ apiRoot?: string;
48
+ /**
49
+ * The nonce of the API.
50
+ */
51
+ apiNonce?: string;
52
+ /**
53
+ * Optional menu items to be displayed
54
+ */
55
+ optionalMenuItems?: JetpackFooterMenuItem[];
56
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { AdminSectionBaseProps } from '../types.js';
3
+ /**
4
+ * This is the wrapper component to build sections within your admin page.
5
+ *
6
+ * @param {AdminSectionBaseProps} props - Component properties.
7
+ * @return {React.ReactNode} AdminSection component.
8
+ */
9
+ declare const AdminSection: React.FC<AdminSectionBaseProps>;
10
+ export default AdminSection;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import styles from './style.module.scss';
3
+ /**
4
+ * This is the wrapper component to build sections within your admin page.
5
+ *
6
+ * @param {AdminSectionBaseProps} props - Component properties.
7
+ * @return {React.ReactNode} AdminSection component.
8
+ */
9
+ const AdminSection = ({ children }) => {
10
+ return _jsx("div", { className: styles.section, children: children });
11
+ };
12
+ export default AdminSection;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { AdminSectionBaseProps } from '../types.js';
3
+ /**
4
+ * The wrapper component for a Hero Section to be used in admin pages.
5
+ *
6
+ * @param {AdminSectionBaseProps} props - Component properties.
7
+ * @return {React.Component} AdminSectionHero component.
8
+ */
9
+ declare const AdminSectionHero: React.FC<AdminSectionBaseProps>;
10
+ export default AdminSectionHero;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import styles from './style.module.scss';
3
+ /**
4
+ * The wrapper component for a Hero Section to be used in admin pages.
5
+ *
6
+ * @param {AdminSectionBaseProps} props - Component properties.
7
+ * @return {React.Component} AdminSectionHero component.
8
+ */
9
+ const AdminSectionHero = ({ children }) => {
10
+ return _jsx("div", { className: styles['section-hero'], children: children });
11
+ };
12
+ export default AdminSectionHero;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" resolution-mode="require"/>
2
+ export type AdminSectionBaseProps = {
3
+ /**
4
+ * The section content
5
+ */
6
+ children: React.ReactNode;
7
+ className?: string;
8
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ type AlertProps = {
3
+ /** The severity of the alert. */
4
+ level: 'error' | 'warning' | 'info' | 'success';
5
+ /** Show/Hide icon */
6
+ showIcon?: boolean;
7
+ /** Children to be rendered inside the alert. */
8
+ children: React.ReactNode;
9
+ /** Wrapper class name */
10
+ className?: string;
11
+ };
12
+ /**
13
+ * Alert component
14
+ *
15
+ * @param {object} props - The component properties.
16
+ * @param {string} props.level - The alert level: error, warning, info, success.
17
+ * @param {boolean} props.showIcon - Whether to show the alert icon.
18
+ * @param {string} props.className - The wrapper class name.
19
+ * @param {React.Component} props.children - The alert content.
20
+ * @return {React.ReactElement} The `Alert` component.
21
+ */
22
+ declare const Alert: React.FC<AlertProps>;
23
+ export default Alert;
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Icon, warning, info, check } from '@wordpress/icons';
3
+ import clsx from 'clsx';
4
+ import styles from './style.module.scss';
5
+ const getIconByLevel = (level) => {
6
+ switch (level) {
7
+ case 'error':
8
+ return warning;
9
+ case 'warning':
10
+ return warning;
11
+ case 'info':
12
+ return info;
13
+ case 'success':
14
+ return check;
15
+ default:
16
+ return warning;
17
+ }
18
+ };
19
+ /**
20
+ * Alert component
21
+ *
22
+ * @param {object} props - The component properties.
23
+ * @param {string} props.level - The alert level: error, warning, info, success.
24
+ * @param {boolean} props.showIcon - Whether to show the alert icon.
25
+ * @param {string} props.className - The wrapper class name.
26
+ * @param {React.Component} props.children - The alert content.
27
+ * @return {React.ReactElement} The `Alert` component.
28
+ */
29
+ const Alert = ({ level = 'warning', children, showIcon = true, className, }) => {
30
+ const classes = clsx(styles.container, styles[`is-${level}`], className);
31
+ return (_jsxs("div", { className: classes, children: [showIcon && (_jsx("div", { className: styles['icon-wrapper'], children: _jsx(Icon, { icon: getIconByLevel(level), className: styles.icon }) })), _jsx("div", { children: children })] }));
32
+ };
33
+ export default Alert;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { AutomatticBylineLogoProps } from './types.js';
3
+ /**
4
+ * Automattic "By line" Logo component.
5
+ *
6
+ * @param {AutomatticBylineLogoProps} props - Component properties.
7
+ * @return {React.ReactNode} AutomatticBylineLogo component.
8
+ */
9
+ declare const AutomatticBylineLogo: React.FC<AutomatticBylineLogoProps>;
10
+ export default AutomatticBylineLogo;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { __ } from '@wordpress/i18n';
3
+ import clsx from 'clsx';
4
+ /**
5
+ * Automattic "By line" Logo component.
6
+ *
7
+ * @param {AutomatticBylineLogoProps} props - Component properties.
8
+ * @return {React.ReactNode} AutomatticBylineLogo component.
9
+ */
10
+ const AutomatticBylineLogo = ({ title = __('An Automattic Airline', 'jetpack-components'), height = 7, className, ...otherProps }) => {
11
+ return (_jsxs("svg", { role: "img", x: "0", y: "0", viewBox: "0 0 935 38.2", enableBackground: "new 0 0 935 38.2", "aria-labelledby": "jp-automattic-byline-logo-title", height: height, className: clsx('jp-automattic-byline-logo', className), ...otherProps, children: [_jsx("desc", { id: "jp-automattic-byline-logo-title", children: title }), _jsx("path", { d: "M317.1 38.2c-12.6 0-20.7-9.1-20.7-18.5v-1.2c0-9.6 8.2-18.5 20.7-18.5 12.6 0 20.8 8.9 20.8 18.5v1.2C337.9 29.1 329.7 38.2 317.1 38.2zM331.2 18.6c0-6.9-5-13-14.1-13s-14 6.1-14 13v0.9c0 6.9 5 13.1 14 13.1s14.1-6.2 14.1-13.1V18.6zM175 36.8l-4.7-8.8h-20.9l-4.5 8.8h-7L157 1.3h5.5L182 36.8H175zM159.7 8.2L152 23.1h15.7L159.7 8.2zM212.4 38.2c-12.7 0-18.7-6.9-18.7-16.2V1.3h6.6v20.9c0 6.6 4.3 10.5 12.5 10.5 8.4 0 11.9-3.9 11.9-10.5V1.3h6.7V22C231.4 30.8 225.8 38.2 212.4 38.2zM268.6 6.8v30h-6.7v-30h-15.5V1.3h37.7v5.5H268.6zM397.3 36.8V8.7l-1.8 3.1 -14.9 25h-3.3l-14.7-25 -1.8-3.1v28.1h-6.5V1.3h9.2l14 24.4 1.7 3 1.7-3 13.9-24.4h9.1v35.5H397.3zM454.4 36.8l-4.7-8.8h-20.9l-4.5 8.8h-7l19.2-35.5h5.5l19.5 35.5H454.4zM439.1 8.2l-7.7 14.9h15.7L439.1 8.2zM488.4 6.8v30h-6.7v-30h-15.5V1.3h37.7v5.5H488.4zM537.3 6.8v30h-6.7v-30h-15.5V1.3h37.7v5.5H537.3zM569.3 36.8V4.6c2.7 0 3.7-1.4 3.7-3.4h2.8v35.5L569.3 36.8 569.3 36.8zM628 11.3c-3.2-2.9-7.9-5.7-14.2-5.7 -9.5 0-14.8 6.5-14.8 13.3v0.7c0 6.7 5.4 13 15.3 13 5.9 0 10.8-2.8 13.9-5.7l4 4.2c-3.9 3.8-10.5 7.1-18.3 7.1 -13.4 0-21.6-8.7-21.6-18.3v-1.2c0-9.6 8.9-18.7 21.9-18.7 7.5 0 14.3 3.1 18 7.1L628 11.3zM321.5 12.4c1.2 0.8 1.5 2.4 0.8 3.6l-6.1 9.4c-0.8 1.2-2.4 1.6-3.6 0.8l0 0c-1.2-0.8-1.5-2.4-0.8-3.6l6.1-9.4C318.7 11.9 320.3 11.6 321.5 12.4L321.5 12.4z" }), _jsx("path", { d: "M37.5 36.7l-4.7-8.9H11.7l-4.6 8.9H0L19.4 0.8H25l19.7 35.9H37.5zM22 7.8l-7.8 15.1h15.9L22 7.8zM82.8 36.7l-23.3-24 -2.3-2.5v26.6h-6.7v-36H57l22.6 24 2.3 2.6V0.8h6.7v35.9H82.8z" }), _jsx("path", { d: "M719.9 37l-4.8-8.9H694l-4.6 8.9h-7.1l19.5-36h5.6l19.8 36H719.9zM704.4 8l-7.8 15.1h15.9L704.4 8zM733 37V1h6.8v36H733zM781 37c-1.8 0-2.6-2.5-2.9-5.8l-0.2-3.7c-0.2-3.6-1.7-5.1-8.4-5.1h-12.8V37H750V1h19.6c10.8 0 15.7 4.3 15.7 9.9 0 3.9-2 7.7-9 9 7 0.5 8.5 3.7 8.6 7.9l0.1 3c0.1 2.5 0.5 4.3 2.2 6.1V37H781zM778.5 11.8c0-2.6-2.1-5.1-7.9-5.1h-13.8v10.8h14.4c5 0 7.3-2.4 7.3-5.2V11.8zM794.8 37V1h6.8v30.4h28.2V37H794.8zM836.7 37V1h6.8v36H836.7zM886.2 37l-23.4-24.1 -2.3-2.5V37h-6.8V1h6.5l22.7 24.1 2.3 2.6V1h6.8v36H886.2zM902.3 37V1H935v5.6h-26v9.2h20v5.5h-20v10.1h26V37H902.3z" })] }));
12
+ };
13
+ export default AutomatticBylineLogo;
@@ -0,0 +1,15 @@
1
+ import type React from 'react';
2
+ export interface AutomatticBylineLogoProps extends React.SVGProps<SVGSVGElement> {
3
+ /**
4
+ * Title for SVG.
5
+ */
6
+ title?: string;
7
+ /**
8
+ * Height for SVG.
9
+ */
10
+ height?: number;
11
+ /**
12
+ * Additional className for the a wrapper. `jp-automattic-byline-logo` always included
13
+ */
14
+ className?: string;
15
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ /**
3
+ * Automattic for Agencies Logo component
4
+ *
5
+ * @param {object} props - Component props
6
+ * @param {string} props.color - Color code for the logo text
7
+ * @return {React.ReactElement} Component template
8
+ */
9
+ export default function AutomatticForAgenciesLogo({ color, }: {
10
+ color: string;
11
+ }): React.ReactElement;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Path, SVG } from '@wordpress/components';
3
+ /**
4
+ * Automattic for Agencies Logo component
5
+ *
6
+ * @param {object} props - Component props
7
+ * @param {string} props.color - Color code for the logo text
8
+ * @return {React.ReactElement} Component template
9
+ */
10
+ export default function AutomatticForAgenciesLogo({ color = '#FFFFFF', }) {
11
+ return (_jsx(SVG, { clipRule: "evenodd", fillRule: "evenodd", width: "251", height: "47", viewBox: "0 0 251 47", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx(Path, { d: "M20.256 17H17.04L14.928 13.04L5.544 13.04L3.504 17H0.336L8.976 1.016L11.472 1.016L20.256 17ZM13.752 10.856L10.152 4.136L6.672 10.856L13.752 10.856ZM42.7174 10.352C42.7174 14.312 40.1734 17.624 34.1494 17.624C28.4134 17.624 25.7494 14.504 25.7494 10.352L25.7494 1.016H28.7254L28.7254 10.4C28.7254 13.352 30.6694 15.104 34.3654 15.104C38.1574 15.104 39.7174 13.352 39.7174 10.4V1.016L42.7174 1.016V10.352ZM66.6443 3.512L59.6603 3.512V17H56.6603V3.512L49.6763 3.512V1.016L66.6443 1.016V3.512ZM91.1207 9.296C91.1207 13.544 87.4487 17.624 81.7607 17.624C76.0967 17.624 72.4247 13.544 72.4247 9.296V8.768C72.4247 4.448 76.0967 0.439999 81.7607 0.439999C87.4487 0.439999 91.1207 4.448 91.1207 8.768V9.296ZM88.0967 9.2V8.816C88.0967 5.72 85.8407 2.96 81.7607 2.96C77.6807 2.96 75.4487 5.72 75.4487 8.816V9.2C75.4487 12.296 77.6807 15.104 81.7607 15.104C85.8407 15.104 88.0967 12.296 88.0967 9.2ZM120.609 17H117.609V4.352L116.817 5.744L110.121 17H108.657L102.033 5.744L101.241 4.352V17H98.3128V1.016H102.465L108.777 11.984L109.521 13.328L110.265 11.984L116.505 1.016L120.609 1.016V17ZM146.748 17H143.532L141.42 13.04H132.036L129.996 17H126.828L135.468 1.016H137.964L146.748 17ZM140.244 10.856L136.644 4.136L133.164 10.856L140.244 10.856ZM166.919 3.512L159.935 3.512V17L156.935 17V3.512L149.951 3.512V1.016L166.919 1.016V3.512ZM190.136 3.512H183.152V17H180.152V3.512H173.168V1.016L190.136 1.016V3.512ZM200.346 17H197.346V1.016L200.346 1.016V17ZM225.532 3.632L223.66 5.528C222.22 4.208 220.108 2.96 217.252 2.96C212.98 2.96 210.58 5.888 210.58 8.936V9.248C210.58 12.272 213.004 15.104 217.468 15.104C220.132 15.104 222.34 13.832 223.732 12.536L225.532 14.432C223.78 16.16 220.804 17.624 217.276 17.624C211.228 17.624 207.556 13.688 207.556 9.368V8.84C207.556 4.52 211.564 0.439999 217.42 0.439999C220.804 0.439999 223.876 1.856 225.532 3.632ZM16.512 32.512H5.256L5.256 37.096H13.632V39.472H5.256L5.256 46H2.28L2.28 30.016H16.512V32.512ZM40.8426 38.296C40.8426 42.544 37.1706 46.624 31.4826 46.624C25.8186 46.624 22.1466 42.544 22.1466 38.296V37.768C22.1466 33.448 25.8186 29.44 31.4826 29.44C37.1706 29.44 40.8426 33.448 40.8426 37.768V38.296ZM37.8186 38.2V37.816C37.8186 34.72 35.5626 31.96 31.4826 31.96C27.4026 31.96 25.1706 34.72 25.1706 37.816V38.2C25.1706 41.296 27.4026 44.104 31.4826 44.104C35.5626 44.104 37.8186 41.296 37.8186 38.2ZM64.5227 46H61.8107C60.9947 46 60.6347 44.872 60.5387 43.432L60.4427 41.8C60.3467 40.216 59.6987 39.544 56.6987 39.544H51.0347V46H48.0347V30.016H56.7467C61.5467 30.016 63.7067 31.936 63.7067 34.408C63.7067 36.16 62.8187 37.816 59.6987 38.392C62.8187 38.632 63.4907 40.048 63.5147 41.92L63.5387 43.24C63.5627 44.344 63.7547 45.136 64.5227 45.928V46ZM60.6827 34.984V34.792C60.6827 33.64 59.7467 32.512 57.1787 32.512H51.0347V37.312H57.4427C59.6507 37.312 60.6827 36.256 60.6827 34.984ZM101.054 46H97.8384L95.7264 42.04L86.3424 42.04L84.3024 46H81.1344L89.7744 30.016H92.2704L101.054 46ZM94.5504 39.856L90.9504 33.136L87.4704 39.856H94.5504ZM123.597 46H121.677L121.221 43.84C119.685 45.616 117.501 46.624 114.789 46.624C109.125 46.624 105.453 42.736 105.453 38.296V38.008C105.453 33.472 109.461 29.44 115.317 29.44C118.917 29.44 121.845 30.928 123.429 32.632L121.557 34.528C120.117 33.208 117.885 31.96 115.293 31.96C110.829 31.96 108.477 34.816 108.477 37.936V38.2C108.477 41.32 110.997 44.104 115.077 44.104C118.173 44.104 120.381 42.208 120.381 40.288V40.12H115.461V37.744H123.597V46ZM145.697 46L131.177 46V30.016L145.697 30.016V32.512L134.177 32.512V36.616H143.033V39.04H134.177V43.504L145.697 43.504V46ZM170.003 46H167.411L157.019 35.296L156.011 34.168V46H153.011V30.016H155.891L165.971 40.696L167.003 41.848V30.016H170.003V46ZM195.19 32.632L193.318 34.528C191.878 33.208 189.766 31.96 186.91 31.96C182.638 31.96 180.238 34.888 180.238 37.936V38.248C180.238 41.272 182.662 44.104 187.126 44.104C189.79 44.104 191.998 42.832 193.39 41.536L195.19 43.432C193.438 45.16 190.462 46.624 186.934 46.624C180.886 46.624 177.214 42.688 177.214 38.368V37.84C177.214 33.52 181.222 29.44 187.078 29.44C190.462 29.44 193.534 30.856 195.19 32.632ZM205.164 46L202.164 46V30.016L205.164 30.016V46ZM227.855 46H213.335V30.016H227.855V32.512H216.335V36.616H225.191V39.04H216.335V43.504H227.855V46ZM251.009 41.512C251.009 44.632 247.601 46.624 242.849 46.624C239.609 46.624 236.609 45.736 234.137 44.56L235.241 42.184C237.761 43.432 240.425 44.176 242.993 44.176C246.449 44.176 247.985 43.048 247.985 41.824C247.985 38.008 234.593 40.552 234.593 34.696C234.593 31.72 237.809 29.44 242.873 29.44C246.017 29.44 248.945 30.544 250.745 31.72L249.113 33.736C247.625 32.776 245.177 31.888 242.777 31.888C239.657 31.888 237.593 32.944 237.593 34.312C237.593 37.792 251.009 35.464 251.009 41.512Z", fill: color }) }));
12
+ }
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ /**
3
+ * Automattic Icon Logo component
4
+ *
5
+ * @param {object} props - Component props
6
+ * @param {string} props.innerColor - Color code for the line in the middle of the logo.
7
+ * @param {string} props.outerColor - Color code for the logo's outer
8
+ * @return {React.ReactElement} Component template
9
+ */
10
+ export default function AutomatticIconLogo({ innerColor, outerColor, }: {
11
+ innerColor: string;
12
+ outerColor: string;
13
+ }): React.ReactElement;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Path, SVG } from '@wordpress/components';
3
+ /**
4
+ * Automattic Icon Logo component
5
+ *
6
+ * @param {object} props - Component props
7
+ * @param {string} props.innerColor - Color code for the line in the middle of the logo.
8
+ * @param {string} props.outerColor - Color code for the logo's outer
9
+ * @return {React.ReactElement} Component template
10
+ */
11
+ export default function AutomatticIconLogo({ innerColor = '#00A3E0', outerColor = '#FFFFFF', }) {
12
+ return (_jsxs(SVG, { clipRule: "evenodd", fill: "none", fillRule: "evenodd", height: "43", viewBox: "0 0 47 43", width: "47", xmlns: "http://www.w3.org/2000/svg", children: [_jsx(Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M39.3164 20.9589C39.3164 13.2129 33.656 6.30469 23.4214 6.30469C13.1867 6.30469 7.58624 13.2129 7.58624 20.9589V21.9206C7.58624 29.6677 13.1867 36.6942 23.4214 36.6942C33.656 36.6942 39.3164 29.6677 39.3164 21.9206V20.9589ZM23.4214 43C9.21187 43 0 32.7913 0 22.1604V20.8407C0 10.0285 9.21187 0 23.4214 0C37.6919 0 46.9038 10.0285 46.9038 20.8407V22.1604C46.9038 32.7913 37.6919 43 23.4214 43Z", fill: innerColor }), _jsx(Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M28.4548 14.1897C29.752 15.0401 30.1158 16.8077 29.2739 18.1343L22.712 28.4682C21.8691 29.7959 20.1348 30.1799 18.8397 29.3295C17.5446 28.477 17.1765 26.7137 18.0205 25.386L24.5824 15.0522C25.4253 13.7256 27.1597 13.3404 28.4548 14.1897Z", fill: outerColor })] }));
13
+ }
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ type BadgeProps = {
3
+ children?: React.ReactNode;
4
+ className?: string;
5
+ variant?: 'success' | 'warning' | 'danger';
6
+ [key: string]: unknown;
7
+ };
8
+ /**
9
+ * Badge component
10
+ *
11
+ * @param {object} props - The component properties.
12
+ * @param {string} props.variant - The badge variant (i.e. 'success', 'warning', 'danger').
13
+ * @param {JSX.Element} props.children - Badge text or content.
14
+ * @param {string} props.className - Additional class name to pass to the Badge component.
15
+ *
16
+ * @return {React.ReactElement} The `Badge` component.
17
+ */
18
+ declare const Badge: React.FC<BadgeProps>;
19
+ export default Badge;
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import clsx from 'clsx';
3
+ import styles from './style.module.scss';
4
+ /**
5
+ * Badge component
6
+ *
7
+ * @param {object} props - The component properties.
8
+ * @param {string} props.variant - The badge variant (i.e. 'success', 'warning', 'danger').
9
+ * @param {JSX.Element} props.children - Badge text or content.
10
+ * @param {string} props.className - Additional class name to pass to the Badge component.
11
+ *
12
+ * @return {React.ReactElement} The `Badge` component.
13
+ */
14
+ const Badge = ({ children, className, variant, ...props }) => {
15
+ const classes = clsx(styles.badge, {
16
+ [styles['is-success']]: variant === 'success',
17
+ [styles['is-warning']]: variant === 'warning',
18
+ [styles['is-danger']]: variant === 'danger',
19
+ }, className);
20
+ return (_jsx("span", { className: classes, ...props, children: children }));
21
+ };
22
+ export default Badge;
@@ -0,0 +1,5 @@
1
+ import type { BoostScoreBarProps } from './types.js';
2
+ import type { FunctionComponent } from 'react';
3
+ import './style.scss';
4
+ export declare const BoostScoreBar: FunctionComponent<BoostScoreBarProps>;
5
+ export default BoostScoreBar;
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { __ } from '@wordpress/i18n';
3
+ import clsx from 'clsx';
4
+ import Gridicon from '../gridicon/index.js';
5
+ import './style.scss';
6
+ export const BoostScoreBar = ({ score, isLoading, showPrevScores, active, prevScore = 0, scoreBarType, noBoostScoreTooltip, }) => {
7
+ if (!active) {
8
+ return null;
9
+ }
10
+ const prevScoreOffset = (prevScore / score) * 100;
11
+ const desktopIconLabel = __('Desktop score', 'jetpack-components');
12
+ const mobileIconLabel = __('Mobile score', 'jetpack-components');
13
+ const getIcon = () => {
14
+ if (scoreBarType === 'desktop') {
15
+ return _jsx(Gridicon, { icon: "computer", size: 24 });
16
+ }
17
+ return _jsx(Gridicon, { icon: "phone", size: 24 });
18
+ };
19
+ const getFillColor = () => {
20
+ // This shows the loading color unless a score already exists.
21
+ // In that case, shows the color based on the current score while refreshing.
22
+ if (isLoading && !score) {
23
+ return 'fill-loading';
24
+ }
25
+ if (score > 70) {
26
+ return 'fill-good';
27
+ }
28
+ if (score > 50) {
29
+ return 'fill-mediocre';
30
+ }
31
+ return 'fill-bad';
32
+ };
33
+ return (_jsxs("div", { className: clsx('jb-score-bar', `jb-score-bar--${scoreBarType}`), children: [_jsxs("div", { className: "jb-score-bar__label", children: [getIcon(), _jsx("div", { children: scoreBarType === 'desktop' ? desktopIconLabel : mobileIconLabel })] }), _jsx("div", { className: "jb-score-bar__bounds", children: _jsxs("div", { className: clsx('jb-score-bar__filler', getFillColor()), style: { width: `${score}%` }, children: [isLoading ? (_jsx("div", { className: "jb-score-bar__loading", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 128 128", children: _jsxs("g", { children: [_jsx("path", { d: "M64 0a7 7 0 11-7 7 7 7 0 017-7zm29.86 12.2a2.8 2.8 0 11-3.83 1.02 2.8 2.8 0 013.83-1.02zm22.16 21.68a3.15 3.15 0 11-4.3-1.15 3.15 3.15 0 014.3 1.15zm.87 60.53a4.2 4.2 0 11-1.57-5.7 4.2 4.2 0 011.54 5.73zm7.8-30.5a3.85 3.85 0 11-3.85-3.85 3.85 3.85 0 013.85 3.84zm-30 53.2a4.55 4.55 0 111.66-6.23 4.55 4.55 0 01-1.67 6.22zM64 125.9a4.9 4.9 0 114.9-4.9 4.9 4.9 0 01-4.9 4.9zm-31.06-8.22a5.25 5.25 0 117.17-1.93 5.25 5.25 0 01-7.14 1.93zM9.9 95.1a5.6 5.6 0 117.65 2.06A5.6 5.6 0 019.9 95.1zM1.18 63.9a5.95 5.95 0 115.95 5.94 5.95 5.95 0 01-5.96-5.94zm8.1-31.6a6.3 6.3 0 112.32 8.6 6.3 6.3 0 01-2.3-8.6zM32.25 8.87a6.65 6.65 0 11-2.44 9.1 6.65 6.65 0 012.46-9.1z" }), _jsx("animateTransform", { attributeName: "transform", type: "rotate", values: "0 64 64;30 64 64;60 64 64;90 64 64;120 64 64;150 64 64;180 64 64;210 64 64;240 64 64;270 64 64;300 64 64;330 64 64", calcMode: "discrete", dur: "1080ms", repeatCount: "indefinite" })] }) }) })) : (_jsx("div", { className: "jb-score-bar__score", children: score })), showPrevScores && !!prevScore && prevScore < score && (_jsxs("div", { className: "jb-score-bar__no_boost_score", style: { left: `min(${prevScoreOffset}%, calc( 100% - var(--clearance-space))` }, children: [prevScore, noBoostScoreTooltip && (_jsx("div", { role: "tooltip", className: "jb-score-bar__no_boost_score_tooltip", children: noBoostScoreTooltip }))] }))] }) })] }));
34
+ };
35
+ export default BoostScoreBar;
@@ -0,0 +1,9 @@
1
+ export interface BoostScoreBarProps {
2
+ score: number;
3
+ prevScore?: number;
4
+ isLoading: boolean;
5
+ showPrevScores: boolean;
6
+ active: boolean;
7
+ scoreBarType: 'mobile' | 'desktop';
8
+ noBoostScoreTooltip: string | null;
9
+ }
@@ -0,0 +1 @@
1
+ export {};