newspack-components 4.1.0 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/colors/colors.module.scss +1 -1
  2. package/dist/cjs/action-card/index.js +21 -12
  3. package/dist/cjs/action-card/style.scss +32 -14
  4. package/dist/cjs/autocomplete-tokenfield/index.js +2 -2
  5. package/dist/cjs/autocomplete-with-latest-posts/index.js +289 -0
  6. package/dist/cjs/autocomplete-with-latest-posts/style.scss +150 -0
  7. package/dist/cjs/badge/index.js +32 -0
  8. package/dist/cjs/badge/style.scss +36 -0
  9. package/dist/cjs/button/index.js +2 -0
  10. package/dist/cjs/card/core-card.js +141 -0
  11. package/dist/cjs/card/index.js +33 -0
  12. package/dist/cjs/card/style-core.scss +227 -0
  13. package/dist/cjs/card/style.scss +2 -2
  14. package/dist/cjs/card-settings-group/index.js +49 -0
  15. package/dist/cjs/card-settings-group/style.scss +33 -0
  16. package/dist/cjs/card-sortable-list/index.js +390 -0
  17. package/dist/cjs/card-sortable-list/style.scss +48 -0
  18. package/dist/cjs/confirm-dialog/index.js +59 -0
  19. package/dist/cjs/divider/index.js +42 -0
  20. package/dist/cjs/divider/style.scss +51 -0
  21. package/dist/cjs/form-token-field/style.scss +0 -5
  22. package/dist/cjs/grid/index.js +2 -1
  23. package/dist/cjs/grid/style.scss +63 -9
  24. package/dist/cjs/index.js +42 -0
  25. package/dist/cjs/modal/index.js +11 -4
  26. package/dist/cjs/modal/style.scss +43 -13
  27. package/dist/cjs/newspack-icon/style.scss +5 -3
  28. package/dist/cjs/popover/style.scss +1 -1
  29. package/dist/cjs/section-header/index.js +76 -17
  30. package/dist/cjs/section-header/style.scss +109 -4
  31. package/dist/cjs/style.scss +2 -0
  32. package/dist/cjs/waiting/index.js +3 -1
  33. package/dist/cjs/waiting/style.scss +4 -0
  34. package/dist/cjs/web-preview/index.js +98 -39
  35. package/dist/cjs/web-preview/style.scss +20 -53
  36. package/dist/cjs/with-wizard/index.js +1 -1
  37. package/dist/cjs/with-wizard/style.scss +24 -6
  38. package/dist/cjs/with-wizard-screen/style.scss +39 -10
  39. package/dist/cjs/wizard/components/WizardSnackbar.js +70 -0
  40. package/dist/cjs/wizard/components/style.scss +48 -0
  41. package/dist/cjs/wizard/index.js +97 -16
  42. package/dist/cjs/wizard/store/index.js +46 -0
  43. package/dist/esm/action-card/index.js +21 -12
  44. package/dist/esm/action-card/style.scss +32 -14
  45. package/dist/esm/autocomplete-tokenfield/index.js +2 -2
  46. package/dist/esm/autocomplete-with-latest-posts/index.js +281 -0
  47. package/dist/esm/autocomplete-with-latest-posts/style.scss +150 -0
  48. package/dist/esm/badge/index.js +24 -0
  49. package/dist/esm/badge/style.scss +36 -0
  50. package/dist/esm/button/index.js +2 -0
  51. package/dist/esm/card/core-card.js +133 -0
  52. package/dist/esm/card/index.js +33 -0
  53. package/dist/esm/card/style-core.scss +227 -0
  54. package/dist/esm/card/style.scss +2 -2
  55. package/dist/esm/card-settings-group/index.js +42 -0
  56. package/dist/esm/card-settings-group/style.scss +33 -0
  57. package/dist/esm/card-sortable-list/index.js +381 -0
  58. package/dist/esm/card-sortable-list/style.scss +48 -0
  59. package/dist/esm/confirm-dialog/index.js +49 -0
  60. package/dist/esm/divider/index.js +34 -0
  61. package/dist/esm/divider/style.scss +51 -0
  62. package/dist/esm/form-token-field/style.scss +0 -5
  63. package/dist/esm/grid/index.js +2 -1
  64. package/dist/esm/grid/style.scss +63 -9
  65. package/dist/esm/index.js +6 -0
  66. package/dist/esm/modal/index.js +11 -4
  67. package/dist/esm/modal/style.scss +43 -13
  68. package/dist/esm/newspack-icon/style.scss +5 -3
  69. package/dist/esm/popover/style.scss +1 -1
  70. package/dist/esm/section-header/index.js +75 -18
  71. package/dist/esm/section-header/style.scss +109 -4
  72. package/dist/esm/style.scss +2 -0
  73. package/dist/esm/waiting/index.js +3 -1
  74. package/dist/esm/waiting/style.scss +4 -0
  75. package/dist/esm/web-preview/index.js +101 -42
  76. package/dist/esm/web-preview/style.scss +20 -53
  77. package/dist/esm/with-wizard/index.js +1 -1
  78. package/dist/esm/with-wizard/style.scss +24 -6
  79. package/dist/esm/with-wizard-screen/style.scss +39 -10
  80. package/dist/esm/wizard/components/WizardSnackbar.js +64 -0
  81. package/dist/esm/wizard/components/style.scss +48 -0
  82. package/dist/esm/wizard/index.js +101 -20
  83. package/dist/esm/wizard/store/index.js +46 -0
  84. package/package.json +5 -6
  85. package/shared/author-context.js +26 -0
  86. package/shared/hooks/use-coauthors.js +220 -0
  87. package/shared/hooks/use-coauthors.test.js +624 -0
  88. package/shared/hooks/use-custom-byline.js +47 -0
  89. package/shared/hooks/use-custom-byline.test.js +133 -0
  90. package/shared/scss/_mixins.scss +46 -0
  91. package/src/action-card/action-card.d.ts +7 -3
  92. package/src/action-card/index.js +24 -11
  93. package/src/action-card/style.scss +32 -14
  94. package/src/autocomplete-tokenfield/index.js +2 -2
  95. package/src/autocomplete-with-latest-posts/index.js +290 -0
  96. package/src/autocomplete-with-latest-posts/style.scss +150 -0
  97. package/src/badge/index.tsx +24 -0
  98. package/src/badge/style.scss +36 -0
  99. package/src/button/index.tsx +3 -2
  100. package/src/card/core-card.js +147 -0
  101. package/src/card/index.js +39 -1
  102. package/src/card/style-core.scss +227 -0
  103. package/src/card/style.scss +2 -2
  104. package/src/card-settings-group/README.md +43 -0
  105. package/src/card-settings-group/index.tsx +53 -0
  106. package/src/card-settings-group/style.scss +33 -0
  107. package/src/card-sortable-list/README.md +51 -0
  108. package/src/card-sortable-list/index.tsx +412 -0
  109. package/src/card-sortable-list/style.scss +48 -0
  110. package/src/confirm-dialog/index.tsx +64 -0
  111. package/src/divider/README.md +25 -0
  112. package/src/divider/index.js +31 -0
  113. package/src/divider/style.scss +51 -0
  114. package/src/form-token-field/style.scss +0 -5
  115. package/src/grid/index.tsx +2 -1
  116. package/src/grid/style.scss +63 -9
  117. package/src/index.js +6 -0
  118. package/src/modal/index.js +12 -3
  119. package/src/modal/style.scss +43 -13
  120. package/src/newspack-icon/style.scss +5 -3
  121. package/src/popover/style.scss +1 -1
  122. package/src/section-header/index.js +72 -13
  123. package/src/section-header/style.scss +109 -4
  124. package/src/style.scss +2 -0
  125. package/src/waiting/index.js +2 -1
  126. package/src/waiting/style.scss +4 -0
  127. package/src/web-preview/index.js +90 -35
  128. package/src/web-preview/style.scss +20 -53
  129. package/src/with-wizard/index.js +1 -1
  130. package/src/with-wizard/style.scss +24 -6
  131. package/src/with-wizard-screen/style.scss +39 -10
  132. package/src/wizard/components/WizardSnackbar.js +58 -0
  133. package/src/wizard/components/style.scss +48 -0
  134. package/src/wizard/index.js +108 -14
  135. package/src/wizard/store/index.js +26 -0
