newspack-components 2.2.1 → 3.0.0-alpha.2

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 (308) hide show
  1. package/babel.config.js +25 -0
  2. package/copy-styles.js +2 -10
  3. package/dist/{cjs/accordion → accordion}/index.js +17 -13
  4. package/dist/{cjs/accordion → accordion}/style.scss +7 -3
  5. package/dist/{cjs/action-card → action-card}/index.js +39 -43
  6. package/dist/{esm/action-card → action-card}/style.scss +9 -9
  7. package/dist/{cjs/autocomplete-tokenfield → autocomplete-tokenfield}/index.js +67 -29
  8. package/dist/{esm/autocomplete-tokenfield → autocomplete-tokenfield}/style.scss +14 -8
  9. package/dist/{cjs/autocomplete-with-suggestions → autocomplete-with-suggestions}/index.js +61 -73
  10. package/dist/{esm/autocomplete-with-suggestions → autocomplete-with-suggestions}/style.scss +9 -17
  11. package/dist/button/index.js +51 -0
  12. package/{src/button/index.js → dist/button/index.tsx} +12 -5
  13. package/dist/{cjs/button → button}/style.scss +1 -1
  14. package/dist/{cjs/button-card → button-card}/index.js +9 -10
  15. package/dist/{cjs/button-card → button-card}/style.scss +19 -13
  16. package/dist/{cjs/card → card}/index.js +4 -5
  17. package/dist/{esm/card → card}/style.scss +1 -1
  18. package/dist/{cjs/category-autocomplete → category-autocomplete}/index.js +51 -53
  19. package/dist/{esm/category-autocomplete → category-autocomplete}/style.scss +2 -2
  20. package/dist/{cjs/color-picker → color-picker}/index.js +14 -16
  21. package/dist/{cjs/color-picker → color-picker}/style.scss +3 -3
  22. package/dist/consts.js +7 -0
  23. package/dist/{cjs/custom-select-control → custom-select-control}/index.js +4 -5
  24. package/dist/{cjs/custom-select-control → custom-select-control}/style.scss +11 -10
  25. package/dist/{cjs/date-range-picker → date-range-picker}/index.js +9 -11
  26. package/dist/{cjs/date-range-picker → date-range-picker}/style.scss +6 -6
  27. package/dist/{cjs/footer → footer}/index.js +33 -36
  28. package/dist/{cjs/footer → footer}/style.scss +1 -1
  29. package/dist/{cjs/form-token-field → form-token-field}/index.js +6 -7
  30. package/dist/{esm/form-token-field → form-token-field}/style.scss +1 -1
  31. package/dist/{cjs/global-notices → global-notices}/index.js +4 -5
  32. package/dist/grid/index.js +44 -0
  33. package/dist/grid/index.tsx +34 -0
  34. package/dist/{cjs/grid → grid}/style.scss +9 -9
  35. package/dist/{cjs/handoff → handoff}/index.js +73 -71
  36. package/dist/{cjs/handoff-message → handoff-message}/index.js +5 -3
  37. package/dist/hooks/index.js +29 -0
  38. package/{src/hooks/index.js → dist/hooks/index.ts} +1 -1
  39. package/dist/{cjs/hooks → hooks}/useObjectState.js +2 -3
  40. package/dist/{cjs/hooks → hooks}/useObjectState.test.js +9 -9
  41. package/dist/{cjs/hooks → hooks}/useOnClickOutside.js +1 -2
  42. package/dist/hooks/usePrompt.js +47 -0
  43. package/{src/hooks/usePrompt.js → dist/hooks/usePrompt.ts} +4 -8
  44. package/dist/image-upload/index.js +148 -0
  45. package/dist/{cjs/image-upload → image-upload}/index.test.js +13 -6
  46. package/dist/{esm/image-upload → image-upload}/style.scss +5 -5
  47. package/dist/{cjs/index.js → index.js} +1 -1
  48. package/dist/{cjs/info-button → info-button}/index.js +6 -7
  49. package/dist/{cjs/modal → modal}/index.js +4 -5
  50. package/dist/{esm/modal → modal}/style.scss +5 -5
  51. package/dist/{cjs/newspack-icon → newspack-icon}/index.js +5 -6
  52. package/dist/{cjs/newspack-icon → newspack-icon}/style.scss +1 -1
  53. package/dist/{cjs/newspack-logo → newspack-logo}/index.js +5 -6
  54. package/dist/{cjs/newspack-logo → newspack-logo}/style.scss +1 -1
  55. package/dist/{cjs/notice → notice}/index.js +12 -10
  56. package/dist/{cjs/notice → notice}/style.scss +11 -11
  57. package/dist/patrons-logo/index.js +77 -0
  58. package/dist/plugin-installer/index.js +297 -0
  59. package/dist/{cjs/plugin-installer → plugin-installer}/style.scss +1 -1
  60. package/dist/{cjs/plugin-settings → plugin-settings}/SettingsSection.js +13 -13
  61. package/dist/plugin-settings/index.js +228 -0
  62. package/dist/{cjs/plugin-settings → plugin-settings}/style.scss +1 -1
  63. package/dist/plugin-toggle/README.md +53 -0
  64. package/dist/plugin-toggle/index.js +222 -0
  65. package/dist/{esm/plugin-toggle → plugin-toggle}/style.scss +1 -1
  66. package/dist/{cjs/popover → popover}/index.js +4 -5
  67. package/dist/{cjs/popover → popover}/style.scss +7 -7
  68. package/dist/{cjs/position-control → position-control}/index.js +33 -32
  69. package/dist/{cjs/position-control → position-control}/style.scss +8 -8
  70. package/dist/{cjs/progress-bar → progress-bar}/index.js +9 -10
  71. package/dist/{cjs/progress-bar → progress-bar}/index.test.js +16 -16
  72. package/dist/{cjs/progress-bar → progress-bar}/style.scss +2 -2
  73. package/dist/proxied-imports/router.js +15 -0
  74. package/dist/{cjs/radio-control → radio-control}/index.js +4 -5
  75. package/dist/{cjs/radio-control → radio-control}/style.scss +3 -3
  76. package/dist/{cjs/section-header → section-header}/index.js +20 -21
  77. package/dist/{esm/section-header → section-header}/style.scss +5 -1
  78. package/dist/{cjs/select-control → select-control}/ButtonGroupControl.js +17 -19
  79. package/dist/{cjs/select-control → select-control}/GroupedSelectControl.js +32 -35
  80. package/dist/{cjs/select-control → select-control}/index.js +7 -8
  81. package/dist/{cjs/select-control → select-control}/style.scss +4 -4
  82. package/dist/settings/MinMaxSetting.js +60 -0
  83. package/dist/{cjs/settings → settings}/SettingsCard.js +14 -16
  84. package/dist/settings/SettingsSection.js +33 -0
  85. package/dist/{cjs/settings → settings}/index.js +3 -4
  86. package/dist/{cjs/settings → settings}/style.scss +15 -2
  87. package/dist/sortable-newsletter-list-control/index.js +135 -0
  88. package/dist/sortable-newsletter-list-control/style.scss +45 -0
  89. package/dist/{cjs/steps-list → steps-list}/index.js +5 -6
  90. package/dist/{esm/steps-list → steps-list}/style.scss +2 -2
  91. package/dist/{cjs/steps-list-item → steps-list-item}/index.js +6 -7
  92. package/dist/{cjs/steps-list-item → steps-list-item}/style.scss +5 -5
  93. package/dist/{cjs/style-card → style-card}/index.js +21 -19
  94. package/dist/{esm/style-card → style-card}/style.scss +4 -4
  95. package/dist/{esm/style.scss → style.scss} +14 -2
  96. package/dist/{cjs/tabbed-navigation → tabbed-navigation}/index.js +16 -19
  97. package/dist/{cjs/tabbed-navigation → tabbed-navigation}/style.scss +4 -4
  98. package/dist/text-control/index.js +76 -0
  99. package/dist/text-control/index.tsx +71 -0
  100. package/dist/utils/index.js +36 -0
  101. package/dist/{cjs/waiting → waiting}/index.js +4 -5
  102. package/dist/web-preview/index.js +191 -0
  103. package/dist/{cjs/web-preview → web-preview}/style.scss +5 -5
  104. package/dist/with-wizard/index.js +328 -0
  105. package/dist/{esm/with-wizard → with-wizard}/style.scss +44 -22
  106. package/dist/{cjs/with-wizard-screen → with-wizard-screen}/index.js +40 -43
  107. package/dist/{esm/with-wizard-screen → with-wizard-screen}/style.scss +7 -7
  108. package/dist/{cjs/wizard → wizard}/components/WizardError.js +16 -17
  109. package/dist/{cjs/wizard → wizard}/index.js +44 -46
  110. package/dist/{cjs/wizard → wizard}/store/index.js +37 -38
  111. package/dist/{cjs/wizard → wizard}/store/utils.js +1 -4
  112. package/package.json +16 -14
  113. package/shared/scss/_mixins.scss +2 -2
  114. package/src/accordion/index.js +4 -1
  115. package/src/accordion/style.scss +7 -3
  116. package/src/action-card/style.scss +9 -9
  117. package/src/autocomplete-tokenfield/index.js +48 -15
  118. package/src/autocomplete-tokenfield/style.scss +14 -8
  119. package/src/autocomplete-with-suggestions/index.js +59 -62
  120. package/src/autocomplete-with-suggestions/style.scss +9 -17
  121. package/src/button/index.tsx +48 -0
  122. package/src/button/style.scss +1 -1
  123. package/src/button-card/style.scss +19 -13
  124. package/src/card/style.scss +1 -1
  125. package/src/category-autocomplete/style.scss +2 -2
  126. package/src/color-picker/style.scss +3 -3
  127. package/src/consts.js +0 -2
  128. package/src/custom-select-control/style.scss +11 -10
  129. package/src/date-range-picker/style.scss +6 -6
  130. package/src/footer/index.js +7 -7
  131. package/src/footer/style.scss +1 -1
  132. package/src/form-token-field/style.scss +1 -1
  133. package/src/grid/index.tsx +34 -0
  134. package/src/grid/style.scss +9 -9
  135. package/src/handoff/index.js +7 -6
  136. package/src/handoff-message/index.js +3 -1
  137. package/src/hooks/index.ts +15 -0
  138. package/src/hooks/usePrompt.ts +46 -0
  139. package/src/image-upload/index.js +5 -5
  140. package/src/image-upload/index.test.js +6 -1
  141. package/src/image-upload/style.scss +5 -5
  142. package/src/modal/style.scss +5 -5
  143. package/src/newspack-icon/style.scss +1 -1
  144. package/src/newspack-logo/style.scss +1 -1
  145. package/src/notice/index.js +1 -1
  146. package/src/notice/style.scss +11 -11
  147. package/src/patrons-logo/index.js +4 -1
  148. package/src/plugin-installer/index.js +7 -7
  149. package/src/plugin-installer/style.scss +1 -1
  150. package/src/plugin-settings/index.js +1 -1
  151. package/src/plugin-settings/style.scss +1 -1
  152. package/src/plugin-toggle/index.js +13 -12
  153. package/src/plugin-toggle/style.scss +1 -1
  154. package/src/popover/style.scss +7 -7
  155. package/src/position-control/index.js +63 -64
  156. package/src/position-control/style.scss +8 -8
  157. package/src/progress-bar/style.scss +2 -2
  158. package/src/radio-control/style.scss +3 -3
  159. package/src/section-header/index.js +3 -3
  160. package/src/section-header/style.scss +5 -1
  161. package/src/select-control/GroupedSelectControl.js +1 -1
  162. package/src/select-control/style.scss +4 -4
  163. package/src/settings/MinMaxSetting.js +8 -6
  164. package/src/settings/style.scss +15 -2
  165. package/src/sortable-newsletter-list-control/index.js +137 -0
  166. package/src/sortable-newsletter-list-control/style.scss +45 -0
  167. package/src/steps-list/style.scss +2 -2
  168. package/src/steps-list-item/style.scss +5 -5
  169. package/src/style-card/index.js +11 -5
  170. package/src/style-card/style.scss +4 -4
  171. package/src/style.scss +14 -2
  172. package/src/tabbed-navigation/style.scss +4 -4
  173. package/src/text-control/index.tsx +65 -0
  174. package/src/web-preview/index.js +6 -6
  175. package/src/web-preview/style.scss +5 -5
  176. package/src/with-wizard/index.js +4 -4
  177. package/src/with-wizard/style.scss +44 -22
  178. package/src/with-wizard-screen/index.js +1 -1
  179. package/src/with-wizard-screen/style.scss +7 -7
  180. package/src/wizard/components/WizardError.js +1 -1
  181. package/src/wizard/index.js +3 -3
  182. package/src/wizard/store/index.js +9 -2
  183. package/dist/cjs/action-card/style.scss +0 -483
  184. package/dist/cjs/autocomplete-tokenfield/style.scss +0 -43
  185. package/dist/cjs/autocomplete-with-suggestions/style.scss +0 -171
  186. package/dist/cjs/button/index.js +0 -57
  187. package/dist/cjs/card/style.scss +0 -168
  188. package/dist/cjs/category-autocomplete/style.scss +0 -34
  189. package/dist/cjs/consts.js +0 -12
  190. package/dist/cjs/form-token-field/style.scss +0 -37
  191. package/dist/cjs/grid/index.js +0 -54
  192. package/dist/cjs/hooks/index.js +0 -26
  193. package/dist/cjs/hooks/usePrompt.js +0 -52
  194. package/dist/cjs/image-upload/index.js +0 -144
  195. package/dist/cjs/image-upload/style.scss +0 -103
  196. package/dist/cjs/modal/style.scss +0 -56
  197. package/dist/cjs/patrons-logo/index.js +0 -82
  198. package/dist/cjs/plugin-installer/index.js +0 -299
  199. package/dist/cjs/plugin-settings/index.js +0 -222
  200. package/dist/cjs/plugin-toggle/index.js +0 -222
  201. package/dist/cjs/plugin-toggle/style.scss +0 -20
  202. package/dist/cjs/proxied-imports/router.js +0 -15
  203. package/dist/cjs/section-header/style.scss +0 -41
  204. package/dist/cjs/settings/MinMaxSetting.js +0 -57
  205. package/dist/cjs/settings/SettingsSection.js +0 -37
  206. package/dist/cjs/steps-list/style.scss +0 -11
  207. package/dist/cjs/style-card/style.scss +0 -94
  208. package/dist/cjs/style.scss +0 -43
  209. package/dist/cjs/text-control/index.js +0 -71
  210. package/dist/cjs/utils/index.js +0 -40
  211. package/dist/cjs/web-preview/index.js +0 -189
  212. package/dist/cjs/with-wizard/index.js +0 -318
  213. package/dist/cjs/with-wizard/style.scss +0 -260
  214. package/dist/cjs/with-wizard-screen/style.scss +0 -160
  215. package/dist/esm/accordion/index.js +0 -38
  216. package/dist/esm/accordion/style.scss +0 -27
  217. package/dist/esm/action-card/index.js +0 -222
  218. package/dist/esm/autocomplete-tokenfield/index.js +0 -223
  219. package/dist/esm/autocomplete-with-suggestions/index.js +0 -289
  220. package/dist/esm/button/index.js +0 -48
  221. package/dist/esm/button/style.scss +0 -11
  222. package/dist/esm/button-card/index.js +0 -65
  223. package/dist/esm/button-card/style.scss +0 -174
  224. package/dist/esm/card/index.js +0 -43
  225. package/dist/esm/category-autocomplete/index.js +0 -185
  226. package/dist/esm/color-picker/index.js +0 -61
  227. package/dist/esm/color-picker/style.scss +0 -37
  228. package/dist/esm/consts.js +0 -3
  229. package/dist/esm/custom-select-control/index.js +0 -37
  230. package/dist/esm/custom-select-control/style.scss +0 -92
  231. package/dist/esm/date-range-picker/index.js +0 -32
  232. package/dist/esm/date-range-picker/style.scss +0 -148
  233. package/dist/esm/footer/index.js +0 -105
  234. package/dist/esm/footer/style.scss +0 -82
  235. package/dist/esm/form-token-field/index.js +0 -50
  236. package/dist/esm/global-notices/index.js +0 -30
  237. package/dist/esm/grid/index.js +0 -45
  238. package/dist/esm/grid/style.scss +0 -166
  239. package/dist/esm/handoff/index.js +0 -177
  240. package/dist/esm/handoff-message/index.js +0 -45
  241. package/dist/esm/hooks/index.js +0 -17
  242. package/dist/esm/hooks/useObjectState.js +0 -31
  243. package/dist/esm/hooks/useObjectState.test.js +0 -83
  244. package/dist/esm/hooks/useOnClickOutside.js +0 -31
  245. package/dist/esm/hooks/usePrompt.js +0 -43
  246. package/dist/esm/image-upload/index.js +0 -141
  247. package/dist/esm/image-upload/index.test.js +0 -28
  248. package/dist/esm/index.js +0 -47
  249. package/dist/esm/info-button/index.js +0 -42
  250. package/dist/esm/info-button/style.scss +0 -18
  251. package/dist/esm/modal/index.js +0 -39
  252. package/dist/esm/newspack-icon/index.js +0 -50
  253. package/dist/esm/newspack-icon/style.scss +0 -26
  254. package/dist/esm/newspack-logo/index.js +0 -46
  255. package/dist/esm/newspack-logo/style.scss +0 -30
  256. package/dist/esm/notice/index.js +0 -67
  257. package/dist/esm/notice/style.scss +0 -111
  258. package/dist/esm/patrons-logo/index.js +0 -76
  259. package/dist/esm/plugin-installer/index.js +0 -295
  260. package/dist/esm/plugin-installer/style.scss +0 -72
  261. package/dist/esm/plugin-settings/SettingsSection.js +0 -136
  262. package/dist/esm/plugin-settings/index.js +0 -217
  263. package/dist/esm/plugin-settings/style.scss +0 -7
  264. package/dist/esm/plugin-toggle/index.js +0 -217
  265. package/dist/esm/popover/index.js +0 -41
  266. package/dist/esm/popover/style.scss +0 -161
  267. package/dist/esm/position-control/index.js +0 -109
  268. package/dist/esm/position-control/style.scss +0 -66
  269. package/dist/esm/progress-bar/index.js +0 -69
  270. package/dist/esm/progress-bar/index.test.js +0 -110
  271. package/dist/esm/progress-bar/style.scss +0 -42
  272. package/dist/esm/proxied-imports/router.js +0 -8
  273. package/dist/esm/radio-control/index.js +0 -37
  274. package/dist/esm/radio-control/style.scss +0 -92
  275. package/dist/esm/section-header/index.js +0 -68
  276. package/dist/esm/select-control/ButtonGroupControl.js +0 -54
  277. package/dist/esm/select-control/GroupedSelectControl.js +0 -84
  278. package/dist/esm/select-control/index.js +0 -51
  279. package/dist/esm/select-control/style.scss +0 -108
  280. package/dist/esm/settings/MinMaxSetting.js +0 -53
  281. package/dist/esm/settings/SettingsCard.js +0 -39
  282. package/dist/esm/settings/SettingsSection.js +0 -30
  283. package/dist/esm/settings/index.js +0 -9
  284. package/dist/esm/settings/style.scss +0 -106
  285. package/dist/esm/steps-list/index.js +0 -43
  286. package/dist/esm/steps-list-item/index.js +0 -48
  287. package/dist/esm/steps-list-item/style.scss +0 -47
  288. package/dist/esm/style-card/index.js +0 -76
  289. package/dist/esm/tabbed-navigation/index.js +0 -56
  290. package/dist/esm/tabbed-navigation/style.scss +0 -86
  291. package/dist/esm/text-control/index.js +0 -66
  292. package/dist/esm/text-control/style.scss +0 -32
  293. package/dist/esm/utils/index.js +0 -32
  294. package/dist/esm/waiting/index.js +0 -44
  295. package/dist/esm/waiting/style.scss +0 -27
  296. package/dist/esm/web-preview/index.js +0 -184
  297. package/dist/esm/web-preview/style.scss +0 -155
  298. package/dist/esm/with-wizard/index.js +0 -313
  299. package/dist/esm/with-wizard-screen/index.js +0 -116
  300. package/dist/esm/wizard/components/WizardError.js +0 -69
  301. package/dist/esm/wizard/index.js +0 -126
  302. package/dist/esm/wizard/store/index.js +0 -155
  303. package/dist/esm/wizard/store/utils.js +0 -17
  304. package/src/grid/index.js +0 -44
  305. package/src/text-control/index.js +0 -56
  306. /package/dist/{cjs/info-button → info-button}/style.scss +0 -0
  307. /package/dist/{cjs/text-control → text-control}/style.scss +0 -0
  308. /package/dist/{cjs/waiting → waiting}/style.scss +0 -0
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
@@ -13,48 +13,47 @@ var _i18n = require("@wordpress/i18n");
13
13
  var _url = require("@wordpress/url");
