newspack-components 3.1.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 (191) 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 -187
  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 +5 -5
  18. package/dist/cjs/index.js +7 -21
  19. package/dist/cjs/modal/index.js +4 -1
  20. package/dist/cjs/modal/style.scss +18 -7
  21. package/dist/cjs/newspack-icon/index.js +2 -2
  22. package/dist/cjs/newspack-icon/style.scss +3 -5
  23. package/dist/cjs/notice/index.js +1 -2
  24. package/dist/cjs/notice/style.scss +11 -9
  25. package/dist/cjs/plugin-installer/index.js +3 -3
  26. package/dist/cjs/plugin-settings/SettingsSection.js +2 -0
  27. package/dist/cjs/plugin-settings/index.js +4 -1
  28. package/dist/cjs/plugin-toggle/index.js +2 -0
  29. package/dist/cjs/popover/style.scss +5 -6
  30. package/dist/cjs/progress-bar/index.test.js +1 -2
  31. package/dist/cjs/progress-bar/style.scss +1 -2
  32. package/dist/cjs/proxied-imports/router.js +1 -2
  33. package/dist/cjs/radio-control/style.scss +4 -10
  34. package/dist/cjs/section-header/index.js +21 -1
  35. package/dist/cjs/select-control/ButtonGroupControl.js +2 -0
  36. package/dist/cjs/settings/SettingsCard.js +2 -6
  37. package/dist/cjs/sortable-newsletter-list-control/index.js +7 -5
  38. package/dist/cjs/sortable-newsletter-list-control/style.scss +11 -1
  39. package/dist/cjs/steps-list/style.scss +0 -3
  40. package/dist/cjs/steps-list-item/style.scss +1 -2
  41. package/dist/cjs/style-card/index.js +1 -0
  42. package/dist/cjs/style-card/style.scss +4 -5
  43. package/dist/cjs/style.scss +15 -0
  44. package/dist/cjs/tabbed-navigation/index.js +17 -7
  45. package/dist/cjs/tabbed-navigation/style.scss +2 -6
  46. package/dist/cjs/utils/color.js +35 -0
  47. package/dist/cjs/web-preview/style.scss +11 -11
  48. package/dist/cjs/with-wizard/index.js +80 -3
  49. package/dist/cjs/with-wizard/style.scss +34 -13
  50. package/dist/cjs/with-wizard-screen/index.js +3 -3
  51. package/dist/cjs/with-wizard-screen/style.scss +9 -9
  52. package/dist/cjs/wizard/index.js +38 -13
  53. package/dist/cjs/wizard/store/index.js +13 -5
  54. package/dist/cjs/wizard/store/utils.js +3 -1
  55. package/dist/esm/action-card/action-card.d.js +1 -0
  56. package/dist/esm/action-card/index.js +286 -189
  57. package/dist/esm/action-card/style.scss +142 -44
  58. package/dist/esm/autocomplete-tokenfield/index.js +6 -2
  59. package/dist/esm/box-contrast/index.js +44 -0
  60. package/dist/esm/button/index.js +1 -1
  61. package/dist/esm/button-props/button-props.js +34 -0
  62. package/dist/esm/button-props/index.js +1 -0
  63. package/dist/esm/color-picker/index.js +11 -0
  64. package/dist/esm/custom-select-control/style.scss +7 -12
  65. package/dist/esm/footer/index.js +18 -25
  66. package/dist/esm/footer/style.scss +0 -36
  67. package/dist/esm/handoff-message/index.js +0 -3
  68. package/dist/esm/hooks/useObjectState.js +10 -0
  69. package/dist/esm/hooks/useObjectState.test.js +6 -6
  70. package/dist/esm/index.js +1 -3
  71. package/dist/esm/modal/index.js +4 -1
  72. package/dist/esm/modal/style.scss +18 -7
  73. package/dist/esm/newspack-icon/index.js +2 -2
  74. package/dist/esm/newspack-icon/style.scss +3 -5
  75. package/dist/esm/notice/index.js +1 -2
  76. package/dist/esm/notice/style.scss +11 -9
  77. package/dist/esm/plugin-installer/index.js +3 -3
  78. package/dist/esm/plugin-settings/SettingsSection.js +2 -0
  79. package/dist/esm/plugin-settings/index.js +4 -1
  80. package/dist/esm/plugin-toggle/index.js +2 -0
  81. package/dist/esm/popover/style.scss +5 -6
  82. package/dist/esm/progress-bar/style.scss +1 -2
  83. package/dist/esm/radio-control/style.scss +4 -10
  84. package/dist/esm/section-header/index.js +22 -0
  85. package/dist/esm/select-control/ButtonGroupControl.js +2 -0
  86. package/dist/esm/settings/SettingsCard.js +2 -6
  87. package/dist/esm/sortable-newsletter-list-control/index.js +8 -6
  88. package/dist/esm/sortable-newsletter-list-control/style.scss +11 -1
  89. package/dist/esm/steps-list/style.scss +0 -3
  90. package/dist/esm/steps-list-item/style.scss +1 -2
  91. package/dist/esm/style-card/index.js +1 -0
  92. package/dist/esm/style-card/style.scss +4 -5
  93. package/dist/esm/style.scss +15 -0
  94. package/dist/esm/tabbed-navigation/index.js +17 -7
  95. package/dist/esm/tabbed-navigation/style.scss +2 -6
  96. package/dist/esm/utils/color.js +29 -0
  97. package/dist/esm/web-preview/style.scss +11 -11
  98. package/dist/esm/with-wizard/index.js +81 -4
  99. package/dist/esm/with-wizard/style.scss +34 -13
  100. package/dist/esm/with-wizard-screen/index.js +1 -1
  101. package/dist/esm/with-wizard-screen/style.scss +9 -9
  102. package/dist/esm/wizard/index.js +39 -13
  103. package/dist/esm/wizard/store/index.js +13 -5
  104. package/dist/esm/wizard/store/utils.js +3 -1
  105. package/package.json +1 -1
  106. package/src/accordion/index.js +1 -3
  107. package/src/action-card/action-card.d.ts +40 -0
  108. package/src/action-card/index.js +284 -202
  109. package/src/action-card/style.scss +142 -44
  110. package/src/autocomplete-tokenfield/index.js +3 -2
  111. package/src/autocomplete-with-suggestions/index.js +52 -63
  112. package/src/box-contrast/index.tsx +44 -0
  113. package/src/button/index.tsx +1 -1
  114. package/src/button-card/index.js +1 -12
  115. package/src/card/index.js +1 -11
  116. package/src/category-autocomplete/index.js +4 -19
  117. package/src/color-picker/index.js +11 -7
  118. package/src/custom-select-control/style.scss +7 -12
  119. package/src/footer/index.js +6 -18
  120. package/src/footer/style.scss +0 -36
  121. package/src/form-token-field/index.js +1 -2
  122. package/src/grid/index.tsx +1 -8
  123. package/src/handoff/index.js +4 -11
  124. package/src/handoff-message/index.js +0 -3
  125. package/src/hooks/useObjectState.js +10 -2
  126. package/src/hooks/useObjectState.test.js +14 -14
  127. package/src/image-upload/index.js +3 -23
  128. package/src/index.js +1 -3
  129. package/src/modal/index.js +2 -2
  130. package/src/modal/style.scss +18 -7
  131. package/src/newspack-icon/index.js +3 -14
  132. package/src/newspack-icon/style.scss +3 -5
  133. package/src/notice/index.js +0 -2
  134. package/src/notice/style.scss +11 -9
  135. package/src/plugin-installer/index.js +8 -17
  136. package/src/plugin-settings/SettingsSection.js +3 -7
  137. package/src/plugin-settings/index.js +7 -14
  138. package/src/plugin-toggle/README.md +3 -3
  139. package/src/plugin-toggle/index.js +10 -13
  140. package/src/popover/index.js +1 -5
  141. package/src/popover/style.scss +5 -6
  142. package/src/position-control/index.js +65 -75
  143. package/src/progress-bar/index.js +2 -9
  144. package/src/progress-bar/index.test.js +4 -13
  145. package/src/progress-bar/style.scss +1 -2
  146. package/src/radio-control/style.scss +4 -10
  147. package/src/section-header/index.js +20 -0
  148. package/src/select-control/ButtonGroupControl.js +2 -9
  149. package/src/select-control/GroupedSelectControl.js +1 -9
  150. package/src/select-control/index.js +1 -5
  151. package/src/settings/MinMaxSetting.js +2 -14
  152. package/src/settings/SettingsCard.js +2 -11
  153. package/src/sortable-newsletter-list-control/index.js +10 -26
  154. package/src/sortable-newsletter-list-control/style.scss +11 -1
  155. package/src/steps-list/style.scss +0 -3
  156. package/src/steps-list-item/index.js +1 -4
  157. package/src/steps-list-item/style.scss +1 -2
  158. package/src/style-card/index.js +6 -21
  159. package/src/style-card/style.scss +4 -5
  160. package/src/style.scss +15 -0
  161. package/src/tabbed-navigation/index.js +19 -7
  162. package/src/tabbed-navigation/style.scss +2 -6
  163. package/src/text-control/index.tsx +2 -12
  164. package/src/utils/color.ts +32 -0
  165. package/src/web-preview/style.scss +11 -11
  166. package/src/with-wizard/index.js +67 -16
  167. package/src/with-wizard/style.scss +34 -13
  168. package/src/with-wizard-screen/index.js +1 -1
  169. package/src/with-wizard-screen/style.scss +9 -9
  170. package/src/wizard/components/WizardError.js +2 -7
  171. package/src/wizard/index.js +64 -62
  172. package/src/wizard/store/index.js +8 -10
  173. package/src/wizard/store/utils.js +3 -4
  174. package/dist/cjs/date-range-picker/index.js +0 -39
  175. package/dist/cjs/date-range-picker/style.scss +0 -148
  176. package/dist/cjs/newspack-logo/index.js +0 -54
  177. package/dist/cjs/newspack-logo/style.scss +0 -30
  178. package/dist/cjs/patrons-logo/index.js +0 -77
  179. package/dist/esm/date-range-picker/index.js +0 -31
  180. package/dist/esm/date-range-picker/style.scss +0 -148
  181. package/dist/esm/newspack-logo/index.js +0 -46
  182. package/dist/esm/newspack-logo/style.scss +0 -30
  183. package/dist/esm/patrons-logo/index.js +0 -70
  184. package/shared/scss/_colors.scss +0 -27
  185. package/src/date-range-picker/index.js +0 -31
  186. package/src/date-range-picker/style.scss +0 -148
  187. package/src/newspack-logo/index.js +0 -45
  188. package/src/newspack-logo/style.scss +0 -30
  189. package/src/patrons-logo/index.js +0 -76
  190. /package/{shared/js → src/button-props}/button-props.js +0 -0
  191. /package/{shared/js → src/button-props}/index.js +0 -0
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';
@@ -22,9 +22,12 @@ function Modal({
22
22
  className,
23
23
  isWide,
24
24
  isNarrow,
25
+ hideTitle,
25
26
  ...otherProps
26
27
  }, ref) {
27
- const classes = classnames('newspack-modal', isWide && 'newspack-modal--wide', isNarrow && 'newspack-modal--narrow', className);
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);
28
31
  return /*#__PURE__*/_jsx(BaseComponent, {
29
32
  className: classes,
30
33
  ...otherProps,
@@ -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
 
@@ -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,7 +38,6 @@
40
38
  }
41
39
 
42
40
  // Radio
43
-
44
41
  input[type="radio"] {
45
42
  height: 24px;
46
43
  width: 24px;
@@ -55,8 +52,8 @@
55
52
  }
56
53
 
57
54
  &:checked {
58
- background-color: colors.$primary-500;
59
- border-color: colors.$primary-500;
55
+ background-color: var(--wp-admin-theme-color);
56
+ border-color: var(--wp-admin-theme-color);
60
57
 
61
58
  &::before {
62
59
  border: none;
@@ -64,20 +61,18 @@
64
61
  }
65
62
 
66
63
  &:focus {
67
- border-color: colors.$primary-500;
68
- 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);
69
66
  }
70
67
  }
