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
@@ -13,7 +13,7 @@
13
13
 
14
14
  // No Margin
15
15
  &--no-margin {
16
- margin: 0;
16
+ margin: 0 !important;
17
17
  }
18
18
 
19
19
  // Gutter 0
@@ -41,6 +41,11 @@
41
41
  grid-gap: 32px;
42
42
  }
43
43
 
44
+ // Gutter 64
45
+ &__gutter-64 {
46
+ grid-gap: 64px;
47
+ }
48
+
44
49
  // Row Gap 0
45
50
  &__row-gap-0 {
46
51
  grid-row-gap: 0;
@@ -61,11 +66,6 @@
61
66
  grid-row-gap: 32px;
62
67
  }
63
68
 
64
- // Gutter 64
65
- &__gutter-64 {
66
- grid-gap: 64px;
67
- }
68
-
69
69
  // Columns 6
70
70
  &__columns-6 {
71
71
  grid-template-columns: repeat(2, 1fr);
@@ -77,6 +77,14 @@
77
77
  &__columns-3,
78
78
  &__columns-4 {
79
79
  grid-template-columns: repeat(2, 1fr);
80
+
81
+ > [start] {
82
+ grid-column-start: 1;
83
+ }
84
+
85
+ > [end] {
86
+ grid-column-end: -1;
87
+ }
80
88
  }
81
89
 
82
90
  &__columns-6 {
@@ -84,8 +92,8 @@
84
92
  }
85
93
  }
86
94
 