@@ -3,21 +3,58 @@
3
3
  */
4
4
 
5
5
  @use "~@wordpress/base-styles/colors" as wp-colors;
6
+ @use "../../../colors/colors.module" as colors;
6
7
 
7
8
  .newspack-section-header {
9
+ flex: 1;
8
10
  margin: 64px 0 32px;
9
11
 
10
- &__container:not(:first-child) {
11
- margin-top: 48px;
12
+ &__container {
13
+ position: relative;
14
+ &:not(:first-child) {
15
+ margin-top: 48px;
16
+ }
17
+ &.newspack-section-header--has-primary-action {
18
+ display: flex;
19
+ flex-direction: column;
20
+ gap: 32px;
21
+ @media (min-width: 782px) {
22
+ align-items: flex-start;
23
+ flex-direction: row;
24
+ }
25
+ }
26
+ &.newspack-section-header--has-back-nav {
27
+ --back-nav-button-size: 36px;
28
+ margin-left: calc(var(--back-nav-button-size) + 8px);
29
+ @media (min-width: 782px) {
30
+ margin-left: 0;
31
+ }
32
+ }
33
+ }
34
+
35
+ &__back-nav {
36
+ left: calc((var(--back-nav-button-size) + 8px) * -1);
37
+ position: absolute;
38
+ top: calc(50% - (var(--back-nav-button-size) / 2));
39
+ a,
40
+ button {
41
+ color: inherit !important;
42
+ }
12
43
  }
13
44
 
14
- &--no-margin,
15
45
  h1,
16
46
  h2,
17
47
  h3,
18
48
  h4,
19
49
  h5,
20
50
  h6 {
51
+ align-items: center;
52
+ display: flex;
53
+ gap: 8px;
54
+ margin: 0 !important;
55
+ }
56
+
57
+ &--no-margin {
21
58
  margin: 0 !important;
22
59
  }
23
60
 
@@ -25,7 +62,7 @@
25
62
  text-align: center;
26
63
  }
27
64
 
28
- &:not( #{&}--no-margin ) + *:not( #{&} ) {
65
+ &:not( #{&}--no-margin ) + *:not( #{&} ):not(.newspack-wizard__section-header):not(.newspack-section-header__primary-action) {
29
66
  margin-top: -16px !important;
30
67
  }
31
68
 
@@ -39,7 +76,75 @@
39
76
  color: wp-colors.$gray-700;
40
77
  }
41
78
 
79
+ &__title-container {
80
+ align-items: baseline;
81
+ display: flex;
82
+ gap: 8px;
83
+
84
+ .newspack-badge {
85
+ transform: translateY(-4px);
86
+ }
87
+ }
88
+
89
+ &__primary-action {
90
+ @media (min-width: 782px) {
91
+ display: flex;
92
+ flex: 1;
93
+ justify-content: flex-end;
94
+ }
95
+ }
96
+
97
+ &__secondary-action {
98
+ display: flex;
99
+ margin-left: 8px;
100
+ }
101
+
102
+ &__children {
103
+ margin-top: 32px;
104
+ width: 100%;
105
+ .newspack-button-card:not(.grouped) {
106
+ margin-bottom: 0;
107
+ & + .newspack-button-card:not(.grouped) {
108
+ margin-top: 16px;
109
+ }
110
+ }
111
+ }
112
+
42
113
  .newspack-wizard__content &:first-child {
43
114
  margin-top: 32px;
44
115
  }
116
+ &.newspack-section-header--page-header {
117
+ display: flex;
118
+ flex-direction: column;
119
+ align-items: center;
120
+ justify-content: center;
121
+ margin-left: auto;
122
+ margin-right: auto;
123
+ > h1,
124
+ > h2,
125
+ > h3,
126
+ > h4,
127
+ > h5,
128
+ > h6,
129
+ > p {
130
+ text-align: center;
131
+ }
132
+ .newspack-section-header__icon {
133
+ background-color: var(--wp-admin-theme-color-lighter-10);
134
+ border-radius: 100%;
135
+ display: grid;
136
+ height: 80px;
137
+ margin-bottom: 8px !important;
138
+ width: 80px;
139
+ place-items: center;
140
+ svg {
141
+ fill: var(--wp-admin-theme-color);
142
+ }
143
+ }
144
+ h1 {
145
+ font-size: 1.25rem;
146
+ font-weight: 500;
147
+ line-height: 1.5;
148
+ }
149
+ }
45
150
  }