71
68
 
72
69
  // Multiple Radio Controls
73
-
74
70
  & + & {
75
71
  margin-bottom: 32px;
76
72
  margin-top: -16px;
77
73
  }
78
74
 
79
75
  // Multiple Controls
80
-
81
76
  + .newspack-select-control,
82
77
  + .newspack-text-control {
83
78
  margin-bottom: 32px;
@@ -85,7 +80,6 @@
85
80
  }
86
81
 
87
82
  // Reset
88
-
89
83
  .components-base-control__field,
90
84
  .components-base-control__label,
91
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'),
@@ -11,8 +11,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
11
11
  const SettingsCard = ({
12
12
  children,
13
13
  className,
14
- columns,
15
- gutter,
14
+ columns = 3,
15
+ gutter = 32,
16
16
  noBorder,
17
17
  rowGap,
18
18
  ...props
@@ -31,8 +31,4 @@ const SettingsCard = ({
31
31
  })
32
32
  });
33
33
  };
34
- SettingsCard.defaultProps = {
35
- columns: 3,
36
- gutter: 32
37
- };
38
34
  export default SettingsCard;
@@ -2,7 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { Icon, chevronUp, chevronDown, trash } from '@wordpress/icons';
5
- import { Notice } from '@wordpress/components';
5
+ import { CheckboxControl, Notice } from '@wordpress/components';
6
6
  import { __ } from '@wordpress/i18n';
