newspack-components 2.1.0 → 2.2.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 (268) hide show
  1. package/dist/cjs/accordion/index.js +46 -0
  2. package/dist/cjs/accordion/style.scss +27 -0
  3. package/dist/cjs/action-card/index.js +48 -25
  4. package/dist/cjs/action-card/style.scss +100 -23
  5. package/dist/cjs/autocomplete-tokenfield/index.js +13 -41
  6. package/dist/cjs/autocomplete-tokenfield/style.scss +2 -2
  7. package/dist/cjs/autocomplete-with-suggestions/index.js +30 -51
  8. package/dist/cjs/autocomplete-with-suggestions/style.scss +16 -15
  9. package/dist/cjs/button/index.js +5 -13
  10. package/dist/cjs/button-card/index.js +1 -10
  11. package/dist/cjs/button-card/style.scss +13 -13
  12. package/dist/cjs/card/index.js +1 -8
  13. package/dist/cjs/card/style.scss +25 -8
  14. package/dist/cjs/category-autocomplete/index.js +18 -38
  15. package/dist/cjs/category-autocomplete/style.scss +0 -2
  16. package/dist/cjs/color-picker/index.js +1 -15
  17. package/dist/cjs/color-picker/style.scss +0 -3
  18. package/dist/cjs/consts.js +5 -3
  19. package/dist/cjs/custom-select-control/index.js +1 -9
  20. package/dist/cjs/custom-select-control/style.scss +6 -7
  21. package/dist/cjs/date-range-picker/index.js +1 -10
  22. package/dist/cjs/date-range-picker/style.scss +12 -12
  23. package/dist/cjs/footer/index.js +5 -17
  24. package/dist/cjs/footer/style.scss +5 -5
  25. package/dist/cjs/form-token-field/index.js +1 -9
  26. package/dist/cjs/form-token-field/style.scss +2 -3
  27. package/dist/cjs/global-notices/index.js +1 -8
  28. package/dist/cjs/grid/index.js +1 -8
  29. package/dist/cjs/grid/style.scss +5 -5
  30. package/dist/cjs/handoff/index.js +8 -17
  31. package/dist/cjs/handoff-message/index.js +50 -0
  32. package/dist/cjs/hooks/index.js +1 -7
  33. package/dist/cjs/hooks/useObjectState.js +7 -13
  34. package/dist/cjs/hooks/useObjectState.test.js +0 -14
  35. package/dist/cjs/hooks/useOnClickOutside.js +3 -6
  36. package/dist/cjs/hooks/usePrompt.js +1 -13
  37. package/dist/cjs/image-upload/index.js +21 -19
  38. package/dist/cjs/image-upload/index.test.js +0 -5
  39. package/dist/cjs/image-upload/style.scss +5 -9
  40. package/dist/cjs/index.js +28 -44
  41. package/dist/cjs/info-button/index.js +3 -11
  42. package/dist/cjs/info-button/style.scss +1 -3
  43. package/dist/cjs/modal/index.js +1 -9
  44. package/dist/cjs/modal/style.scss +8 -8
  45. package/dist/cjs/newspack-icon/index.js +1 -9
  46. package/dist/cjs/newspack-icon/style.scss +4 -4
  47. package/dist/cjs/newspack-logo/index.js +1 -9
  48. package/dist/cjs/newspack-logo/style.scss +3 -3
  49. package/dist/cjs/notice/index.js +8 -15
  50. package/dist/cjs/notice/style.scss +28 -15
  51. package/dist/cjs/patrons-logo/index.js +3 -11
  52. package/dist/cjs/plugin-installer/index.js +36 -36
  53. package/dist/cjs/plugin-installer/style.scss +5 -5
  54. package/dist/cjs/plugin-settings/SettingsSection.js +9 -28
  55. package/dist/cjs/plugin-settings/index.js +39 -22
  56. package/dist/cjs/plugin-toggle/index.js +40 -33
  57. package/dist/cjs/plugin-toggle/style.scss +2 -2
  58. package/dist/cjs/popover/index.js +1 -11
  59. package/dist/cjs/popover/style.scss +19 -16
  60. package/dist/cjs/position-control/index.js +113 -0
  61. package/dist/cjs/position-control/style.scss +66 -0
  62. package/dist/cjs/progress-bar/index.js +2 -9
  63. package/dist/cjs/progress-bar/index.test.js +2 -7
  64. package/dist/cjs/progress-bar/style.scss +4 -4
  65. package/dist/cjs/proxied-imports/router.js +0 -3
  66. package/dist/cjs/radio-control/index.js +1 -11
  67. package/dist/cjs/radio-control/style.scss +9 -9
  68. package/dist/cjs/section-header/index.js +44 -29
  69. package/dist/cjs/section-header/style.scss +2 -2
  70. package/dist/cjs/select-control/ButtonGroupControl.js +4 -13
  71. package/dist/cjs/select-control/GroupedSelectControl.js +9 -15
  72. package/dist/cjs/select-control/index.js +5 -12
  73. package/dist/cjs/select-control/style.scss +2 -2
  74. package/dist/cjs/settings/MinMaxSetting.js +3 -7
  75. package/dist/cjs/settings/SettingsCard.js +3 -7
  76. package/dist/cjs/settings/SettingsSection.js +1 -4
  77. package/dist/cjs/settings/index.js +0 -6
  78. package/dist/cjs/settings/style.scss +1 -1
  79. package/dist/cjs/steps-list/index.js +52 -0
  80. package/dist/cjs/steps-list/style.scss +11 -0
  81. package/dist/cjs/steps-list-item/index.js +56 -0
  82. package/dist/cjs/steps-list-item/style.scss +47 -0
  83. package/dist/cjs/style-card/index.js +6 -13
  84. package/dist/cjs/style-card/style.scss +9 -12
  85. package/dist/cjs/style.scss +5 -6
  86. package/dist/cjs/tabbed-navigation/index.js +19 -16
  87. package/dist/cjs/tabbed-navigation/style.scss +3 -4
  88. package/dist/cjs/text-control/index.js +6 -16
  89. package/dist/cjs/utils/index.js +10 -5
  90. package/dist/cjs/waiting/index.js +1 -9
  91. package/dist/cjs/web-preview/index.js +13 -28
  92. package/dist/cjs/web-preview/style.scss +14 -14
  93. package/dist/cjs/with-wizard/index.js +51 -31
  94. package/dist/cjs/with-wizard/style.scss +35 -37
  95. package/dist/cjs/with-wizard-screen/index.js +11 -17
  96. package/dist/cjs/with-wizard-screen/style.scss +14 -17
  97. package/dist/cjs/wizard/components/WizardError.js +3 -15
  98. package/dist/cjs/wizard/index.js +10 -24
  99. package/dist/cjs/wizard/store/index.js +42 -55
  100. package/dist/cjs/wizard/store/utils.js +1 -6
  101. package/dist/esm/accordion/index.js +38 -0
  102. package/dist/esm/accordion/style.scss +27 -0
  103. package/dist/esm/action-card/index.js +50 -21
  104. package/dist/esm/action-card/style.scss +100 -23
  105. package/dist/esm/autocomplete-tokenfield/index.js +14 -37
  106. package/dist/esm/autocomplete-tokenfield/style.scss +2 -2
  107. package/dist/esm/autocomplete-with-suggestions/index.js +28 -41
  108. package/dist/esm/autocomplete-with-suggestions/style.scss +16 -15
  109. package/dist/esm/button/index.js +5 -7
  110. package/dist/esm/button-card/index.js +2 -5
  111. package/dist/esm/button-card/style.scss +13 -13
  112. package/dist/esm/card/index.js +2 -5
  113. package/dist/esm/card/style.scss +25 -8
  114. package/dist/esm/category-autocomplete/index.js +17 -30
  115. package/dist/esm/category-autocomplete/style.scss +0 -2
  116. package/dist/esm/color-picker/index.js +2 -4
  117. package/dist/esm/color-picker/style.scss +0 -3
  118. package/dist/esm/consts.js +3 -2
  119. package/dist/esm/custom-select-control/index.js +2 -5
  120. package/dist/esm/custom-select-control/style.scss +6 -7
  121. package/dist/esm/date-range-picker/index.js +1 -3
  122. package/dist/esm/date-range-picker/style.scss +12 -12
  123. package/dist/esm/footer/index.js +3 -11
  124. package/dist/esm/footer/style.scss +5 -5
  125. package/dist/esm/form-token-field/index.js +2 -5
  126. package/dist/esm/form-token-field/style.scss +2 -3
  127. package/dist/esm/global-notices/index.js +1 -6
  128. package/dist/esm/grid/index.js +2 -5
  129. package/dist/esm/grid/style.scss +5 -5
  130. package/dist/esm/handoff/index.js +3 -14
  131. package/dist/esm/handoff-message/index.js +45 -0
  132. package/dist/esm/hooks/index.js +0 -2
  133. package/dist/esm/hooks/useObjectState.js +3 -8
  134. package/dist/esm/hooks/useObjectState.test.js +0 -3
  135. package/dist/esm/hooks/useOnClickOutside.js +2 -5
  136. package/dist/esm/hooks/usePrompt.js +1 -8
  137. package/dist/esm/image-upload/index.js +17 -16
  138. package/dist/esm/image-upload/style.scss +5 -9
  139. package/dist/esm/index.js +4 -0
  140. package/dist/esm/info-button/index.js +4 -6
  141. package/dist/esm/info-button/style.scss +1 -3
  142. package/dist/esm/modal/index.js +2 -5
  143. package/dist/esm/modal/style.scss +8 -8
  144. package/dist/esm/newspack-icon/index.js +2 -5
  145. package/dist/esm/newspack-icon/style.scss +4 -4
  146. package/dist/esm/newspack-logo/index.js +2 -5
  147. package/dist/esm/newspack-logo/style.scss +3 -3
  148. package/dist/esm/notice/index.js +4 -8
  149. package/dist/esm/notice/style.scss +28 -15
  150. package/dist/esm/patrons-logo/index.js +3 -5
  151. package/dist/esm/plugin-installer/index.js +35 -39
  152. package/dist/esm/plugin-installer/style.scss +5 -5
  153. package/dist/esm/plugin-settings/SettingsSection.js +8 -21
  154. package/dist/esm/plugin-settings/index.js +38 -24
  155. package/dist/esm/plugin-toggle/index.js +39 -36
  156. package/dist/esm/plugin-toggle/style.scss +2 -2
  157. package/dist/esm/popover/index.js +3 -6
  158. package/dist/esm/popover/style.scss +19 -16
  159. package/dist/esm/position-control/index.js +109 -0
  160. package/dist/esm/position-control/style.scss +66 -0
  161. package/dist/esm/progress-bar/index.js +2 -7
  162. package/dist/esm/progress-bar/index.test.js +2 -1
  163. package/dist/esm/progress-bar/style.scss +4 -4
  164. package/dist/esm/proxied-imports/router.js +1 -0
  165. package/dist/esm/radio-control/index.js +3 -6
  166. package/dist/esm/radio-control/style.scss +9 -9
  167. package/dist/esm/section-header/index.js +44 -25
  168. package/dist/esm/section-header/style.scss +2 -2
  169. package/dist/esm/select-control/ButtonGroupControl.js +5 -7
  170. package/dist/esm/select-control/GroupedSelectControl.js +5 -6
  171. package/dist/esm/select-control/index.js +6 -6
  172. package/dist/esm/select-control/style.scss +2 -2
  173. package/dist/esm/settings/MinMaxSetting.js +1 -3
  174. package/dist/esm/settings/SettingsCard.js +3 -4
  175. package/dist/esm/settings/SettingsSection.js +0 -2
  176. package/dist/esm/settings/style.scss +1 -1
  177. package/dist/esm/steps-list/index.js +43 -0
  178. package/dist/esm/steps-list/style.scss +11 -0
  179. package/dist/esm/steps-list-item/index.js +48 -0
  180. package/dist/esm/steps-list-item/style.scss +47 -0
  181. package/dist/esm/style-card/index.js +2 -5
  182. package/dist/esm/style-card/style.scss +9 -12
  183. package/dist/esm/style.scss +5 -6
  184. package/dist/esm/tabbed-navigation/index.js +20 -10
  185. package/dist/esm/tabbed-navigation/style.scss +3 -4
  186. package/dist/esm/text-control/index.js +2 -9
  187. package/dist/esm/utils/index.js +9 -3
  188. package/dist/esm/waiting/index.js +2 -5
  189. package/dist/esm/web-preview/index.js +9 -24
  190. package/dist/esm/web-preview/style.scss +14 -14
  191. package/dist/esm/with-wizard/index.js +49 -34
  192. package/dist/esm/with-wizard/style.scss +35 -37
  193. package/dist/esm/with-wizard-screen/index.js +9 -11
  194. package/dist/esm/with-wizard-screen/style.scss +14 -17
  195. package/dist/esm/wizard/components/WizardError.js +1 -10
  196. package/dist/esm/wizard/index.js +10 -12
  197. package/dist/esm/wizard/store/index.js +40 -46
  198. package/dist/esm/wizard/store/utils.js +1 -1
  199. package/package.json +4 -4
  200. package/shared/js/button-props.js +3 -1
  201. package/shared/scss/_mixins.scss +12 -0
  202. package/src/accordion/index.js +32 -0
  203. package/src/accordion/style.scss +27 -0
  204. package/src/action-card/index.js +43 -8
  205. package/src/action-card/style.scss +100 -23
  206. package/src/autocomplete-tokenfield/index.js +1 -1
  207. package/src/autocomplete-tokenfield/style.scss +2 -2
  208. package/src/autocomplete-with-suggestions/style.scss +16 -15
  209. package/src/button-card/style.scss +13 -13
  210. package/src/card/style.scss +25 -8
  211. package/src/category-autocomplete/index.js +3 -1
  212. package/src/category-autocomplete/style.scss +0 -2
  213. package/src/color-picker/style.scss +0 -3
  214. package/src/consts.js +2 -1
  215. package/src/custom-select-control/style.scss +6 -7
  216. package/src/date-range-picker/style.scss +12 -12
  217. package/src/footer/index.js +2 -2
  218. package/src/footer/style.scss +5 -5
  219. package/src/form-token-field/index.js +2 -7
  220. package/src/form-token-field/style.scss +2 -3
  221. package/src/grid/style.scss +5 -5
  222. package/src/handoff/index.js +3 -8
  223. package/src/handoff-message/index.js +39 -0
  224. package/src/hooks/useObjectState.js +2 -1
  225. package/src/image-upload/index.js +9 -3
  226. package/src/image-upload/style.scss +5 -9
  227. package/src/index.js +4 -0
  228. package/src/info-button/style.scss +1 -3
  229. package/src/modal/style.scss +8 -8
  230. package/src/newspack-icon/style.scss +4 -4
  231. package/src/newspack-logo/style.scss +3 -3
  232. package/src/notice/index.js +2 -0
  233. package/src/notice/style.scss +28 -15
  234. package/src/plugin-installer/index.js +15 -2
  235. package/src/plugin-installer/style.scss +5 -5
  236. package/src/plugin-settings/SettingsSection.js +7 -13
  237. package/src/plugin-settings/index.js +7 -2
  238. package/src/plugin-toggle/index.js +2 -3
  239. package/src/plugin-toggle/style.scss +2 -2
  240. package/src/popover/style.scss +19 -16
  241. package/src/position-control/index.js +122 -0
  242. package/src/position-control/style.scss +66 -0
  243. package/src/progress-bar/style.scss +4 -4
  244. package/src/radio-control/style.scss +9 -9
  245. package/src/section-header/index.js +32 -15
  246. package/src/section-header/style.scss +2 -2
  247. package/src/select-control/ButtonGroupControl.js +3 -0
  248. package/src/select-control/GroupedSelectControl.js +2 -1
  249. package/src/select-control/index.js +6 -2
  250. package/src/select-control/style.scss +2 -2
  251. package/src/settings/style.scss +1 -1
  252. package/src/steps-list/index.js +39 -0
  253. package/src/steps-list/style.scss +11 -0
  254. package/src/steps-list-item/index.js +40 -0
  255. package/src/steps-list-item/style.scss +47 -0
  256. package/src/style-card/index.js +2 -11
  257. package/src/style-card/style.scss +9 -12
  258. package/src/style.scss +5 -6
  259. package/src/tabbed-navigation/index.js +12 -4
  260. package/src/tabbed-navigation/style.scss +3 -4
  261. package/src/utils/index.js +9 -0
  262. package/src/web-preview/index.js +1 -1
  263. package/src/web-preview/style.scss +14 -14
  264. package/src/with-wizard/style.scss +35 -37
  265. package/src/with-wizard-screen/index.js +4 -1
  266. package/src/with-wizard-screen/style.scss +14 -17
  267. package/src/wizard/index.js +15 -3
  268. package/src/wizard/store/index.js +8 -2
