newspack-components 2.1.0 → 2.2.1
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.
- package/dist/cjs/accordion/index.js +46 -0
- package/dist/cjs/accordion/style.scss +27 -0
- package/dist/cjs/action-card/index.js +48 -25
- package/dist/cjs/action-card/style.scss +100 -23
- package/dist/cjs/autocomplete-tokenfield/index.js +13 -41
- package/dist/cjs/autocomplete-tokenfield/style.scss +2 -2
- package/dist/cjs/autocomplete-with-suggestions/index.js +30 -51
- package/dist/cjs/autocomplete-with-suggestions/style.scss +16 -15
- package/dist/cjs/button/index.js +5 -13
- package/dist/cjs/button-card/index.js +1 -10
- package/dist/cjs/button-card/style.scss +13 -13
- package/dist/cjs/card/index.js +1 -8
- package/dist/cjs/card/style.scss +25 -8
- package/dist/cjs/category-autocomplete/index.js +18 -38
- package/dist/cjs/category-autocomplete/style.scss +0 -2
- package/dist/cjs/color-picker/index.js +1 -15
- package/dist/cjs/color-picker/style.scss +0 -3
- package/dist/cjs/consts.js +5 -3
- package/dist/cjs/custom-select-control/index.js +1 -9
- package/dist/cjs/custom-select-control/style.scss +6 -7
- package/dist/cjs/date-range-picker/index.js +1 -10
- package/dist/cjs/date-range-picker/style.scss +12 -12
- package/dist/cjs/footer/index.js +5 -17
- package/dist/cjs/footer/style.scss +5 -5
- package/dist/cjs/form-token-field/index.js +1 -9
- package/dist/cjs/form-token-field/style.scss +2 -3
- package/dist/cjs/global-notices/index.js +1 -8
- package/dist/cjs/grid/index.js +1 -8
- package/dist/cjs/grid/style.scss +5 -5
- package/dist/cjs/handoff/index.js +8 -17
- package/dist/cjs/handoff-message/index.js +50 -0
- package/dist/cjs/hooks/index.js +1 -7
- package/dist/cjs/hooks/useObjectState.js +7 -13
- package/dist/cjs/hooks/useObjectState.test.js +0 -14
- package/dist/cjs/hooks/useOnClickOutside.js +3 -6
- package/dist/cjs/hooks/usePrompt.js +1 -13
- package/dist/cjs/image-upload/index.js +21 -19
- package/dist/cjs/image-upload/index.test.js +0 -5
- package/dist/cjs/image-upload/style.scss +5 -9
- package/dist/cjs/index.js +28 -44
- package/dist/cjs/info-button/index.js +3 -11
- package/dist/cjs/info-button/style.scss +1 -3
- package/dist/cjs/modal/index.js +1 -9
- package/dist/cjs/modal/style.scss +8 -8
- package/dist/cjs/newspack-icon/index.js +1 -9
- package/dist/cjs/newspack-icon/style.scss +4 -4
- package/dist/cjs/newspack-logo/index.js +1 -9
- package/dist/cjs/newspack-logo/style.scss +3 -3
- package/dist/cjs/notice/index.js +8 -15
- package/dist/cjs/notice/style.scss +28 -15
- package/dist/cjs/patrons-logo/index.js +3 -11
- package/dist/cjs/plugin-installer/index.js +36 -36
- package/dist/cjs/plugin-installer/style.scss +5 -5
- package/dist/cjs/plugin-settings/SettingsSection.js +9 -28
- package/dist/cjs/plugin-settings/index.js +39 -22
- package/dist/cjs/plugin-toggle/index.js +40 -33
- package/dist/cjs/plugin-toggle/style.scss +2 -2
- package/dist/cjs/popover/index.js +1 -11
- package/dist/cjs/popover/style.scss +19 -16
- package/dist/cjs/position-control/index.js +113 -0
- package/dist/cjs/position-control/style.scss +66 -0
- package/dist/cjs/progress-bar/index.js +2 -9
- package/dist/cjs/progress-bar/index.test.js +2 -7
- package/dist/cjs/progress-bar/style.scss +4 -4
- package/dist/cjs/proxied-imports/router.js +0 -3
- package/dist/cjs/radio-control/index.js +1 -11
- package/dist/cjs/radio-control/style.scss +9 -9
- package/dist/cjs/section-header/index.js +44 -29
- package/dist/cjs/section-header/style.scss +2 -2
- package/dist/cjs/select-control/ButtonGroupControl.js +4 -13
- package/dist/cjs/select-control/GroupedSelectControl.js +9 -15
- package/dist/cjs/select-control/index.js +5 -12
- package/dist/cjs/select-control/style.scss +2 -2
- package/dist/cjs/settings/MinMaxSetting.js +3 -7
- package/dist/cjs/settings/SettingsCard.js +3 -7
- package/dist/cjs/settings/SettingsSection.js +1 -4
- package/dist/cjs/settings/index.js +0 -6
- package/dist/cjs/settings/style.scss +1 -1
- package/dist/cjs/steps-list/index.js +52 -0
- package/dist/cjs/steps-list/style.scss +11 -0
- package/dist/cjs/steps-list-item/index.js +56 -0
- package/dist/cjs/steps-list-item/style.scss +47 -0
- package/dist/cjs/style-card/index.js +6 -13
- package/dist/cjs/style-card/style.scss +9 -12
- package/dist/cjs/style.scss +5 -6
- package/dist/cjs/tabbed-navigation/index.js +19 -16
- package/dist/cjs/tabbed-navigation/style.scss +3 -4
- package/dist/cjs/text-control/index.js +6 -16
- package/dist/cjs/utils/index.js +10 -5
- package/dist/cjs/waiting/index.js +1 -9
- package/dist/cjs/web-preview/index.js +13 -28
- package/dist/cjs/web-preview/style.scss +14 -14
- package/dist/cjs/with-wizard/index.js +51 -31
- package/dist/cjs/with-wizard/style.scss +35 -37
- package/dist/cjs/with-wizard-screen/index.js +11 -17
- package/dist/cjs/with-wizard-screen/style.scss +14 -17
- package/dist/cjs/wizard/components/WizardError.js +3 -15
- package/dist/cjs/wizard/index.js +10 -24
- package/dist/cjs/wizard/store/index.js +42 -55
- package/dist/cjs/wizard/store/utils.js +1 -6
- package/dist/esm/accordion/index.js +38 -0
- package/dist/esm/accordion/style.scss +27 -0
- package/dist/esm/action-card/index.js +50 -21
- package/dist/esm/action-card/style.scss +100 -23
- package/dist/esm/autocomplete-tokenfield/index.js +14 -37
- package/dist/esm/autocomplete-tokenfield/style.scss +2 -2
- package/dist/esm/autocomplete-with-suggestions/index.js +28 -41
- package/dist/esm/autocomplete-with-suggestions/style.scss +16 -15
- package/dist/esm/button/index.js +5 -7
- package/dist/esm/button-card/index.js +2 -5
- package/dist/esm/button-card/style.scss +13 -13
- package/dist/esm/card/index.js +2 -5
- package/dist/esm/card/style.scss +25 -8
- package/dist/esm/category-autocomplete/index.js +17 -30
- package/dist/esm/category-autocomplete/style.scss +0 -2
- package/dist/esm/color-picker/index.js +2 -4
- package/dist/esm/color-picker/style.scss +0 -3
- package/dist/esm/consts.js +3 -2
- package/dist/esm/custom-select-control/index.js +2 -5
- package/dist/esm/custom-select-control/style.scss +6 -7
- package/dist/esm/date-range-picker/index.js +1 -3
- package/dist/esm/date-range-picker/style.scss +12 -12
- package/dist/esm/footer/index.js +3 -11
- package/dist/esm/footer/style.scss +5 -5
- package/dist/esm/form-token-field/index.js +2 -5
- package/dist/esm/form-token-field/style.scss +2 -3
- package/dist/esm/global-notices/index.js +1 -6
- package/dist/esm/grid/index.js +2 -5
- package/dist/esm/grid/style.scss +5 -5
- package/dist/esm/handoff/index.js +3 -14
- package/dist/esm/handoff-message/index.js +45 -0
- package/dist/esm/hooks/index.js +0 -2
- package/dist/esm/hooks/useObjectState.js +3 -8
- package/dist/esm/hooks/useObjectState.test.js +0 -3
- package/dist/esm/hooks/useOnClickOutside.js +2 -5
- package/dist/esm/hooks/usePrompt.js +1 -8
- package/dist/esm/image-upload/index.js +17 -16
- package/dist/esm/image-upload/style.scss +5 -9
- package/dist/esm/index.js +4 -0
- package/dist/esm/info-button/index.js +4 -6
- package/dist/esm/info-button/style.scss +1 -3
- package/dist/esm/modal/index.js +2 -5
- package/dist/esm/modal/style.scss +8 -8
- package/dist/esm/newspack-icon/index.js +2 -5
- package/dist/esm/newspack-icon/style.scss +4 -4
- package/dist/esm/newspack-logo/index.js +2 -5
- package/dist/esm/newspack-logo/style.scss +3 -3
- package/dist/esm/notice/index.js +4 -8
- package/dist/esm/notice/style.scss +28 -15
- package/dist/esm/patrons-logo/index.js +3 -5
- package/dist/esm/plugin-installer/index.js +35 -39
- package/dist/esm/plugin-installer/style.scss +5 -5
- package/dist/esm/plugin-settings/SettingsSection.js +8 -21
- package/dist/esm/plugin-settings/index.js +38 -24
- package/dist/esm/plugin-toggle/index.js +39 -36
- package/dist/esm/plugin-toggle/style.scss +2 -2
- package/dist/esm/popover/index.js +3 -6
- package/dist/esm/popover/style.scss +19 -16
- package/dist/esm/position-control/index.js +109 -0
- package/dist/esm/position-control/style.scss +66 -0
- package/dist/esm/progress-bar/index.js +2 -7
- package/dist/esm/progress-bar/index.test.js +2 -1
- package/dist/esm/progress-bar/style.scss +4 -4
- package/dist/esm/proxied-imports/router.js +1 -0
- package/dist/esm/radio-control/index.js +3 -6
- package/dist/esm/radio-control/style.scss +9 -9
- package/dist/esm/section-header/index.js +44 -25
- package/dist/esm/section-header/style.scss +2 -2
- package/dist/esm/select-control/ButtonGroupControl.js +5 -7
- package/dist/esm/select-control/GroupedSelectControl.js +5 -6
- package/dist/esm/select-control/index.js +6 -6
- package/dist/esm/select-control/style.scss +2 -2
- package/dist/esm/settings/MinMaxSetting.js +1 -3
- package/dist/esm/settings/SettingsCard.js +3 -4
- package/dist/esm/settings/SettingsSection.js +0 -2
- package/dist/esm/settings/style.scss +1 -1
- package/dist/esm/steps-list/index.js +43 -0
- package/dist/esm/steps-list/style.scss +11 -0
- package/dist/esm/steps-list-item/index.js +48 -0
- package/dist/esm/steps-list-item/style.scss +47 -0
- package/dist/esm/style-card/index.js +2 -5
- package/dist/esm/style-card/style.scss +9 -12
- package/dist/esm/style.scss +5 -6
- package/dist/esm/tabbed-navigation/index.js +20 -10
- package/dist/esm/tabbed-navigation/style.scss +3 -4
- package/dist/esm/text-control/index.js +2 -9
- package/dist/esm/utils/index.js +9 -3
- package/dist/esm/waiting/index.js +2 -5
- package/dist/esm/web-preview/index.js +9 -24
- package/dist/esm/web-preview/style.scss +14 -14
- package/dist/esm/with-wizard/index.js +49 -34
- package/dist/esm/with-wizard/style.scss +35 -37
- package/dist/esm/with-wizard-screen/index.js +9 -11
- package/dist/esm/with-wizard-screen/style.scss +14 -17
- package/dist/esm/wizard/components/WizardError.js +1 -10
- package/dist/esm/wizard/index.js +10 -12
- package/dist/esm/wizard/store/index.js +40 -46
- package/dist/esm/wizard/store/utils.js +1 -1
- package/package.json +4 -4
- package/shared/js/button-props.js +3 -1
- package/shared/scss/_mixins.scss +12 -0
- package/src/accordion/index.js +32 -0
- package/src/accordion/style.scss +27 -0
- package/src/action-card/index.js +43 -8
- package/src/action-card/style.scss +100 -23
- package/src/autocomplete-tokenfield/index.js +1 -1
- package/src/autocomplete-tokenfield/style.scss +2 -2
- package/src/autocomplete-with-suggestions/style.scss +16 -15
- package/src/button-card/style.scss +13 -13
- package/src/card/style.scss +25 -8
- package/src/category-autocomplete/index.js +3 -1
- package/src/category-autocomplete/style.scss +0 -2
- package/src/color-picker/style.scss +0 -3
- package/src/consts.js +2 -1
- package/src/custom-select-control/style.scss +6 -7
- package/src/date-range-picker/style.scss +12 -12
- package/src/footer/index.js +2 -2
- package/src/footer/style.scss +5 -5
- package/src/form-token-field/index.js +2 -7
- package/src/form-token-field/style.scss +2 -3
- package/src/grid/style.scss +5 -5
- package/src/handoff/index.js +3 -8
- package/src/handoff-message/index.js +39 -0
- package/src/hooks/useObjectState.js +2 -1
- package/src/image-upload/index.js +9 -3
- package/src/image-upload/style.scss +5 -9
- package/src/index.js +4 -0
- package/src/info-button/style.scss +1 -3
- package/src/modal/style.scss +8 -8
- package/src/newspack-icon/style.scss +4 -4
- package/src/newspack-logo/style.scss +3 -3
- package/src/notice/index.js +2 -0
- package/src/notice/style.scss +28 -15
- package/src/plugin-installer/index.js +15 -2
- package/src/plugin-installer/style.scss +5 -5
- package/src/plugin-settings/SettingsSection.js +7 -13
- package/src/plugin-settings/index.js +7 -2
- package/src/plugin-toggle/index.js +2 -3
- package/src/plugin-toggle/style.scss +2 -2
- package/src/popover/style.scss +19 -16
- package/src/position-control/index.js +122 -0
- package/src/position-control/style.scss +66 -0
- package/src/progress-bar/style.scss +4 -4
- package/src/radio-control/style.scss +9 -9
- package/src/section-header/index.js +32 -15
- package/src/section-header/style.scss +2 -2
- package/src/select-control/ButtonGroupControl.js +3 -0
- package/src/select-control/GroupedSelectControl.js +2 -1
- package/src/select-control/index.js +6 -2
- package/src/select-control/style.scss +2 -2
- package/src/settings/style.scss +1 -1
- package/src/steps-list/index.js +39 -0
- package/src/steps-list/style.scss +11 -0
- package/src/steps-list-item/index.js +40 -0
- package/src/steps-list-item/style.scss +47 -0
- package/src/style-card/index.js +2 -11
- package/src/style-card/style.scss +9 -12
- package/src/style.scss +5 -6
- package/src/tabbed-navigation/index.js +12 -4
- package/src/tabbed-navigation/style.scss +3 -4
- package/src/utils/index.js +9 -0
- package/src/web-preview/index.js +1 -1
- package/src/web-preview/style.scss +14 -14
- package/src/with-wizard/style.scss +35 -37
- package/src/with-wizard-screen/index.js +4 -1
- package/src/with-wizard-screen/style.scss +14 -17
- package/src/wizard/index.js +15 -3
- package/src/wizard/store/index.js +8 -2
|
@@ -1,36 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _apiFetch = _interopRequireDefault(require("@wordpress/api-fetch"));
|
|
11
|
-
|
|
12
9
|
var _components = require("@wordpress/components");
|
|
13
|
-
|
|
14
10
|
var _htmlEntities = require("@wordpress/html-entities");
|
|
15
|
-
|
|
16
11
|
var _element = require("@wordpress/element");
|
|
17
|
-
|
|
18
12
|
var _i18n = require("@wordpress/i18n");
|
|
19
|
-
|
|
20
13
|
var _url = require("@wordpress/url");
|
|
21
|
-
|
|
22
14
|
var _ = require("../");
|
|
23
|
-
|
|
24
15
|
require("./style.scss");
|
|
25
|
-
|
|
26
16
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
27
|
-
|
|
28
17
|
/**
|
|
29
18
|
* WordPress dependencies
|
|
30
19
|
*/
|
|
31
20
|
const __ = _i18n.__,
|
|
32
|
-
|
|
33
|
-
|
|
21
|
+
_x = _i18n._x;
|
|
22
|
+
/**
|
|
23
|
+
* External dependencies.
|
|
24
|
+
*/
|
|
34
25
|
const AutocompleteWithSuggestions = _ref => {
|
|
35
26
|
let {
|
|
36
27
|
fetchSavedPosts = false,
|
|
@@ -63,7 +54,6 @@ const AutocompleteWithSuggestions = _ref => {
|
|
|
63
54
|
selectedPost = 0,
|
|
64
55
|
// Legacy prop when single-select was the only option.
|
|
65
56
|
suggestionsToFetch = 10 // Number of suggestions to fetch per query.
|
|
66
|
-
|
|
67
57
|
} = _ref;
|
|
68
58
|
const [isLoading, setIsLoading] = (0, _element.useState)(true);
|
|
69
59
|
const [isLoadingMore, setIsLoadingMore] = (0, _element.useState)(false);
|
|
@@ -71,20 +61,17 @@ const AutocompleteWithSuggestions = _ref => {
|
|
|
71
61
|
const [maxSuggestions, setMaxSuggestions] = (0, _element.useState)(0);
|
|
72
62
|
const [postTypeToSearch, setPostTypeToSearch] = (0, _element.useState)(postTypes[0].slug);
|
|
73
63
|
const classNames = ['newspack-autocomplete-with-suggestions'];
|
|
74
|
-
|
|
75
64
|
if (hideHelp) {
|
|
76
65
|
classNames.push('hide-help');
|
|
77
66
|
}
|
|
67
|
+
|
|
78
68
|
/**
|
|
79
69
|
* Fetch recent posts to show as suggestions.
|
|
80
70
|
*/
|
|
81
|
-
|
|
82
|
-
|
|
83
71
|
(0, _element.useEffect)(() => {
|
|
84
72
|
if (onPostTypeChange) {
|
|
85
73
|
onPostTypeChange(postTypeToSearch);
|
|
86
74
|
}
|
|
87
|
-
|
|
88
75
|
setIsLoading(true);
|
|
89
76
|
handleFetchSuggestions(null, 0, postTypeToSearch).then(_suggestions => {
|
|
90
77
|
if (0 < _suggestions.length) {
|
|
@@ -92,10 +79,10 @@ const AutocompleteWithSuggestions = _ref => {
|
|
|
92
79
|
}
|
|
93
80
|
}).finally(() => setIsLoading(false));
|
|
94
81
|
}, [postTypeToSearch]);
|
|
82
|
+
|
|
95
83
|
/**
|
|
96
84
|
* Fetch more suggestions.
|
|
97
85
|
*/
|
|
98
|
-
|
|
99
86
|
(0, _element.useEffect)(() => {
|
|
100
87
|
if (isLoadingMore) {
|
|
101
88
|
handleFetchSuggestions(null, suggestions.length, postTypeToSearch).then(_suggestions => {
|
|
@@ -105,17 +92,16 @@ const AutocompleteWithSuggestions = _ref => {
|
|
|
105
92
|
}).finally(() => setIsLoadingMore(false));
|
|
106
93
|
}
|
|
107
94
|
}, [isLoadingMore]);
|
|
95
|
+
|
|
108
96
|
/**
|
|
109
97
|
* If passed a `fetchSavedPosts` prop, use that, otherwise, build it based on the selected post type.
|
|
110
98
|
*/
|
|
111
|
-
|
|
112
99
|
const handleFetchSaved = fetchSavedPosts ? fetchSavedPosts : async function () {
|
|
113
100
|
let postIds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
114
101
|
let searchSlug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
115
102
|
const postTypeSlug = searchSlug || postTypeToSearch;
|
|
116
103
|
const endpoint = 'post' === postTypeSlug || 'page' === postTypeSlug ? postTypeSlug + 's' // Default post type endpoints are plural.
|
|
117
104
|
: postTypeSlug; // Custom post type endpoints are singular.
|
|
118
|
-
|
|
119
105
|
const posts = await (0, _apiFetch.default)({
|
|
120
106
|
path: (0, _url.addQueryArgs)('/wp/v2/' + endpoint, {
|
|
121
107
|
per_page: 100,
|
|
@@ -128,10 +114,10 @@ const AutocompleteWithSuggestions = _ref => {
|
|
|
128
114
|
label: (0, _htmlEntities.decodeEntities)(post.title) || __('(no title)', 'newspack')
|
|
129
115
|
}));
|
|
130
116
|
};
|
|
117
|
+
|
|
131
118
|
/**
|
|
132
119
|
* If passed a `fetchSuggestions` prop, use that, otherwise, build it based on the selected post type.
|
|
133
120
|
*/
|
|
134
|
-
|
|
135
121
|
const handleFetchSuggestions = fetchSuggestions ? fetchSuggestions : async function () {
|
|
136
122
|
let search = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
137
123
|
let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
@@ -139,7 +125,6 @@ const AutocompleteWithSuggestions = _ref => {
|
|
|
139
125
|
const postTypeSlug = searchSlug || postTypeToSearch;
|
|
140
126
|
const endpoint = 'post' === postTypeSlug || 'page' === postTypeSlug ? postTypeSlug + 's' // Default post type endpoints are plural.
|
|
141
127
|
: postTypeSlug; // Custom post type endpoints are singular.
|
|
142
|
-
|
|
143
128
|
const response = await (0, _apiFetch.default)({
|
|
144
129
|
parse: false,
|
|
145
130
|
path: (0, _url.addQueryArgs)('/wp/v2/' + endpoint, {
|
|
@@ -151,8 +136,9 @@ const AutocompleteWithSuggestions = _ref => {
|
|
|
151
136
|
});
|
|
152
137
|
const total = parseInt(response.headers.get('x-wp-total') || 0);
|
|
153
138
|
const posts = await response.json();
|
|
154
|
-
setMaxSuggestions(total);
|
|
139
|
+
setMaxSuggestions(total);
|
|
155
140
|
|
|
141
|
+
// Format suggestions for FormTokenField display.
|
|
156
142
|
return posts.reduce((acc, post) => {
|
|
157
143
|
acc.push({
|
|
158
144
|
value: parseInt(post.id),
|
|
@@ -161,22 +147,22 @@ const AutocompleteWithSuggestions = _ref => {
|
|
|
161
147
|
return acc;
|
|
162
148
|
}, []);
|
|
163
149
|
};
|
|
150
|
+
|
|
164
151
|
/**
|
|
165
152
|
* Intercept onChange callback so we can decide whether to allow multiple selections.
|
|
166
153
|
*/
|
|
167
|
-
|
|
168
154
|
const handleOnChange = _selections => {
|
|
169
155
|
// If only allowing one selection, just return the one selected item.
|
|
170
156
|
if (!multiSelect) {
|
|
171
157
|
return onChange(_selections);
|
|
172
|
-
}
|
|
173
|
-
|
|
158
|
+
}
|
|
174
159
|
|
|
175
|
-
|
|
160
|
+
// Handle legacy `selectedPost` prop.
|
|
161
|
+
const selections = selectedPost ? [...selectedItems, selectedPost] : [...selectedItems];
|
|
176
162
|
|
|
163
|
+
// Loop through new selections to determine whether to add or remove them.
|
|
177
164
|
_selections.forEach(_selection => {
|
|
178
165
|
const existingSelection = selections.findIndex(selection => parseInt(selection.value) === parseInt(_selection.value));
|
|
179
|
-
|
|
180
166
|
if (-1 < existingSelection) {
|
|
181
167
|
// If the selection is already selected, remove it.
|
|
182
168
|
selections.splice(existingSelection, 1);
|
|
@@ -184,23 +170,25 @@ const AutocompleteWithSuggestions = _ref => {
|
|
|
184
170
|
// Otherwise, add it.
|
|
185
171
|
selections.push(_selection);
|
|
186
172
|
}
|
|
187
|
-
});
|
|
188
|
-
|
|
173
|
+
});
|
|
189
174
|
|
|
190
|
-
|
|
175
|
+
// Include currently selected post type in selection results.
|
|
176
|
+
onChange(selections.map(selection => ({
|
|
177
|
+
...selection,
|
|
191
178
|
postType: postTypeToSearch
|
|
192
179
|
})));
|
|
193
180
|
};
|
|
181
|
+
|
|
194
182
|
/**
|
|
195
183
|
* Render selected item(s) for this component. Clicking on a selection deselects it.
|
|
196
184
|
*/
|
|
197
|
-
|
|
198
|
-
|
|
199
185
|
const renderSelections = () => {
|
|
200
186
|
// Handle legacy `selectedPost` prop.
|
|
201
187
|
const selections = selectedPost ? [...selectedItems, selectedPost] : selectedItems;
|
|
202
|
-
const selectedMessage = multiSelect ? (0, _i18n.sprintf)(
|
|
203
|
-
|
|
188
|
+
const selectedMessage = multiSelect ? (0, _i18n.sprintf)(
|
|
189
|
+
// Translators: %1: the length of selections. %2: the selection leabel.
|
|
190
|
+
__('%1$s %2$s selected', 'newspack'), selections.length, selections.length > 1 ? postTypeLabelPlural : postTypeLabel) :
|
|
191
|
+
// Translators: %s: The label for the selection.
|
|
204
192
|
(0, _i18n.sprintf)(__('Selected %s', 'newspack'), postTypeLabel);
|
|
205
193
|
return (0, _jsxRuntime.jsxs)("div", {
|
|
206
194
|
className: "newspack-autocomplete-with-suggestions__selected-items",
|
|
@@ -220,14 +208,14 @@ const AutocompleteWithSuggestions = _ref => {
|
|
|
220
208
|
}, selection.value))]
|
|
221
209
|
});
|
|
222
210
|
};
|
|
211
|
+
|
|
223
212
|
/**
|
|
224
213
|
* Render post type select dropdown.
|
|
225
214
|
*/
|
|
226
|
-
|
|
227
|
-
|
|
228
215
|
const renderPostTypeSelect = () => {
|
|
229
216
|
return (0, _jsxRuntime.jsx)(_components.SelectControl, {
|
|
230
|
-
label: (0, _i18n.sprintf)(
|
|
217
|
+
label: (0, _i18n.sprintf)(
|
|
218
|
+
// Translators: %s: The name of the type.
|
|
231
219
|
__('%s type', 'newspack'), postTypeLabel.charAt(0).toUpperCase() + postTypeLabel.slice(1)),
|
|
232
220
|
value: postTypeToSearch,
|
|
233
221
|
options: postTypes.map(postTypeOption => ({
|
|
@@ -237,13 +225,12 @@ const AutocompleteWithSuggestions = _ref => {
|
|
|
237
225
|
onChange: _postType => setPostTypeToSearch(_postType)
|
|
238
226
|
});
|
|
239
227
|
};
|
|
228
|
+
|
|
240
229
|
/**
|
|
241
230
|
* Render a single suggestion object that can be clicked to select it immediately.
|
|
242
231
|
*
|
|
243
232
|
* @param {Object} suggestion Suggestion object with value and label keys.
|
|
244
233
|
*/
|
|
245
|
-
|
|
246
|
-
|
|
247
234
|
const renderSuggestion = suggestion => {
|
|
248
235
|
if (multiSelect) {
|
|
249
236
|
const selections = selectedPost ? [...selectedItems, selectedPost] : [...selectedItems];
|
|
@@ -254,18 +241,16 @@ const AutocompleteWithSuggestions = _ref => {
|
|
|
254
241
|
label: suggestion.label
|
|
255
242
|
}, suggestion.value);
|
|
256
243
|
}
|
|
257
|
-
|
|
258
244
|
return (0, _jsxRuntime.jsx)(_components.Button, {
|
|
259
245
|
isLink: true,
|
|
260
246
|
onClick: () => handleOnChange([suggestion]),
|
|
261
247
|
children: suggestion.label
|
|
262
248
|
}, suggestion.value);
|
|
263
249
|
};
|
|
250
|
+
|
|
264
251
|
/**
|
|
265
252
|
* Render a list of suggestions that can be clicked to select instead of searching by title.
|
|
266
253
|
*/
|
|
267
|
-
|
|
268
|
-
|
|
269
254
|
const renderSuggestions = () => {
|
|
270
255
|
if (isLoading) {
|
|
271
256
|
return (0, _jsxRuntime.jsx)("div", {
|
|
@@ -273,18 +258,14 @@ const AutocompleteWithSuggestions = _ref => {
|
|
|
273
258
|
children: (0, _jsxRuntime.jsx)(_components.Spinner, {})
|
|
274
259
|
});
|
|
275
260
|
}
|
|
276
|
-
|
|
277
261
|
if (0 === suggestions.length) {
|
|
278
262
|
return null;
|
|
279
263
|
}
|
|
280
|
-
|
|
281
264
|
const className = multiSelect ? 'newspack-autocomplete-with-suggestions__search-suggestions-multiselect' : 'newspack-autocomplete-with-suggestions__search-suggestions';
|
|
282
265
|
return (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
283
266
|
children: [!hideHelp && (0, _jsxRuntime.jsx)("p", {
|
|
284
267
|
className: "newspack-autocomplete-with-suggestions__label",
|
|
285
|
-
children:
|
|
286
|
-
/* Translators: %s: the name of a post type. */
|
|
287
|
-
(0, _i18n.sprintf)(__('Or, select a recent %s:', 'newspack'), postTypeLabel)
|
|
268
|
+
children: /* Translators: %s: the name of a post type. */(0, _i18n.sprintf)(__('Or, select a recent %s:', 'newspack'), postTypeLabel)
|
|
288
269
|
}), (0, _jsxRuntime.jsxs)("div", {
|
|
289
270
|
className: className,
|
|
290
271
|
children: [suggestions.map(renderSuggestion), suggestions.length < (maxItemsToSuggest || maxSuggestions) && (0, _jsxRuntime.jsx)(_components.Button, {
|
|
@@ -296,7 +277,6 @@ const AutocompleteWithSuggestions = _ref => {
|
|
|
296
277
|
})]
|
|
297
278
|
});
|
|
298
279
|
};
|
|
299
|
-
|
|
300
280
|
return (0, _jsxRuntime.jsxs)("div", {
|
|
301
281
|
className: classNames.join(' '),
|
|
302
282
|
children: [0 < selectedItems.length && renderSelections(), 1 < postTypes.length && renderPostTypeSelect(), (0, _jsxRuntime.jsx)(_.AutocompleteTokenField, {
|
|
@@ -310,6 +290,5 @@ const AutocompleteWithSuggestions = _ref => {
|
|
|
310
290
|
}), renderSuggestions()]
|
|
311
291
|
});
|
|
312
292
|
};
|
|
313
|
-
|
|
314
293
|
var _default = AutocompleteWithSuggestions;
|
|
315
294
|
exports.default = _default;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Styles for AutocompleteWithSuggestions component.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
@
|
|
5
|
+
@use '~@wordpress/base-styles/colors' as wp-colors;
|
|
6
6
|
|
|
7
7
|
.newspack-autocomplete-with-suggestions {
|
|
8
8
|
width: 100%;
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
.components-input-control__backdrop {
|
|
30
|
-
border-color:
|
|
30
|
+
border-color: wp-colors.$gray-700 !important;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
.newspack-autocomplete-with-suggestions__label,
|
|
34
34
|
.components-form-token-field__label,
|
|
35
35
|
.components-input-control__label,
|
|
36
36
|
.components-checkbox-control__label {
|
|
37
|
-
color:
|
|
37
|
+
color: wp-colors.$gray-900 !important;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
&__suggestions-spinner {
|
|
41
|
-
background:
|
|
42
|
-
border: 1px solid
|
|
41
|
+
background: wp-colors.$gray-100;
|
|
42
|
+
border: 1px solid wp-colors.$gray-700;
|
|
43
43
|
border-radius: 2px;
|
|
44
44
|
cursor: progress;
|
|
45
45
|
margin: 16px 0;
|
|
@@ -56,15 +56,16 @@
|
|
|
56
56
|
|
|
57
57
|
.newspack-autocomplete-tokenfield__help {
|
|
58
58
|
font-size: inherit;
|
|
59
|
+
margin-bottom: 8px !important;
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
.components-form-token-field {
|
|
62
63
|
&__input-container {
|
|
63
|
-
border-color:
|
|
64
|
+
border-color: wp-colors.$gray-700;
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
&__suggestions-list {
|
|
67
|
-
border-top-color:
|
|
68
|
+
border-top-color: wp-colors.$gray-700;
|
|
68
69
|
margin: 4px -4px -2px;
|
|
69
70
|
}
|
|
70
71
|
|
|
@@ -79,7 +80,7 @@
|
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
&__selected-items {
|
|
82
|
-
border-bottom: 1px solid
|
|
83
|
+
border-bottom: 1px solid wp-colors.$gray-700;
|
|
83
84
|
display: flex;
|
|
84
85
|
flex-wrap: wrap;
|
|
85
86
|
gap: 8px;
|
|
@@ -93,9 +94,9 @@
|
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
&__selected-item-button.components-button.is-tertiary {
|
|
96
|
-
background-color:
|
|
97
|
+
background-color: wp-colors.$gray-300;
|
|
97
98
|
border-radius: 2px;
|
|
98
|
-
color:
|
|
99
|
+
color: wp-colors.$gray-900;
|
|
99
100
|
font-size: 13px;
|
|
100
101
|
height: auto;
|
|
101
102
|
margin: 0;
|
|
@@ -116,7 +117,7 @@
|
|
|
116
117
|
&__search-suggestions,
|
|
117
118
|
&__search-suggestions-multiselect {
|
|
118
119
|
border-radius: 2px;
|
|
119
|
-
border: 1px solid
|
|
120
|
+
border: 1px solid wp-colors.$gray-700;
|
|
120
121
|
max-height: 178px;
|
|
121
122
|
overflow-x: visible;
|
|
122
123
|
overflow-y: auto;
|
|
@@ -128,14 +129,14 @@
|
|
|
128
129
|
margin: auto;
|
|
129
130
|
|
|
130
131
|
&.is-link {
|
|
131
|
-
color:
|
|
132
|
+
color: wp-colors.$gray-900;
|
|
132
133
|
padding: 8px;
|
|
133
134
|
text-decoration: none;
|
|
134
135
|
width: 100%;
|
|
135
136
|
|
|
136
137
|
&:active:not( :disabled ),
|
|
137
138
|
&:hover:not( :disabled ) {
|
|
138
|
-
background:
|
|
139
|
+
background: wp-colors.$gray-900;
|
|
139
140
|
background: var( --wp-admin-theme-color );
|
|
140
141
|
color: white;
|
|
141
142
|
}
|
|
@@ -150,7 +151,7 @@
|
|
|
150
151
|
|
|
151
152
|
&__search-suggestions {
|
|
152
153
|
border-radius: 2px;
|
|
153
|
-
border: 1px solid
|
|
154
|
+
border: 1px solid wp-colors.$gray-700;
|
|
154
155
|
padding: 0;
|
|
155
156
|
|
|
156
157
|
.components-button {
|
|
@@ -158,7 +159,7 @@
|
|
|
158
159
|
|
|
159
160
|
&:focus:not( :disabled ) {
|
|
160
161
|
border-radius: 0;
|
|
161
|
-
box-shadow: inset 0 0 0 1.5px
|
|
162
|
+
box-shadow: inset 0 0 0 1.5px wp-colors.$gray-900;
|
|
162
163
|
box-shadow: inset 0 0 0 var( --wp-admin-border-width-focus ) var( --wp-admin-theme-color );
|
|
163
164
|
}
|
|
164
165
|
|
package/dist/cjs/button/index.js
CHANGED
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _components = require("@wordpress/components");
|
|
11
|
-
|
|
12
9
|
var _element = require("@wordpress/element");
|
|
13
|
-
|
|
14
10
|
var _router = _interopRequireDefault(require("../proxied-imports/router"));
|
|
15
|
-
|
|
16
11
|
require("./style.scss");
|
|
17
|
-
|
|
18
12
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
19
|
-
|
|
20
13
|
/**
|
|
21
14
|
* Button
|
|
22
15
|
*/
|
|
@@ -28,10 +21,10 @@ var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
|
28
21
|
/**
|
|
29
22
|
* Internal dependencies
|
|
30
23
|
*/
|
|
24
|
+
|
|
31
25
|
const {
|
|
32
26
|
useHistory
|
|
33
27
|
} = _router.default;
|
|
34
|
-
|
|
35
28
|
const Button = _ref => {
|
|
36
29
|
let {
|
|
37
30
|
href,
|
|
@@ -39,8 +32,9 @@ const Button = _ref => {
|
|
|
39
32
|
...otherProps
|
|
40
33
|
} = _ref;
|
|
41
34
|
const history = useHistory();
|
|
42
|
-
const [isAwaitingOnClick, setIsAwaitingOnClick] = (0, _element.useState)(false);
|
|
35
|
+
const [isAwaitingOnClick, setIsAwaitingOnClick] = (0, _element.useState)(false);
|
|
43
36
|
|
|
37
|
+
// If both onClick and href are present, await the onClick action an then redirect.
|
|
44
38
|
if (href && onClick) {
|
|
45
39
|
otherProps.onClick = async () => {
|
|
46
40
|
setIsAwaitingOnClick(true);
|
|
@@ -52,14 +46,12 @@ const Button = _ref => {
|
|
|
52
46
|
otherProps.href = href;
|
|
53
47
|
otherProps.onClick = onClick;
|
|
54
48
|
}
|
|
55
|
-
|
|
56
49
|
if (isAwaitingOnClick) {
|
|
57
50
|
otherProps.disabled = true;
|
|
58
51
|
}
|
|
59
|
-
|
|
60
|
-
|
|
52
|
+
return (0, _jsxRuntime.jsx)(_components.Button, {
|
|
53
|
+
...otherProps
|
|
61
54
|
});
|
|
62
55
|
};
|
|
63
|
-
|
|
64
56
|
var _default = Button;
|
|
65
57
|
exports.default = _default;
|
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _element = require("@wordpress/element");
|
|
11
|
-
|
|
12
9
|
var _icons = require("@wordpress/icons");
|
|
13
|
-
|
|
14
10
|
var _ = require("../");
|
|
15
|
-
|
|
16
11
|
require("./style.scss");
|
|
17
|
-
|
|
18
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
19
|
-
|
|
20
13
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
21
|
-
|
|
22
14
|
/**
|
|
23
15
|
* Button Card
|
|
24
16
|
*/
|
|
@@ -34,6 +26,7 @@ var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
|
34
26
|
/**
|
|
35
27
|
* External dependencies
|
|
36
28
|
*/
|
|
29
|
+
|
|
37
30
|
class ButtonCard extends _element.Component {
|
|
38
31
|
/**
|
|
39
32
|
* Render
|
|
@@ -75,8 +68,6 @@ class ButtonCard extends _element.Component {
|
|
|
75
68
|
})]
|
|
76
69
|
});
|
|
77
70
|
}
|
|
78
|
-
|
|
79
71
|
}
|
|
80
|
-
|
|
81
72
|
var _default = ButtonCard;
|
|
82
73
|
exports.default = _default;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Button Card
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
@
|
|
5
|
+
@use '~@wordpress/base-styles/colors' as wp-colors;
|
|
6
6
|
|
|
7
7
|
.newspack-button-card {
|
|
8
8
|
background: white;
|
|
9
9
|
border-radius: 2px;
|
|
10
|
-
border: 1px solid
|
|
10
|
+
border: 1px solid wp-colors.$gray-300;
|
|
11
11
|
box-shadow: inset 0 0 0 var( --wp-admin-border-width-focus ) transparent;
|
|
12
12
|
cursor: pointer;
|
|
13
13
|
display: block;
|
|
@@ -51,11 +51,11 @@
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.newspack-grid h3 {
|
|
54
|
-
color:
|
|
54
|
+
color: wp-colors.$gray-900;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
p {
|
|
58
|
-
color:
|
|
58
|
+
color: wp-colors.$gray-700;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
// Grouped
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
&:active,
|
|
91
91
|
&:hover {
|
|
92
92
|
svg {
|
|
93
|
-
fill:
|
|
93
|
+
fill: currentcolor;
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
|
|
@@ -144,31 +144,31 @@
|
|
|
144
144
|
|
|
145
145
|
&.is-destructive {
|
|
146
146
|
.title {
|
|
147
|
-
color:
|
|
147
|
+
color: wp-colors.$alert-red;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
&.has-chevron,
|
|
151
151
|
&.has-icon {
|
|
152
152
|
svg {
|
|
153
|
-
fill:
|
|
153
|
+
fill: wp-colors.$alert-red;
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
&:focus,
|
|
158
158
|
&.is-pressed {
|
|
159
|
-
border-color:
|
|
160
|
-
box-shadow: inset 0 0 0 1px
|
|
159
|
+
border-color: wp-colors.$alert-red;
|
|
160
|
+
box-shadow: inset 0 0 0 1px wp-colors.$alert-red !important;
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
&.is-pressed:focus-visible {
|
|
164
|
-
box-shadow: inset 0 0 0 1px
|
|
165
|
-
0 0 0 var( --wp-admin-border-width-focus )
|
|
164
|
+
box-shadow: inset 0 0 0 1px wp-colors.$alert-red, 0 0 0 1px white,
|
|
165
|
+
0 0 0 var( --wp-admin-border-width-focus ) wp-colors.$alert-red !important;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
&:active,
|
|
169
169
|
&:hover {
|
|
170
|
-
background-color:
|
|
171
|
-
border-color:
|
|
170
|
+
background-color: wp-colors.$gray-100;
|
|
171
|
+
border-color: wp-colors.$alert-red;
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
}
|
package/dist/cjs/card/index.js
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _element = require("@wordpress/element");
|
|
11
|
-
|
|
12
9
|
require("./style.scss");
|
|
13
|
-
|
|
14
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
11
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
17
|
-
|
|
18
12
|
/**
|
|
19
13
|
* Card
|
|
20
14
|
*/
|
|
@@ -30,6 +24,7 @@ var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
|
30
24
|
/**
|
|
31
25
|
* External dependencies
|
|
32
26
|
*/
|
|
27
|
+
|
|
33
28
|
class Card extends _element.Component {
|
|
34
29
|
/**
|
|
35
30
|
* Render
|
|
@@ -52,8 +47,6 @@ class Card extends _element.Component {
|
|
|
52
47
|
...otherProps
|
|
53
48
|
});
|
|
54
49
|
}
|
|
55
|
-
|
|
56
50
|
}
|
|
57
|
-
|
|
58
51
|
var _default = Card;
|
|
59
52
|
exports.default = _default;
|
package/dist/cjs/card/style.scss
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Card
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
@
|
|
5
|
+
@use '~@wordpress/base-styles/colors' as wp-colors;
|
|
6
6
|
|
|
7
7
|
.newspack-card {
|
|
8
8
|
border-radius: 2px;
|
|
9
|
-
border: 1px solid
|
|
10
|
-
color:
|
|
9
|
+
border: 1px solid wp-colors.$gray-300;
|
|
10
|
+
color: wp-colors.$gray-900;
|
|
11
11
|
margin: 32px 0;
|
|
12
12
|
padding: 16px 48px;
|
|
13
13
|
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
align-items: center;
|
|
31
31
|
display: flex;
|
|
32
32
|
flex-wrap: wrap;
|
|
33
|
+
gap: 8px;
|
|
33
34
|
justify-content: space-between;
|
|
34
35
|
margin-bottom: -16px;
|
|
35
36
|
|
|
@@ -37,6 +38,12 @@
|
|
|
37
38
|
margin-bottom: 0 !important;
|
|
38
39
|
margin-top: 0 !important;
|
|
39
40
|
}
|
|
41
|
+
|
|
42
|
+
.newspack-select-control {
|
|
43
|
+
.components-base-control__field {
|
|
44
|
+
margin-bottom: 0;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
40
47
|
}
|
|
41
48
|
|
|
42
49
|
// Is Narrow
|
|
@@ -101,6 +108,16 @@
|
|
|
101
108
|
padding: 0;
|
|
102
109
|
}
|
|
103
110
|
|
|
111
|
+
// Margin
|
|
112
|
+
|
|
113
|
+
&.mt64 {
|
|
114
|
+
margin-top: 64px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&.mt16 {
|
|
118
|
+
margin-top: 16px;
|
|
119
|
+
}
|
|
120
|
+
|
|
104
121
|
// Typography
|
|
105
122
|
|
|
106
123
|
small {
|
|
@@ -109,15 +126,15 @@
|
|
|
109
126
|
}
|
|
110
127
|
|
|
111
128
|
code {
|
|
112
|
-
background:
|
|
113
|
-
color:
|
|
129
|
+
background: wp-colors.$gray-100;
|
|
130
|
+
color: wp-colors.$gray-900;
|
|
114
131
|
padding: 0 0.5em;
|
|
115
132
|
}
|
|
116
133
|
|
|
117
134
|
// Thematic Break
|
|
118
135
|
|
|
119
136
|
hr {
|
|
120
|
-
background:
|
|
137
|
+
background: wp-colors.$gray-300;
|
|
121
138
|
border: 0;
|
|
122
139
|
height: 1px;
|
|
123
140
|
margin: 48px 0;
|
|
@@ -130,7 +147,7 @@
|
|
|
130
147
|
// Separator
|
|
131
148
|
|
|
132
149
|
.sep {
|
|
133
|
-
background:
|
|
150
|
+
background: wp-colors.$gray-300;
|
|
134
151
|
height: 1px;
|
|
135
152
|
margin-left: 8px;
|
|
136
153
|
margin-right: 8px;
|
|
@@ -146,6 +163,6 @@
|
|
|
146
163
|
// Error
|
|
147
164
|
|
|
148
165
|
.newspack-error {
|
|
149
|
-
color:
|
|
166
|
+
color: wp-colors.$alert-red;
|
|
150
167
|
}
|
|
151
168
|
}
|