87
- // Media Queries - 1128px
88
- @media screen and ( min-width: 1128px ) {
95
+ // Media Queries - 1054px
96
+ @media screen and ( min-width: 1054px ) {
89
97
  // Columns 3
90
98
  &__columns-3 {
91
99
  grid-template-columns: repeat(3, 1fr);
@@ -94,6 +102,14 @@
94
102
  // Columns 4
95
103
  &__columns-4 {
96
104
  grid-template-columns: repeat(4, 1fr);
105
+
106
+ > [start="2"] {
107
+ grid-column-start: 2;
108
+ }
109
+
110
+ > [end="4"] {
111
+ grid-column-end: 4;
112
+ }
97
113
  }
98
114
 
99
115
  // Columns 6
@@ -116,6 +132,44 @@
116
132
  > * {
117
133
  margin-bottom: 0 !important;
118
134
  margin-top: 0 !important;
135
+ > h1:first-child,
136
+ > h2:first-child,
137
+ > h3:first-child,
138
+ > h4:first-child,
139
+ > h5:first-child,
140
+ > h6:first-child {
141
+ margin-top: 0;
142
+ }
143
+ }
144
+
145
+ // Borders
146
+ &__borders {
147
+ grid-gap: 0 !important;
148
+ > * {
149
+ border-bottom: 1px solid wp-colors.$gray-300;
150
+ &:last-child {
151
+ border-bottom: none;
152
+ }
153
+ @media screen and ( min-width: 744px ) {
154
+ border-bottom: none;
155
+ border-right: 1px solid wp-colors.$gray-300;
156
+ &:last-child {
157
+ border-right: none;
158
+ }
159
+ }
160
+ }
161
+ &.newspack-grid__gutter-8 > * {
162
+ padding: 8px;
163
+ }
164
+ &.newspack-grid__gutter-16 > * {
165
+ padding: 16px;
166
+ }
167
+ &.newspack-grid__gutter-32 > * {
168
+ padding: 32px;
169
+ }
170
+ &.newspack-grid__gutter-64 > * {
171
+ padding: 64px;
172
+ }
119
173
  }
120
174
 
121
175
  .components-base-control {
@@ -163,4 +217,4 @@
163
217
  &__tbody + &__tbody {
164
218
  margin-top: -32px;
165
219
  }
166
- }
220
+ }
package/src/index.js CHANGED
@@ -2,13 +2,19 @@ export { default as Accordion } from './accordion';
2
2
  export { default as ActionCard } from './action-card';
3
3
  export { default as AutocompleteTokenField } from './autocomplete-tokenfield';
4
4
  export { default as AutocompleteWithSuggestions } from './autocomplete-with-suggestions';
5
+ export { default as AutocompleteWithLatestPosts } from './autocomplete-with-latest-posts';
6
+ export { default as Badge } from './badge';
5
7
  export { default as Button } from './button';
6
8
  export { default as ButtonCard } from './button-card';
7
9
  export { default as BoxContrast } from './box-contrast';
8
10
  export { default as Card } from './card';
11
+ export { default as CardSettingsGroup } from './card-settings-group';
12
+ export { default as CardSortableList } from './card-sortable-list';
9
13
  export { default as CategoryAutocomplete } from './category-autocomplete';
10
14
  export { default as ColorPicker } from './color-picker';
15
+ export { default as ConfirmDialog } from './confirm-dialog';
11
16
  export { default as CustomSelectControl } from './custom-select-control';
17
+ export { default as Divider } from './divider';
12
18
  export { default as FormTokenField } from './form-token-field';
13
19
  export { default as Footer } from './footer';
14
20
  export { default as Handoff } from './handoff';
@@ -18,12 +18,21 @@ import './style.scss';
18
18
  */
19
19
  import classnames from 'classnames';
20
20
 
21
- function Modal( { className, isWide, isNarrow, hideTitle, ...otherProps }, ref ) {
21
+ const sizeClassMap = {
22
+ small: 'newspack-modal--size-small',
23
+ medium: 'newspack-modal--size-medium',
24
+ large: 'newspack-modal--size-large',
25
+ 'x-large': 'newspack-modal--size-x-large',
26
+ full: 'newspack-modal--size-full',
27
+ };
28
+
29
+ const getSizeClassName = size => sizeClassMap[ size ] || sizeClassMap.medium;
30
+
31
+ function Modal( { className, size = 'medium', hideTitle, ...otherProps }, ref ) {
22
32
  const classes = classnames(
23
33
  'newspack-modal',
24
- isWide && 'newspack-modal--wide',
25
- isNarrow && 'newspack-modal--narrow',
26
34
  hideTitle && 'newspack-modal--hide-title', // Note: also hides the X close button.
35
+ getSizeClassName( size ),
27
36
  className
28
37
  );
29
38
 
@@ -12,20 +12,37 @@
12
12
  --wp-admin-theme-color-darker-10--rgb: #{colors.$primary-700--rgb};
13
13
  --wp-admin-theme-color-darker-20: #{colors.$primary-800};
14
14
  --wp-admin-theme-color-darker-20--rgb: #{colors.$primary-800--rgb};
15
+ --wp-admin-theme-color-lighter-10: #{colors.$primary-000};
16
+ --wp-admin-theme-color-lighter-10--rgb: #{colors.$primary-000--rgb};
15
17
 
16
- @media screen and ( min-width: 744px ) {
17
- max-width: 680px;
18
- width: 680px;
18
+ border-radius: 8px;
19
+ margin: auto;
20
+ max-height: calc(100% - 64px);
21
+ max-width: 512px;
22
+ width: calc(100% - 64px);
19
23
 
20
- &--wide {
21
- max-width: 1168px;
22
- width: 1168px;
24
+ &--size-small {
25
+ max-width: 384px;
26
+
27
+ &.newspack-modal--hide-title {
28
+ max-width: 350px;
23
29
  }
24
30
  }
25
31
 
26
- &--narrow {
27
- max-width: 360px;
28
- width: 360px;
32
+ &--size-medium {
33
+ max-width: 512px;
34
+ }
35
+
36
+ &--size-large {
37
+ max-width: 840px;
38
+ }
39
+
40
+ &--size-x-large {
41
+ max-width: calc(var(--newspack-wizard-section-width) + 64px)
42
+ }
43
+
44
+ &--size-full {
45
+ max-width: 100%;
29
46
  }
30
47
 
31
48
  &--hide-title {
@@ -39,8 +56,15 @@
39
56
  }
40
57
  }
41
58
 
42
- @media screen and ( min-width: 960px ) {
43
- max-height: calc(100% - 128px);
59
+ &--destructive {
60
+ .components-button.is-primary {
61
+ background-color: colors.$error-500;
62
+ color: colors.$neutral-000;
63
+ &:hover,
64
+ &:focus {
65
+ background-color: colors.$error-600;
66
+ }
67
+ }
44
68
  }
45
69
 
46
70
  // Links
@@ -60,8 +84,14 @@
60
84
  }
61
85
 
62
86
  .components-modal__content {
63
- > *:last-child {
64
- margin-bottom: 0;
87
+ > * {
88
+ &:first-child {
89
+ margin-top: 0;
90
+ }
91
+
92
+ &:last-child {
93
+ margin-bottom: 0;
94
+ }
65
95
  }
66
96
  }
67
97
  }
@@ -1,20 +1,22 @@
1
+ @use '../../../colors/colors.module.scss' as colors;
2
+
1
3
  /**
2
4
  * Newspack Icon
3
5
  */
4
6
 
5
7
  .newspack-icon {
6
- background: var(--wp-admin-theme-color);
8
+ background: colors.$primary-600;
7
9
  fill: white;
8
10
  padding: 12px;
9
11
 
10
12
  &--white {
11
13
  background: white;
12
- fill: var(--wp-admin-theme-color);
14
+ fill: colors.$primary-600;
13
15
  }
14
16
 
15
17
  &--simple {
16
18
  background: none;
17
- fill: var(--wp-admin-theme-color);
19
+ fill: colors.$primary-600;
18
20
  padding: 0;
19
21
  }
20
22
 
@@ -75,7 +75,7 @@
75
75
  }
76
76
 
77
77
  .screen-reader-text {
78
- display: flex;
78
+ opacity: 0;
79
79
  }
80
80
 
81
81
  .newspack-select-control {
@@ -5,12 +5,15 @@
5
5
  /**
6
6
  * WordPress dependencies
7
7
  */
8
+ import { __ } from '@wordpress/i18n';
8
9
  import { useEffect, useRef } from '@wordpress/element';
10
+ import { Tooltip } from '@wordpress/components'; // eslint-disable-line @wordpress/no-unsafe-wp-apis
11
+ import { Icon, chevronLeft } from '@wordpress/icons';
9
12
 
10
13
  /**
11
14
  * Internal dependencies
12
15
  */
13
- import { Grid } from '..';
16
+ import { Badge, Button, Grid } from '..';
14
17
  import './style.scss';
15
18
 
16
19
  /**
@@ -22,14 +25,20 @@ import classnames from 'classnames';
22
25
  * Represents a section header component.
23
26
  *
24
27
  * @typedef {Object} SectionHeaderProps
25
- * @property {boolean} [centered=false] - Indicates if the header is centered.
26
- * @property {?string} [className=null] - Additional CSS class name.
27
- * @property {string|Function|*} [description] - Description of the section.
28
- * @property {number} [heading=2] - HTML heading level, e.g., 1 for h1, 2 for h2, etc.
29
- * @property {boolean} [isWhite=false] - Indicates if the header should use a white theme.
30
- * @property {boolean} [noMargin=false] - Indicates if the header should have no margin.
31
- * @property {string} title - The title of the section.
32
- * @property {?string} [id=null] - Optional ID for the header element.
28
+ * @property {string} [backNav=''] - URL to navigate back to.
29
+ * @property {string|string[]} [badge] - Badge to display in the header.
30
+ * @property {string} [badgeLevel] - Badge level, e.g., 'success', 'info', 'warning', 'error'.
31
+ * @property {boolean} [centered=false] - Indicates if the header is centered.
32
+ * @property {?string} [className=null] - Additional CSS class name.
33
+ * @property {string|Function|*} [description] - Description of the section.
34
+ * @property {number} [heading=2] - HTML heading level, e.g., 1 for h1, 2 for h2, etc.
35
+ * @property {string|Function|*} [icon] - Icon to display in the header.
36
+ * @property {boolean} [isWhite=false] - Indicates if the header should use a white theme.
37
+ * @property {boolean} [noMargin=false] - Indicates if the header should have no margin.
38
+ * @property {boolean} [pageHeader=false] - Indicates if the header is used as a page header.
39
+ * @property {string} title - The title of the section.
40
+ * @property {?string} [id=null] - Optional ID for the header element.
41
+ * @property {?string|Function|*} [children=null] - Optional children to display in the header.
33
42
  */
34
43
 
35
44
  /**
@@ -38,14 +47,21 @@ import classnames from 'classnames';
38
47
  * @param {SectionHeaderProps} props - The properties for the section header.
39
48
  */
40
49
  const SectionHeader = ( {
50
+ backNav = '',
51
+ badges,
41
52
  centered = false,
42
53
  className = null,
43
54
  description = '',
44
55
  heading = 2,
56
+ icon = null,
45
57
  isWhite = false,
46
58
  noMargin = false,
59
+ pageHeader = false,
47
60
  title,
48
61
  id = null,
62
+ primaryAction,
63
+ secondaryAction,
64
+ children = null,
49
65
  } ) => {
50
66
  // If id is in the URL as a scrollTo param, scroll to it on render.
51
67
  const ref = useRef();
@@ -65,20 +81,63 @@ const SectionHeader = ( {
65
81
  centered && 'newspack-section-header--is-centered',
66
82
  isWhite && 'newspack-section-header--is-white',
67
83
  noMargin && 'newspack-section-header--no-margin',
68
- className
84
+ pageHeader && 'newspack-section-header--page-header'
69
85
  );
70
86
 
71
- const HeadingTag = `h${ heading }`;
87
+ const HeadingTag = pageHeader ? 'h1' : `h${ heading }`;
72
88
 
73
89
  return (
74
- <div id={ id } className="newspack-section-header__container" ref={ ref }>
90
+ <div
91
+ id={ id }
92
+ className={ classnames(
93
+ 'newspack-section-header__container',
94
+ backNav && 'newspack-section-header--has-back-nav',
95
+ primaryAction && 'newspack-section-header--has-primary-action',
96
+ className
97
+ ) }
98
+ ref={ ref }
99
+ >
75
100
  <Grid columns={ 1 } gutter={ 8 } className={ classes }>
76
- { typeof title === 'string' && <HeadingTag>{ title }</HeadingTag> }
101
+ { icon && (
102
+ <div className="newspack-section-header__icon">
103
+ <Icon icon={ icon } size={ 48 } />
104
+ </div>
105
+ ) }
106
+ { backNav && (
107
+ <div className="newspack-section-header__back-nav">
108
+ <Tooltip text={ __( 'Go back', 'newspack-plugin' ) }>
109
+ <Button href={ backNav } icon={ chevronLeft } variant="tertiary" />
110
+ </Tooltip>
111
+ </div>
112
+ ) }
113
+ { typeof title === 'string' && (
114
+ <div className="newspack-section-header__title-container">
115
+ <HeadingTag>{ title }</HeadingTag>
116
+ { badges?.length
117
+ ? badges.map( ( badge, i ) => <Badge key={ i } text={ badge.label } level={ badge.level || 'default' } /> )
118
+ : null }
119
+ { secondaryAction && (
120
+ <div className="newspack-section-header__secondary-action">
121
+ <Button variant="link" href={ secondaryAction.href } onClick={ secondaryAction.action }>
122
+ { secondaryAction.label }
123
+ </Button>
124
+ </div>
125
+ ) }
126
+ </div>
127
+ ) }
77
128
  { typeof title === 'function' && <HeadingTag>{ title() }</HeadingTag> }
78
129
  { description && typeof description === 'string' && <p>{ description }</p> }
79
130
  { typeof description === 'function' && <p>{ description() }</p> }
80
131
  { description && typeof description !== 'string' && typeof description !== 'function' && <p>{ description }</p> }
132
+ { children && <div className="newspack-section-header__children">{ children }</div> }
81
133
  </Grid>
134
+ { primaryAction && (
135
+ <div className="newspack-section-header__primary-action">
136
+ <Button href={ primaryAction.href } variant="primary" onClick={ primaryAction.action }>
137
+ { primaryAction.label }
138
+ </Button>
139
+ </div>
140
+ ) }
82
141
  </div>
83
142
  );
84
143
  };
@@ -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
  }
package/src/style.scss CHANGED
@@ -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
@@ -23,11 +23,12 @@ class Waiting extends Component {
23
23
  * Render
24
24
  */
25
25
  render() {
26
- const { className, isRight, isLeft, isCenter, ...otherProps } = this.props;
26
+ const { className, isRight, isLeft, isCenter, noMargin, ...otherProps } = this.props;
27
27
  const classes = classnames( 'newspack-waiting', className, {
28
28
  'is-right': isRight,
29
29
  'is-left': isLeft,
30
30
  'is-center': isCenter,
31
+ 'no-margin': noMargin,
31
32
  } );
32
33
  return <Spinner className={ classes } { ...otherProps } />;
33
34
  }
@@ -24,4 +24,8 @@
24
24
  &.is-center {
25
25
  margin: auto;
26
26
  }
27
+
28
+ &.no-margin {
29
+ margin: 0;
30
+ }
27
31
  }