newspack-components 3.0.0 → 4.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 (197) hide show
  1. package/colors/colors.module.scss +277 -0
  2. package/copy-styles.js +8 -1
  3. package/dist/cjs/action-card/action-card.d.js +5 -0
  4. package/dist/cjs/action-card/index.js +282 -186
  5. package/dist/cjs/action-card/style.scss +142 -44
  6. package/dist/cjs/autocomplete-tokenfield/index.js +6 -2
  7. package/dist/cjs/box-contrast/index.js +49 -0
  8. package/dist/cjs/button/index.js +1 -1
  9. package/dist/cjs/button-props/button-props.js +41 -0
  10. package/dist/cjs/button-props/index.js +13 -0
  11. package/dist/cjs/color-picker/index.js +11 -0
  12. package/dist/cjs/custom-select-control/style.scss +7 -12
  13. package/dist/cjs/footer/index.js +17 -24
  14. package/dist/cjs/footer/style.scss +0 -36
  15. package/dist/cjs/handoff-message/index.js +0 -3
  16. package/dist/cjs/hooks/useObjectState.js +9 -0
  17. package/dist/cjs/hooks/useObjectState.test.js +6 -6
  18. package/dist/cjs/image-upload/index.test.js +2 -2
  19. package/dist/cjs/index.js +7 -21
  20. package/dist/cjs/modal/index.js +16 -18
  21. package/dist/cjs/modal/style.scss +18 -7
  22. package/dist/cjs/newspack-icon/index.js +2 -2
  23. package/dist/cjs/newspack-icon/style.scss +3 -5
  24. package/dist/cjs/notice/index.js +1 -2
  25. package/dist/cjs/notice/style.scss +11 -9
  26. package/dist/cjs/plugin-installer/index.js +3 -3
  27. package/dist/cjs/plugin-settings/SettingsSection.js +2 -0
  28. package/dist/cjs/plugin-settings/index.js +4 -1
  29. package/dist/cjs/plugin-toggle/index.js +2 -0
  30. package/dist/cjs/popover/style.scss +5 -6
  31. package/dist/cjs/progress-bar/index.test.js +8 -9
  32. package/dist/cjs/progress-bar/style.scss +1 -2
  33. package/dist/cjs/proxied-imports/router.js +1 -2
  34. package/dist/cjs/radio-control/style.scss +8 -11
  35. package/dist/cjs/section-header/index.js +21 -1
  36. package/dist/cjs/select-control/ButtonGroupControl.js +2 -0
  37. package/dist/cjs/settings/SettingsCard.js +2 -6
  38. package/dist/cjs/sortable-newsletter-list-control/index.js +7 -5
  39. package/dist/cjs/sortable-newsletter-list-control/style.scss +11 -1
  40. package/dist/cjs/steps-list/style.scss +0 -3
  41. package/dist/cjs/steps-list-item/style.scss +1 -2
  42. package/dist/cjs/style-card/index.js +1 -0
  43. package/dist/cjs/style-card/style.scss +4 -5
  44. package/dist/cjs/style.scss +15 -0
  45. package/dist/cjs/tabbed-navigation/index.js +17 -7
  46. package/dist/cjs/tabbed-navigation/style.scss +2 -6
  47. package/dist/cjs/utils/color.js +35 -0
  48. package/dist/cjs/web-preview/index.js +1 -1
  49. package/dist/cjs/web-preview/style.scss +11 -11
  50. package/dist/cjs/with-wizard/index.js +80 -3
  51. package/dist/cjs/with-wizard/style.scss +34 -13
  52. package/dist/cjs/with-wizard-screen/index.js +3 -3
  53. package/dist/cjs/with-wizard-screen/style.scss +9 -9
  54. package/dist/cjs/wizard/index.js +38 -13
  55. package/dist/cjs/wizard/store/index.js +13 -5
  56. package/dist/cjs/wizard/store/utils.js +3 -1
  57. package/dist/esm/action-card/action-card.d.js +1 -0
  58. package/dist/esm/action-card/index.js +286 -188
  59. package/dist/esm/action-card/style.scss +142 -44
  60. package/dist/esm/autocomplete-tokenfield/index.js +6 -2
  61. package/dist/esm/box-contrast/index.js +44 -0
  62. package/dist/esm/button/index.js +1 -1
  63. package/dist/esm/button-props/button-props.js +34 -0
  64. package/dist/esm/button-props/index.js +1 -0
  65. package/dist/esm/color-picker/index.js +11 -0
  66. package/dist/esm/custom-select-control/style.scss +7 -12
  67. package/dist/esm/footer/index.js +18 -25
  68. package/dist/esm/footer/style.scss +0 -36
  69. package/dist/esm/handoff-message/index.js +0 -3
  70. package/dist/esm/hooks/useObjectState.js +12 -2
  71. package/dist/esm/hooks/useObjectState.test.js +7 -7
  72. package/dist/esm/hooks/usePrompt.js +2 -2
  73. package/dist/esm/image-upload/index.test.js +2 -2
  74. package/dist/esm/index.js +1 -3
  75. package/dist/esm/modal/index.js +17 -19
  76. package/dist/esm/modal/style.scss +18 -7
  77. package/dist/esm/newspack-icon/index.js +2 -2
  78. package/dist/esm/newspack-icon/style.scss +3 -5
  79. package/dist/esm/notice/index.js +1 -2
  80. package/dist/esm/notice/style.scss +11 -9
  81. package/dist/esm/plugin-installer/index.js +3 -3
  82. package/dist/esm/plugin-settings/SettingsSection.js +2 -0
  83. package/dist/esm/plugin-settings/index.js +4 -1
  84. package/dist/esm/plugin-toggle/index.js +2 -0
  85. package/dist/esm/popover/style.scss +5 -6
  86. package/dist/esm/progress-bar/index.test.js +7 -7
  87. package/dist/esm/progress-bar/style.scss +1 -2
  88. package/dist/esm/radio-control/style.scss +8 -11
  89. package/dist/esm/section-header/index.js +22 -0
  90. package/dist/esm/select-control/ButtonGroupControl.js +2 -0
  91. package/dist/esm/settings/SettingsCard.js +2 -6
  92. package/dist/esm/sortable-newsletter-list-control/index.js +8 -6
  93. package/dist/esm/sortable-newsletter-list-control/style.scss +11 -1
  94. package/dist/esm/steps-list/style.scss +0 -3
  95. package/dist/esm/steps-list-item/style.scss +1 -2
  96. package/dist/esm/style-card/index.js +1 -0
  97. package/dist/esm/style-card/style.scss +4 -5
  98. package/dist/esm/style.scss +15 -0
  99. package/dist/esm/tabbed-navigation/index.js +17 -7
  100. package/dist/esm/tabbed-navigation/style.scss +2 -6
  101. package/dist/esm/utils/color.js +29 -0
  102. package/dist/esm/web-preview/index.js +1 -1
  103. package/dist/esm/web-preview/style.scss +11 -11
  104. package/dist/esm/with-wizard/index.js +81 -4
  105. package/dist/esm/with-wizard/style.scss +34 -13
  106. package/dist/esm/with-wizard-screen/index.js +1 -1
  107. package/dist/esm/with-wizard-screen/style.scss +9 -9
  108. package/dist/esm/wizard/index.js +39 -13
  109. package/dist/esm/wizard/store/index.js +14 -6
  110. package/dist/esm/wizard/store/utils.js +3 -1
  111. package/package.json +2 -2
  112. package/src/accordion/index.js +1 -3
  113. package/src/action-card/action-card.d.ts +40 -0
  114. package/src/action-card/index.js +284 -201
  115. package/src/action-card/style.scss +142 -44
  116. package/src/autocomplete-tokenfield/index.js +3 -2
  117. package/src/autocomplete-with-suggestions/index.js +52 -63
  118. package/src/box-contrast/index.tsx +44 -0
  119. package/src/button/index.tsx +1 -1
  120. package/src/button-card/index.js +1 -12
  121. package/src/card/index.js +1 -11
  122. package/src/category-autocomplete/index.js +4 -19
  123. package/src/color-picker/index.js +11 -7
  124. package/src/custom-select-control/style.scss +7 -12
  125. package/src/footer/index.js +6 -18
  126. package/src/footer/style.scss +0 -36
  127. package/src/form-token-field/index.js +1 -2
  128. package/src/grid/index.tsx +1 -8
  129. package/src/handoff/index.js +4 -11
  130. package/src/handoff-message/index.js +0 -3
  131. package/src/hooks/useObjectState.js +10 -2
  132. package/src/hooks/useObjectState.test.js +14 -14
  133. package/src/image-upload/index.js +3 -23
  134. package/src/index.js +1 -3
  135. package/src/modal/index.js +11 -17
  136. package/src/modal/style.scss +18 -7
  137. package/src/newspack-icon/index.js +3 -14
  138. package/src/newspack-icon/style.scss +3 -5
  139. package/src/notice/index.js +0 -2
  140. package/src/notice/style.scss +11 -9
  141. package/src/plugin-installer/index.js +8 -17
  142. package/src/plugin-settings/SettingsSection.js +3 -7
  143. package/src/plugin-settings/index.js +7 -14
  144. package/src/plugin-toggle/README.md +3 -3
  145. package/src/plugin-toggle/index.js +10 -13
  146. package/src/popover/index.js +1 -5
  147. package/src/popover/style.scss +5 -6
  148. package/src/position-control/index.js +65 -75
  149. package/src/progress-bar/index.js +2 -9
  150. package/src/progress-bar/index.test.js +4 -13
  151. package/src/progress-bar/style.scss +1 -2
  152. package/src/radio-control/style.scss +8 -11
  153. package/src/section-header/index.js +20 -0
  154. package/src/select-control/ButtonGroupControl.js +2 -9
  155. package/src/select-control/GroupedSelectControl.js +1 -9
  156. package/src/select-control/index.js +1 -5
  157. package/src/settings/MinMaxSetting.js +2 -14
  158. package/src/settings/SettingsCard.js +2 -11
  159. package/src/sortable-newsletter-list-control/index.js +10 -26
  160. package/src/sortable-newsletter-list-control/style.scss +11 -1
  161. package/src/steps-list/style.scss +0 -3
  162. package/src/steps-list-item/index.js +1 -4
  163. package/src/steps-list-item/style.scss +1 -2
  164. package/src/style-card/index.js +6 -21
  165. package/src/style-card/style.scss +4 -5
  166. package/src/style.scss +15 -0
  167. package/src/tabbed-navigation/index.js +19 -7
  168. package/src/tabbed-navigation/style.scss +2 -6
  169. package/src/text-control/index.tsx +2 -12
  170. package/src/utils/color.ts +32 -0
  171. package/src/web-preview/style.scss +11 -11
  172. package/src/with-wizard/index.js +67 -16
  173. package/src/with-wizard/style.scss +34 -13
  174. package/src/with-wizard-screen/index.js +1 -1
  175. package/src/with-wizard-screen/style.scss +9 -9
  176. package/src/wizard/components/WizardError.js +2 -7
  177. package/src/wizard/index.js +64 -62
  178. package/src/wizard/store/index.js +8 -10
  179. package/src/wizard/store/utils.js +3 -4
  180. package/dist/cjs/date-range-picker/index.js +0 -39
  181. package/dist/cjs/date-range-picker/style.scss +0 -148
  182. package/dist/cjs/newspack-logo/index.js +0 -54
  183. package/dist/cjs/newspack-logo/style.scss +0 -30
  184. package/dist/cjs/patrons-logo/index.js +0 -77
  185. package/dist/esm/date-range-picker/index.js +0 -31
  186. package/dist/esm/date-range-picker/style.scss +0 -148
  187. package/dist/esm/newspack-logo/index.js +0 -46
  188. package/dist/esm/newspack-logo/style.scss +0 -30
  189. package/dist/esm/patrons-logo/index.js +0 -70
  190. package/shared/scss/_colors.scss +0 -27
  191. package/src/date-range-picker/index.js +0 -31
  192. package/src/date-range-picker/style.scss +0 -148
  193. package/src/newspack-logo/index.js +0 -45
  194. package/src/newspack-logo/style.scss +0 -30
  195. package/src/patrons-logo/index.js +0 -76
  196. /package/{shared/js → src/button-props}/button-props.js +0 -0
  197. /package/{shared/js → src/button-props}/index.js +0 -0
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { render, screen, fireEvent } from '@testing-library/react';
2
+ import { render, screen, fireEvent, act } from '@testing-library/react';
3
3
  import useObjectState from './useObjectState';