7
7
 
8
8
  /**
@@ -41,9 +41,9 @@ export default function SortableNewsletterListControl({
41
41
  }
42
42
  return /*#__PURE__*/_jsx(ActionCard, {
43
43
  title: list.name,
44
- description: () => /*#__PURE__*/_jsxs(_Fragment, {
45
- children: [/*#__PURE__*/_jsx("input", {
46
- type: "checkbox",
44
+ description: () => /*#__PURE__*/_jsx(_Fragment, {
45
+ children: /*#__PURE__*/_jsx(CheckboxControl, {
46
+ label: __('Checked by default', 'newspack-plugin'),
47
47
  checked: selectedList.checked,
48
48
  onChange: () => {
49
49
  const index = selected.findIndex(({
@@ -53,16 +53,18 @@ export default function SortableNewsletterListControl({
53
53
  newSelected[index].checked = !newSelected[index].checked;
54
54
  onChange(newSelected);
55
55
  }
56
- }), __('Checked by default', 'newspack-plugin')]
56
+ })
57
57
  }),
58
58
  isSmall: true,
59
+ hasWhiteHeader: true,
59
60
  actionText: /*#__PURE__*/_jsx(_Fragment, {
60
61
  children: /*#__PURE__*/_jsx(Button, {
61
62
  onClick: () => onChange(selected.filter(({
62
63
  id
63
64
  }) => id !== selectedList.id)),
64
65
  label: __('Remove', 'newspack-plugin'),
65
- icon: trash
66
+ icon: trash,
67
+ isDestructive: true
66
68
  })
67
69
  }),
68
70
  children: selected.length > 1 && /*#__PURE__*/_jsxs("span", {
@@ -1,10 +1,15 @@
1
1
  .newspack__newsletter-list-control {
2
+ grid-column: span 3;
3
+
2
4
  &__selected {
3
5
  .newspack-card {
4
6
  display: flex;
5
7
  justify-content: center;
6
8
  min-height: 40px;
7
9
  flex-direction: row;
10
+ &:first-of-type {
11
+ margin-top: 0 !important;
12
+ }
8
13
  .newspack-action-card__region {
9
14
  align-items: center;
10
15
  display: flex;
@@ -14,11 +19,16 @@
14
19
  .newspack-action-card__region-top {
15
20
  flex: 1;
16
21
  order: 2;
22
+
23
+ .newspack-grid {
24
+ margin: 0;
25
+ }
17
26
  }
18
27
  .newspack-action-card__region-children {
19
- padding: 12px;
28
+ padding: 12px !important;
20
29
  }
21
30
  }
31
+
22
32
  }
23
33
  &__sort-handle {
24
34
  display: flex;
@@ -1,6 +1,3 @@
1
- @use "../../../shared/scss/colors";
2
- @use "~@wordpress/base-styles/colors" as wp-colors;
3
-
4
1
  .steps-list {
5
2
  margin-left: auto;
6
3
  margin-right: auto;
@@ -1,4 +1,3 @@
1
- @use "../../../shared/scss/colors";
2
1
  @use "~@wordpress/base-styles/colors" as wp-colors;
3
2
 
4
3
  .steps-list-item {
@@ -35,7 +34,7 @@
35
34
  background: #fff;
36
35
  border: 1px solid currentcolor;
37
36
  border-radius: 100%;
38
- color: colors.$primary-500;
37
+ color: var(--wp-admin-theme-color);
39
38
  display: flex;
40
39
  height: 28px;
41
40
  justify-content: center;
@@ -43,6 +43,7 @@ class StyleCard extends Component {
43
43
  children: [/*#__PURE__*/_jsxs("div", {
44
44
  className: "newspack-style-card__image",
45
45
  children: [imageType === 'html' ? /*#__PURE__*/_jsx("div", {
46
+ className: "newspack-style-card__image-html",
46
47
  dangerouslySetInnerHTML: image
47
48
  }) : /*#__PURE__*/_jsx("img", {
48
49
  src: image,
@@ -2,7 +2,6 @@
2
2
  * Style Card
3
3
  */
4
4
 
5
- @use "../../../shared/scss/colors";
6
5
  @use "~@wordpress/base-styles/colors" as wp-colors;
7
6
 
8
7
  .newspack-style-card {
@@ -15,7 +14,7 @@
15
14
  text-align: center;
16
15
 
17
16
  .newspack-style-card__is-active & {
18
- color: colors.$primary-500;
17
+ color: var(--wp-admin-theme-color);
19
18
  }
20
19
  }
21
20
 
@@ -48,8 +47,8 @@
48
47
  }
49
48
 
50
49
  .newspack-style-card__is-active & {
51
- border-color: colors.$primary-500;
52
- box-shadow: inset 0 0 0 1px colors.$primary-500;
50
+ border-color: var(--wp-admin-theme-color);
51
+ box-shadow: inset 0 0 0 1px var(--wp-admin-theme-color);
53
52
 
54
53
  img {
55
54
  position: relative;
@@ -88,7 +87,7 @@
88
87
  }
89
88
 
90
89
  .newspack-style-card__is-active & {
91
- box-shadow: inset 0 0 0 1px colors.$primary-500;
90
+ box-shadow: inset 0 0 0 1px var(--wp-admin-theme-color);
92
91
  }
93
92
  }
94
93
  }
@@ -1,4 +1,15 @@
1
1
  @use "~@wordpress/base-styles/colors" as wp-colors;
2
+ @use "../../colors/colors.module" as colors;
3
+
4
+ :root {
5
+ // WP Admin
6
+ --wp-admin-theme-color: #{colors.$primary-600};
7
+ --wp-admin-theme-color--rgb: #{colors.$primary-600--rgb};
8
+ --wp-admin-theme-color-darker-10: #{colors.$primary-700};
9
+ --wp-admin-theme-color-darker-10--rgb: #{colors.$primary-700--rgb};
10
+ --wp-admin-theme-color-darker-20: #{colors.$primary-800};
11
+ --wp-admin-theme-color-darker-20--rgb: #{colors.$primary-800--rgb};
12
+ }
2
13
 
3
14
  // Buttons Card
4
15
 
@@ -13,6 +24,10 @@
13
24
  &:empty {
14
25
  display: none;
15
26
  }
27
+
28
+ + .newspack-card {
29
+ margin-top: 64px;
30
+ }
16
31
  }
17
32
 
18
33
  // Checkboxes