@@ -1,5 +1,4 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
-
3
2
  /**
4
3
  * Category Autocomplete
5
4
  */
@@ -11,52 +10,55 @@ import apiFetch from '@wordpress/api-fetch';
11
10
  import { Spinner } from '@wordpress/components';
12
11
  import { Component } from '@wordpress/element';
13
12
  import { addQueryArgs } from '@wordpress/url';
13
+
14
14
  /**
15
15
  * Internal dependencies.
16
16
  */
17
-
18
17
  import { FormTokenField } from '../';
19
18
  import './style.scss';
19
+
20
20
  /**
21
21
  * External dependencies
22
22
  */
23
-
24
- import { debounce, find, filter } from 'lodash';
23
+ import debounce from 'lodash/debounce';
24
+ import find from 'lodash/find';
25
+ import filter from 'lodash/filter';
25
26
  import classnames from 'classnames';
27
+
26
28
  /**
27
29
  * Category autocomplete field component.
28
30
  */
29
-
30
31
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
31
32
  import { jsxs as _jsxs } from "@emotion/react/jsx-runtime";
32
-
33
33
  class CategoryAutocomplete extends Component {
34
34
  /**
35
35
  * Class constructor.
36
36
  */
37
37
  constructor(props) {
38
38
  super(props);
39
-
40
39
  _defineProperty(this, "state", {
41
40
  suggestions: {},
42
41
  allCategories: {},
43
42
  isLoading: false
44
43
  });
45
-
44
+ /**
45
+ * Prepare categories data for the API endpoint, call the change handler.
46
+ *
47
+ * @param {Array} tokens An array of category tokens.
48
+ */
46
49
  _defineProperty(this, "handleOnChange", tokens => {
47
50
  const {
48
51
  onChange
49
52
  } = this.props;
50
53
  const {
51
54
  suggestions
52
- } = this.state; // Categories that are already will be objects, while new additions will be strings (the name).
55
+ } = this.state;
56
+ // Categories that are already will be objects, while new additions will be strings (the name).
53
57
  // allValues nomalizes the array so that they are all objects.
54
-
55
58
  const allValues = tokens.filter(token => 'undefined' !== typeof token) // Ensure each token is a valid value.
56
59
  .map(token => 'string' === typeof token ? suggestions[token] : token).filter(Boolean);
57
60
  onChange(allValues);
58
61
  });
59
-
60
62
  _defineProperty(this, "getAvailableSuggestions", () => {
61
63
  const {
62
64
  value
@@ -68,7 +70,6 @@ class CategoryAutocomplete extends Component {
68
70
  if (item?.id) {
69
71
  acc.push(item.id);
70
72
  }
71
-
72
73
  return acc;
73
74
  }, []);
74
75
  const availableSuggestions = filter(suggestions, _ref => {
@@ -79,10 +80,8 @@ class CategoryAutocomplete extends Component {
79
80
  });
80
81
  return availableSuggestions.map(v => v.name);
81
82
  });
82
-
83
83
  this.debouncedUpdateSuggestions = debounce(this.updateSuggestions, 100);
84
84
  }
85
-
86
85
  componentDidMount() {
87
86
  this.setState({
88
87
  isLoading: true
@@ -98,21 +97,19 @@ class CategoryAutocomplete extends Component {
98
97
  isLoading: false
99
98
  }));
100
99
  }
100
+
101
101
  /**
102
102
  * Clean up debounced suggestions method.
103
103
  */
104
-
105
-
106
104
  componentWillUnmount() {
107
105
  this.debouncedUpdateSuggestions.cancel();
108
106
  }
107
+
109
108
  /**
110
109
  * Refresh the autocomplete UI based on text that was typed.
111
110
  *
112
111
  * @param {string} search The typed text to search for.
113
112
  */
114
-
115
-
116
113
  updateSuggestions(search) {
117
114
  this.setState({
118
115
  isLoading: true
@@ -127,7 +124,8 @@ class CategoryAutocomplete extends Component {
127
124
  })
128
125
  }).then(categories => {
129
126
  this.setState({
130
- suggestions: categories.reduce((accumulator, category) => ({ ...accumulator,
127
+ suggestions: categories.reduce((accumulator, category) => ({
128
+ ...accumulator,
131
129
  [category.name]: category
132
130
  }), {})
133
131
  });
@@ -135,13 +133,6 @@ class CategoryAutocomplete extends Component {
135
133
  isLoading: false
136
134
  }));
137
135
  }
138
- /**
139
- * Prepare categories data for the API endpoint, call the change handler.
140
- *
141
- * @param {Array} tokens An array of category tokens.
142
- */
143
-
144
-
145
136
  /**
146
137
  * Render the component.
147
138
  */
@@ -166,14 +157,12 @@ class CategoryAutocomplete extends Component {
166
157
  onInputChange: input => this.debouncedUpdateSuggestions(input),
167
158
  value: value.reduce((acc, item) => {
168
159
  const categoryOrItem = typeof item === 'number' ? find(allCategories, ['id', item]) : item;
169
-
170
160
  if (categoryOrItem) {
171
161
  acc.push({
172
162
  id: categoryOrItem.term_id || categoryOrItem.id,
173
163
  value: categoryOrItem.value || categoryOrItem.name
174
164
  });
175
165
  }
176
-
177
166
  return acc;
178
167
  }, []),
179
168
  suggestions: this.getAvailableSuggestions(),
@@ -189,9 +178,7 @@ class CategoryAutocomplete extends Component {
189
178
  }) : null]
190
179
  });