@@ -9,6 +9,8 @@
9
9
  --wp-admin-theme-color-darker-10--rgb: #{colors.$primary-700--rgb};
10
10
  --wp-admin-theme-color-darker-20: #{colors.$primary-800};
11
11
  --wp-admin-theme-color-darker-20--rgb: #{colors.$primary-800--rgb};
12
+ --wp-admin-theme-color-lighter-10: #{colors.$primary-000};
13
+ --wp-admin-theme-color-lighter-10--rgb: #{colors.$primary-000--rgb};
12
14
  }
13
15
 
14
16
  // Buttons Card
@@ -28,12 +28,14 @@ class Waiting extends Component {
28
28
  isRight,
29
29
  isLeft,
30
30
  isCenter,
31
+ noMargin,
31
32
  ...otherProps
32
33
  } = this.props;
33
34
  const classes = classnames('newspack-waiting', className, {
34
35
  'is-right': isRight,
35
36
  'is-left': isLeft,
36
- 'is-center': isCenter
37
+ 'is-center': isCenter,
38
+ 'no-margin': noMargin
37
39
  });
38
40
  return /*#__PURE__*/_jsx(Spinner, {
39
41
  className: classes,
@@ -24,4 +24,8 @@
24
24
  &.is-center {
25
25
  margin: auto;
26
26
  }
27
+
28
+ &.no-margin {
29
+ margin: 0;
30
+ }
27
31
  }
@@ -3,8 +3,8 @@
3
3
  */
4
4
  import { Component, createRef, Fragment, createPortal } from '@wordpress/element';
5
5
  import { __ } from '@wordpress/i18n';
6
- import { closeSmall, desktop, mobile, tablet } from '@wordpress/icons';
7
- import { Button, ButtonGroup } from '@wordpress/components';
6
+ import { close, desktop, mobile, tablet, check } from '@wordpress/icons';
7
+ import { Button, DropdownMenu, MenuItem } from '@wordpress/components';
8
8
 
9
9
  /**
10
10
  * Internal dependencies.
@@ -16,7 +16,7 @@ import './style.scss';
16
16
  * External dependencies.
17
17
  */
18
18
  import classnames from 'classnames';
19
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
20
20
  const PORTAL_PARENT_ID = 'newspack-components-web-preview-wrapper';
21
21
 
22
22
  /**
@@ -47,24 +47,63 @@ class WebPreview extends Component {
47
47
  }
48
48
 
49
49
  /**
50
- * Add or remove applicable body classes
50
+ * Add or remove applicable body classes and keyboard event listeners
51
51
  */
52
- componentDidUpdate() {
52
+ componentDidUpdate(prevProps, prevState) {
53
53
  if (this.state.isPreviewVisible === true) {
54
54
  document.body.classList.add('newspack-web-preview--open');
55
+ if (prevState.isPreviewVisible === false) {
56
+ // Add event listener when modal opens
57
+ document.addEventListener('keydown', this.handleKeyDown);
58
+ }
55
59
  } else {
56
60
  document.body.classList.remove('newspack-web-preview--open');
61
+ if (prevState.isPreviewVisible === true) {
62
+ // Remove event listener when modal closes
63
+ document.removeEventListener('keydown', this.handleKeyDown);
64
+ }
57
65
  }
58
66
  }
59
67
 
68
+ /**
69
+ * Clean up event listeners on unmount
70
+ */
71
+ componentWillUnmount() {
72
+ document.removeEventListener('keydown', this.handleKeyDown);
73
+ document.body.classList.remove('newspack-web-preview--open');
74
+ }
75
+
76
+ /**
77
+ * Handle keyboard events
78
+ */
79
+ handleKeyDown = event => {
80
+ if (event.key === 'Escape' && this.state.isPreviewVisible) {
81
+ this.closePreview();
82
+ }
83
+ };
84
+
85
+ /**
86
+ * Close the preview modal
87
+ */
88
+ closePreview = () => {
89
+ const {
90
+ onClose = () => {}
91
+ } = this.props;
92
+ onClose();
93
+ this.setState({
94
+ isPreviewVisible: false,
95
+ loaded: false
96
+ });
97
+ };
98
+
60
99
  /**
61
100
  * Create JSX for the modal
62
101
  */
63
102
  getWebPreviewModal = () => {
64
103
  const {
65
104
  beforeLoad = () => {},
66
- onClose = () => {},
67
- url
105
+ url,
106
+ title
68
107
  } = this.props;
69
108
  const {
70
109
  device,
@@ -75,6 +114,12 @@ class WebPreview extends Component {
75
114
  return null;
76
115
  }
77
116
  const classes = classnames('newspack-web-preview', device, loaded && 'is-loaded');
117
+ let icon = mobile;
118
+ if (device === 'desktop') {
119
+ icon = desktop;
120
+ } else if (device === 'tablet') {
121
+ icon = tablet;
122
+ }
78
123
  beforeLoad();
79
124
  return createPortal(/*#__PURE__*/_jsx("div", {
80
125
  className: classes,
@@ -82,45 +127,59 @@ class WebPreview extends Component {
82
127
  className: "newspack-web-preview__interior",
83
128
  children: [/*#__PURE__*/_jsxs("div", {
84
129
  className: "newspack-web-preview__toolbar",
85
- children: [/*#__PURE__*/_jsx("div", {
130
+ children: [title && /*#__PURE__*/_jsx("div", {
86
131
  className: "newspack-web-preview__toolbar-left",
87
- children: /*#__PURE__*/_jsxs(ButtonGroup, {
88
- children: [/*#__PURE__*/_jsx(Button, {
89
- onClick: () => this.setState({
90
- device: 'desktop'
91
- }),
92
- variant: 'desktop' === device && 'primary',
93
- icon: desktop,
94
- label: __('Preview Desktop Size', 'newspack-plugin')
95
- }), /*#__PURE__*/_jsx(Button, {
96
- onClick: () => this.setState({
97
- device: 'tablet'
98
- }),
99
- variant: 'tablet' === device && 'primary',
100
- icon: tablet,
101
- label: __('Preview Tablet Size', 'newspack-plugin')
102
- }), /*#__PURE__*/_jsx(Button, {
103
- onClick: () => this.setState({
104
- device: 'phone'
105
- }),
106
- variant: 'phone' === device && 'primary',
107
- icon: mobile,
108
- label: __('Preview Phone Size', 'newspack-plugin')
109
- })]
132
+ children: /*#__PURE__*/_jsx("h3", {
133
+ children: title
110
134
  })
111
- }), /*#__PURE__*/_jsx("div", {
135
+ }), /*#__PURE__*/_jsxs("div", {
112
136
  className: "newspack-web-preview__toolbar-right",
113
- children: /*#__PURE__*/_jsx(Button, {
114
- onClick: () => {
115
- onClose();
116
- this.setState({
117
- isPreviewVisible: false,
118
- loaded: false
119
- });
120
- },
121
- icon: closeSmall,
137
+ children: [/*#__PURE__*/_jsx(DropdownMenu, {
138
+ icon: icon,
139
+ label: __('Preview Size', 'newspack-plugin'),
140
+ children: ({
141
+ onClose: onDropdownClose
142
+ }) => /*#__PURE__*/_jsxs(_Fragment, {
143
+ children: [/*#__PURE__*/_jsx(MenuItem, {
144
+ icon: device === 'desktop' ? check : null,
145
+ role: "menuitemradio",
146
+ isSelected: device === 'desktop',
147
+ onClick: () => {
148
+ this.setState({
149
+ device: 'desktop'
150
+ });
151
+ onDropdownClose();
152
+ },
153
+ children: __('Desktop', 'newspack-plugin')
154
+ }), /*#__PURE__*/_jsx(MenuItem, {
155
+ icon: device === 'tablet' ? check : null,
156
+ role: "menuitemradio",
157
+ isSelected: device === 'tablet',
158
+ onClick: () => {
159
+ this.setState({
160
+ device: 'tablet'
161
+ });
162
+ onDropdownClose();
163
+ },
164
+ children: __('Tablet', 'newspack-plugin')
165
+ }), /*#__PURE__*/_jsx(MenuItem, {
166
+ icon: device === 'phone' ? check : null,
167
+ role: "menuitemradio",
168
+ isSelected: device === 'phone',
169
+ onClick: () => {
170
+ this.setState({
171
+ device: 'phone'
172
+ });
173
+ onDropdownClose();
174
+ },
175
+ children: __('Phone', 'newspack-plugin')
176
+ })]
177
+ })
178
+ }), /*#__PURE__*/_jsx(Button, {
179
+ onClick: this.closePreview,
180
+ icon: close,
122
181
  label: __('Close Preview', 'newspack-plugin')
123
- })
182
+ })]
124
183
  })]
125
184
  }), /*#__PURE__*/_jsxs("div", {
126
185
  className: "newspack-web-preview__content",
@@ -13,8 +13,10 @@
13
13
  --wp-admin-theme-color-darker-10--rgb: #{colors.$primary-700--rgb};
14
14
  --wp-admin-theme-color-darker-20: #{colors.$primary-800};
15
15
  --wp-admin-theme-color-darker-20--rgb: #{colors.$primary-800--rgb};
16
+ --wp-admin-theme-color-lighter-10: #{colors.$primary-000};
17
+ --wp-admin-theme-color-lighter-10--rgb: #{colors.$primary-000--rgb};
16
18
 
17
- background: #{colors.$neutral-700};
19
+ background: color-mix(in srgb, colors.$neutral-1000, transparent 65%);
18
20
  box-sizing: border-box;
19
21
  height: 100%;
20
22
  left: 0;
@@ -27,11 +29,11 @@
27
29
  z-index: 99999;
28
30
 
29
31
  &.phone iframe {
30
- max-width: 380px;
32
+ max-width: 360px;
31
33
  }
32
34
 
33
35
  &.tablet iframe {
34
- max-width: 768px;
36
+ max-width: 780px;
35
37
  }
36
38
 
37
39
  &.is-loaded iframe {
@@ -46,7 +48,7 @@
46
48
  animation: appear-animation 125ms ease-in-out;
47
49
  animation-fill-mode: forwards;
48
50
  background: white;
49
- border-radius: 2px;
51
+ border-radius: 8px;
50
52
  overflow: hidden;
51
53
  height: 100%;
52
54
  width: 100%;
@@ -54,19 +56,18 @@
54
56
 
55
57
  &__content {
56
58
  background: wp-colors.$gray-100;
57
- height: calc(100% - 49px);
59
+ height: calc(100% - 72px);
58
60
  -webkit-overflow-scrolling: touch;
59
61
  overflow-x: hidden;
60
62
  width: 100%;
61
63
 
62
64
  iframe {
63
- background: #fff;
65
+ background: white;
64
66
  display: block;
65
67
  height: 100%;
66
68
  margin: 0 auto;
67
69
  max-width: 100%;
68
70
  opacity: 0;
69
- outline: 1px solid wp-colors.$gray-300;
70
71
  padding: 0;
71
72
  pointer-events: all;
72
73
  transition: max-width 125ms ease-in-out, opacity 250ms ease-in-out;
@@ -85,62 +86,28 @@
85
86
  }
86
87
 
87
88
  &__toolbar {
89
+ align-items: center;
88
90
  border-bottom: 1px solid wp-colors.$gray-300;
89
91
  display: flex;
90
- padding: 6px;
92
+ gap: 16px;
93
+ justify-content: space-between;
94
+ min-height: 71px;
95
+ padding: 12px 24px;
91
96
 
92
97
  &-left {
93
- flex: 0 0 auto;
98
+ display: flex;
94
99
 
95
- .newspack-button-group {
96
- display: flex;
100
+ h3 {
97
101
  margin: 0;
98
102
  }
99
-
100
- .newspack-button {
101
- display: none;
102
- padding: 0 !important;
103
-
104
- &.is-selected {
105
- background: var(--wp-admin-theme-color);
106
- color: white;
107
-
108
- &:active,
109
- &:focus,
110
- &:hover {
111
- box-shadow: none !important;
112
- color: white;
113
- outline: none;
114
- }
115
-
116
- &:focus {
117
- box-shadow: inset 0 0 0 1px var(--wp-admin-theme-color), inset 0 0 0 3px white !important;
118
- }
119
- }
120
-
121
- @media screen and ( min-width: 528px ) {
122
- &.is-phone,
123
- &.is-tablet {
124
- display: flex;
125
- }
126
- }
127
-
128
- @media screen and ( min-width: 816px ) {
129
- &.is-desktop {
130
- display: flex;
131
- }
132
- }
133
- }
134
103
  }
135
104
 
136
105
  &-right {
137
- display: flex;
138
- flex: 1;
139
- justify-content: flex-end;
140
- }
141
-
142
- .newspack-button {
143
- border-radius: 0 !important;
106
+ display: grid;
107
+ gap: 8px;
108
+ grid-template-columns: repeat(2, 1fr);
109
+ justify-self: end;
110
+ margin-left: auto;
144
111
  }
145
112
  }
146
113
  }
@@ -318,7 +318,7 @@ export default function withWizard(WrappedComponent, requiredPlugins) {
318
318
  callback
319
319
  } = this.state.confirmation;
320
320
  return message && callback && /*#__PURE__*/_jsxs(Modal, {
321
- isNarrow: true,
321
+ size: "small",
322
322
  hideTitle: !title,
323
323
  title: title,
324
324
  onRequestClose: () => this.setState({
@@ -3,11 +3,21 @@
3
3
  */
4
4
 
5
5
  @use "~@wordpress/base-styles/colors" as wp-colors;
6
+ @use "../../../colors/colors.module" as colors;
6
7
 
7
8
  // Styling for full-page-react Wizards (ignoring admin-header-only wizards).
8
9
  body.newspack-wizard-page:not(.newspack-admin-header) {
9
-
10
- background: white;
10
+ --wp-admin-theme-color: #{colors.$primary-600};
11
+ --wp-admin-theme-color--rgb: #{colors.$primary-600--rgb};
12
+ --wp-admin-theme-color-darker-10: #{colors.$primary-700};
13
+ --wp-admin-theme-color-darker-10--rgb: #{colors.$primary-700--rgb};
14
+ --wp-admin-theme-color-darker-20: #{colors.$primary-800};
15
+ --wp-admin-theme-color-darker-20--rgb: #{colors.$primary-800--rgb};
16
+ --wp-admin-theme-color-lighter-10: #{colors.$primary-000};
17
+ --wp-admin-theme-color-lighter-10--rgb: #{colors.$primary-000--rgb};
18
+ --wp-components-color-accent: #{colors.$primary-600};
19
+
20
+ background: #{wp-colors.$white};
11
21
 
12
22
  // Reset Padding
13
23
  #wpcontent {
@@ -18,6 +28,14 @@ body.newspack-wizard-page:not(.newspack-admin-header) {
18
28
  padding-bottom: 220px;
19
29
  min-height: 100vh;
20
30
 
31
+ @media screen and ( min-width: 600px ) {
32
+ min-height: calc(100vh - 46px);
33
+ }
34
+
35
+ @media screen and ( min-width: 783px ) {
36
+ min-height: calc(100vh - 32px);
37
+ }
38
+
21
39
  // For admin notices directly ">" at top of page above the Wizard header.
22
40
  // PHP code should hide these notices, but just incase add this style.
23
41
  > .notice {
@@ -29,8 +47,8 @@ body.newspack-wizard-page:not(.newspack-admin-header) {
29
47
  padding-bottom: 202px;
30
48
  }
31
49
 
32
- @media screen and ( min-width: 1128px ) {
33
- padding-bottom: 168px;
50
+ @media screen and ( min-width: 1054px ) {
51
+ padding-bottom: 136px;
34
52
  }
35
53
  }
36
54
  }
@@ -134,7 +152,7 @@ svg {
134
152
  0 96px 0 0 wp-colors.$gray-700;
135
153
  height: 24px;
136
154
  margin: 68px auto 0;
137
- max-width: 1040px;
155
+ max-width: 1006px;
138
156
  width: calc(100% - ( 32px * 2 ));
139
157
 
140
158
  @media screen and ( min-width: 744px ) {
@@ -250,7 +268,7 @@ svg {
250
268
  0 96px 0 0 wp-colors.$gray-700;
251
269
  height: 24px;
252
270
  margin: 0 auto;
253
- max-width: 1040px;
271
+ max-width: 1006px;
254
272
  width: 100%;
255
273
 
256
274
  @media screen and ( min-width: 744px ) {
@@ -13,6 +13,8 @@
13
13
  --wp-admin-theme-color-darker-10--rgb: #{colors.$primary-700--rgb};
14
14
  --wp-admin-theme-color-darker-20: #{colors.$primary-800};
15
15
  --wp-admin-theme-color-darker-20--rgb: #{colors.$primary-800--rgb};
16
+ --wp-admin-theme-color-lighter-10: #{colors.$primary-000};
17
+ --wp-admin-theme-color-lighter-10--rgb: #{colors.$primary-000--rgb};
16
18
 
17
19
  color: wp-colors.$gray-900;
18
20
 
@@ -44,12 +46,39 @@
44
46
  }
45
47
 
46
48
  &__header {
49
+ align-items: center;
47
50
  background: white;
51
+ border-bottom: 1px solid wp-colors.$gray-300;
52
+ display: flex;
53
+ .newspack-wizard__fixed-header & {
54
+ position: sticky;
55
+ top: 0;
56
+ width: 100%;
57
+ z-index: 1000;
58
+ .admin-bar & {
59
+ @media only screen and ( min-width: 601px ) {
60
+ top: 46px;
61
+ }
62
+ @media only screen and ( min-width: 782px ) {
63
+ top: 32px;
64
+ }
65
+ }
66
+ }
67
+ &__inner {
68
+ flex: 1;
69
+ }
70
+ &__actions {
71
+ align-items: center;
72
+ display: flex;
73
+ flex: 1 1 auto;
74
+ gap: 8px;
75
+ justify-content: flex-end;
76
+ padding: 0 24px 0 0;
77
+ }
48
78
  }
49
79
 
50
80
  &__title {
51
81
  align-items: center;
52
- border-bottom: 1px solid wp-colors.$gray-300;
53
82
  display: flex;
54
83
 
55
84
  h2 {
@@ -62,7 +91,7 @@
62
91
  display: flex;
63
92
  padding: 0 24px;
64
93
 
65
- span {
94
+ > span {
66
95
  color: wp-colors.$gray-700;
67
96
  display: none;
68
97
  margin-left: 8px;
@@ -119,14 +148,14 @@
119
148
  }
120
149
  }
121
150
 
151
+ &__section-header {
152
+ margin-bottom: 32px;
153
+ }
154
+
122
155
  &__content {
123
156
  margin: 0 auto;
124
- max-width: 1208px;
125
- padding: 0 16px;
126
-
127
- @media screen and ( min-width: 744px ) {
128
- padding: 40px 84px;
129
- }
157
+ max-width: calc(calc(var(--newspack-wizard-section-space) * 2) + var(--newspack-wizard-section-width));
158
+ padding: calc(var(--newspack-wizard-section-space) * 2) var(--newspack-wizard-section-space) 0;
130
159
 
131
160
  // Typography
132
161
 
@@ -141,11 +170,11 @@
141
170
 
142
171
  // Thematic Break
143
172
 
144
- hr {
173
+ hr:not(.newspack-divider) {
145
174
  background: wp-colors.$gray-300;
146
175
  border: 0;
147
176
  height: 1px;
148
- margin: 48px 0;
177
+ margin: 32px 0;
149
178
 
150
179
  @media screen and ( min-width: 744px ) {
151
180
  margin: 64px 0;