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

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 (217) 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/esm/accordion/index.js +42 -0
  5. package/dist/esm/accordion/style.scss +31 -0
  6. package/dist/esm/action-card/index.js +218 -0
  7. package/dist/esm/action-card/style.scss +483 -0
  8. package/dist/esm/autocomplete-tokenfield/index.js +261 -0
  9. package/dist/esm/autocomplete-tokenfield/style.scss +49 -0
  10. package/dist/esm/autocomplete-with-suggestions/index.js +274 -0
  11. package/dist/esm/autocomplete-with-suggestions/style.scss +163 -0
  12. package/dist/esm/button/style.scss +11 -0
  13. package/dist/esm/button-card/index.js +64 -0
  14. package/dist/esm/button-card/style.scss +180 -0
  15. package/dist/esm/card/index.js +43 -0
  16. package/dist/esm/card/style.scss +168 -0
  17. package/dist/esm/category-autocomplete/index.js +183 -0
  18. package/dist/esm/category-autocomplete/style.scss +34 -0
  19. package/dist/esm/color-picker/index.js +59 -0
  20. package/dist/esm/color-picker/style.scss +37 -0
  21. package/dist/esm/consts.js +1 -0
  22. package/dist/esm/custom-select-control/index.js +37 -0
  23. package/dist/esm/custom-select-control/style.scss +93 -0
  24. package/dist/esm/date-range-picker/index.js +31 -0
  25. package/dist/esm/date-range-picker/style.scss +148 -0
  26. package/dist/esm/footer/index.js +99 -0
  27. package/dist/esm/footer/style.scss +82 -0
  28. package/dist/esm/form-token-field/index.js +49 -0
  29. package/dist/esm/form-token-field/style.scss +37 -0
  30. package/dist/esm/global-notices/index.js +30 -0
  31. package/dist/esm/grid/style.scss +166 -0
  32. package/dist/esm/handoff/index.js +175 -0
  33. package/dist/esm/handoff-message/index.js +47 -0
  34. package/dist/esm/hooks/useObjectState.js +30 -0
  35. package/dist/esm/hooks/useObjectState.test.js +82 -0
  36. package/dist/esm/hooks/useOnClickOutside.js +31 -0
  37. package/dist/esm/image-upload/index.js +140 -0
  38. package/dist/esm/image-upload/index.test.js +34 -0
  39. package/dist/esm/image-upload/style.scss +103 -0
  40. package/dist/esm/index.js +47 -0
  41. package/dist/esm/info-button/index.js +42 -0
  42. package/dist/esm/info-button/style.scss +18 -0
  43. package/dist/esm/modal/index.js +39 -0
  44. package/dist/esm/modal/style.scss +56 -0
  45. package/dist/esm/newspack-icon/index.js +50 -0
  46. package/dist/esm/newspack-icon/style.scss +26 -0
  47. package/dist/esm/newspack-logo/index.js +46 -0
  48. package/dist/esm/newspack-logo/style.scss +30 -0
  49. package/dist/esm/notice/index.js +65 -0
  50. package/dist/esm/notice/style.scss +111 -0
  51. package/dist/esm/patrons-logo/index.js +70 -0
  52. package/dist/esm/plugin-installer/index.js +289 -0
  53. package/dist/esm/plugin-installer/style.scss +72 -0
  54. package/dist/esm/plugin-settings/SettingsSection.js +133 -0
  55. package/dist/esm/plugin-settings/index.js +220 -0
  56. package/dist/esm/plugin-settings/style.scss +7 -0
  57. package/dist/esm/plugin-toggle/index.js +216 -0
  58. package/dist/esm/plugin-toggle/style.scss +20 -0
  59. package/dist/esm/popover/index.js +41 -0
  60. package/dist/esm/popover/style.scss +161 -0
  61. package/dist/esm/position-control/index.js +106 -0
  62. package/dist/esm/position-control/style.scss +66 -0
  63. package/dist/esm/progress-bar/index.js +68 -0
  64. package/dist/esm/progress-bar/index.test.js +108 -0
  65. package/dist/esm/progress-bar/style.scss +42 -0
  66. package/dist/esm/proxied-imports/router.js +8 -0
  67. package/dist/esm/radio-control/index.js +37 -0
  68. package/dist/esm/radio-control/style.scss +92 -0
  69. package/dist/esm/section-header/index.js +67 -0
  70. package/dist/esm/section-header/style.scss +45 -0
  71. package/dist/esm/select-control/ButtonGroupControl.js +53 -0
  72. package/dist/esm/select-control/GroupedSelectControl.js +78 -0
  73. package/dist/esm/select-control/index.js +51 -0
  74. package/dist/esm/select-control/style.scss +108 -0
  75. package/dist/esm/settings/MinMaxSetting.js +53 -0
  76. package/dist/esm/settings/SettingsCard.js +38 -0
  77. package/dist/esm/settings/SettingsSection.js +26 -0
  78. package/dist/esm/settings/index.js +9 -0
  79. package/dist/esm/settings/style.scss +119 -0
  80. package/dist/esm/sortable-newsletter-list-control/index.js +127 -0
  81. package/dist/esm/sortable-newsletter-list-control/style.scss +45 -0
  82. package/dist/esm/steps-list/index.js +43 -0
  83. package/dist/esm/steps-list/style.scss +11 -0
  84. package/dist/esm/steps-list-item/index.js +47 -0
  85. package/dist/esm/steps-list-item/style.scss +47 -0
  86. package/dist/esm/style-card/index.js +74 -0
  87. package/dist/esm/style-card/style.scss +94 -0
  88. package/dist/esm/style.scss +55 -0
  89. package/dist/esm/tabbed-navigation/index.js +53 -0
  90. package/dist/esm/tabbed-navigation/style.scss +86 -0
  91. package/dist/esm/text-control/style.scss +32 -0
  92. package/dist/esm/utils/index.js +29 -0
  93. package/dist/esm/waiting/index.js +44 -0
  94. package/dist/esm/waiting/style.scss +27 -0
  95. package/dist/esm/web-preview/index.js +183 -0
  96. package/dist/esm/web-preview/style.scss +155 -0
  97. package/dist/esm/with-wizard/index.js +320 -0
  98. package/dist/esm/with-wizard/style.scss +282 -0
  99. package/dist/esm/with-wizard-screen/index.js +109 -0
  100. package/dist/esm/with-wizard-screen/style.scss +160 -0
  101. package/dist/esm/wizard/components/WizardError.js +66 -0
  102. package/dist/esm/wizard/index.js +119 -0
  103. package/dist/esm/wizard/store/index.js +155 -0
  104. package/dist/esm/wizard/store/utils.js +14 -0
  105. package/package.json +7 -4
  106. package/dist/button/index.js +0 -51
  107. package/dist/button/index.tsx +0 -48
  108. package/dist/grid/index.js +0 -44
  109. package/dist/grid/index.tsx +0 -34
  110. package/dist/hooks/index.js +0 -29
  111. package/dist/hooks/index.ts +0 -15
  112. package/dist/hooks/usePrompt.js +0 -47
  113. package/dist/hooks/usePrompt.ts +0 -46
  114. package/dist/plugin-toggle/README.md +0 -53
  115. package/dist/text-control/index.js +0 -76
  116. package/dist/text-control/index.tsx +0 -71
  117. /package/dist/{accordion → cjs/accordion}/index.js +0 -0
  118. /package/dist/{accordion → cjs/accordion}/style.scss +0 -0
  119. /package/dist/{action-card → cjs/action-card}/index.js +0 -0
  120. /package/dist/{action-card → cjs/action-card}/style.scss +0 -0
  121. /package/dist/{autocomplete-tokenfield → cjs/autocomplete-tokenfield}/index.js +0 -0
  122. /package/dist/{autocomplete-tokenfield → cjs/autocomplete-tokenfield}/style.scss +0 -0
  123. /package/dist/{autocomplete-with-suggestions → cjs/autocomplete-with-suggestions}/index.js +0 -0
  124. /package/dist/{autocomplete-with-suggestions → cjs/autocomplete-with-suggestions}/style.scss +0 -0
  125. /package/dist/{button → cjs/button}/style.scss +0 -0
  126. /package/dist/{button-card → cjs/button-card}/index.js +0 -0
  127. /package/dist/{button-card → cjs/button-card}/style.scss +0 -0
  128. /package/dist/{card → cjs/card}/index.js +0 -0
  129. /package/dist/{card → cjs/card}/style.scss +0 -0
  130. /package/dist/{category-autocomplete → cjs/category-autocomplete}/index.js +0 -0
  131. /package/dist/{category-autocomplete → cjs/category-autocomplete}/style.scss +0 -0
  132. /package/dist/{color-picker → cjs/color-picker}/index.js +0 -0
  133. /package/dist/{color-picker → cjs/color-picker}/style.scss +0 -0
  134. /package/dist/{consts.js → cjs/consts.js} +0 -0
  135. /package/dist/{custom-select-control → cjs/custom-select-control}/index.js +0 -0
  136. /package/dist/{custom-select-control → cjs/custom-select-control}/style.scss +0 -0
  137. /package/dist/{date-range-picker → cjs/date-range-picker}/index.js +0 -0
  138. /package/dist/{date-range-picker → cjs/date-range-picker}/style.scss +0 -0
  139. /package/dist/{footer → cjs/footer}/index.js +0 -0
  140. /package/dist/{footer → cjs/footer}/style.scss +0 -0
  141. /package/dist/{form-token-field → cjs/form-token-field}/index.js +0 -0
  142. /package/dist/{form-token-field → cjs/form-token-field}/style.scss +0 -0
  143. /package/dist/{global-notices → cjs/global-notices}/index.js +0 -0
  144. /package/dist/{grid → cjs/grid}/style.scss +0 -0
  145. /package/dist/{handoff → cjs/handoff}/index.js +0 -0
  146. /package/dist/{handoff-message → cjs/handoff-message}/index.js +0 -0
  147. /package/dist/{hooks → cjs/hooks}/useObjectState.js +0 -0
  148. /package/dist/{hooks → cjs/hooks}/useObjectState.test.js +0 -0
  149. /package/dist/{hooks → cjs/hooks}/useOnClickOutside.js +0 -0
  150. /package/dist/{image-upload → cjs/image-upload}/index.js +0 -0
  151. /package/dist/{image-upload → cjs/image-upload}/index.test.js +0 -0
  152. /package/dist/{image-upload → cjs/image-upload}/style.scss +0 -0
  153. /package/dist/{index.js → cjs/index.js} +0 -0
  154. /package/dist/{info-button → cjs/info-button}/index.js +0 -0
  155. /package/dist/{info-button → cjs/info-button}/style.scss +0 -0
  156. /package/dist/{modal → cjs/modal}/index.js +0 -0
  157. /package/dist/{modal → cjs/modal}/style.scss +0 -0
  158. /package/dist/{newspack-icon → cjs/newspack-icon}/index.js +0 -0
  159. /package/dist/{newspack-icon → cjs/newspack-icon}/style.scss +0 -0
  160. /package/dist/{newspack-logo → cjs/newspack-logo}/index.js +0 -0
  161. /package/dist/{newspack-logo → cjs/newspack-logo}/style.scss +0 -0
  162. /package/dist/{notice → cjs/notice}/index.js +0 -0
  163. /package/dist/{notice → cjs/notice}/style.scss +0 -0
  164. /package/dist/{patrons-logo → cjs/patrons-logo}/index.js +0 -0
  165. /package/dist/{plugin-installer → cjs/plugin-installer}/index.js +0 -0
  166. /package/dist/{plugin-installer → cjs/plugin-installer}/style.scss +0 -0
  167. /package/dist/{plugin-settings → cjs/plugin-settings}/SettingsSection.js +0 -0
  168. /package/dist/{plugin-settings → cjs/plugin-settings}/index.js +0 -0
  169. /package/dist/{plugin-settings → cjs/plugin-settings}/style.scss +0 -0
  170. /package/dist/{plugin-toggle → cjs/plugin-toggle}/index.js +0 -0
  171. /package/dist/{plugin-toggle → cjs/plugin-toggle}/style.scss +0 -0
  172. /package/dist/{popover → cjs/popover}/index.js +0 -0
  173. /package/dist/{popover → cjs/popover}/style.scss +0 -0
  174. /package/dist/{position-control → cjs/position-control}/index.js +0 -0
  175. /package/dist/{position-control → cjs/position-control}/style.scss +0 -0
  176. /package/dist/{progress-bar → cjs/progress-bar}/index.js +0 -0
  177. /package/dist/{progress-bar → cjs/progress-bar}/index.test.js +0 -0
  178. /package/dist/{progress-bar → cjs/progress-bar}/style.scss +0 -0
  179. /package/dist/{proxied-imports → cjs/proxied-imports}/router.js +0 -0
  180. /package/dist/{radio-control → cjs/radio-control}/index.js +0 -0
  181. /package/dist/{radio-control → cjs/radio-control}/style.scss +0 -0
  182. /package/dist/{section-header → cjs/section-header}/index.js +0 -0
  183. /package/dist/{section-header → cjs/section-header}/style.scss +0 -0
  184. /package/dist/{select-control → cjs/select-control}/ButtonGroupControl.js +0 -0
  185. /package/dist/{select-control → cjs/select-control}/GroupedSelectControl.js +0 -0
  186. /package/dist/{select-control → cjs/select-control}/index.js +0 -0
  187. /package/dist/{select-control → cjs/select-control}/style.scss +0 -0
  188. /package/dist/{settings → cjs/settings}/MinMaxSetting.js +0 -0
  189. /package/dist/{settings → cjs/settings}/SettingsCard.js +0 -0
  190. /package/dist/{settings → cjs/settings}/SettingsSection.js +0 -0
  191. /package/dist/{settings → cjs/settings}/index.js +0 -0
  192. /package/dist/{settings → cjs/settings}/style.scss +0 -0
  193. /package/dist/{sortable-newsletter-list-control → cjs/sortable-newsletter-list-control}/index.js +0 -0
  194. /package/dist/{sortable-newsletter-list-control → cjs/sortable-newsletter-list-control}/style.scss +0 -0
  195. /package/dist/{steps-list → cjs/steps-list}/index.js +0 -0
  196. /package/dist/{steps-list → cjs/steps-list}/style.scss +0 -0
  197. /package/dist/{steps-list-item → cjs/steps-list-item}/index.js +0 -0
  198. /package/dist/{steps-list-item → cjs/steps-list-item}/style.scss +0 -0
  199. /package/dist/{style-card → cjs/style-card}/index.js +0 -0
  200. /package/dist/{style-card → cjs/style-card}/style.scss +0 -0
  201. /package/dist/{style.scss → cjs/style.scss} +0 -0
  202. /package/dist/{tabbed-navigation → cjs/tabbed-navigation}/index.js +0 -0
  203. /package/dist/{tabbed-navigation → cjs/tabbed-navigation}/style.scss +0 -0
  204. /package/dist/{text-control → cjs/text-control}/style.scss +0 -0
  205. /package/dist/{utils → cjs/utils}/index.js +0 -0
  206. /package/dist/{waiting → cjs/waiting}/index.js +0 -0
  207. /package/dist/{waiting → cjs/waiting}/style.scss +0 -0
  208. /package/dist/{web-preview → cjs/web-preview}/index.js +0 -0
  209. /package/dist/{web-preview → cjs/web-preview}/style.scss +0 -0
  210. /package/dist/{with-wizard → cjs/with-wizard}/index.js +0 -0
  211. /package/dist/{with-wizard → cjs/with-wizard}/style.scss +0 -0
  212. /package/dist/{with-wizard-screen → cjs/with-wizard-screen}/index.js +0 -0
  213. /package/dist/{with-wizard-screen → cjs/with-wizard-screen}/style.scss +0 -0
  214. /package/dist/{wizard → cjs/wizard}/components/WizardError.js +0 -0
  215. /package/dist/{wizard → cjs/wizard}/index.js +0 -0
  216. /package/dist/{wizard → cjs/wizard}/store/index.js +0 -0
  217. /package/dist/{wizard → cjs/wizard}/store/utils.js +0 -0
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Custom Select Control
3
+ */
4
+
5
+ /**
6
+ * WordPress dependencies
7
+ */
8
+ import { CustomSelectControl as BaseComponent } from '@wordpress/components';
9
+ import { Component } from '@wordpress/element';
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 CustomSelectControl extends Component {
22
+ /**
23
+ * Render.
24
+ */
25
+ render() {
26
+ const {
27
+ className,
28
+ ...otherProps
29
+ } = this.props;
30
+ const classes = classnames('newspack-custom-select-control', className);
31
+ return /*#__PURE__*/_jsx(BaseComponent, {
32
+ className: classes,
33
+ ...otherProps
34
+ });
35
+ }
36
+ }
37
+ export default CustomSelectControl;
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Custom Select Control
3
+ */
4
+
5
+ @use "~@wordpress/base-styles/colors" as wp-colors;
6
+
7
+ .newspack-custom-select-control {
8
+ label {
9
+ display: block;
10
+ margin-bottom: 8px;
11
+ }
12
+
13
+ .components-custom-select-control__button {
14
+ border-color: wp-colors.$gray-700;
15
+ border-radius: 2px;
16
+ color: wp-colors.$gray-900;
17
+ font-size: inherit;
18
+ min-height: 30px;
19
+ min-width: 100%;
20
+ padding-right: 24px;
21
+
22
+ &:active,
23
+ &:focus,
24
+ &:hover,
25
+ &[aria-expanded="true"] {
26
+ color: wp-colors.$gray-900;
27
+ }
28
+
29
+ &:focus {
30
+ border-color: var(--wp-admin-theme-color);
31
+ box-shadow: inset 0 0 0 1px var(--wp-admin-theme-color);
32
+ }
33
+
34
+ &-icon {
35
+ right: 3px;
36
+ width: 18px;
37
+ }
38
+
39
+ &[aria-expanded="true"] svg {
40
+ transform: rotate(180deg);
41
+ }
42
+ }
43
+
44
+ .components-custom-select-control__menu {
45
+ border-color: wp-colors.$gray-700;
46
+ border-radius: 2px;
47
+ box-shadow: 0 4px 8px rgba(black, 0.08);
48
+ margin: 8px 0 0;
49
+ min-width: 222px;
50
+ }
51
+
52
+ .components-custom-select-control__item {
53
+ box-sizing: border-box;
54
+ cursor: pointer;
55
+ display: flex;
56
+ line-height: inherit;
57
+ margin: 0 0 0 28px;
58
+ padding: 6px 8px;
59
+ transition: color 125ms ease-in-out;
60
+
61
+ &:empty {
62
+ display: none;
63
+ }
64
+
65
+ &.is-header {
66
+ background: wp-colors.$gray-100;
67
+ cursor: default;
68
+ font-weight: bold;
69
+ margin-left: 0;
70
+ pointer-events: none;
71
+ }
72
+
73
+ &.is-highlighted {
74
+ background: white;
75
+ color: var(--wp-admin-theme-color);
76
+ }
77
+
78
+ &.is-selected {
79
+ margin-left: 0;
80
+
81
+ &::before {
82
+ background:
83
+ url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cGF0aCBkPSJNMTguMyA1LjZMOS45IDE2LjlsLTQuNi0zLjQtLjkgMS4yIDUuOCA0LjMgOS4zLTEyLjZ6IiBmaWxsPSIjMzM2NmZmIj48L3BhdGg+PC9zdmc+Cg==")
84
+ 0 0 no-repeat;
85
+ content: "";
86
+ display: block;
87
+ height: 24px;
88
+ margin: 0 4px 0 0;
89
+ width: 24px;
90
+ }
91
+ }
92
+ }
93
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * External dependencies.
3
+ */
4
+ import { default as ReactDateRangePicker } from 'react-daterange-picker';
5
+ import origMoment from 'moment';
6
+ import { extendMoment } from 'moment-range';
7
+ import 'react-daterange-picker/dist/css/react-calendar.css';
8
+
9
+ /**
10
+ * Internal dependencies.
11
+ */
12
+ import './style.scss';
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ const moment = extendMoment(origMoment);
15
+ const DateRangePicker = ({
16
+ start,
17
+ end,
18
+ onChange
19
+ }) => {
20
+ return /*#__PURE__*/_jsx(ReactDateRangePicker, {
21
+ value: moment.range(moment(start), moment(end)),
22
+ firstOfWeek: 1,
23
+ onSelect: range => {
24
+ onChange({
25
+ start: range.start._d,
26
+ end: range.end._d
27
+ });
28
+ }
29
+ });
30
+ };
31
+ export default DateRangePicker;
@@ -0,0 +1,148 @@
1
+ @use "../../../shared/scss/colors";
2
+ @use "~@wordpress/base-styles/colors" as wp-colors;
3
+
4
+ .DateRangePicker {
5
+ margin: 32px 0;
6
+ max-width: 296px;
7
+ width: 100%;
8
+
9
+ &__PaginationArrow {
10
+ background: transparent 50% 50% no-repeat;
11
+ background-size: 24px 24px;
12
+ border-radius: 3px;
13
+ height: 36px;
14
+ transition: background-image 125ms ease-in-out;
15
+ width: 36px;
16
+
17
+ &--previous {
18
+ background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"%3E%3Cpath d="M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" fill="%231e1e1e"/%3E%3C/svg%3E');
19
+ left: 0;
20
+
21
+ &:hover {
22
+ background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"%3E%3Cpath d="M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" fill="%2336f"/%3E%3C/svg%3E');
23
+ }
24
+ }
25
+
26
+ &--next {
27
+ background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"%3E%3Cpath d="M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" fill="%231e1e1e"/%3E%3C/svg%3E');
28
+ right: 0;
29
+
30
+ &:hover {
31
+ background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"%3E%3Cpath d="M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" fill="%2336f"/%3E%3C/svg%3E');
32
+ }
33
+ }
34
+
35
+ &:hover {
36
+ background-color: transparent;
37
+ }
38
+ }
39
+
40
+ &__PaginationArrowIcon {
41
+ display: none;
42
+ }
43
+
44
+ &__Month {
45
+ margin: 0;
46
+ width: inherit;
47
+ }
48
+
49
+ &__MonthHeader {
50
+ color: wp-colors.$gray-900;
51
+ font-size: 17px;
52
+ height: auto;
53
+ line-height: 24px;
54
+ padding: 6px 44px;
55
+ }
56
+
57
+ &__WeekdayHeading,
58
+ &__Date {
59
+ font-size: 14px;
60
+ line-height: 24px;
61
+ padding: 6px 0;
62
+ }
63
+
64
+ &__WeekdayHeading {
65
+ border-bottom-color: wp-colors.$gray-300;
66
+ color: wp-colors.$gray-900;
67
+
68
+ abbr[title] {
69
+ color: inherit;
70
+ }
71
+ }
72
+
73
+ &__MonthDates {
74
+ border: 0;
75
+ border-spacing: 0;
76
+ }
77
+
78
+ &__Date {
79
+ border-color: wp-colors.$gray-300;
80
+ border-bottom-width: 1px;
81
+
82
+ &--weekend {
83
+ background-color: wp-colors.$gray-100;
84
+ }
85
+
86
+ &--otherMonth {
87
+ color: wp-colors.$gray-200;
88
+ opacity: 1;
89
+ }
90
+
91
+ &--is-disabled {
92
+ color: wp-colors.$gray-100;
93
+ cursor: not-allowed;
94
+ }
95
+
96
+ &--is-highlighted {
97
+ color: white;
98
+ }
99
+ }
100
+
101
+ &__CalendarSelection,
102
+ &__CalendarHighlight {
103
+ border-color: colors.$primary-500;
104
+ bottom: 4px;
105
+ top: 4px;
106
+
107
+ &--inOtherMonth {
108
+ opacity: 1;
109
+ }
110
+
111
+ &--start {
112
+ border-bottom-left-radius: 3px;
113
+ border-top-left-radius: 3px;
114
+ left: 4px;
115
+ }
116
+
117
+ &--end {
118
+ border-bottom-right-radius: 3px;
119
+ border-top-right-radius: 3px;
120
+ right: 4px;
121
+ }
122
+
123
+ &--single {
124
+ border: none;
125
+ border-radius: 3px;
126
+ left: 4px;
127
+ right: 4px;
128
+ }
129
+ }
130
+
131
+ &__CalendarSelection {
132
+ background-color: colors.$primary-500;
133
+ }
134
+
135
+ &__CalendarHighlight {
136
+ background: colors.$primary-500;
137
+ border: none;
138
+ bottom: 0;
139
+ top: 0;
140
+
141
+ &--single {
142
+ border: none;
143
+ border-radius: 0;
144
+ left: 0;
145
+ right: 0;
146
+ }
147
+ }
148
+ }
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Footer
3
+ */
4
+
5
+ /**
6
+ * WordPress dependencies.
7
+ */
8
+ import { __ } from '@wordpress/i18n';
9
+ import { ExternalLink } from '@wordpress/components';
10
+
11
+ /**
12
+ * Internal dependencies.
13
+ */
14
+ import { PatronsLogo } from '../';
15
+ import './style.scss';
16
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
+ const Footer = ({
18
+ simple
19
+ }) => {
20
+ const {
21
+ components_demo: componentsDemo = false,
22
+ support = false,
23
+ setup_wizard: setupWizard = false,
24
+ reset_url: resetUrl = false,
25
+ plugin_version: pluginVersion = {
26
+ label: 'Newspack'
27
+ },
28
+ remove_starter_content: removeStarterContent = false,
29
+ support_email: supportEmail
30
+ } = window.newspack_urls || {};
31
+ const footerElements = [{
32
+ label: pluginVersion.label,
33
+ url: 'https://newspack.com/category/release-notes/',
34
+ external: true
35
+ }, {
36
+ label: __('About', 'newspack-plugin'),
37
+ url: 'https://newspack.com/',
38
+ external: true
39
+ }, {
40
+ label: __('Documentation', 'newspack-plugin'),
41
+ url: support,
42
+ external: true
43
+ }];
44
+ if (componentsDemo) {
45
+ footerElements.push({
46
+ label: __('Components Demo', 'newspack-plugin'),
47
+ url: componentsDemo
48
+ });
49
+ }
50
+ if (setupWizard) {
51
+ footerElements.push({
52
+ label: __('Setup Wizard', 'newspack-plugin'),
53
+ url: setupWizard
54
+ });
55
+ }
56
+ if (resetUrl) {
57
+ footerElements.push({
58
+ label: __('Reset Newspack', 'newspack-plugin'),
59
+ url: resetUrl
60
+ });
61
+ }
62
+ if (removeStarterContent) {
63
+ footerElements.push({
64
+ label: __('Remove Starter Content', 'newspack-plugin'),
65
+ url: removeStarterContent
66
+ });
67
+ }
68
+ if (supportEmail) {
69
+ footerElements.push({
70
+ label: __('Contact Support', 'newspack-plugin'),
71
+ url: `mailto:${supportEmail}`
72
+ });
73
+ }
74
+ return /*#__PURE__*/_jsxs("div", {
75
+ className: "newspack-footer",
76
+ children: [!simple && /*#__PURE__*/_jsx("div", {
77
+ className: "newspack-footer__inner",
78
+ children: /*#__PURE__*/_jsx("ul", {
79
+ children: footerElements.map(({
80
+ url,
81
+ label,
82
+ external
83
+ }, index) => /*#__PURE__*/_jsx("li", {
84
+ children: external ? /*#__PURE__*/_jsx(ExternalLink, {
85
+ href: url,
86
+ children: label
87
+ }) : /*#__PURE__*/_jsx("a", {
88
+ href: url,
89
+ children: label
90
+ })
91
+ }, index))
92
+ })
93
+ }), /*#__PURE__*/_jsx("div", {
94
+ className: "newspack-footer__logo",
95
+ children: /*#__PURE__*/_jsx(PatronsLogo, {})
96
+ })]
97
+ });
98
+ };
99
+ export default Footer;
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Footer
3
+ */
4
+
5
+ @use "~@wordpress/base-styles/colors" as wp-colors;
6
+
7
+ .newspack-footer {
8
+ align-items: stretch;
9
+ background: white;
10
+ border: 0 solid wp-colors.$gray-300;
11
+ border-width: 1px 0;
12
+ bottom: 0;
13
+ color: wp-colors.$gray-700;
14
+ display: flex;
15
+ flex-wrap: wrap;
16
+ font-size: 12px;
17
+ justify-content: space-between;
18
+ left: 0;
19
+ line-height: 16px;
20
+ position: absolute;
21
+ right: 0;
22
+
23
+ @media screen and ( min-width: 783px ) {
24
+ bottom: 40px;
25
+ flex-wrap: nowrap;
26
+ }
27
+
28
+ &__inner {
29
+ align-items: center;
30
+ display: flex;
31
+ flex: 0 0 100%;
32
+
33
+ @media screen and ( min-width: 783px ) {
34
+ flex: 1 1 auto;
35
+ }
36
+ }
37
+
38
+ ul {
39
+ display: flex;
40
+ flex-wrap: wrap;
41
+ margin: 0;
42
+ padding: 7px 8px;
43
+ }
44
+
45
+ li {
46
+ margin: 8px;
47
+
48
+ a {
49
+ align-items: flex-end;
50
+ color: inherit;
51
+ display: flex;
52
+
53
+ &:active,
54
+ &:focus,
55
+ &:hover {
56
+ color: wp-colors.$gray-900;
57
+ }
58
+ }
59
+ }
60
+
61
+ &__logo {
62
+ align-items: center;
63
+ background: wp-colors.$gray-900;
64
+ display: flex;
65
+ margin: 0 0 -1px;
66
+ padding: 16px;
67
+ width: 100%;
68
+
69
+ @media screen and ( min-width: 783px ) {
70
+ margin: -1px 0 -1px 8px;
71
+ max-width: 33.33%;
72
+ width: auto;
73
+ }
74
+
75
+ .patrons-logo {
76
+ display: block;
77
+ fill: white;
78
+ max-height: 16px;
79
+ width: auto;
80
+ }
81
+ }
82
+ }
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Form Token Field
3
+ */
4
+
5
+ /**
6
+ * WordPress dependencies.
7
+ */
8
+ import { FormTokenField as BaseComponent } from '@wordpress/components';
9
+ import { Component } from '@wordpress/element';
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, jsxs as _jsxs } from "react/jsx-runtime";
21
+ class FormTokenField extends Component {
22
+ /**
23
+ * Render.
24
+ */
25
+ render() {
26
+ const {
27
+ className,
28
+ description,
29
+ hideHelpFromVision,
30
+ hideLabelFromVision,
31
+ ...otherProps
32
+ } = this.props;
33
+ const classes = classnames('newspack-form-token-field__input-container', className);
34
+ return /*#__PURE__*/_jsxs("div", {
35
+ className: classnames({
36
+ 'newspack-form-token-field--label-hidden': hideLabelFromVision,
37
+ 'newspack-form-token-field--help-hidden': hideHelpFromVision
38
+ }, 'newspack-form-token-field'),
39
+ children: [/*#__PURE__*/_jsx(BaseComponent, {
40
+ className: classes,
41
+ ...otherProps
42
+ }), description && /*#__PURE__*/_jsx("p", {
43
+ className: "newspack-form-token-field__help",
44
+ children: description
45
+ })]
46
+ });
47
+ }
48
+ }
49
+ export default FormTokenField;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Form Token Field
3
+ */
4
+
5
+ @use "~@wordpress/base-styles/colors" as wp-colors;
6
+
7
+ .newspack-form-token-field {
8
+ width: 100%;
9
+
10
+ .components-form-token-field__input-container {
11
+ padding-bottom: 1px;
12
+ padding-top: 1px;
13
+ }
14
+
15
+ // Help
16
+
17
+ &__help {
18
+ color: wp-colors.$gray-700;
19
+ font-size: 12px;
20
+ margin: 8px 0 0 !important;
21
+ }
22
+
23
+ // Hidden Elements
24
+
25
+ &--label-hidden {
26
+ label {
27
+ display: none;
28
+ }
29
+ }
30
+
31
+ &--help-hidden {
32
+ .components-form-token-field__help,
33
+ div.i {
34
+ display: none;
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { parse } from 'qs';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import { Notice } from '../';
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ const GlobalNotices = () => {
12
+ const notice = parse(window.location.search)['newspack-notice'];
13
+ if (!notice) {
14
+ return null;
15
+ }
16
+ return notice.split(',').map((text, i) => {
17
+ if (text.indexOf('_error_') === 0) {
18
+ return /*#__PURE__*/_jsx(Notice, {
19
+ isError: true,
20
+ noticeText: text.replace('_error_', ''),
21
+ rawHTML: true
22
+ }, i);
23
+ }
24
+ return /*#__PURE__*/_jsx(Notice, {
25
+ isSuccess: true,
26
+ noticeText: text
27
+ }, i);
28
+ });
29
+ };
30
+ export default GlobalNotices;