191
180
  }
192
-
193
181
  }
194
-
195
182
  CategoryAutocomplete.defaultProps = {
196
183
  taxonomy: 'categories'
197
184
  };
@@ -2,8 +2,6 @@
2
2
  * Category Autocomplete
3
3
  */
4
4
 
5
- @import '../../../shared/scss/colors';
6
-
7
5
  .newspack-category-autocomplete {
8
6
  position: relative;
9
7
 
@@ -3,17 +3,17 @@
3
3
  */
4
4
  import { ColorPicker as ColorPickerComponent } from '@wordpress/components';
5
5
  import { useState, useRef } from '@wordpress/element';
6
+
6
7
  /**
7
8
  * External dependencies.
8
9
  */
9
-
10
10
  import classnames from 'classnames';
11
11
  import { colord, extend } from 'colord';
12
12
  import a11yPlugin from 'colord/plugins/a11y';
13
+
13
14
  /**
14
15
  * Internal dependencies.
15
16
  */
16
-
17
17
  import hooks from '../hooks';
18
18
  import utils from '../utils';
19
19
  import './style.scss';
@@ -23,7 +23,6 @@ extend([a11yPlugin]);
23
23
  const {
24
24
  InteractiveDiv
25
25
  } = utils;
26
-
27
26
  const ColorPicker = _ref => {
28
27
  let {
29
28
  label,
@@ -59,5 +58,4 @@ const ColorPicker = _ref => {
59
58
  })]
60
59
  });