14
14
  var _ = require("../");
15
15
  require("./style.scss");
16
- var _jsxRuntime = require("@emotion/react/jsx-runtime");
16
+ var _jsxRuntime = require("react/jsx-runtime");
17
17
  /**
18
18
  * WordPress dependencies
19
19
  */
20
- const __ = _i18n.__,
21
- _x = _i18n._x;
20
+
22
21
  /**
23
22
  * External dependencies.
24
23
  */
25
- const AutocompleteWithSuggestions = _ref => {
26
- let {
27
- fetchSavedPosts = false,
28
- // If passed, will use this function to fetch saved data.
29
- fetchSuggestions = false,
30
- // If passed, will use this function to fetch suggestions data.
31
- help = __('Begin typing search term, click autocomplete result to select.', 'newspack'),
32
- hideHelp = false,
33
- // If true, all help text will be hidden.
34
- label = __('Search', 'newspack'),
35
- maxItemsToSuggest = 0,
36
- // If passed, will be used to determine "load more" state. Necessary if you want "load more" functionality when using a custom `fetchSuggestions` function.
37
- multiSelect = false,
38
- // If true, component can select multiple values at once.
39
- onChange = false,
40
- // Function to call when selections change.
41
- onPostTypeChange = false,
42
- // Funciton to call when the post type selector is changed.
43
- postTypes = [{
44
- slug: 'post',
45
- label: 'Post'
46
- }],
47
- // If passed, will render a selector to change the post type queried for suggestions.
48
- postTypeLabel = __('item', 'newspack'),
49
- // String to describe the data being shown.
50
- postTypeLabelPlural = __('items', 'newspack'),
51
- // Plural string to describe the data being shown.
52
- selectedItems = [],
53
- // Array of saved items.
54
- selectedPost = 0,
55
- // Legacy prop when single-select was the only option.
56
- suggestionsToFetch = 10 // Number of suggestions to fetch per query.
57
- } = _ref;
24
+
25
+ const AutocompleteWithSuggestions = ({
26
+ fetchSavedPosts = false,
27
+ // If passed, will use this function to fetch saved data.
28
+ fetchSuggestions = false,
29
+ // If passed, will use this function to fetch suggestions data.
30
+ help = (0, _i18n.__)('Begin typing search term, click autocomplete result to select.', 'newspack-plugin'),
31
+ hideHelp = false,
32
+ // If true, all help text will be hidden.
33
+ label = (0, _i18n.__)('Search', 'newspack-plugin'),
34
+ maxItemsToSuggest = 0,
35
+ // If passed, will be used to determine "load more" state. Necessary if you want "load more" functionality when using a custom `fetchSuggestions` function.
36
+ multiSelect = false,
37
+ // If true, component can select multiple values at once.
38
+ onChange = false,
39
+ // Function to call when selections change.
40
+ onPostTypeChange = false,
41
+ // Funciton to call when the post type selector is changed.
42
+ postTypes = [{
43
+ slug: 'post',
44
+ label: 'Post'
45
+ }],
46
+ // If passed, will render a selector to change the post type queried for suggestions.
47
+ postTypeLabel = (0, _i18n.__)('item', 'newspack-plugin'),
48
+ // String to describe the data being shown.
49
+ postTypeLabelPlural = (0, _i18n.__)('items', 'newspack-plugin'),
50
+ // Plural string to describe the data being shown.
51
+ selectedItems = [],
52
+ // Array of saved items.
53
+ selectedPost = 0,
54
+ // Legacy prop when single-select was the only option.
55
+ suggestionsToFetch = 10 // Number of suggestions to fetch per query.
56
+ }) => {
58
57
  const [isLoading, setIsLoading] = (0, _element.useState)(true);
59
58
  const [isLoadingMore, setIsLoadingMore] = (0, _element.useState)(false);
60
59
  const [suggestions, setSuggestions] = (0, _element.useState)([]);
@@ -96,9 +95,7 @@ const AutocompleteWithSuggestions = _ref => {
96
95
  /**
97
96
  * If passed a `fetchSavedPosts` prop, use that, otherwise, build it based on the selected post type.
98
97
  */
99
- const handleFetchSaved = fetchSavedPosts ? fetchSavedPosts : async function () {
100
- let postIds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
101
- let searchSlug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
98
+ const handleFetchSaved = fetchSavedPosts ? fetchSavedPosts : async (postIds = [], searchSlug = null) => {
102
99
  const postTypeSlug = searchSlug || postTypeToSearch;
103
100
  const endpoint = 'post' === postTypeSlug || 'page' === postTypeSlug ? postTypeSlug + 's' // Default post type endpoints are plural.
104
101
  : postTypeSlug; // Custom post type endpoints are singular.
@@ -111,17 +108,14 @@ const AutocompleteWithSuggestions = _ref => {
111
108
  });
112
109
  return posts.map(post => ({
113
110
  value: parseInt(post.id),
114
- label: (0, _htmlEntities.decodeEntities)(post.title) || __('(no title)', 'newspack')
111
+ label: (0, _htmlEntities.decodeEntities)(post.title) || (0, _i18n.__)('(no title)', 'newspack-plugin')
115
112
  }));
116
113
  };
117
114
 
118
115
  /**
119
116
  * If passed a `fetchSuggestions` prop, use that, otherwise, build it based on the selected post type.
120
117
  */
121
- const handleFetchSuggestions = fetchSuggestions ? fetchSuggestions : async function () {
122
- let search = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
123
- let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
124
- let searchSlug = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
118
+ const handleFetchSuggestions = fetchSuggestions ? fetchSuggestions : async (search = null, offset = 0, searchSlug = null) => {
125
119
  const postTypeSlug = searchSlug || postTypeToSearch;
126
120
  const endpoint = 'post' === postTypeSlug || 'page' === postTypeSlug ? postTypeSlug + 's' // Default post type endpoints are plural.
127
121
  : postTypeSlug; // Custom post type endpoints are singular.
@@ -142,7 +136,7 @@ const AutocompleteWithSuggestions = _ref => {
142
136
  return posts.reduce((acc, post) => {
143
137
  acc.push({
144
138
  value: parseInt(post.id),
145
- label: (0, _htmlEntities.decodeEntities)(post?.title.rendered) || __('(no title)', 'newspack')
139
+ label: (0, _htmlEntities.decodeEntities)(post?.title.rendered) || (0, _i18n.__)('(no title)', 'newspack-plugin')
146
140
  });
147
141
  return acc;
148
142
  }, []);
@@ -187,20 +181,20 @@ const AutocompleteWithSuggestions = _ref => {
187
181
  const selections = selectedPost ? [...selectedItems, selectedPost] : selectedItems;
188
182
  const selectedMessage = multiSelect ? (0, _i18n.sprintf)(
189
183
  // Translators: %1: the length of selections. %2: the selection leabel.
190
- __('%1$s %2$s selected', 'newspack'), selections.length, selections.length > 1 ? postTypeLabelPlural : postTypeLabel) :
184
+ (0, _i18n.__)('%1$s %2$s selected', 'newspack-plugin'), selections.length, selections.length > 1 ? postTypeLabelPlural : postTypeLabel) : (0, _i18n.sprintf)(
191
185
  // Translators: %s: The label for the selection.
192
- (0, _i18n.sprintf)(__('Selected %s', 'newspack'), postTypeLabel);
193
- return (0, _jsxRuntime.jsxs)("div", {
186
+ (0, _i18n.__)('Selected %s', 'newspack-plugin'), postTypeLabel);
187
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
194
188
  className: "newspack-autocomplete-with-suggestions__selected-items",
195
- children: [(0, _jsxRuntime.jsxs)("p", {
189
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
196
190
  className: "newspack-autocomplete-with-suggestions__label",
197
- children: [selectedMessage, 1 < selections.length && _x(' – ', 'separator character', 'newspack'), 1 < selections.length && (0, _jsxRuntime.jsx)(_components.Button, {
191
+ children: [selectedMessage, 1 < selections.length && (0, _i18n._x)(' – ', 'separator character', 'newspack-plugin'), 1 < selections.length && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
198
192
  onClick: () => onChange([]),
199
193
  isLink: true,
200
194
  isDestructive: true,
201
- children: __('Clear all', 'newspack')
195
+ children: (0, _i18n.__)('Clear all', 'newspack-plugin')
202
196
  })]
203
- }), selections.map(selection => (0, _jsxRuntime.jsx)(_components.Button, {
197
+ }), selections.map(selection => /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
204
198
  className: "newspack-autocomplete-with-suggestions__selected-item-button",
205
199
  isTertiary: true,
206
200
  onClick: () => onChange(selections.filter(_selection => _selection.value !== selection.value)),
@@ -213,10 +207,10 @@ const AutocompleteWithSuggestions = _ref => {
213
207
  * Render post type select dropdown.
214
208
  */
215
209
  const renderPostTypeSelect = () => {
216
- return (0, _jsxRuntime.jsx)(_components.SelectControl, {
210
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl, {
217
211
  label: (0, _i18n.sprintf)(
218
212
  // Translators: %s: The name of the type.
219
- __('%s type', 'newspack'), postTypeLabel.charAt(0).toUpperCase() + postTypeLabel.slice(1)),
213
+ (0, _i18n.__)('%s type', 'newspack-plugin'), postTypeLabel.charAt(0).toUpperCase() + postTypeLabel.slice(1)),
220
214
  value: postTypeToSearch,
221
215
  options: postTypes.map(postTypeOption => ({
222
216
  label: postTypeOption.label,
@@ -235,13 +229,13 @@ const AutocompleteWithSuggestions = _ref => {
235
229
  if (multiSelect) {
236
230
  const selections = selectedPost ? [...selectedItems, selectedPost] : [...selectedItems];
237
231
  const isSelected = !!selections.find(_selection => parseInt(_selection.value) === parseInt(suggestion.value) && _selection.label === suggestion.label);
238
- return (0, _jsxRuntime.jsx)(_components.CheckboxControl, {
232
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.CheckboxControl, {
239
233
  checked: isSelected,
240
234
  onChange: () => handleOnChange([suggestion]),
241
235
  label: suggestion.label
242
236
  }, suggestion.value);
243
237
  }
244
- return (0, _jsxRuntime.jsx)(_components.Button, {
238
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
245
239
  isLink: true,
246
240
  onClick: () => handleOnChange([suggestion]),
247
241
  children: suggestion.label
@@ -252,43 +246,37 @@ const AutocompleteWithSuggestions = _ref => {
252
246
  * Render a list of suggestions that can be clicked to select instead of searching by title.
253
247
  */
254
248
  const renderSuggestions = () => {
255
- if (isLoading) {
256
- return (0, _jsxRuntime.jsx)("div", {
257
- className: "newspack-autocomplete-with-suggestions__suggestions-spinner",
258
- children: (0, _jsxRuntime.jsx)(_components.Spinner, {})
259
- });
260
- }
261
249
  if (0 === suggestions.length) {
262
250
  return null;
263
251
  }
264
252
  const className = multiSelect ? 'newspack-autocomplete-with-suggestions__search-suggestions-multiselect' : 'newspack-autocomplete-with-suggestions__search-suggestions';
265
- return (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
266
- children: [!hideHelp && (0, _jsxRuntime.jsx)("p", {
253
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
254
+ children: [!hideHelp && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
267
255
  className: "newspack-autocomplete-with-suggestions__label",
268
- children: /* Translators: %s: the name of a post type. */(0, _i18n.sprintf)(__('Or, select a recent %s:', 'newspack'), postTypeLabel)
269
- }), (0, _jsxRuntime.jsxs)("div", {
256
+ children: /* Translators: %s: the name of a post type. */(0, _i18n.sprintf)((0, _i18n.__)('Or, select a recent %s:', 'newspack-plugin'), postTypeLabel)
257
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
270
258
  className: className,
271
- children: [suggestions.map(renderSuggestion), suggestions.length < (maxItemsToSuggest || maxSuggestions) && (0, _jsxRuntime.jsx)(_components.Button, {
259
+ children: [suggestions.map(renderSuggestion), suggestions.length < (maxItemsToSuggest || maxSuggestions) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
272
260
  disabled: isLoadingMore,
273
261
  isSecondary: true,
274
262
  onClick: () => setIsLoadingMore(true),
275
- children: isLoadingMore ? __('Loading…', 'newspack') : __('Load more', 'newspack')
263
+ children: isLoadingMore ? (0, _i18n.__)('Loading…', 'newspack-plugin') : (0, _i18n.__)('Load more', 'newspack-plugin')
276
264
  })]
277
265
  })]
278
266
  });
279
267
  };
280
- return (0, _jsxRuntime.jsxs)("div", {
268
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
281
269
  className: classNames.join(' '),
282
- children: [0 < selectedItems.length && renderSelections(), 1 < postTypes.length && renderPostTypeSelect(), (0, _jsxRuntime.jsx)(_.AutocompleteTokenField, {
270
+ children: [0 < selectedItems.length && renderSelections(), 1 < postTypes.length && renderPostTypeSelect(), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.AutocompleteTokenField, {
283
271
  tokens: [],
284
272
  onChange: handleOnChange,
285
273
  fetchSuggestions: async search => handleFetchSuggestions(search, 0, postTypeToSearch),
286
274
  fetchSavedInfo: postIds => handleFetchSaved(postIds),
287
275
  label: label,
276
+ loading: isLoading,
288
277
  help: !hideHelp && help,
289
278
  returnFullObjects: true
290
279
  }), renderSuggestions()]
291
280
  });
292
281
  };
293
- var _default = AutocompleteWithSuggestions;
294
- exports.default = _default;
282
+ var _default = exports.default = AutocompleteWithSuggestions;
@@ -2,7 +2,7 @@
2
2
  * Styles for AutocompleteWithSuggestions component.
3
3
  */
4
4
 
5
- @use '~@wordpress/base-styles/colors' as wp-colors;
5
+ @use "~@wordpress/base-styles/colors" as wp-colors;
6
6
 
7
7
  .newspack-autocomplete-with-suggestions {
8
8
  width: 100%;
@@ -15,13 +15,6 @@
15
15
  margin-top: 16px;
16
16
  }
17
17
  }
18
-
19
- .components-spinner {
20
- margin: 8px;
21
- right: 0;
22
- top: calc( 1.4em + 8px );
23
- }
24
-
25
18
  .components-select-control__input {
26
19
  max-width: none;
27
20
  }
@@ -104,7 +97,7 @@
104
97
  padding-right: 8px;
105
98
 
106
99
  &::after {
107
- content: '✕';
100
+ content: "✕";
108
101
  margin-left: 8px;
109
102
  }
110
103
 
@@ -119,8 +112,7 @@
119
112
  border-radius: 2px;
120
113
  border: 1px solid wp-colors.$gray-700;
121
114
  max-height: 178px;
122
- overflow-x: visible;
123
- overflow-y: auto;
115
+ overflow: visible auto;
124
116
  padding: 8px 8px 0;
125
117
 
126
118
  .components-button {
@@ -134,10 +126,10 @@
134
126
  text-decoration: none;
135
127
  width: 100%;
136
128
 
137
- &:active:not( :disabled ),
138
- &:hover:not( :disabled ) {
129
+ &:active:not(:disabled),
130
+ &:hover:not(:disabled) {
139
131
  background: wp-colors.$gray-900;
140
- background: var( --wp-admin-theme-color );
132
+ background: var(--wp-admin-theme-color);
141
133
  color: white;
142
134
  }
143
135
  }
@@ -157,14 +149,14 @@
157
149
  .components-button {
158
150
  line-height: normal;
159
151
 
160
- &:focus:not( :disabled ) {
152
+ &:focus:not(:disabled) {
161
153
  border-radius: 0;
162
154
  box-shadow: inset 0 0 0 1.5px wp-colors.$gray-900;
163
- box-shadow: inset 0 0 0 var( --wp-admin-border-width-focus ) var( --wp-admin-theme-color );
155
+ box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
164
156
  }
165
157
 
166
158
  &.is-secondary {
167
- width: calc( 100% - 16px );
159
+ width: calc(100% - 16px);
168
160
  }
169
161
  }
170
162
  }
@@ -0,0 +1,51 @@
1
+ 'use strict';
2
+
3
+ var _interopRequireDefault = require( '@babel/runtime/helpers/interopRequireDefault' );
4
+ Object.defineProperty( exports, '__esModule', {
5
+ value: true,
6
+ } );
7
+ exports.default = void 0;
8
+ var _components = require( '@wordpress/components' );
9
+ var _element = require( '@wordpress/element' );
10
+ var _router = _interopRequireDefault( require( '../proxied-imports/router' ) );
11
+ require( './style.scss' );
12
+ var _jsxRuntime = require( 'react/jsx-runtime' );
13
+ /**
14
+ * Button
15
+ */
16
+
17
+ /**
18
+ * WordPress dependencies.
19
+ */
20
+
21
+ /**
22
+ * Internal dependencies
23
+ */
24
+
25
+ const { useHistory } = _router.default;
26
+ const Button = ( { href, onClick, ...otherProps } ) => {
27
+ const history = useHistory();
28
+ const [ isAwaitingOnClick, setIsAwaitingOnClick ] = ( 0,
29
+ _element.useState )( false );
30
+
31
+ // If both onClick and href are present, await the onClick action an then redirect.
32
+ if ( href && onClick ) {
33
+ otherProps.onClick = async () => {
34
+ setIsAwaitingOnClick( true );
35
+ await onClick();
36
+ setIsAwaitingOnClick( false );
37
+ history.push( ( href || '' ).replace( '#', '' ) );
38
+ };
39
+ } else {
40
+ otherProps.href = href;
41
+ otherProps.onClick = onClick;
42
+ }
43
+ if ( isAwaitingOnClick ) {
44
+ otherProps.disabled = true;
45
+ }
46
+ // @ts-ignore - @wordpress/components' Button can only have either href or onClick, not both.
47
+ return /*#__PURE__*/ ( 0, _jsxRuntime.jsx )( _components.Button, {
48
+ ...otherProps,
49
+ } );
50
+ };
51
+ var _default = ( exports.default = Button );
@@ -16,25 +16,32 @@ import './style.scss';
16
16
 
17
17
  const { useHistory } = Router;
18
18
 
19
- const Button = ( { href, onClick, ...otherProps } ) => {
19
+ type OriginalButtonProps = typeof BaseComponent.defaultProps;
20
+ type Props = OriginalButtonProps & {
21
+ href?: string;
22
+ onClick?: () => void;
23
+ };
24
+
25
+ const Button = ( { href, onClick, ...otherProps }: Props ) => {
20
26
  const history = useHistory();
21
27
  const [ isAwaitingOnClick, setIsAwaitingOnClick ] = useState( false );
22
28
 
23
29
  // If both onClick and href are present, await the onClick action an then redirect.
24
30
  if ( href && onClick ) {
25
- otherProps.onClick = async () => {
31
+ ( otherProps as Props ).onClick = async () => {
26
32
  setIsAwaitingOnClick( true );
27
33
  await onClick();
28
34
  setIsAwaitingOnClick( false );
29
- history.push( href.replace( '#', '' ) );
35
+ history.push( ( href || '' ).replace( '#', '' ) );
30
36
  };
31
37
  } else {
32
- otherProps.href = href;
33
- otherProps.onClick = onClick;
38
+ ( otherProps as Props ).href = href;
39
+ ( otherProps as Props ).onClick = onClick;
34
40
  }
35
41
  if ( isAwaitingOnClick ) {
36
42
  otherProps.disabled = true;
37
43
  }
44
+ // @ts-ignore - @wordpress/components' Button can only have either href or onClick, not both.
38
45
  return <BaseComponent { ...otherProps } />;
39
46
  };
40
47
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  .components-button {
6
6
  &.is-destructive {
7
- &:hover:not( :disabled ) {
7
+ &:hover:not(:disabled) {
8
8
  box-shadow: none;
9
9
  }
10
10
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
@@ -10,7 +10,7 @@ var _icons = require("@wordpress/icons");
10
10
  var _ = require("../");
11
11
  require("./style.scss");
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
- var _jsxRuntime = require("@emotion/react/jsx-runtime");
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
14
  /**
15
15
  * Button Card
16
16
  */
@@ -45,23 +45,23 @@ class ButtonCard extends _element.Component {
45
45
  ...otherProps
46
46
  } = this.props;
47
47
  const classes = (0, _classnames.default)('newspack-button-card', className, chevron && 'has-chevron', grouped && 'grouped', icon && 'has-icon', isDestructive && 'is-destructive', isPressed && 'is-pressed', isSmall && 'is-small');
48
- return (0, _jsxRuntime.jsxs)("a", {
48
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("a", {
49
49
  className: classes,
50
50
  ...otherProps,
51
- children: [icon && (0, _jsxRuntime.jsx)(_icons.Icon, {
51
+ children: [icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.Icon, {
52
52
  icon: icon,
53
53
  height: 48,
54
54
  width: 48
55
- }), (0, _jsxRuntime.jsxs)(_.Grid, {
55
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.Grid, {
56
56
  noMargin: true,
57
57
  columns: 1,
58
58
  gutter: 8,
59
- children: [title && (0, _jsxRuntime.jsx)("h3", {
59
+ children: [title && /*#__PURE__*/(0, _jsxRuntime.jsx)("h3", {
60
60
  children: title
61
- }), desc && (0, _jsxRuntime.jsx)("p", {
61
+ }), desc && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
62
62
  children: desc
63
63
  })]
64
- }), chevron && (0, _jsxRuntime.jsx)(_icons.Icon, {
64
+ }), chevron && /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.Icon, {
65
65
  icon: _icons.chevronRight,
66
66
  height: 24,
67
67
  width: 24
@@ -69,5 +69,4 @@ class ButtonCard extends _element.Component {
69
69
  });
70
70
  }
71
71
  }
72
- var _default = ButtonCard;
73
- exports.default = _default;
72
+ var _default = exports.default = ButtonCard;
@@ -2,40 +2,44 @@
2
2
  * Button Card
3
3
  */
4
4
 
5
- @use '~@wordpress/base-styles/colors' as wp-colors;
5
+ @use "~@wordpress/base-styles/colors" as wp-colors;
6
6
 
7
7
  .newspack-button-card {
8
8
  background: white;
9
9
  border-radius: 2px;
10
10
  border: 1px solid wp-colors.$gray-300;
11
- box-shadow: inset 0 0 0 var( --wp-admin-border-width-focus ) transparent;
11
+ box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) transparent;
12
12
  cursor: pointer;
13
13
  display: block;
14
14
  margin: 32px 0;
15
15
  padding: 32px;
16
16
  position: relative;
17
17
  text-decoration: none;
18
- transition: background-color 125ms ease-in-out, border-color 125ms ease-in-out,
18
+ transition:
19
+ background-color 125ms ease-in-out,
20
+ border-color 125ms ease-in-out,
19
21
  box-shadow 125ms ease-in-out;
20
22
 
21
23
  &:focus,
22
24
  &.is-pressed {
23
25
  background: white;
24
- border-color: var( --wp-admin-theme-color );
25
- box-shadow: inset 0 0 0 1px var( --wp-admin-theme-color ) !important;
26
+ border-color: var(--wp-admin-theme-color);
27
+ box-shadow: inset 0 0 0 1px var(--wp-admin-theme-color) !important;
26
28
  outline: none !important;
27
29
  z-index: 1;
28
30
  }
29
31
 
30
32
  &.is-pressed:focus-visible {
31
- box-shadow: inset 0 0 0 1px var( --wp-admin-theme-color ), 0 0 0 1px white,
32
- 0 0 0 var( --wp-admin-border-width-focus ) var( --wp-admin-theme-color ) !important;
33
+ box-shadow:
34
+ inset 0 0 0 1px var(--wp-admin-theme-color),
35
+ 0 0 0 1px white,
36
+ 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color) !important;
33
37
  }
34
38
 
35
39
  &:active,
36
40
  &:hover {
37
- border-color: var( --wp-admin-theme-color );
38
- color: var( --wp-admin-theme-color );
41
+ border-color: var(--wp-admin-theme-color);
42
+ color: var(--wp-admin-theme-color);
39
43
  text-decoration: none;
40
44
  z-index: 1;
41
45
 
@@ -63,7 +67,7 @@
63
67
  &.grouped {
64
68
  border-radius: 0;
65
69
 
66
- & + &:not( .br--top ) {
70
+ & + &:not(.br--top) {
67
71
  margin-top: -33px;
68
72
  }
69
73
 
@@ -95,7 +99,7 @@
95
99
  }
96
100
 
97
101
  svg {
98
- fill: var( --wp-admin-theme-color );
102
+ fill: var(--wp-admin-theme-color);
99
103
  transition: fill 125ms ease-in-out;
100
104
  }
101
105
  }
@@ -161,8 +165,10 @@
161
165
  }
162
166
 
163
167
  &.is-pressed:focus-visible {
164
- box-shadow: inset 0 0 0 1px wp-colors.$alert-red, 0 0 0 1px white,
165
- 0 0 0 var( --wp-admin-border-width-focus ) wp-colors.$alert-red !important;
168
+ box-shadow:
169
+ inset 0 0 0 1px wp-colors.$alert-red,
170
+ 0 0 0 1px white,
171
+ 0 0 0 var(--wp-admin-border-width-focus) wp-colors.$alert-red !important;
166
172
  }
167
173
 
168
174
  &:active,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
@@ -8,7 +8,7 @@ exports.default = void 0;
8
8
  var _element = require("@wordpress/element");
9
9
  require("./style.scss");
10
10
  var _classnames = _interopRequireDefault(require("classnames"));
11
- var _jsxRuntime = require("@emotion/react/jsx-runtime");
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
12
  /**
13
13
  * Card
14
14
  */
@@ -42,11 +42,10 @@ class Card extends _element.Component {
42
42
  ...otherProps
43
43
  } = this.props;
44
44
  const classes = (0, _classnames.default)('newspack-card', className, buttonsCard && 'newspack-card__buttons-card', headerActions && 'newspack-card__header-actions', isMedium && 'newspack-card__is-medium', isNarrow && 'newspack-card__is-narrow', isSmall && 'newspack-card__is-small', isWhite && 'newspack-card__is-white', noBorder && 'newspack-card__no-border');
45
- return (0, _jsxRuntime.jsx)("div", {
45
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
46
46
  className: classes,
47
47
  ...otherProps
48
48
  });
49
49
  }
50
50
  }
51
- var _default = Card;
52
- exports.default = _default;
51
+ var _default = exports.default = Card;
@@ -2,7 +2,7 @@
2
2
  * Card
3
3
  */
4
4
 
5
- @use '~@wordpress/base-styles/colors' as wp-colors;
5
+ @use "~@wordpress/base-styles/colors" as wp-colors;
6
6
 
7
7
  .newspack-card {
8
8
  border-radius: 2px;