newspack-components 3.0.0-alpha.2 → 3.0.0-alpha.4

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 (227) hide show
  1. package/babel.config.cjs.js +26 -0
  2. package/babel.config.js +1 -0
  3. package/copy-styles.js +10 -2
  4. package/dist/cjs/button/index.js +56 -0
  5. package/dist/cjs/grid/index.js +37 -0
  6. package/dist/cjs/hooks/index.js +25 -0
  7. package/dist/cjs/hooks/usePrompt.js +49 -0
  8. package/dist/cjs/text-control/index.js +64 -0
  9. package/dist/esm/accordion/index.js +42 -0
  10. package/dist/esm/accordion/style.scss +31 -0
  11. package/dist/esm/action-card/index.js +218 -0
  12. package/dist/esm/action-card/style.scss +483 -0
  13. package/dist/esm/autocomplete-tokenfield/index.js +261 -0
  14. package/dist/esm/autocomplete-tokenfield/style.scss +49 -0
  15. package/dist/esm/autocomplete-with-suggestions/index.js +274 -0
  16. package/dist/esm/autocomplete-with-suggestions/style.scss +163 -0
  17. package/dist/esm/button/index.js +48 -0
  18. package/dist/esm/button/style.scss +11 -0
  19. package/dist/esm/button-card/index.js +64 -0
  20. package/dist/esm/button-card/style.scss +180 -0
  21. package/dist/esm/card/index.js +43 -0
  22. package/dist/esm/card/style.scss +168 -0
  23. package/dist/esm/category-autocomplete/index.js +183 -0
  24. package/dist/esm/category-autocomplete/style.scss +34 -0
  25. package/dist/esm/color-picker/index.js +59 -0
  26. package/dist/esm/color-picker/style.scss +37 -0
  27. package/dist/esm/consts.js +1 -0
  28. package/dist/esm/custom-select-control/index.js +37 -0
  29. package/dist/esm/custom-select-control/style.scss +93 -0
  30. package/dist/esm/date-range-picker/index.js +31 -0
  31. package/dist/esm/date-range-picker/style.scss +148 -0
  32. package/dist/esm/footer/index.js +99 -0
  33. package/dist/esm/footer/style.scss +82 -0
  34. package/dist/esm/form-token-field/index.js +49 -0
  35. package/dist/esm/form-token-field/style.scss +37 -0
  36. package/dist/esm/global-notices/index.js +30 -0
  37. package/dist/esm/grid/index.js +29 -0
  38. package/dist/esm/grid/style.scss +166 -0
  39. package/dist/esm/handoff/index.js +175 -0
  40. package/dist/esm/handoff-message/index.js +47 -0
  41. package/dist/esm/hooks/index.js +17 -0
  42. package/dist/esm/hooks/useObjectState.js +30 -0
  43. package/dist/esm/hooks/useObjectState.test.js +82 -0
  44. package/dist/esm/hooks/useOnClickOutside.js +31 -0
  45. package/dist/esm/hooks/usePrompt.js +40 -0
  46. package/dist/esm/image-upload/index.js +140 -0
  47. package/dist/esm/image-upload/index.test.js +34 -0
  48. package/dist/esm/image-upload/style.scss +103 -0
  49. package/dist/esm/index.js +47 -0
  50. package/dist/esm/info-button/index.js +42 -0
  51. package/dist/esm/info-button/style.scss +18 -0
  52. package/dist/esm/modal/index.js +39 -0
  53. package/dist/esm/modal/style.scss +56 -0
  54. package/dist/esm/newspack-icon/index.js +50 -0
  55. package/dist/esm/newspack-icon/style.scss +26 -0
  56. package/dist/esm/newspack-logo/index.js +46 -0
  57. package/dist/esm/newspack-logo/style.scss +30 -0
  58. package/dist/esm/notice/index.js +65 -0
  59. package/dist/esm/notice/style.scss +111 -0
  60. package/dist/esm/patrons-logo/index.js +70 -0
  61. package/dist/esm/plugin-installer/index.js +289 -0
  62. package/dist/esm/plugin-installer/style.scss +72 -0
  63. package/dist/esm/plugin-settings/SettingsSection.js +133 -0
  64. package/dist/esm/plugin-settings/index.js +220 -0
  65. package/dist/esm/plugin-settings/style.scss +7 -0
  66. package/dist/esm/plugin-toggle/index.js +216 -0
  67. package/dist/esm/plugin-toggle/style.scss +20 -0
  68. package/dist/esm/popover/index.js +41 -0
  69. package/dist/esm/popover/style.scss +161 -0
  70. package/dist/esm/position-control/index.js +106 -0
  71. package/dist/esm/position-control/style.scss +66 -0
  72. package/dist/esm/progress-bar/index.js +68 -0
  73. package/dist/esm/progress-bar/index.test.js +108 -0
  74. package/dist/esm/progress-bar/style.scss +42 -0
  75. package/dist/esm/proxied-imports/router.js +8 -0
  76. package/dist/esm/radio-control/index.js +37 -0
  77. package/dist/esm/radio-control/style.scss +92 -0
  78. package/dist/esm/section-header/index.js +67 -0
  79. package/dist/esm/section-header/style.scss +45 -0
  80. package/dist/esm/select-control/ButtonGroupControl.js +53 -0
  81. package/dist/esm/select-control/GroupedSelectControl.js +78 -0
  82. package/dist/esm/select-control/index.js +51 -0
  83. package/dist/esm/select-control/style.scss +108 -0
  84. package/dist/esm/settings/MinMaxSetting.js +53 -0
  85. package/dist/esm/settings/SettingsCard.js +38 -0
  86. package/dist/esm/settings/SettingsSection.js +26 -0
  87. package/dist/esm/settings/index.js +9 -0
  88. package/dist/esm/settings/style.scss +119 -0
  89. package/dist/esm/sortable-newsletter-list-control/index.js +127 -0
  90. package/dist/esm/sortable-newsletter-list-control/style.scss +45 -0
  91. package/dist/esm/steps-list/index.js +43 -0
  92. package/dist/esm/steps-list/style.scss +11 -0
  93. package/dist/esm/steps-list-item/index.js +47 -0
  94. package/dist/esm/steps-list-item/style.scss +47 -0
  95. package/dist/esm/style-card/index.js +74 -0
  96. package/dist/esm/style-card/style.scss +94 -0
  97. package/dist/esm/style.scss +55 -0
  98. package/dist/esm/tabbed-navigation/index.js +53 -0
  99. package/dist/esm/tabbed-navigation/style.scss +86 -0
  100. package/dist/esm/text-control/index.js +56 -0
  101. package/dist/esm/text-control/style.scss +32 -0
  102. package/dist/esm/utils/index.js +29 -0
  103. package/dist/esm/waiting/index.js +44 -0
  104. package/dist/esm/waiting/style.scss +27 -0
  105. package/dist/esm/web-preview/index.js +183 -0
  106. package/dist/esm/web-preview/style.scss +155 -0
  107. package/dist/esm/with-wizard/index.js +320 -0
  108. package/dist/esm/with-wizard/style.scss +282 -0
  109. package/dist/esm/with-wizard-screen/index.js +109 -0
  110. package/dist/esm/with-wizard-screen/style.scss +160 -0
  111. package/dist/esm/wizard/components/WizardError.js +66 -0
  112. package/dist/esm/wizard/index.js +119 -0
  113. package/dist/esm/wizard/store/index.js +155 -0
  114. package/dist/esm/wizard/store/utils.js +14 -0
  115. package/package.json +8 -4
  116. package/dist/button/index.js +0 -51
  117. package/dist/button/index.tsx +0 -48
  118. package/dist/grid/index.js +0 -44
  119. package/dist/grid/index.tsx +0 -34
  120. package/dist/hooks/index.js +0 -29
  121. package/dist/hooks/index.ts +0 -15
  122. package/dist/hooks/usePrompt.js +0 -47
  123. package/dist/hooks/usePrompt.ts +0 -46
  124. package/dist/plugin-toggle/README.md +0 -53
  125. package/dist/text-control/index.js +0 -76
  126. package/dist/text-control/index.tsx +0 -71
  127. /package/dist/{accordion → cjs/accordion}/index.js +0 -0
  128. /package/dist/{accordion → cjs/accordion}/style.scss +0 -0
  129. /package/dist/{action-card → cjs/action-card}/index.js +0 -0
  130. /package/dist/{action-card → cjs/action-card}/style.scss +0 -0
  131. /package/dist/{autocomplete-tokenfield → cjs/autocomplete-tokenfield}/index.js +0 -0
  132. /package/dist/{autocomplete-tokenfield → cjs/autocomplete-tokenfield}/style.scss +0 -0
  133. /package/dist/{autocomplete-with-suggestions → cjs/autocomplete-with-suggestions}/index.js +0 -0
  134. /package/dist/{autocomplete-with-suggestions → cjs/autocomplete-with-suggestions}/style.scss +0 -0
  135. /package/dist/{button → cjs/button}/style.scss +0 -0
  136. /package/dist/{button-card → cjs/button-card}/index.js +0 -0
  137. /package/dist/{button-card → cjs/button-card}/style.scss +0 -0
  138. /package/dist/{card → cjs/card}/index.js +0 -0
  139. /package/dist/{card → cjs/card}/style.scss +0 -0
  140. /package/dist/{category-autocomplete → cjs/category-autocomplete}/index.js +0 -0
  141. /package/dist/{category-autocomplete → cjs/category-autocomplete}/style.scss +0 -0
  142. /package/dist/{color-picker → cjs/color-picker}/index.js +0 -0
  143. /package/dist/{color-picker → cjs/color-picker}/style.scss +0 -0
  144. /package/dist/{consts.js → cjs/consts.js} +0 -0
  145. /package/dist/{custom-select-control → cjs/custom-select-control}/index.js +0 -0
  146. /package/dist/{custom-select-control → cjs/custom-select-control}/style.scss +0 -0
  147. /package/dist/{date-range-picker → cjs/date-range-picker}/index.js +0 -0
  148. /package/dist/{date-range-picker → cjs/date-range-picker}/style.scss +0 -0
  149. /package/dist/{footer → cjs/footer}/index.js +0 -0
  150. /package/dist/{footer → cjs/footer}/style.scss +0 -0
  151. /package/dist/{form-token-field → cjs/form-token-field}/index.js +0 -0
  152. /package/dist/{form-token-field → cjs/form-token-field}/style.scss +0 -0
  153. /package/dist/{global-notices → cjs/global-notices}/index.js +0 -0
  154. /package/dist/{grid → cjs/grid}/style.scss +0 -0
  155. /package/dist/{handoff → cjs/handoff}/index.js +0 -0
  156. /package/dist/{handoff-message → cjs/handoff-message}/index.js +0 -0
  157. /package/dist/{hooks → cjs/hooks}/useObjectState.js +0 -0
  158. /package/dist/{hooks → cjs/hooks}/useObjectState.test.js +0 -0
  159. /package/dist/{hooks → cjs/hooks}/useOnClickOutside.js +0 -0
  160. /package/dist/{image-upload → cjs/image-upload}/index.js +0 -0
  161. /package/dist/{image-upload → cjs/image-upload}/index.test.js +0 -0
  162. /package/dist/{image-upload → cjs/image-upload}/style.scss +0 -0
  163. /package/dist/{index.js → cjs/index.js} +0 -0
  164. /package/dist/{info-button → cjs/info-button}/index.js +0 -0
  165. /package/dist/{info-button → cjs/info-button}/style.scss +0 -0
  166. /package/dist/{modal → cjs/modal}/index.js +0 -0
  167. /package/dist/{modal → cjs/modal}/style.scss +0 -0
  168. /package/dist/{newspack-icon → cjs/newspack-icon}/index.js +0 -0
  169. /package/dist/{newspack-icon → cjs/newspack-icon}/style.scss +0 -0
  170. /package/dist/{newspack-logo → cjs/newspack-logo}/index.js +0 -0
  171. /package/dist/{newspack-logo → cjs/newspack-logo}/style.scss +0 -0
  172. /package/dist/{notice → cjs/notice}/index.js +0 -0
  173. /package/dist/{notice → cjs/notice}/style.scss +0 -0
  174. /package/dist/{patrons-logo → cjs/patrons-logo}/index.js +0 -0
  175. /package/dist/{plugin-installer → cjs/plugin-installer}/index.js +0 -0
  176. /package/dist/{plugin-installer → cjs/plugin-installer}/style.scss +0 -0
  177. /package/dist/{plugin-settings → cjs/plugin-settings}/SettingsSection.js +0 -0
  178. /package/dist/{plugin-settings → cjs/plugin-settings}/index.js +0 -0
  179. /package/dist/{plugin-settings → cjs/plugin-settings}/style.scss +0 -0
  180. /package/dist/{plugin-toggle → cjs/plugin-toggle}/index.js +0 -0
  181. /package/dist/{plugin-toggle → cjs/plugin-toggle}/style.scss +0 -0
  182. /package/dist/{popover → cjs/popover}/index.js +0 -0
  183. /package/dist/{popover → cjs/popover}/style.scss +0 -0
  184. /package/dist/{position-control → cjs/position-control}/index.js +0 -0
  185. /package/dist/{position-control → cjs/position-control}/style.scss +0 -0
  186. /package/dist/{progress-bar → cjs/progress-bar}/index.js +0 -0
  187. /package/dist/{progress-bar → cjs/progress-bar}/index.test.js +0 -0
  188. /package/dist/{progress-bar → cjs/progress-bar}/style.scss +0 -0
  189. /package/dist/{proxied-imports → cjs/proxied-imports}/router.js +0 -0
  190. /package/dist/{radio-control → cjs/radio-control}/index.js +0 -0
  191. /package/dist/{radio-control → cjs/radio-control}/style.scss +0 -0
  192. /package/dist/{section-header → cjs/section-header}/index.js +0 -0
  193. /package/dist/{section-header → cjs/section-header}/style.scss +0 -0
  194. /package/dist/{select-control → cjs/select-control}/ButtonGroupControl.js +0 -0
  195. /package/dist/{select-control → cjs/select-control}/GroupedSelectControl.js +0 -0
  196. /package/dist/{select-control → cjs/select-control}/index.js +0 -0
  197. /package/dist/{select-control → cjs/select-control}/style.scss +0 -0
  198. /package/dist/{settings → cjs/settings}/MinMaxSetting.js +0 -0
  199. /package/dist/{settings → cjs/settings}/SettingsCard.js +0 -0
  200. /package/dist/{settings → cjs/settings}/SettingsSection.js +0 -0
  201. /package/dist/{settings → cjs/settings}/index.js +0 -0
  202. /package/dist/{settings → cjs/settings}/style.scss +0 -0
  203. /package/dist/{sortable-newsletter-list-control → cjs/sortable-newsletter-list-control}/index.js +0 -0
  204. /package/dist/{sortable-newsletter-list-control → cjs/sortable-newsletter-list-control}/style.scss +0 -0
  205. /package/dist/{steps-list → cjs/steps-list}/index.js +0 -0
  206. /package/dist/{steps-list → cjs/steps-list}/style.scss +0 -0
  207. /package/dist/{steps-list-item → cjs/steps-list-item}/index.js +0 -0
  208. /package/dist/{steps-list-item → cjs/steps-list-item}/style.scss +0 -0
  209. /package/dist/{style-card → cjs/style-card}/index.js +0 -0
  210. /package/dist/{style-card → cjs/style-card}/style.scss +0 -0
  211. /package/dist/{style.scss → cjs/style.scss} +0 -0
  212. /package/dist/{tabbed-navigation → cjs/tabbed-navigation}/index.js +0 -0
  213. /package/dist/{tabbed-navigation → cjs/tabbed-navigation}/style.scss +0 -0
  214. /package/dist/{text-control → cjs/text-control}/style.scss +0 -0
  215. /package/dist/{utils → cjs/utils}/index.js +0 -0
  216. /package/dist/{waiting → cjs/waiting}/index.js +0 -0
  217. /package/dist/{waiting → cjs/waiting}/style.scss +0 -0
  218. /package/dist/{web-preview → cjs/web-preview}/index.js +0 -0
  219. /package/dist/{web-preview → cjs/web-preview}/style.scss +0 -0
  220. /package/dist/{with-wizard → cjs/with-wizard}/index.js +0 -0
  221. /package/dist/{with-wizard → cjs/with-wizard}/style.scss +0 -0
  222. /package/dist/{with-wizard-screen → cjs/with-wizard-screen}/index.js +0 -0
  223. /package/dist/{with-wizard-screen → cjs/with-wizard-screen}/style.scss +0 -0
  224. /package/dist/{wizard → cjs/wizard}/components/WizardError.js +0 -0
  225. /package/dist/{wizard → cjs/wizard}/index.js +0 -0
  226. /package/dist/{wizard → cjs/wizard}/store/index.js +0 -0
  227. /package/dist/{wizard → cjs/wizard}/store/utils.js +0 -0