61
60
  };
62
-
63
61
  export default ColorPicker;
@@ -2,9 +2,6 @@
2
2
  * Color Picker
3
3
  */
4
4
 
5
- @import '../../../shared/scss/colors';
6
- @import '~@wordpress/base-styles/colors';
7
-
8
5
  .newspack-color-picker {
9
6
  position: relative;
10
7
 
@@ -1,2 +1,3 @@
1
- export const NEWSPACK_SITE_URL = 'https://newspack.pub';
2
- export const NEWSPACK_SUPPORT_URL = `${NEWSPACK_SITE_URL}/support`;
1
+ export const NEWSPACK_SITE_URL = 'https://newspack.com';
2
+ export const NEWSPACK_SUPPORT_URL = `${NEWSPACK_SITE_URL}/support`;
3
+ export const HANDOFF_KEY = 'newspack_wizard_handoff_message';
@@ -7,18 +7,17 @@
7
7
  */
8
8
  import { CustomSelectControl as BaseComponent } from '@wordpress/components';
9
9
  import { Component } from '@wordpress/element';
10
+
10
11
  /**
11
12
  * External dependencies
12
13
  */
13
-
14
14
  import classnames from 'classnames';
15
+
15
16
  /**
16
17
  * Internal dependencies
17
18
  */
18
-
19
19
  import './style.scss';
20
20
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
21
-
22
21
  class CustomSelectControl extends Component {
23
22
  /**
24
23
  * Render.
@@ -34,7 +33,5 @@ class CustomSelectControl extends Component {
34
33
  ...otherProps
35
34
  });
36
35
  }
37
-
38
36
  }
39
-
40
37
  export default CustomSelectControl;
@@ -2,8 +2,7 @@
2
2
  * Custom Select Control
3
3
  */
4
4
 
5
- @import '../../../shared/scss/colors';
6
- @import '~@wordpress/base-styles/colors';
5
+ @use '~@wordpress/base-styles/colors' as wp-colors;
7
6
 
8
7
  .newspack-custom-select-control {
9
8
  label {
@@ -12,9 +11,9 @@
12
11
  }
13
12
 
14
13
  .components-custom-select-control__button {
15
- border-color: $gray-700;
14
+ border-color: wp-colors.$gray-700;
16
15
  border-radius: 2px;
17
- color: $gray-900;
16
+ color: wp-colors.$gray-900;
18
17
  font-size: inherit;
19
18
  min-height: 30px;
20
19
  min-width: 100%;
@@ -24,7 +23,7 @@
24
23
  &:focus,
25
24
  &:hover,
26
25
  &[aria-expanded='true'] {
27
- color: $gray-900;
26
+ color: wp-colors.$gray-900;
28
27
  }
29
28
 
30
29
  &:focus {
@@ -43,7 +42,7 @@
43
42
  }
44
43
 
45
44
  .components-custom-select-control__menu {
46
- border-color: $gray-700;
45
+ border-color: wp-colors.$gray-700;
47
46
  border-radius: 2px;
48
47
  box-shadow: 0 4px 8px rgba( black, 0.08 );
49
48
  margin: 8px 0 0;
@@ -64,7 +63,7 @@
64
63
  }
65
64
 
66
65
  &.is-header {
67
- background: $gray-100;
66
+ background: wp-colors.$gray-100;
68
67
  cursor: default;
69
68
  font-weight: bold;
70
69
  margin-left: 0;
@@ -5,14 +5,13 @@ import { default as ReactDateRangePicker } from 'react-daterange-picker';
5
5
  import origMoment from 'moment';
6
6
  import { extendMoment } from 'moment-range';
7
7
  import 'react-daterange-picker/dist/css/react-calendar.css';
8
+
8
9
  /**
9
10
  * Internal dependencies.
10
11
  */
11
-
12
12
  import './style.scss';
13
13
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
14
14
  const moment = extendMoment(origMoment);
15
-
16
15
  const DateRangePicker = _ref => {
17
16
  let {
18
17
  start,
@@ -30,5 +29,4 @@ const DateRangePicker = _ref => {
30
29
  }
31
30
  });
32
31
  };
33
-
34
32
  export default DateRangePicker;
@@ -1,5 +1,5 @@
1
- @import '../../../shared/scss/colors';
2
- @import '~@wordpress/base-styles/colors';
1
+ @use '../../../shared/scss/colors';
2
+ @use '~@wordpress/base-styles/colors' as wp-colors;
3
3
 
4
4
  .DateRangePicker {
5
5
  margin: 32px 0;
@@ -47,7 +47,7 @@
47
47
  }
48
48
 
49
49
  &__MonthHeader {
50
- color: $gray-900;
50
+ color: wp-colors.$gray-900;
51
51
  font-size: 17px;
52
52
  height: auto;
53
53
  line-height: 24px;
@@ -62,8 +62,8 @@
62
62
  }
63
63
 
64
64
  &__WeekdayHeading {
65
- border-bottom-color: $gray-300;
66
- color: $gray-900;
65
+ border-bottom-color: wp-colors.$gray-300;
66
+ color: wp-colors.$gray-900;
67
67
 
68
68
  abbr[title] {
69
69
  color: inherit;
@@ -76,20 +76,20 @@
76
76
  }
77
77
 
78
78
  &__Date {
79
- border-color: $gray-300;
79
+ border-color: wp-colors.$gray-300;
80
80
  border-bottom-width: 1px;
81
81
 
82
82
  &--weekend {
83
- background-color: $gray-100;
83
+ background-color: wp-colors.$gray-100;
84
84
  }
85
85
 
86
86
  &--otherMonth {
87
- color: $gray-200;
87
+ color: wp-colors.$gray-200;
88
88
  opacity: 1;
89
89
  }
90
90
 
91
91
  &--is-disabled {
92
- color: $gray-100;
92
+ color: wp-colors.$gray-100;
93
93
  cursor: not-allowed;
94
94
  }
95
95
 
@@ -100,7 +100,7 @@
100
100
 
101
101
  &__CalendarSelection,
102
102
  &__CalendarHighlight {
103
- border-color: $primary-500;
103
+ border-color: colors.$primary-500;
104
104
  bottom: 4px;
105
105
  top: 4px;
106
106
 
@@ -129,11 +129,11 @@
129
129
  }
130
130
 
131
131
  &__CalendarSelection {
132
- background-color: $primary-500;
132
+ background-color: colors.$primary-500;
133
133
  }
134
134
 
135
135
  &__CalendarHighlight {
136
- background: $primary-500;
136
+ background: colors.$primary-500;
137
137
  border: none;
138
138
  bottom: 0;
139
139
  top: 0;
@@ -8,15 +8,14 @@
8
8
  import { __ as alias__ } from '@wordpress/i18n';
9
9
  const __ = alias__;
10
10
  import { ExternalLink } from '@wordpress/components';
11
+
11
12
  /**
12
13
  * Internal dependencies.
13
14
  */
14
-
15
15
  import { PatronsLogo } from '../';
16
16
  import './style.scss';
17
17
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
18
18
  import { jsxs as _jsxs } from "@emotion/react/jsx-runtime";
19
-
20
19
  const Footer = _ref => {
21
20
  let {
22
21
  simple
@@ -34,53 +33,47 @@ const Footer = _ref => {
34
33
  } = window.newspack_urls || {};
35
34
  const footerElements = [{
36
35
  label: pluginVersion.label,
37
- url: 'https://newspack.pub/category/release-notes/',
36
+ url: 'https://newspack.com/category/release-notes/',
38
37
  external: true
39
38
  }, {
40
39
  label: __('About', 'newspack'),
41
- url: 'https://newspack.pub/',
40
+ url: 'https://newspack.com/',
42
41
  external: true
43
42
  }, {
44
43
  label: __('Documentation', 'newspack'),
45
44
  url: support,
46
45
  external: true
47
46
  }];
48
-
49
47
  if (componentsDemo) {
50
48
  footerElements.push({
51
49
  label: __('Components Demo', 'newspack'),
52
50
  url: componentsDemo
53
51
  });
54
52
  }
55
-
56
53
  if (setupWizard) {
57
54
  footerElements.push({
58
55
  label: __('Setup Wizard', 'newspack'),
59
56
  url: setupWizard
60
57
  });
61
58
  }
62
-
63
59
  if (resetUrl) {
64
60
  footerElements.push({
65
61
  label: __('Reset Newspack', 'newspack'),
66
62
  url: resetUrl
67
63
  });
68
64
  }
69
-
70
65
  if (removeStarterContent) {
71
66
  footerElements.push({
72
67
  label: __('Remove Starter Content', 'newspack'),
73
68
  url: removeStarterContent
74
69
  });
75
70
  }
76
-
77
71
  if (supportEmail) {
78
72
  footerElements.push({
79
73
  label: __('Contact Support', 'newspack'),
80
74
  url: `mailto:${supportEmail}`
81
75
  });
82
76
  }
83
-
84
77
  return _jsxs("div", {
85
78
  className: "newspack-footer",
86
79
  children: [!simple && _jsx("div", {
@@ -109,5 +102,4 @@ const Footer = _ref => {
109
102
  })]
110
103
  });
111
104
  };
112
-
113
105
  export default Footer;
@@ -2,15 +2,15 @@
2
2
  * Footer
3
3
  */
4
4
 
5
- @import '~@wordpress/base-styles/colors';
5
+ @use '~@wordpress/base-styles/colors' as wp-colors;
6
6
 
7
7
  .newspack-footer {
8
8
  align-items: stretch;
9
9
  background: white;
10
- border: 0 solid $gray-300;
10
+ border: 0 solid wp-colors.$gray-300;
11
11
  border-width: 1px 0;
12
12
  bottom: 0;
13
- color: $gray-700;
13
+ color: wp-colors.$gray-700;
14
14
  display: flex;
15
15
  flex-wrap: wrap;
16
16
  font-size: 12px;
@@ -53,14 +53,14 @@
53
53
  &:active,
54
54
  &:focus,
55
55
  &:hover {
56
- color: $gray-900;
56
+ color: wp-colors.$gray-900;
57
57
  }
58
58
  }
59
59
  }
60
60
 
61
61
  &__logo {
62
62
  align-items: center;
63
- background: $gray-900;
63
+ background: wp-colors.$gray-900;
64
64
  display: flex;
65
65
  margin: 0 0 -1px;
66
66
  padding: 16px;
@@ -7,19 +7,18 @@
7
7
  */
8
8
  import { FormTokenField as BaseComponent } from '@wordpress/components';
9
9
  import { Component } from '@wordpress/element';
10
+
10
11
  /**
11
12
  * Internal dependencies.
12
13
  */
13
-
14
14
  import './style.scss';
15
+
15
16
  /**
16
17
  * External dependencies.
17
18
  */
18
-
19
19
  import classnames from 'classnames';
20
20
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
21
21
  import { jsxs as _jsxs } from "@emotion/react/jsx-runtime";
22
-
23
22
  class FormTokenField extends Component {
24
23
  /**
25
24
  * Render.
@@ -47,7 +46,5 @@ class FormTokenField extends Component {
47
46
  })]
48
47
  });
49
48
  }
50
-
51
49
  }
52
-
53
50
  export default FormTokenField;
@@ -2,8 +2,7 @@
2
2
  * Form Token Field
3
3
  */
4
4
 
5
- @import '../../../shared/scss/colors';
6
- @import '~@wordpress/base-styles/colors';
5
+ @use '~@wordpress/base-styles/colors' as wp-colors;
7
6
 
8
7
  .newspack-form-token-field {
9
8
  width: 100%;
@@ -16,7 +15,7 @@
16
15
  // Help
17
16
 
18
17
  &__help {
19
- color: $gray-700;
18
+ color: wp-colors.$gray-700;
20
19
  font-size: 12px;
21
20
  margin: 8px 0 0 !important;
22
21
  }
@@ -2,20 +2,17 @@
2
2
  * External dependencies
3
3
  */
4
4
  import { parse } from 'qs';
5
+
5
6
  /**
6
7
  * Internal dependencies
7
8
  */
8
-
9
9
  import { Notice } from '../';
10
10
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
11
-
12
11
  const GlobalNotices = () => {
13
12
  const notice = parse(window.location.search)['newspack-notice'];
14
-
15
13
  if (!notice) {
16
14
  return null;
17
15
  }
18
-
19
16
  return notice.split(',').map((text, i) => {
20
17
  if (text.indexOf('_error_') === 0) {
21
18
  return _jsx(Notice, {
@@ -24,12 +21,10 @@ const GlobalNotices = () => {
24
21
  rawHTML: true
25
22
  }, i);
26
23
  }
27
-
28
24
  return _jsx(Notice, {
29
25
  isSuccess: true,
30
26
  noticeText: text
31
27
  }, i);
32
28
  });
33
29
  };
34
-
35
30
  export default GlobalNotices;
@@ -6,18 +6,17 @@
6
6
  * WordPress dependencies
7
7
  */
8
8
  import { Component } from '@wordpress/element';
9
+
9
10
  /**
10
11
  * Internal dependencies
11
12
  */
12
-
13
13
  import './style.scss';
14
+
14
15
  /**
15
16
  * External dependencies
16
17
  */
17
-
18
18
  import classnames from 'classnames';
19
19
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
20
-
21
20
  class Grid extends Component {
22
21
  /**
23
22
  * Render
@@ -37,9 +36,7 @@ class Grid extends Component {
37
36
  ...otherProps
38
37
  });
39
38
  }
40
-
41
39
  }
42
-
43
40
  Grid.defaultProps = {
44
41
  columns: 2,
45
42
  gutter: 32,
@@ -2,7 +2,7 @@
2
2
  * Grid
3
3
  */
4
4
 
5
- @import '~@wordpress/base-styles/colors';
5
+ @use '~@wordpress/base-styles/colors' as wp-colors;
6
6
 
7
7
  .newspack-grid {
8
8
  display: grid;
@@ -145,9 +145,9 @@
145
145
  // Table-like
146
146
  &__thead {
147
147
  background: rgba( black, 0.025 );
148
- border-bottom: 1px solid $gray-300;
149
- border-top: 1px solid $gray-300;
150
- color: $gray-900;
148
+ border-bottom: 1px solid wp-colors.$gray-300;
149
+ border-top: 1px solid wp-colors.$gray-300;
150
+ color: wp-colors.$gray-900;
151
151
 
152
152
  > *:not( .screen-reader-text ) {
153
153
  padding: 8px;
@@ -155,7 +155,7 @@
155
155
  }
156
156
 
157
157
  &__tbody {
158
- border-bottom: 1px solid $gray-300;
158
+ border-bottom: 1px solid wp-colors.$gray-300;
159
159
  padding: 8px 0;
160
160
  }
161
161