4
4
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  const INIT_STATE = {
@@ -47,31 +47,31 @@ const TestComponent = () => {
47
47
  describe('useObjectState', () => {
48
48
  const getState = () => JSON.parse(screen.getByPlaceholderText('state').getAttribute('value'));
49
49
  beforeEach(() => {
50
- render( /*#__PURE__*/_jsx(TestComponent, {}));
50
+ render(/*#__PURE__*/_jsx(TestComponent, {}));
51
51
  });
52
52
  it('updates arrays', () => {
53
53
  expect(getState()).toStrictEqual(INIT_STATE);
54
- screen.getByText('Remove widgets').click();
54
+ act(() => screen.getByText('Remove widgets').click());
55
55
  expect(getState()).toMatchObject({
56
56
  widgets: []
57
57
  });
58
- screen.getByText('Add widget').click();
58
+ act(() => screen.getByText('Add widget').click());
59
59
  expect(getState()).toMatchObject({
60
60
  widgets: [1]
61
61
  });
62
62
  });
63
63
  it('updates a simple value', () => {
64
- fireEvent.change(screen.getByPlaceholderText('name'), {
64
+ act(() => fireEvent.change(screen.getByPlaceholderText('name'), {
65
65
  target: {
66
66
  value: 'Ramon'
67
67
  }
68
- });
68
+ }));
69
69
  expect(getState()).toMatchObject({
70
70
  name: 'Ramon'
71
71
  });
72
72
  });
73
73
  it('updates a nested object', () => {
74
- screen.getByText('Nested update').click();
74
+ act(() => screen.getByText('Nested update').click());
75
75
  expect(getState()).toMatchObject({
76
76
  attributes: {
77
77
  bar: 2,
@@ -12,7 +12,7 @@ import Router from '../proxied-imports/router';
12
12
  const {
13
13
  useHistory
14
14
  } = Router;
15
- export default ((when, message) => {
15
+ export default (when, message) => {
16
16
  const history = useHistory();
17
17
  const self = useRef(null);
18
18
  const onWindowOrTabClose = event => {
@@ -37,4 +37,4 @@ export default ((when, message) => {
37
37
  };
38
38
  }, [message, when]);
39
39
  return self.current || (() => {});
40
- });
40
+ };
@@ -12,7 +12,7 @@ describe('ImageUpload', () => {
12
12
  it('should render an add image button', () => {
13
13
  const {
14
14
  getByText
15
- } = render( /*#__PURE__*/_jsx(ImageUpload, {}));
15
+ } = render(/*#__PURE__*/_jsx(ImageUpload, {}));
16
16
  expect(getByText('Upload')).toBeInTheDocument();
17
17
  });
18
18
  it('should render replace and remove buttons if there is an image provided', () => {
@@ -23,7 +23,7 @@ describe('ImageUpload', () => {
23
23
  const {
24
24
  getByText,
25
25
  getByTestId
26
- } = render( /*#__PURE__*/_jsx(ImageUpload, {
26
+ } = render(/*#__PURE__*/_jsx(ImageUpload, {
27
27
  image: image
28
28
  }));
29
29
  expect(getByText('Remove')).toBeInTheDocument();
package/dist/esm/index.js CHANGED
@@ -4,6 +4,7 @@ export { default as AutocompleteTokenField } from './autocomplete-tokenfield';
4
4
  export { default as AutocompleteWithSuggestions } from './autocomplete-with-suggestions';
5
5
  export { default as Button } from './button';
6
6
  export { default as ButtonCard } from './button-card';
7
+ export { default as BoxContrast } from './box-contrast';
7
8
  export { default as Card } from './card';
8
9
  export { default as CategoryAutocomplete } from './category-autocomplete';
9
10
  export { default as ColorPicker } from './color-picker';
@@ -18,9 +19,7 @@ export { default as GlobalNotices } from './global-notices';
18
19
  export { default as Grid } from './grid';
19
20
  export { default as Modal } from './modal';
20
21
  export { default as NewspackIcon } from './newspack-icon';
21
- export { default as NewspackLogo } from './newspack-logo';
22
22
  export { default as Notice } from './notice';
23
- export { default as PatronsLogo } from './patrons-logo';
24
23
  export { default as PluginInstaller } from './plugin-installer';
25
24
  export { default as PluginSettings } from './plugin-settings';
26
25
  export { default as PluginToggle } from './plugin-toggle';
@@ -29,7 +28,6 @@ export { default as ProgressBar } from './progress-bar';
29
28
  export { default as RadioControl } from './radio-control';
30
29
  export { default as SectionHeader } from './section-header';
31
30
  export { default as SelectControl } from './select-control';
32
- export { default as DateRangePicker } from './date-range-picker';
33
31
  export { default as Settings } from './settings';
34
32
  export { default as StepsList } from './steps-list';
35
33
  export { default as StepsListItem } from './steps-list-item';
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * WordPress dependencies.
7
7
  */
8
- import { Component } from '@wordpress/element';
8
+ import { forwardRef } from '@wordpress/element';
9
9
  import { Modal as BaseComponent } from '@wordpress/components';
10
10
 
11
11
  /**
@@ -18,22 +18,20 @@ import './style.scss';
18
18
  */
19
19
  import classnames from 'classnames';
20
20
  import { jsx as _jsx } from "react/jsx-runtime";
21
- class Modal extends Component {
22
- /**
23
- * Render.
24
- */
25
- render() {
26
- const {
27
- className,
28
- isWide,
29
- isNarrow,
30
- ...otherProps
31
- } = this.props;
32
- const classes = classnames('newspack-modal', isWide && 'newspack-modal--wide', isNarrow && 'newspack-modal--narrow', className);
33
- return /*#__PURE__*/_jsx(BaseComponent, {
34
- className: classes,
35
- ...otherProps
36
- });
37
- }
21
+ function Modal({
22
+ className,
23
+ isWide,
24
+ isNarrow,
25
+ hideTitle,
26
+ ...otherProps
27
+ }, ref) {
28
+ const classes = classnames('newspack-modal', isWide && 'newspack-modal--wide', isNarrow && 'newspack-modal--narrow', hideTitle && 'newspack-modal--hide-title',
29
+ // Note: also hides the X close button.
30
+ className);
31
+ return /*#__PURE__*/_jsx(BaseComponent, {
32
+ className: classes,
33
+ ...otherProps,
34
+ ref: ref
35
+ });
38
36
  }
39
- export default Modal;
37
+ export default forwardRef(Modal);
@@ -2,16 +2,16 @@
2
2
  * Modal
3
3
  */
4
4
 
5
- @use "../../../shared/scss/colors";
5
+ @use "../../../colors/colors.module" as colors;
6
6
 
7
7
  .newspack-modal {
8
8
  // Color
9
- --wp-admin-theme-color: #{colors.$primary-500};
10
- --wp-admin-theme-color--rgb: #{colors.$primary-500--rgb};
11
- --wp-admin-theme-color-darker-10: #{colors.$primary-600};
12
- --wp-admin-theme-color-darker-10--rgb: #{colors.$primary-600--rgb};
13
- --wp-admin-theme-color-darker-20: #{colors.$primary-700};
14
- --wp-admin-theme-color-darker-20--rgb: #{colors.$primary-700--rgb};
9
+ --wp-admin-theme-color: #{colors.$primary-600};
10
+ --wp-admin-theme-color--rgb: #{colors.$primary-600--rgb};
11
+ --wp-admin-theme-color-darker-10: #{colors.$primary-700};
12
+ --wp-admin-theme-color-darker-10--rgb: #{colors.$primary-700--rgb};
13
+ --wp-admin-theme-color-darker-20: #{colors.$primary-800};
14
+ --wp-admin-theme-color-darker-20--rgb: #{colors.$primary-800--rgb};
15
15
 
16
16
  @media screen and ( min-width: 744px ) {
17
17
  max-width: 680px;
@@ -28,6 +28,17 @@
28
28
  width: 360px;
29
29
  }
30
30
 
31
+ &--hide-title {
32
+ .components-modal__header {
33
+ display: none;
34
+ }
35
+
36
+ .components-modal__content {
37
+ margin-top: 0;
38
+ padding-top: 32px;
39
+ }
40
+ }
41
+
31
42
  @media screen and ( min-width: 960px ) {
32
43
  max-height: calc(100% - 128px);
33
44
  }
@@ -34,12 +34,12 @@ class NewspackIcon extends Component {
34
34
  xmlns: "http://www.w3.org/2000/svg",
35
35
  height: size,
36
36
  width: size,
37
- viewBox: "0 0 32 32",
37
+ viewBox: "0 0 24 24",
38
38
  className: classes,
39
39
  children: /*#__PURE__*/_jsx(Path, {
40
40
  fillRule: "evenodd",
41
41
  clipRule: "evenodd",
42
- d: "M32 16c0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16S7.164 0 16 0s16 7.164 16 16zm-10.732.622h1.72v-1.124h-2.823l1.103 1.124zm-3.249-3.31h4.97v-1.124h-6.072l1.102 1.124zm-3.248-3.31h8.217V8.877h-9.32l1.103 1.125zM9.01 8.877l13.977 14.246h-4.66l-5.866-5.98v5.98h-3.45V8.877z"
42
+ d: "M24 12C24 18.6271 18.6271 24 12 24C5.37213 24 0 18.6271 0 12C0 5.3729 5.3729 0 12 0C18.6271 0 24 5.3729 24 12ZM17.4545 17.4546L6.54545 6.54545V17.4545H8.72727V11.8182L14.3636 17.4546H17.4545ZM11.2727 8.18182H17.4545V6.54545H9.63636L11.2727 8.18182ZM17.4545 11.2727H14.3636L12.7273 9.63636H17.4545V11.2727ZM17.4545 12.7273V14.3636L15.8182 12.7273H17.4545Z"
43
43
  })
44
44
  });
45
45
  }
@@ -2,21 +2,19 @@
2
2
  * Newspack Icon
3
3
  */
4
4
 
5
- @use "../../../shared/scss/colors";
6
-
7
5
  .newspack-icon {
8
- background: colors.$primary-500;
6
+ background: var(--wp-admin-theme-color);
9
7
  fill: white;
10
8
  padding: 12px;
11
9
 
12
10
  &--white {
13
11
  background: white;
14
- fill: colors.$primary-500;
12
+ fill: var(--wp-admin-theme-color);
15
13
  }
16
14
 
17
15
  &--simple {
18
16
  background: none;
19
- fill: colors.$primary-500;
17
+ fill: var(--wp-admin-theme-color);
20
18
  padding: 0;
21
19
  }
22
20
 
@@ -7,7 +7,6 @@
7
7
  */
8
8
  import { Component, RawHTML } from '@wordpress/element';
9
9
  import { Icon, bug, check, help, info } from '@wordpress/icons';
10
- import { __ } from '@wordpress/i18n';
11
10
 
12
11
  /**
13
12
  * Internal dependencies.
@@ -57,7 +56,7 @@ class Notice extends Component {
57
56
  className: "newspack-notice__content",
58
57
  children: [rawHTML ? /*#__PURE__*/_jsx(RawHTML, {
59
58
  children: noticeText
60
- }) : noticeText, debugMode && __('Debug Mode', 'newspack-plugin'), children || null]
59
+ }) : noticeText, children || null]
61
60
  })]
62
61
  });
63
62
  }
@@ -4,7 +4,7 @@
4
4
 
5
5
  @use "sass:color";
6
6
  @use "~@wordpress/base-styles/colors" as wp-colors;
7
- @use "../../../shared/scss/colors";
7
+ @use "../../../colors/colors.module" as colors;
8
8
 
9
9
  .newspack-notice {
10
10
  align-items: center;
@@ -13,7 +13,7 @@
13
13
  display: flex;
14
14
  justify-content: flex-start;
15
15
  margin: 32px 0;
16
- padding: 6px 8px;
16
+ padding: 8px 12px;
17
17
 
18
18
  > svg {
19
19
  display: block;
@@ -23,24 +23,26 @@
23
23
  }
24
24
 
25
25
  &__is-debug {
26
- background: colors.$primary-700;
27
- border-radius: 2px;
26
+ background: colors.$primary-600;
27
+ border-radius: 50%;
28
28
  bottom: 16px;
29
29
  box-shadow: 0 0 8px 4px rgba(black, 0.08);
30
30
  color: white;
31
31
  font-weight: bold;
32
32
  margin: 0 16px;
33
+ padding: 6px;
33
34
  position: fixed;
34
35
  text-transform: uppercase;
35
36
  z-index: 9997;
36
37
 
37
38
  > svg {
38
39
  fill: white;
40
+ margin: 0;
39
41
  }
40
42
  }
41
43
 
42
44
  &__is-error {
43
- background: color.adjust(wp-colors.$alert-red, $lightness: 51%);
45
+ background: color.adjust(wp-colors.$alert-red, $lightness: 35%);
44
46
 
45
47
  > svg {
46
48
  fill: wp-colors.$alert-red;
@@ -49,7 +51,7 @@
49
51
  }
50
52
 
51
53
  &__is-handoff {
52
- background: color.adjust(wp-colors.$alert-yellow, $lightness: 30%);
54
+ background: color.adjust(wp-colors.$alert-yellow, $lightness: 35%);
53
55
  margin-top: 0;
54
56
  position: sticky;
55
57
  top: 46px;
@@ -64,12 +66,12 @@
64
66
  background: colors.$primary-050;
65
67
 
66
68
  > svg {
67
- fill: colors.$primary-500;
69
+ fill: var(--wp-admin-theme-color);
68
70
  }
69
71
  }
70
72
 
71
73
  &__is-success {
72
- background: color.adjust(wp-colors.$alert-green, $lightness: 42%);
74
+ background: color.adjust(wp-colors.$alert-green, $lightness: 45%);
73
75
 
74
76
  > svg {
75
77
  fill: wp-colors.$alert-green;
@@ -77,7 +79,7 @@
77
79
  }
78
80
 
79
81
  &__is-warning {
80
- background: color.adjust(wp-colors.$alert-yellow, $lightness: 30%);
82
+ background: color.adjust(wp-colors.$alert-yellow, $lightness: 35%);
81
83
 
82
84
  > svg {
83
85
  fill: wp-colors.$alert-yellow;
@@ -183,8 +183,8 @@ class PluginInstaller extends Component {
183
183
  pluginInfo
184
184
  } = this.state;
185
185
  const {
186
- is_atomic: isAtomic
187
- } = window;
186
+ is_managed: isManaged
187
+ } = window.newspack_aux_data || {};
188
188
  const slugs = Object.keys(pluginInfo);
189
189
 
190
190
  // Store all plugin status info for installer button text value based on current status.
@@ -226,7 +226,7 @@ class PluginInstaller extends Component {
226
226
  } else if (!installable) {
227
227
  actionText = /*#__PURE__*/_jsxs("span", {
228
228
  className: "newspack-plugin-installer__status",
229
- children: [isAtomic ? __('Contact Newspack support to install', 'newspack-plugin') : __('Plugin must be installed manually', 'newspack-plugin'), /*#__PURE__*/_jsx("span", {
229
+ children: [isManaged ? __('Contact Newspack support to install', 'newspack-plugin') : __('Plugin must be installed manually', 'newspack-plugin'), /*#__PURE__*/_jsx("span", {
230
230
  className: "newspack-checkbox-icon"
231
231
  })]
232
232
  });
@@ -51,6 +51,7 @@ const getControlType = setting => {
51
51
  }
52
52
  };
53
53
  const SettingsSection = props => {
54
+ var _props$id;
54
55
  const [saveDisabled, setSaveDisabled] = useState(true);
55
56
  const {
56
57
  error,
@@ -91,6 +92,7 @@ const SettingsSection = props => {
91
92
  columns = 1;
92
93
  }
93
94
  return /*#__PURE__*/_jsx(ActionCard, {
95
+ id: (_props$id = props.id) !== null && _props$id !== void 0 ? _props$id : null,
94
96
  isMedium: true,
95
97
  disabled: disabled,
96
98
  title: title,
@@ -180,7 +180,8 @@ class PluginSettings extends Component {
180
180
  title,
181
181
  description,
182
182
  hasGreyHeader,
183
- children
183
+ children,
184
+ titleLevel = 1
184
185
  } = this.props;
185
186
  const {
186
187
  settings,
@@ -190,6 +191,7 @@ class PluginSettings extends Component {
190
191
  return /*#__PURE__*/_jsxs(Fragment, {
191
192
  children: [title && /*#__PURE__*/_jsx(SectionHeader, {
192
193
  title: title,
194
+ heading: titleLevel,
193
195
  description: description
194
196
  }), error && /*#__PURE__*/_jsx(Notice, {
195
197
  isError: true,
@@ -200,6 +202,7 @@ class PluginSettings extends Component {
200
202
  }),
201
203
  children: [Object.keys(settings).map(sectionKey => /*#__PURE__*/_jsx(SettingsSection, {
202
204
  disabled: inFlight,
205
+ id: `plugin-settings-${sectionKey}`,
203
206
  sectionKey: sectionKey,
204
207
  title: this.getSectionTitle(sectionKey),
205
208
  description: this.getSectionDescription(sectionKey),
@@ -97,6 +97,7 @@ class PluginToggle extends Component {
97
97
  pluginInfo
98
98
  } = this.state;
99
99
  return this.prepareDataForRender(plugins, pluginInfo).map((plugin, index) => {
100
+ var _plugin$onClick;
100
101
  const {
101
102
  name,
102
103
  description,
@@ -113,6 +114,7 @@ class PluginToggle extends Component {
113
114
  description: description,
114
115
  actionText: this.actionTextForPlugin(plugin),
115
116
  handoff: handoff,
117
+ onClick: (_plugin$onClick = plugin.onClick) !== null && _plugin$onClick !== void 0 ? _plugin$onClick : null,
116
118
  href: href,
117
119
  toggle: true,
118
120
  toggleChecked: this.isPluginInstalledAndActive(plugin),
@@ -2,7 +2,6 @@
2
2
  * Popover
3
3
  */
4
4
 
5
- @use "../../../shared/scss/colors";
6
5
  @use "~@wordpress/base-styles/colors" as wp-colors;
7
6
 
8
7
  .newspack-popover {
@@ -16,7 +15,7 @@
16
15
  padding: 6px 8px;
17
16
 
18
17
  &:hover {
19
- color: colors.$primary-500;
18
+ color: var(--wp-admin-theme-color);
20
19
 
21
20
  .components-menu-items__item-icon {
22
21
  fill: currentcolor;
@@ -24,7 +23,7 @@
24
23
  }
25
24
 
26
25
  &:focus:not(:disabled) {
27
- box-shadow: inset 0 0 0 2px colors.$primary-500;
26
+ box-shadow: inset 0 0 0 2px var(--wp-admin-theme-color);
28
27
  position: relative;
29
28
  z-index: 1;
30
29
  }
@@ -42,7 +41,7 @@
42
41
  &:focus,
43
42
  &:focus:enabled &:hover,
44
43
  &:not(:disabled, [aria-disabled="true"], .is-default):hover {
45
- color: colors.$primary-500;
44
+ color: var(--wp-admin-theme-color);
46
45
  }
47
46
  }
48
47
 
@@ -89,8 +88,8 @@
89
88
  min-height: 36px;
90
89
 
91
90
  &:focus ~ div.components-input-control__backdrop {
92
- border-color: colors.$primary-500;
93
- box-shadow: inset 0 0 0 1px colors.$primary-500;
91
+ border-color: var(--wp-admin-theme-color);
92
+ box-shadow: inset 0 0 0 1px var(--wp-admin-theme-color);
94
93
  }
95
94
  }
96
95
 
@@ -6,7 +6,7 @@ describe('ProgressBar', () => {
6
6
  it('should render a progress indicator', () => {
7
7
  const {
8
8
  getByTestId
9
- } = render( /*#__PURE__*/_jsx(ProgressBar, {
9
+ } = render(/*#__PURE__*/_jsx(ProgressBar, {
10
10
  completed: "1",
11
11
  total: "2"
12
12
  }));
@@ -17,7 +17,7 @@ describe('ProgressBar', () => {
17
17
  const label = 'test label';
18
18
  const {
19
19
  getByText
20
- } = render( /*#__PURE__*/_jsx(ProgressBar, {
20
+ } = render(/*#__PURE__*/_jsx(ProgressBar, {
21
21
  completed: "1",
22
22
  total: "2",
23
23
  label: label
@@ -27,7 +27,7 @@ describe('ProgressBar', () => {
27
27
  it('should render progress as a fraction', () => {
28
28
  const {
29
29
  getByText
30
- } = render( /*#__PURE__*/_jsx(ProgressBar, {
30
+ } = render(/*#__PURE__*/_jsx(ProgressBar, {
31
31
  completed: "1",
32
32
  total: "2",
33
33
  displayFraction: true
@@ -38,7 +38,7 @@ describe('ProgressBar', () => {
38
38
  const label = 'test label';
39
39
  const {
40
40
  getByText
41
- } = render( /*#__PURE__*/_jsx(ProgressBar, {
41
+ } = render(/*#__PURE__*/_jsx(ProgressBar, {
42
42
  completed: "1",
43
43
  total: "2",
44
44
  label: label,
@@ -73,7 +73,7 @@ describe('ProgressBar', () => {
73
73
  it(`with expected progress of ${expectedWidth}`, () => {
74
74
  const {
75
75
  getByTestId
76
- } = render( /*#__PURE__*/_createElement(ProgressBar, {
76
+ } = render(/*#__PURE__*/_createElement(ProgressBar, {
77
77
  ...props,
78
78
  key: expectedWidth
79
79
  }));
@@ -85,7 +85,7 @@ describe('ProgressBar', () => {
85
85
  const {
86
86
  getByText,
87
87
  getByTestId
88
- } = render( /*#__PURE__*/_jsx(ProgressBar, {
88
+ } = render(/*#__PURE__*/_jsx(ProgressBar, {
89
89
  completed: "cats",
90
90
  total: "dogs",
91
91
  displayFraction: true
@@ -97,7 +97,7 @@ describe('ProgressBar', () => {
97
97
  const {
98
98
  getByText,
99
99
  getByTestId
100
- } = render( /*#__PURE__*/_jsx(ProgressBar, {
100
+ } = render(/*#__PURE__*/_jsx(ProgressBar, {
101
101
  completed: "3",
102
102
  total: "-1",
103
103
  displayFraction: true
@@ -2,7 +2,6 @@
2
2
  * Progress Bar
3
3
  */
4
4
 
5
- @use "../../../shared/scss/colors";
6
5
  @use "~@wordpress/base-styles/colors" as wp-colors;
7
6
 
8
7
  .newspack-progress-bar {
@@ -35,7 +34,7 @@
35
34
  }
36
35
 
37
36
  &__bar {
38
- background-color: colors.$primary-500;
37
+ background-color: var(--wp-admin-theme-color);
39
38
  height: 8px;
40
39
  transition: width 125ms ease-in-out;
41
40
  }
@@ -2,7 +2,6 @@
2
2
  * Radio Control
3
3
  */
4
4
 
5
- @use "../../../shared/scss/colors";
6
5
  @use "~@wordpress/base-styles/colors" as wp-colors;
7
6
 
8
7
  .newspack-radio-control {
@@ -24,7 +23,6 @@
24
23
  }
25
24
 
26
25
  // Options
27
-
28
26
  .components-radio-control__option {
29
27
  align-items: center;
30
28
  display: flex;
@@ -40,20 +38,22 @@
40
38
  }
41
39
 
42
40
  // Radio
43
-
44
41
  input[type="radio"] {
45
42
  height: 24px;
46
- margin-right: 8px;
47
43
  width: 24px;
44
+ max-height: 24px;
45
+ max-width: 24px;
48
46
 
49
47
  @media screen and ( min-width: 782px ) {
50
48
  height: 20px;
51
49
  width: 20px;
50
+ max-height: 20px;
51
+ max-width: 20px;
52
52
  }
53
53
 
54
54
  &:checked {
55
- background-color: colors.$primary-500;
56
- border-color: colors.$primary-500;
55
+ background-color: var(--wp-admin-theme-color);
56
+ border-color: var(--wp-admin-theme-color);
57
57
 
58
58
  &::before {
59
59
  border: none;
@@ -61,20 +61,18 @@
61
61
  }
62
62
 
63
63
  &:focus {
64
- border-color: colors.$primary-500;
65
- box-shadow: 0 0 0 2px white, 0 0 0 3.5px colors.$primary-500;
64
+ border-color: var(--wp-admin-theme-color);
65
+ box-shadow: 0 0 0 2px white, 0 0 0 3.5px var(--wp-admin-theme-color);
66
66
  }
67
67
  }
68
68
 
69
69
  // Multiple Radio Controls
70
-
71
70
  & + & {
72
71
  margin-bottom: 32px;
73
72
  margin-top: -16px;
74
73
  }
75
74
 
76
75
  // Multiple Controls
77
-
78
76
  + .newspack-select-control,
79
77
  + .newspack-text-control {
80
78
  margin-bottom: 32px;
@@ -82,7 +80,6 @@
82
80
  }
83
81
 
84
82
  // Reset
85
-
86
83
  .components-base-control__field,
87
84
  .components-base-control__label,
88
85
  .components-base-control__help {
@@ -17,6 +17,26 @@ import './style.scss';
17
17
  * External dependencies
18
18
  */
19
19
  import classnames from 'classnames';
20
+
21
+ /**
22
+ * Represents a section header component.
23
+ *
24
+ * @typedef {Object} SectionHeaderProps
25
+ * @property {boolean} [centered=false] - Indicates if the header is centered.
26
+ * @property {?string} [className=null] - Additional CSS class name.
27
+ * @property {string|Function|*} [description] - Description of the section.
28
+ * @property {number} [heading=2] - HTML heading level, e.g., 1 for h1, 2 for h2, etc.
29
+ * @property {boolean} [isWhite=false] - Indicates if the header should use a white theme.
30
+ * @property {boolean} [noMargin=false] - Indicates if the header should have no margin.
31
+ * @property {string} title - The title of the section.
32
+ * @property {?string} [id=null] - Optional ID for the header element.
33
+ */
34
+
35
+ /**
36
+ * Creates a section header.
37
+ *
38
+ * @param {SectionHeaderProps} props - The properties for the section header.
39
+ */
20
40
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
21
41
  const SectionHeader = ({
22
42
  centered = false,
@@ -60,6 +80,8 @@ const SectionHeader = ({
60
80
  children: description
61
81
  }), typeof description === 'function' && /*#__PURE__*/_jsx("p", {
62
82
  children: description()
83
+ }), description && typeof description !== 'string' && typeof description !== 'function' && /*#__PURE__*/_jsx("p", {
84
+ children: description
63
85
  })]
64
86
  })
65
87
  });
@@ -18,6 +18,7 @@ const ButtonGroupControl = ({
18
18
  buttonOptions,
19
19
  buttonSmall,
20
20
  className,
21
+ help,
21
22
  hideLabelFromVision,
22
23
  label,
23
24
  onChange,
@@ -26,6 +27,7 @@ const ButtonGroupControl = ({
26
27
  const id = hooks.useUniqueId('button-group');
27
28
  return /*#__PURE__*/_jsx(BaseControl, {
28
29
  label: label,
30
+ help: help,
29
31
  hideLabelFromVision: hideLabelFromVision,
30
32
  id: id.current,
31
33
  className: classnames(className, 'components-select-control'),