@@ -0,0 +1,140 @@
1
+ /**
2
+ * Image Upload
3
+ */
4
+
5
+ /**
6
+ * WordPress dependencies.
7
+ */
8
+ import { Component } from '@wordpress/element';
9
+ import { __ } from '@wordpress/i18n';
10
+
11
+ /**
12
+ * Internal dependencies.
13
+ */
14
+ import { Button, InfoButton } from '../';
15
+ import './style.scss';
16
+
17
+ /**
18
+ * External dependencies.
19
+ */
20
+ import classnames from 'classnames';
21
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
22
+ class ImageUpload extends Component {
23
+ /**
24
+ * Constructor.
25
+ */
26
+ constructor() {
27
+ super(...arguments);
28
+ this.state = {
29
+ frame: false
30
+ };
31
+ }
32
+
33
+ /**
34
+ * Open the WP media modal.
35
+ */
36
+ openModal = () => {
37
+ if (this.state.frame) {
38
+ this.state.frame.open();
39
+ return;
40
+ }
41
+ this.setState({
42
+ frame: wp.media({
43
+ title: __('Select or upload image'),
44
+ button: {
45
+ text: __('Select')
46
+ },
47
+ library: {
48
+ type: 'image'
49
+ },
50
+ multiple: false
51
+ })
52
+ }, () => {
53
+ this.state.frame.on('select', this.handleImageSelect);
54
+ this.state.frame.open();
55
+ });
56
+ };
57
+
58
+ /**
59
+ * Update the state when an image is selected from the media modal.
60
+ */
61
+ handleImageSelect = () => {
62
+ const {
63
+ onChange
64
+ } = this.props;
65
+ const attachment = this.state.frame.state().get('selection').first().toJSON();
66
+ onChange(attachment);
67
+ };
68
+
69
+ /**
70
+ * Render.
71
+ */
72
+ render = () => {
73
+ const {
74
+ buttonLabel,
75
+ className,
76
+ disabled,
77
+ help,
78
+ image,
79
+ info,
80
+ isCovering,
81
+ label,
82
+ onChange,
83
+ style = {}
84
+ } = this.props;
85
+ const classes = classnames('newspack-image-upload__image', {
86
+ 'newspack-image-upload__image--has-image': image
87
+ }, {
88
+ 'newspack-image-upload__image--covering': isCovering
89
+ });
90
+ return /*#__PURE__*/_jsxs("div", {
91
+ className: classnames('newspack-image-upload', className),
92
+ children: [/*#__PURE__*/_jsxs("div", {
93
+ className: "newspack-image-upload__header",
94
+ children: [label && /*#__PURE__*/_jsx("label", {
95
+ className: "newspack-image-upload__label",
96
+ children: label
97
+ }), info && /*#__PURE__*/_jsx(InfoButton, {
98
+ text: info
99
+ })]
100
+ }), /*#__PURE__*/_jsx("div", {
101
+ className: classes,
102
+ style: {
103
+ ...style
104
+ },
105
+ children: image?.url ? /*#__PURE__*/_jsxs(_Fragment, {
106
+ children: [/*#__PURE__*/_jsx("img", {
107
+ "data-testid": "image-upload",
108
+ src: image.url,
109
+ alt: __('Image preview', 'newspack-plugin')
110
+ }), /*#__PURE__*/_jsxs("div", {
111
+ className: "newspack-image-upload__controls",
112
+ children: [/*#__PURE__*/_jsx(Button, {
113
+ disabled: disabled,
114
+ onClick: this.openModal,
115
+ isLink: true,
116
+ children: __('Replace', 'newspack-plugin')
117
+ }), /*#__PURE__*/_jsx("span", {
118
+ className: "sep"
119
+ }), /*#__PURE__*/_jsx(Button, {
120
+ disabled: disabled,
121
+ onClick: () => onChange(null),
122
+ isLink: true,
123
+ isDestructive: true,
124
+ children: __('Remove', 'newspack-plugin')
125
+ })]
126
+ })]
127
+ }) : /*#__PURE__*/_jsx(Button, {
128
+ disabled: disabled,
129
+ onClick: this.openModal,
130
+ isLink: true,
131
+ children: buttonLabel ? buttonLabel : __('Upload', 'newspack-plugin')
132
+ })
133
+ }), help && /*#__PURE__*/_jsx("p", {
134
+ className: "newspack-image-upload__help",
135
+ children: help
136
+ })]
137
+ });
138
+ };
139
+ }
140
+ export default ImageUpload;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { render } from '@testing-library/react';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import ImageUpload from './';
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ describe('ImageUpload', () => {
12
+ it('should render an add image button', () => {
13
+ const {
14
+ getByText
15
+ } = render( /*#__PURE__*/_jsx(ImageUpload, {}));
16
+ expect(getByText('Upload')).toBeInTheDocument();
17
+ });
18
+ it('should render replace and remove buttons if there is an image provided', () => {
19
+ const image = {
20
+ id: 1234,
21
+ url: 'https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg'
22
+ };
23
+ const {
24
+ getByText,
25
+ getByTestId
26
+ } = render( /*#__PURE__*/_jsx(ImageUpload, {
27
+ image: image
28
+ }));
29
+ expect(getByText('Remove')).toBeInTheDocument();
30
+ expect(getByText('Replace')).toBeInTheDocument();
31
+ expect(getByTestId('image-upload')).toBeInTheDocument();
32
+ expect(getByTestId('image-upload').getAttribute('src')).toEqual(image.url);
33
+ });
34
+ });
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Image Upload
3
+ */
4
+
5
+ @use "~@wordpress/base-styles/colors" as wp-colors;
6
+
7
+ .newspack-image-upload {
8
+ margin: 32px 0;
9
+ &__header {
10
+ display: flex;
11
+ }
12
+ &__label {
13
+ margin: 0 0 8px;
14
+ }
15
+ &__image {
16
+ align-items: center;
17
+ background-repeat: no-repeat;
18
+ background-size: contain;
19
+ background-position: center;
20
+ border: 1px dashed wp-colors.$gray-700;
21
+ border-radius: 2px;
22
+ display: flex;
23
+ justify-content: center;
24
+ max-width: 100%;
25
+ min-height: 48px;
26
+ position: relative;
27
+ &--covering {
28
+ background-size: cover;
29
+ }
30
+ &:not(&--has-image) {
31
+ .newspack-button {
32
+ background: white !important;
33
+ border-radius: 2px !important;
34
+ padding: 4px 16px !important;
35
+
36
+ &:active,
37
+ &:focus,
38
+ &:hover {
39
+ background: white !important;
40
+ }
41
+
42
+ &:focus {
43
+ outline-offset: -3px !important;
44
+ }
45
+ }
46
+ }
47
+ &--has-image {
48
+ border: none;
49
+ overflow: hidden;
50
+ &::before,
51
+ &::after {
52
+ border: 1px solid rgba(black, 0.54);
53
+ border-radius: 2px;
54
+ content: "";
55
+ inset: 0;
56
+ position: absolute;
57
+ z-index: 0;
58
+ }
59
+ button,
60
+ &::after {
61
+ opacity: 0;
62
+ transition: opacity 125ms;
63
+ }
64
+ button {
65
+ z-index: 1;
66
+ position: relative;
67
+ }
68
+ &::after {
69
+ background: rgba(white, 0.9);
70
+ border-color: wp-colors.$gray-700;
71
+ }
72
+ &:focus-within,
73
+ &:hover {
74
+ button,
75
+ &::after {
76
+ opacity: 1;
77
+ }
78
+ }
79
+ img {
80
+ max-height: 100%;
81
+ max-width: 100%;
82
+ }
83
+ .sep {
84
+ background: transparent;
85
+ display: block;
86
+ height: 8px;
87
+ margin: 0;
88
+ width: 100%;
89
+ }
90
+ }
91
+ }
92
+ &__image + &__help {
93
+ color: wp-colors.$gray-700;
94
+ font-size: 12px;
95
+ margin: 1em 0 0;
96
+ }
97
+ &__controls {
98
+ align-items: center;
99
+ display: flex;
100
+ flex-direction: column;
101
+ position: absolute;
102
+ }
103
+ }
@@ -0,0 +1,47 @@
1
+ export { default as Accordion } from './accordion';
2
+ export { default as ActionCard } from './action-card';
3
+ export { default as AutocompleteTokenField } from './autocomplete-tokenfield';
4
+ export { default as AutocompleteWithSuggestions } from './autocomplete-with-suggestions';
5
+ export { default as Button } from './button';
6
+ export { default as ButtonCard } from './button-card';
7
+ export { default as Card } from './card';
8
+ export { default as CategoryAutocomplete } from './category-autocomplete';
9
+ export { default as ColorPicker } from './color-picker';
10
+ export { default as CustomSelectControl } from './custom-select-control';
11
+ export { default as FormTokenField } from './form-token-field';
12
+ export { default as Footer } from './footer';
13
+ export { default as Handoff } from './handoff';
14
+ export { default as HandoffMessage } from './handoff-message';
15
+ export { default as InfoButton } from './info-button';
16
+ export { default as ImageUpload } from './image-upload';
17
+ export { default as GlobalNotices } from './global-notices';
18
+ export { default as Grid } from './grid';
19
+ export { default as Modal } from './modal';
20
+ export { default as NewspackIcon } from './newspack-icon';
21
+ export { default as NewspackLogo } from './newspack-logo';
22
+ export { default as Notice } from './notice';
23
+ export { default as PatronsLogo } from './patrons-logo';
24
+ export { default as PluginInstaller } from './plugin-installer';
25
+ export { default as PluginSettings } from './plugin-settings';
26
+ export { default as PluginToggle } from './plugin-toggle';
27
+ export { default as Popover } from './popover';
28
+ export { default as ProgressBar } from './progress-bar';
29
+ export { default as RadioControl } from './radio-control';
30
+ export { default as SectionHeader } from './section-header';
31
+ export { default as SelectControl } from './select-control';
32
+ export { default as DateRangePicker } from './date-range-picker';
33
+ export { default as Settings } from './settings';
34
+ export { default as StepsList } from './steps-list';
35
+ export { default as StepsListItem } from './steps-list-item';
36
+ export { default as StyleCard } from './style-card';
37
+ export { default as TabbedNavigation } from './tabbed-navigation';
38
+ export { default as TextControl } from './text-control';
39
+ export { default as Waiting } from './waiting';
40
+ export { default as WebPreview } from './web-preview';
41
+ export { default as Wizard } from './wizard';
42
+ export { default as withWizard } from './with-wizard';
43
+ export { default as withWizardScreen } from './with-wizard-screen';
44
+ export { default as Router } from './proxied-imports/router';
45
+ export { default as hooks } from './hooks';
46
+ export { default as utils } from './utils';
47
+ import './style.scss';
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Info Button
3
+ */
4
+
5
+ /**
6
+ * WordPress dependencies.
7
+ */
8
+ import { Component } from '@wordpress/element';
9
+ import { Tooltip } from '@wordpress/components';
10
+ import { Icon, info } from '@wordpress/icons';
11
+
12
+ /**
13
+ * External dependencies.
14
+ */
15
+ import classnames from 'classnames';
16
+
17
+ /**
18
+ * Internal dependencies.
19
+ */
20
+ import './style.scss';
21
+ import { jsx as _jsx } from "react/jsx-runtime";
22
+ class InfoButton extends Component {
23
+ /**
24
+ * Render.
25
+ */
26
+ render() {
27
+ const {
28
+ className,
29
+ ...otherProps
30
+ } = this.props;
31
+ return /*#__PURE__*/_jsx(Tooltip, {
32
+ ...otherProps,
33
+ children: /*#__PURE__*/_jsx("span", {
34
+ className: classnames('newspack-info-button', className),
35
+ children: /*#__PURE__*/_jsx(Icon, {
36
+ icon: info
37
+ })
38
+ })
39
+ });
40
+ }
41
+ }
42
+ export default InfoButton;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Info Button
3
+ */
4
+
5
+ .newspack-info-button {
6
+ display: inline-block;
7
+ flex: 0 0 24px;
8
+ height: 24px;
9
+ margin: 0;
10
+ margin-left: 4px;
11
+ width: 24px;
12
+ vertical-align: middle;
13
+
14
+ svg {
15
+ display: block;
16
+ fill: currentcolor;
17
+ }
18
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Modal
3
+ */
4
+
5
+ /**
6
+ * WordPress dependencies.
7
+ */
8
+ import { Component } from '@wordpress/element';
9
+ import { Modal as BaseComponent } from '@wordpress/components';
10
+
11
+ /**
12
+ * Internal dependencies.
13
+ */
14
+ import './style.scss';
15
+
16
+ /**
17
+ * External dependencies.
18
+ */
19
+ import classnames from 'classnames';
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+ class Modal extends Component {
22
+ /**
23
+ * Render.
24
+ */
25
+ render() {
26
+ const {
27
+ className,
28
+ isWide,
29
+ isNarrow,
30
+ ...otherProps
31
+ } = this.props;
32
+ const classes = classnames('newspack-modal', isWide && 'newspack-modal--wide', isNarrow && 'newspack-modal--narrow', className);
33
+ return /*#__PURE__*/_jsx(BaseComponent, {
34
+ className: classes,
35
+ ...otherProps
36
+ });
37
+ }
38
+ }
39
+ export default Modal;
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Modal
3
+ */
4
+
5
+ @use "../../../shared/scss/colors";
6
+
7
+ .newspack-modal {
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};
15
+
16
+ @media screen and ( min-width: 744px ) {
17
+ max-width: 680px;
18
+ width: 680px;
19
+
20
+ &--wide {
21
+ max-width: 1168px;
22
+ width: 1168px;
23
+ }
24
+ }
25
+
26
+ &--narrow {
27
+ max-width: 360px;
28
+ width: 360px;
29
+ }
30
+
31
+ @media screen and ( min-width: 960px ) {
32
+ max-height: calc(100% - 128px);
33
+ }
34
+
35
+ // Links
36
+ a {
37
+ color: var(--wp-admin-theme-color);
38
+
39
+ &:active,
40
+ &:focus,
41
+ &:hover {
42
+ color: var(--wp-admin-theme-color-darker-10);
43
+ }
44
+
45
+ &:focus {
46
+ box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
47
+ outline: 3px solid transparent;
48
+ }
49
+ }
50
+
51
+ .components-modal__content {
52
+ > *:last-child {
53
+ margin-bottom: 0;
54
+ }
55
+ }
56
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Newspack Icon.
3
+ */
4
+
5
+ /**
6
+ * WordPress dependencies.
7
+ */
8
+ import { Component } from '@wordpress/element';
9
+ import { Path, SVG } from '@wordpress/components';
10
+
11
+ /**
12
+ * External dependencies.
13
+ */
14
+ import classnames from 'classnames';
15
+
16
+ /**
17
+ * Internal dependencies.
18
+ */
19
+ import './style.scss';
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+ class NewspackIcon extends Component {
22
+ /**
23
+ * Render
24
+ */
25
+ render() {
26
+ const {
27
+ className,
28
+ simple,
29
+ size,
30
+ white
31
+ } = this.props;
32
+ const classes = classnames('newspack-icon', simple && 'newspack-icon--simple', white && 'newspack-icon--white', className);
33
+ return /*#__PURE__*/_jsx(SVG, {
34
+ xmlns: "http://www.w3.org/2000/svg",
35
+ height: size,
36
+ width: size,
37
+ viewBox: "0 0 32 32",
38
+ className: classes,
39
+ children: /*#__PURE__*/_jsx(Path, {
40
+ fillRule: "evenodd",
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"
43
+ })
44
+ });
45
+ }
46
+ }
47
+ NewspackIcon.defaultProps = {
48
+ size: 32
49
+ };
50
+ export default NewspackIcon;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Newspack Icon
3
+ */
4
+
5
+ @use "../../../shared/scss/colors";
6
+
7
+ .newspack-icon {
8
+ background: colors.$primary-500;
9
+ fill: white;
10
+ padding: 12px;
11
+
12
+ &--white {
13
+ background: white;
14
+ fill: colors.$primary-500;
15
+ }
16
+
17
+ &--simple {
18
+ background: none;
19
+ fill: colors.$primary-500;
20
+ padding: 0;
21
+ }
22
+
23
+ &#{&}--simple#{&}--white {
24
+ fill: white;
25
+ }
26
+ }
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Newspack Logo.
3
+ */
4
+
5
+ /**
6
+ * WordPress dependencies.
7
+ */
8
+ import { Component } from '@wordpress/element';
9
+ import { Path, SVG } from '@wordpress/components';
10
+
11
+ /**
12
+ * External dependencies.
13
+ */
14
+ import classnames from 'classnames';
15
+
16
+ /**
17
+ * Internal dependencies.
18
+ */
19
+ import './style.scss';
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+ class NewspackLogo extends Component {
22
+ /**
23
+ * Render
24
+ */
25
+ render() {
26
+ const {
27
+ centered,
28
+ className,
29
+ height
30
+ } = this.props;
31
+ const classes = classnames('newspack-logo__svg', centered && 'is-centered', className);
32
+ return /*#__PURE__*/_jsx(SVG, {
33
+ xmlns: "http://www.w3.org/2000/svg",
34
+ height: height,
35
+ viewBox: "0 0 221 64",
36
+ className: classes,
37
+ children: /*#__PURE__*/_jsx(Path, {
38
+ d: "M32 0c17.672 0 32 14.328 32 32S49.672 64 32 64C14.326 64 0 49.672 0 32S14.328 0 32 0zm130.57 27.247c3.611 0 6.475 2.521 6.475 7.974 0 5.417-3.134 8.995-8.314 8.995-1.262 0-2.248-.172-3.305-.376v8.551h-4.022V27.67h3.85v1.486c1.534-1.191 3.237-1.908 5.316-1.908zM18.023 17.755v28.49h6.902V34.287l11.733 11.958h9.319l-27.954-28.49zm178.552 9.495c2.009 0 3.219.34 4.581.784v3.407c-1.158-.444-2.878-.921-4.513-.921-2.453 0-4.532 1.294-4.532 5.076 0 4.156 2.077 5.383 4.736 5.387 1.262 0 2.676-.273 4.516-.99v3.34c-1.636.544-3.118.92-5.025.92-6.033 0-8.417-3.442-8.417-8.45 0-5.283 3.305-8.553 8.654-8.553zm-18.195-.003c3.919 0 6.44 1.567 6.435 6.235V43.84h-3.747v-1.771h-.103c-1.327 1.022-2.93 2.079-5.314 2.079-2.112 0-4.36-1.534-4.36-4.6 0-4.133 3.545-4.912 5.997-5.252l3.51-.477v-.47c0-2.181-.886-2.897-2.93-2.897-.989 0-3.338.305-5.28 1.09l-.341-3.237c1.738-.614 4.123-1.058 6.133-1.058zm-73.55-.12c5.145 0 6.951 3.579 6.951 6.987 0 .936-.047 1.518-.102 2.06l-.034.325h-10.358c.101 3.542 2.106 4.36 5.104 4.36 1.637 0 3.158-.372 4.845-.991v3.342c-2.093.644-3.89.921-5.968.921-5.141 0-8.308-2.556-8.308-8.586 0-4.398 2.69-8.417 7.87-8.417zm39.998 0c1.771 0 3.305.172 4.804.614v3.338s-2.188-.714-4.497-.714c-1.43 0-2.76.477-2.76 1.703 0 2.725 8.042 1.262 8.04 6.883 0 4.053-3.611 5.178-7.394 5.178-1.738 0-3.487-.467-4.736-.958v-3.305c1.5.52 3.578 1.026 4.873 1.026 1.84 0 3.1-.374 3.1-1.771 0-2.829-8.04-1.33-8.04-7.156 0-2.998 2.724-4.837 6.61-4.837zm64.01-6.114v13.63c.34-.376.615-.785 5.657-6.952h5.213l-6.543 7.666 7.156 8.485h-5.248l-6.235-7.665v7.665h-4.02v-22.83h4.02zm-127.634 0l8.633 15.263V21.013h4.022v22.83h-4.416L80.81 28.578v15.263h-4.021v-22.83h4.416zm36.758 6.678l2.476 11.469 2.801-11.469h3.572l2.438 11.469 2.75-11.469h4.038l-4.54 16.151h-4.83l-1.714-9.495-2.325 9.495h-4.814l-4.268-16.15h4.416zm62.836 8.616l-3.305.512c-.987.136-2.044.732-2.044 2.231 0 1.322.75 2.067 1.84 2.067 1.157 0 2.452-.716 3.509-1.466v-3.344zm-19.318-5.752c-1.193 0-2.657.545-4.054 1.771v8.415c.885.17 1.77.306 2.997.306 2.829 0 4.464-1.805 4.464-5.517 0-3.476-1.158-4.975-3.407-4.975zm-56.685-.394c-2.009 0-3.235 1.43-3.475 3.678h6.268c0-1.975-.646-3.678-2.793-3.678zm-58.818.836H40.33l2.205 2.248h3.442v-2.248zm0-6.621H33.833l2.205 2.248h9.939v-2.248zm0-6.621h-18.64l2.204 2.248h16.436v-2.248z"
39
+ })
40
+ });
41
+ }
42
+ }
43
+ NewspackLogo.defaultProps = {
44
+ height: 56
45
+ };
46
+ export default NewspackLogo;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Newspack Logo
3
+ */
4
+
5
+ @use "../../../shared/scss/colors";
6
+
7
+ .newspack-logo {
8
+ &__svg {
9
+ display: block;
10
+ fill: currentcolor;
11
+ margin: 0;
12
+ padding-bottom: 32px;
13
+ width: auto;
14
+
15
+ &.is-centered {
16
+ margin-left: auto;
17
+ margin-right: auto;
18
+ }
19
+ }
20
+
21
+ &__wrapper {
22
+ background: colors.$primary-500;
23
+ color: white;
24
+ position: relative;
25
+
26
+ a {
27
+ color: inherit;
28
+ }
29
+ }
30
+ }