newspack-components 3.0.0-alpha.1 → 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.
- package/babel.config.cjs.js +26 -0
- package/babel.config.js +26 -0
- package/dist/cjs/accordion/index.js +50 -0
- package/dist/cjs/accordion/style.scss +31 -0
- package/dist/cjs/action-card/index.js +38 -41
- package/dist/cjs/action-card/style.scss +9 -9
- package/dist/cjs/autocomplete-tokenfield/index.js +19 -18
- package/dist/cjs/autocomplete-tokenfield/style.scss +3 -3
- package/dist/cjs/autocomplete-with-suggestions/index.js +29 -29
- package/dist/cjs/autocomplete-with-suggestions/style.scss +8 -8
- package/dist/cjs/button/style.scss +1 -1
- package/dist/cjs/button-card/index.js +8 -8
- package/dist/cjs/button-card/style.scss +19 -13
- package/dist/cjs/card/index.js +3 -3
- package/dist/cjs/card/style.scss +1 -1
- package/dist/cjs/category-autocomplete/index.js +50 -48
- package/dist/cjs/category-autocomplete/style.scss +2 -2
- package/dist/cjs/color-picker/index.js +7 -7
- package/dist/cjs/color-picker/style.scss +3 -3
- package/dist/cjs/custom-select-control/index.js +3 -3
- package/dist/cjs/custom-select-control/style.scss +11 -10
- package/dist/cjs/date-range-picker/index.js +39 -0
- package/dist/cjs/date-range-picker/style.scss +148 -0
- package/dist/cjs/footer/index.js +19 -17
- package/dist/cjs/footer/style.scss +1 -1
- package/dist/cjs/form-token-field/index.js +5 -5
- package/dist/cjs/form-token-field/style.scss +1 -1
- package/dist/cjs/global-notices/index.js +3 -3
- package/dist/cjs/grid/style.scss +9 -9
- package/dist/cjs/handoff/index.js +72 -69
- package/dist/cjs/handoff-message/index.js +5 -3
- package/dist/cjs/hooks/useObjectState.js +1 -1
- package/dist/cjs/hooks/useObjectState.test.js +9 -9
- package/dist/cjs/image-upload/index.js +113 -108
- package/dist/cjs/image-upload/index.test.js +13 -6
- package/dist/cjs/image-upload/style.scss +5 -5
- package/dist/cjs/index.js +15 -1
- package/dist/cjs/info-button/index.js +5 -5
- package/dist/cjs/modal/index.js +3 -3
- package/dist/cjs/modal/style.scss +5 -5
- package/dist/cjs/newspack-icon/index.js +4 -4
- package/dist/cjs/newspack-icon/style.scss +1 -1
- package/dist/cjs/newspack-logo/index.js +4 -4
- package/dist/cjs/newspack-logo/style.scss +1 -1
- package/dist/cjs/notice/index.js +11 -8
- package/dist/cjs/notice/style.scss +11 -11
- package/dist/cjs/patrons-logo/index.js +58 -62
- package/dist/cjs/plugin-installer/index.js +139 -137
- package/dist/cjs/plugin-installer/style.scss +1 -1
- package/dist/cjs/plugin-settings/SettingsSection.js +11 -9
- package/dist/cjs/plugin-settings/index.js +151 -144
- package/dist/cjs/plugin-settings/style.scss +1 -1
- package/dist/cjs/plugin-toggle/index.js +159 -155
- package/dist/cjs/plugin-toggle/style.scss +1 -1
- package/dist/cjs/popover/index.js +3 -3
- package/dist/cjs/popover/style.scss +7 -7
- package/dist/cjs/position-control/index.js +24 -22
- package/dist/cjs/position-control/style.scss +8 -8
- package/dist/cjs/progress-bar/index.js +8 -8
- package/dist/cjs/progress-bar/index.test.js +12 -11
- package/dist/cjs/progress-bar/style.scss +2 -2
- package/dist/cjs/proxied-imports/router.js +2 -1
- package/dist/cjs/radio-control/index.js +3 -3
- package/dist/cjs/radio-control/style.scss +3 -3
- package/dist/cjs/section-header/index.js +8 -8
- package/dist/cjs/section-header/style.scss +1 -1
- package/dist/cjs/select-control/ButtonGroupControl.js +7 -7
- package/dist/cjs/select-control/GroupedSelectControl.js +15 -14
- package/dist/cjs/select-control/index.js +6 -6
- package/dist/cjs/select-control/style.scss +4 -4
- package/dist/cjs/settings/MinMaxSetting.js +12 -11
- package/dist/cjs/settings/SettingsCard.js +4 -4
- package/dist/cjs/settings/SettingsSection.js +6 -6
- package/dist/cjs/settings/index.js +1 -1
- package/dist/cjs/settings/style.scss +1 -1
- package/dist/cjs/sortable-newsletter-list-control/index.js +25 -24
- package/dist/cjs/steps-list/index.js +4 -4
- package/dist/cjs/steps-list/style.scss +2 -2
- package/dist/cjs/steps-list-item/index.js +5 -5
- package/dist/cjs/steps-list-item/style.scss +5 -5
- package/dist/cjs/style-card/index.js +20 -17
- package/dist/cjs/style-card/style.scss +4 -4
- package/dist/cjs/style.scss +1 -1
- package/dist/cjs/tabbed-navigation/index.js +7 -7
- package/dist/cjs/tabbed-navigation/style.scss +4 -4
- package/dist/cjs/utils/index.js +2 -2
- package/dist/cjs/waiting/index.js +3 -3
- package/dist/cjs/web-preview/index.js +107 -104
- package/dist/cjs/web-preview/style.scss +5 -5
- package/dist/cjs/with-wizard/index.js +250 -239
- package/dist/cjs/with-wizard/style.scss +44 -22
- package/dist/cjs/with-wizard-screen/index.js +24 -23
- package/dist/cjs/with-wizard-screen/style.scss +7 -7
- package/dist/cjs/wizard/components/WizardError.js +10 -9
- package/dist/cjs/wizard/index.js +30 -27
- package/dist/cjs/wizard/store/index.js +1 -1
- package/dist/esm/accordion/index.js +42 -0
- package/dist/esm/accordion/style.scss +31 -0
- package/dist/esm/action-card/index.js +37 -40
- package/dist/esm/action-card/style.scss +9 -9
- package/dist/esm/autocomplete-tokenfield/index.js +18 -17
- package/dist/esm/autocomplete-tokenfield/style.scss +3 -3
- package/dist/esm/autocomplete-with-suggestions/index.js +17 -19
- package/dist/esm/autocomplete-with-suggestions/style.scss +8 -8
- package/dist/esm/button/style.scss +1 -1
- package/dist/esm/button-card/index.js +7 -7
- package/dist/esm/button-card/style.scss +19 -13
- package/dist/esm/card/index.js +2 -2
- package/dist/esm/card/style.scss +1 -1
- package/dist/esm/category-autocomplete/index.js +49 -47
- package/dist/esm/category-autocomplete/style.scss +2 -2
- package/dist/esm/color-picker/index.js +6 -6
- package/dist/esm/color-picker/style.scss +3 -3
- package/dist/esm/custom-select-control/index.js +2 -2
- package/dist/esm/custom-select-control/style.scss +11 -10
- package/dist/esm/date-range-picker/index.js +31 -0
- package/dist/esm/date-range-picker/style.scss +148 -0
- package/dist/esm/footer/index.js +10 -11
- package/dist/esm/footer/style.scss +1 -1
- package/dist/esm/form-token-field/index.js +4 -4
- package/dist/esm/form-token-field/style.scss +1 -1
- package/dist/esm/global-notices/index.js +3 -3
- package/dist/esm/grid/style.scss +9 -9
- package/dist/esm/handoff/index.js +66 -67
- package/dist/esm/handoff-message/index.js +5 -3
- package/dist/esm/hooks/useObjectState.test.js +8 -8
- package/dist/esm/image-upload/index.js +109 -108
- package/dist/esm/image-upload/index.test.js +10 -4
- package/dist/esm/image-upload/style.scss +5 -5
- package/dist/esm/index.js +2 -0
- package/dist/esm/info-button/index.js +4 -4
- package/dist/esm/modal/index.js +2 -2
- package/dist/esm/modal/style.scss +5 -5
- package/dist/esm/newspack-icon/index.js +3 -3
- package/dist/esm/newspack-icon/style.scss +1 -1
- package/dist/esm/newspack-logo/index.js +3 -3
- package/dist/esm/newspack-logo/style.scss +1 -1
- package/dist/esm/notice/index.js +6 -7
- package/dist/esm/notice/style.scss +11 -11
- package/dist/esm/patrons-logo/index.js +57 -62
- package/dist/esm/plugin-installer/index.js +133 -134
- package/dist/esm/plugin-installer/style.scss +1 -1
- package/dist/esm/plugin-settings/SettingsSection.js +8 -9
- package/dist/esm/plugin-settings/index.js +147 -143
- package/dist/esm/plugin-settings/style.scss +1 -1
- package/dist/esm/plugin-toggle/index.js +156 -153
- package/dist/esm/plugin-toggle/style.scss +1 -1
- package/dist/esm/popover/index.js +2 -2
- package/dist/esm/popover/style.scss +7 -7
- package/dist/esm/position-control/index.js +8 -9
- package/dist/esm/position-control/style.scss +8 -8
- package/dist/esm/progress-bar/index.js +8 -8
- package/dist/esm/progress-bar/index.test.js +9 -10
- package/dist/esm/progress-bar/style.scss +2 -2
- package/dist/esm/radio-control/index.js +2 -2
- package/dist/esm/radio-control/style.scss +3 -3
- package/dist/esm/section-header/index.js +7 -7
- package/dist/esm/section-header/style.scss +1 -1
- package/dist/esm/select-control/ButtonGroupControl.js +6 -6
- package/dist/esm/select-control/GroupedSelectControl.js +10 -11
- package/dist/esm/select-control/index.js +5 -5
- package/dist/esm/select-control/style.scss +4 -4
- package/dist/esm/settings/MinMaxSetting.js +9 -10
- package/dist/esm/settings/SettingsCard.js +3 -3
- package/dist/esm/settings/SettingsSection.js +6 -6
- package/dist/esm/settings/style.scss +1 -1
- package/dist/esm/sortable-newsletter-list-control/index.js +19 -20
- package/dist/esm/steps-list/index.js +3 -3
- package/dist/esm/steps-list/style.scss +2 -2
- package/dist/esm/steps-list-item/index.js +4 -4
- package/dist/esm/steps-list-item/style.scss +5 -5
- package/dist/esm/style-card/index.js +11 -12
- package/dist/esm/style-card/style.scss +4 -4
- package/dist/esm/style.scss +1 -1
- package/dist/esm/tabbed-navigation/index.js +6 -6
- package/dist/esm/tabbed-navigation/style.scss +4 -4
- package/dist/esm/utils/index.js +2 -2
- package/dist/esm/waiting/index.js +2 -2
- package/dist/esm/web-preview/index.js +103 -103
- package/dist/esm/web-preview/style.scss +5 -5
- package/dist/esm/with-wizard/index.js +248 -239
- package/dist/esm/with-wizard/style.scss +44 -22
- package/dist/esm/with-wizard-screen/index.js +19 -20
- package/dist/esm/with-wizard-screen/style.scss +7 -7
- package/dist/esm/wizard/components/WizardError.js +7 -8
- package/dist/esm/wizard/index.js +23 -24
- package/package.json +21 -15
- package/shared/scss/_mixins.scss +2 -2
- package/src/accordion/index.js +35 -0
- package/src/accordion/style.scss +31 -0
- package/src/action-card/style.scss +9 -9
- package/src/autocomplete-tokenfield/style.scss +3 -3
- package/src/autocomplete-with-suggestions/index.js +46 -44
- package/src/autocomplete-with-suggestions/style.scss +8 -8
- package/src/button/style.scss +1 -1
- package/src/button-card/style.scss +19 -13
- package/src/card/style.scss +1 -1
- package/src/category-autocomplete/style.scss +2 -2
- package/src/color-picker/style.scss +3 -3
- package/src/custom-select-control/style.scss +11 -10
- package/src/date-range-picker/index.js +31 -0
- package/src/date-range-picker/style.scss +148 -0
- package/src/footer/style.scss +1 -1
- package/src/form-token-field/style.scss +1 -1
- package/src/grid/style.scss +9 -9
- package/src/handoff-message/index.js +3 -1
- package/src/image-upload/index.js +1 -1
- package/src/image-upload/index.test.js +6 -1
- package/src/image-upload/style.scss +5 -5
- package/src/index.js +2 -0
- package/src/modal/style.scss +5 -5
- package/src/newspack-icon/style.scss +1 -1
- package/src/newspack-logo/style.scss +1 -1
- package/src/notice/style.scss +11 -11
- package/src/plugin-installer/style.scss +1 -1
- package/src/plugin-settings/style.scss +1 -1
- package/src/plugin-toggle/index.js +6 -7
- package/src/plugin-toggle/style.scss +1 -1
- package/src/popover/style.scss +7 -7
- package/src/position-control/index.js +62 -63
- package/src/position-control/style.scss +8 -8
- package/src/progress-bar/style.scss +2 -2
- package/src/radio-control/style.scss +3 -3
- package/src/section-header/style.scss +1 -1
- package/src/select-control/style.scss +4 -4
- package/src/settings/style.scss +1 -1
- package/src/steps-list/style.scss +2 -2
- package/src/steps-list-item/style.scss +5 -5
- package/src/style-card/style.scss +4 -4
- package/src/style.scss +1 -1
- package/src/tabbed-navigation/index.js +1 -1
- package/src/tabbed-navigation/style.scss +4 -4
- package/src/web-preview/style.scss +5 -5
- package/src/with-wizard/style.scss +44 -22
- package/src/with-wizard-screen/style.scss +7 -7
- package/dist/cjs/button/index.js +0 -56
- package/dist/cjs/grid/index.js +0 -37
- package/dist/cjs/hooks/index.js +0 -25
- package/dist/cjs/hooks/usePrompt.js +0 -49
- package/dist/cjs/text-control/index.js +0 -61
- package/dist/esm/button/index.js +0 -48
- package/dist/esm/grid/index.js +0 -29
- package/dist/esm/hooks/index.js +0 -17
- package/dist/esm/hooks/usePrompt.js +0 -40
- package/dist/esm/text-control/index.js +0 -57
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
4
|
-
var _react =
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
5
5
|
var _react2 = require("@testing-library/react");
|
|
6
6
|
var _ = _interopRequireDefault(require("./"));
|
|
7
|
-
var _jsxRuntime = require("
|
|
8
|
-
|
|
7
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
9
10
|
describe('ProgressBar', () => {
|
|
10
11
|
it('should render a progress indicator', () => {
|
|
11
12
|
const {
|
|
12
13
|
getByTestId
|
|
13
|
-
} = (0, _react2.render)((0, _jsxRuntime.jsx)(_.default, {
|
|
14
|
+
} = (0, _react2.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
14
15
|
completed: "1",
|
|
15
16
|
total: "2"
|
|
16
17
|
}));
|
|
@@ -21,7 +22,7 @@ describe('ProgressBar', () => {
|
|
|
21
22
|
const label = 'test label';
|
|
22
23
|
const {
|
|
23
24
|
getByText
|
|
24
|
-
} = (0, _react2.render)((0, _jsxRuntime.jsx)(_.default, {
|
|
25
|
+
} = (0, _react2.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
25
26
|
completed: "1",
|
|
26
27
|
total: "2",
|
|
27
28
|
label: label
|
|
@@ -31,7 +32,7 @@ describe('ProgressBar', () => {
|
|
|
31
32
|
it('should render progress as a fraction', () => {
|
|
32
33
|
const {
|
|
33
34
|
getByText
|
|
34
|
-
} = (0, _react2.render)((0, _jsxRuntime.jsx)(_.default, {
|
|
35
|
+
} = (0, _react2.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
35
36
|
completed: "1",
|
|
36
37
|
total: "2",
|
|
37
38
|
displayFraction: true
|
|
@@ -42,7 +43,7 @@ describe('ProgressBar', () => {
|
|
|
42
43
|
const label = 'test label';
|
|
43
44
|
const {
|
|
44
45
|
getByText
|
|
45
|
-
} = (0, _react2.render)((0, _jsxRuntime.jsx)(_.default, {
|
|
46
|
+
} = (0, _react2.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
46
47
|
completed: "1",
|
|
47
48
|
total: "2",
|
|
48
49
|
label: label,
|
|
@@ -77,7 +78,7 @@ describe('ProgressBar', () => {
|
|
|
77
78
|
it(`with expected progress of ${expectedWidth}`, () => {
|
|
78
79
|
const {
|
|
79
80
|
getByTestId
|
|
80
|
-
} = (0, _react2.render)((0,
|
|
81
|
+
} = (0, _react2.render)( /*#__PURE__*/(0, _react.createElement)(_.default, {
|
|
81
82
|
...props,
|
|
82
83
|
key: expectedWidth
|
|
83
84
|
}));
|
|
@@ -89,7 +90,7 @@ describe('ProgressBar', () => {
|
|
|
89
90
|
const {
|
|
90
91
|
getByText,
|
|
91
92
|
getByTestId
|
|
92
|
-
} = (0, _react2.render)((0, _jsxRuntime.jsx)(_.default, {
|
|
93
|
+
} = (0, _react2.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
93
94
|
completed: "cats",
|
|
94
95
|
total: "dogs",
|
|
95
96
|
displayFraction: true
|
|
@@ -101,7 +102,7 @@ describe('ProgressBar', () => {
|
|
|
101
102
|
const {
|
|
102
103
|
getByText,
|
|
103
104
|
getByTestId
|
|
104
|
-
} = (0, _react2.render)((0, _jsxRuntime.jsx)(_.default, {
|
|
105
|
+
} = (0, _react2.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
105
106
|
completed: "3",
|
|
106
107
|
total: "-1",
|
|
107
108
|
displayFraction: true
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
7
|
var ReactRouterDOM = _interopRequireWildcard(require("react-router-dom"));
|
|
8
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
9
10
|
/**
|
|
10
11
|
* A proxy for react-router-dom.
|
|
11
12
|
* Ensures that both components and the plugin use the same instance of
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
@@ -9,7 +9,7 @@ var _components = require("@wordpress/components");
|
|
|
9
9
|
var _element = require("@wordpress/element");
|
|
10
10
|
require("./style.scss");
|
|
11
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
|
-
var _jsxRuntime = require("
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
/**
|
|
14
14
|
* WordPress dependencies.
|
|
15
15
|
*/
|
|
@@ -34,7 +34,7 @@ var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
|
34
34
|
...otherProps
|
|
35
35
|
} = this.props;
|
|
36
36
|
const classes = (0, _classnames.default)('newspack-radio-control', className);
|
|
37
|
-
return (0, _jsxRuntime.jsx)(_components.RadioControl, {
|
|
37
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.RadioControl, {
|
|
38
38
|
className: classes,
|
|
39
39
|
...otherProps
|
|
40
40
|
});
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Radio Control
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
@use
|
|
6
|
-
@use
|
|
5
|
+
@use "../../../shared/scss/colors";
|
|
6
|
+
@use "~@wordpress/base-styles/colors" as wp-colors;
|
|
7
7
|
|
|
8
8
|
.newspack-radio-control {
|
|
9
9
|
color: wp-colors.$gray-700;
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
|
|
42
42
|
// Radio
|
|
43
43
|
|
|
44
|
-
input[type=
|
|
44
|
+
input[type="radio"] {
|
|
45
45
|
height: 24px;
|
|
46
46
|
margin-right: 8px;
|
|
47
47
|
width: 24px;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
@@ -9,7 +9,7 @@ var _element = require("@wordpress/element");
|
|
|
9
9
|
var _ = require("..");
|
|
10
10
|
require("./style.scss");
|
|
11
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
|
-
var _jsxRuntime = require("
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
/**
|
|
14
14
|
* Section Header
|
|
15
15
|
*/
|
|
@@ -52,21 +52,21 @@ const SectionHeader = ({
|
|
|
52
52
|
}, []);
|
|
53
53
|
const classes = (0, _classnames.default)('newspack-section-header', centered && 'newspack-section-header--is-centered', isWhite && 'newspack-section-header--is-white', noMargin && 'newspack-section-header--no-margin', className);
|
|
54
54
|
const HeadingTag = `h${heading}`;
|
|
55
|
-
return (0, _jsxRuntime.jsx)("div", {
|
|
55
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
56
56
|
id: id,
|
|
57
57
|
className: "newspack-section-header__container",
|
|
58
58
|
ref: ref,
|
|
59
|
-
children: (0, _jsxRuntime.jsxs)(_.Grid, {
|
|
59
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.Grid, {
|
|
60
60
|
columns: 1,
|
|
61
61
|
gutter: 8,
|
|
62
62
|
className: classes,
|
|
63
|
-
children: [typeof title === 'string' && (0, _jsxRuntime.jsx)(HeadingTag, {
|
|
63
|
+
children: [typeof title === 'string' && /*#__PURE__*/(0, _jsxRuntime.jsx)(HeadingTag, {
|
|
64
64
|
children: title
|
|
65
|
-
}), typeof title === 'function' && (0, _jsxRuntime.jsx)(HeadingTag, {
|
|
65
|
+
}), typeof title === 'function' && /*#__PURE__*/(0, _jsxRuntime.jsx)(HeadingTag, {
|
|
66
66
|
children: title()
|
|
67
|
-
}), description && typeof description === 'string' && (0, _jsxRuntime.jsx)("p", {
|
|
67
|
+
}), description && typeof description === 'string' && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
68
68
|
children: description
|
|
69
|
-
}), typeof description === 'function' && (0, _jsxRuntime.jsx)("p", {
|
|
69
|
+
}), typeof description === 'function' && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
70
70
|
children: description()
|
|
71
71
|
})]
|
|
72
72
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
@@ -9,7 +9,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
9
9
|
var _icons = require("@wordpress/icons");
|
|
10
10
|
var _components = require("@wordpress/components");
|
|
11
11
|
var _ = require("..");
|
|
12
|
-
var _jsxRuntime = require("
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
/**
|
|
14
14
|
* External dependencies
|
|
15
15
|
*/
|
|
@@ -32,27 +32,27 @@ const ButtonGroupControl = ({
|
|
|
32
32
|
value
|
|
33
33
|
}) => {
|
|
34
34
|
const id = _.hooks.useUniqueId('button-group');
|
|
35
|
-
return (0, _jsxRuntime.jsx)(_components.BaseControl, {
|
|
35
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.BaseControl, {
|
|
36
36
|
label: label,
|
|
37
37
|
hideLabelFromVision: hideLabelFromVision,
|
|
38
38
|
id: id.current,
|
|
39
39
|
className: (0, _classnames.default)(className, 'components-select-control'),
|
|
40
|
-
children: (0, _jsxRuntime.jsx)(_components.ButtonGroup, {
|
|
40
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ButtonGroup, {
|
|
41
41
|
children: buttonOptions.map(option => {
|
|
42
42
|
const isSelected = value === option.value;
|
|
43
43
|
let Label = () => option.label;
|
|
44
44
|
if (option.icon) {
|
|
45
45
|
// eslint-disable-next-line react/display-name
|
|
46
|
-
Label = () => (0, _jsxRuntime.jsx)(_icons.Icon, {
|
|
46
|
+
Label = () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.Icon, {
|
|
47
47
|
icon: option.icon
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
return (0, _jsxRuntime.jsx)(_components.Button, {
|
|
50
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
51
51
|
variant: isSelected ? 'primary' : null,
|
|
52
52
|
isPressed: isSelected,
|
|
53
53
|
onClick: () => onChange(option.value),
|
|
54
54
|
isSmall: buttonSmall,
|
|
55
|
-
children: (0, _jsxRuntime.jsx)(Label, {})
|
|
55
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Label, {})
|
|
56
56
|
}, option.value);
|
|
57
57
|
})
|
|
58
58
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
@@ -12,21 +12,22 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
12
12
|
var _find = _interopRequireDefault(require("lodash/find"));
|
|
13
13
|
var _some = _interopRequireDefault(require("lodash/some"));
|
|
14
14
|
var _ = require("..");
|
|
15
|
-
var _jsxRuntime = require("
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
16
|
/**
|
|
17
17
|
* WordPress dependencies
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
/**
|
|
21
21
|
* External dependencies
|
|
22
22
|
*/
|
|
23
|
+
|
|
23
24
|
/**
|
|
24
25
|
* Internal dependencies
|
|
25
26
|
*/
|
|
27
|
+
|
|
26
28
|
/**
|
|
27
29
|
* SelectControl with optgroup support
|
|
28
|
-
*/
|
|
29
|
-
function GroupedSelectControl({
|
|
30
|
+
*/function GroupedSelectControl({
|
|
30
31
|
help,
|
|
31
32
|
label,
|
|
32
33
|
onChange,
|
|
@@ -43,37 +44,37 @@ function GroupedSelectControl({
|
|
|
43
44
|
onChange(value, optgroup);
|
|
44
45
|
};
|
|
45
46
|
const id = _.hooks.useUniqueId('group-select');
|
|
46
|
-
return (0, _jsxRuntime.jsx)(_components.BaseControl, {
|
|
47
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.BaseControl, {
|
|
47
48
|
label: label,
|
|
48
49
|
hideLabelFromVision: hideLabelFromVision,
|
|
49
50
|
id: id,
|
|
50
51
|
help: help,
|
|
51
52
|
className: (0, _classnames.default)(className, 'components-select-control'),
|
|
52
|
-
children: (0, _jsxRuntime.jsxs)("div", {
|
|
53
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
53
54
|
className: "relative",
|
|
54
|
-
children: [(0, _jsxRuntime.jsxs)("select", {
|
|
55
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("select", {
|
|
55
56
|
id: id,
|
|
56
57
|
className: "components-select-control__input",
|
|
57
58
|
onChange: onChangeValue,
|
|
58
59
|
"aria-describedby": !!help ? `${id}__help` : undefined,
|
|
59
60
|
...props,
|
|
60
|
-
children: [(0, _jsxRuntime.jsx)("option", {
|
|
61
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
61
62
|
value: "",
|
|
62
|
-
children: __('-- Select --', 'newspack-plugin')
|
|
63
|
+
children: (0, _i18n.__)('-- Select --', 'newspack-plugin')
|
|
63
64
|
}), optgroups.map(({
|
|
64
65
|
label: optgroupLabel,
|
|
65
66
|
options
|
|
66
|
-
}, optgroupIndex) => (0, _jsxRuntime.jsx)("optgroup", {
|
|
67
|
+
}, optgroupIndex) => /*#__PURE__*/(0, _jsxRuntime.jsx)("optgroup", {
|
|
67
68
|
label: optgroupLabel,
|
|
68
|
-
children: options.map((option, optionIndex) => (0, _jsxRuntime.jsx)("option", {
|
|
69
|
+
children: options.map((option, optionIndex) => /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
69
70
|
value: option.value,
|
|
70
71
|
disabled: option.disabled,
|
|
71
72
|
children: option.label
|
|
72
73
|
}, `${option.label}-${option.value}-${optionIndex}`))
|
|
73
74
|
}, optgroupIndex))]
|
|
74
|
-
}), (0, _jsxRuntime.jsx)("div", {
|
|
75
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
75
76
|
className: "components-select-control__arrow-wrapper",
|
|
76
|
-
children: (0, _jsxRuntime.jsx)(_icons.Icon, {
|
|
77
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.Icon, {
|
|
77
78
|
icon: _icons.chevronDown,
|
|
78
79
|
size: 18
|
|
79
80
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
@@ -11,7 +11,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
11
11
|
require("./style.scss");
|
|
12
12
|
var _GroupedSelectControl = _interopRequireDefault(require("./GroupedSelectControl"));
|
|
13
13
|
var _ButtonGroupControl = _interopRequireDefault(require("./ButtonGroupControl"));
|
|
14
|
-
var _jsxRuntime = require("
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
15
|
/**
|
|
16
16
|
* Select Control
|
|
17
17
|
*/
|
|
@@ -41,16 +41,16 @@ class SelectControl extends _element.Component {
|
|
|
41
41
|
...otherProps
|
|
42
42
|
} = this.props;
|
|
43
43
|
const classes = (0, _classnames.default)('newspack-select-control', optgroups && 'newspack-grouped-select-control', buttonOptions && 'newspack-buttons-select-control', className);
|
|
44
|
-
return (0, _jsxRuntime.jsx)("div", {
|
|
44
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
45
45
|
className: classes,
|
|
46
|
-
children: optgroups ? (0, _jsxRuntime.jsx)(_GroupedSelectControl.default, {
|
|
46
|
+
children: optgroups ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_GroupedSelectControl.default, {
|
|
47
47
|
optgroups: optgroups,
|
|
48
48
|
...otherProps
|
|
49
|
-
}) : buttonOptions ? (0, _jsxRuntime.jsx)(_ButtonGroupControl.default, {
|
|
49
|
+
}) : buttonOptions ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonGroupControl.default, {
|
|
50
50
|
buttonOptions: buttonOptions,
|
|
51
51
|
buttonSmall: buttonSmall,
|
|
52
52
|
...otherProps
|
|
53
|
-
}) : (0, _jsxRuntime.jsx)(_components.SelectControl, {
|
|
53
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl, {
|
|
54
54
|
...otherProps
|
|
55
55
|
})
|
|
56
56
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Select Control
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
@use
|
|
5
|
+
@use "~@wordpress/base-styles/colors" as wp-colors;
|
|
6
6
|
|
|
7
7
|
.components-select-control {
|
|
8
8
|
&__input {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
padding: 8px;
|
|
23
23
|
|
|
24
24
|
&:checked {
|
|
25
|
-
background: var(
|
|
25
|
+
background: var(--wp-admin-theme-color);
|
|
26
26
|
color: white;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
&:focus {
|
|
67
|
-
border-color: var(
|
|
68
|
-
box-shadow: inset 0 0 0 1px var(
|
|
67
|
+
border-color: var(--wp-admin-theme-color-darker-10) !important;
|
|
68
|
+
box-shadow: inset 0 0 0 1px var(--wp-admin-theme-color-darker-10) !important;
|
|
69
69
|
color: inherit;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -7,14 +7,15 @@ exports.default = void 0;
|
|
|
7
7
|
var _i18n = require("@wordpress/i18n");
|
|
8
8
|
var _components = require("@wordpress/components");
|
|
9
9
|
var _ = require("../");
|
|
10
|
-
var _jsxRuntime = require("
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
/**
|
|
12
12
|
* WordPress dependencies.
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
/**
|
|
16
16
|
* Internal dependencies.
|
|
17
17
|
*/
|
|
18
|
+
|
|
18
19
|
const MinMaxSetting = ({
|
|
19
20
|
min,
|
|
20
21
|
max,
|
|
@@ -24,29 +25,29 @@ const MinMaxSetting = ({
|
|
|
24
25
|
maxPlaceholder,
|
|
25
26
|
...props
|
|
26
27
|
}) => {
|
|
27
|
-
return (0, _jsxRuntime.jsxs)("div", {
|
|
28
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
28
29
|
...props,
|
|
29
|
-
children: [(0, _jsxRuntime.jsxs)("div", {
|
|
30
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
30
31
|
className: "newspack-settings__min-max",
|
|
31
|
-
children: [(0, _jsxRuntime.jsx)(_components.CheckboxControl, {
|
|
32
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.CheckboxControl, {
|
|
32
33
|
checked: min > 0,
|
|
33
34
|
onChange: value => onChangeMin(value ? 1 : 0),
|
|
34
|
-
label: __('Min', 'newspack-plugin')
|
|
35
|
-
}), (0, _jsxRuntime.jsx)(_.TextControl, {
|
|
35
|
+
label: (0, _i18n.__)('Min', 'newspack-plugin')
|
|
36
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TextControl, {
|
|
36
37
|
"data-testid": "min",
|
|
37
38
|
type: "number",
|
|
38
39
|
value: min,
|
|
39
40
|
placeholder: minPlaceholder,
|
|
40
41
|
onChange: value => onChangeMin(value > 0 ? value : 0)
|
|
41
42
|
})]
|
|
42
|
-
}), (0, _jsxRuntime.jsxs)("div", {
|
|
43
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
43
44
|
className: "newspack-settings__min-max",
|
|
44
45
|
"data-testid": "max",
|
|
45
|
-
children: [(0, _jsxRuntime.jsx)(_components.CheckboxControl, {
|
|
46
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.CheckboxControl, {
|
|
46
47
|
checked: max > 0,
|
|
47
48
|
onChange: value => onChangeMax(value ? min || 1 : 0),
|
|
48
|
-
label: __('Max', 'newspack-plugin')
|
|
49
|
-
}), (0, _jsxRuntime.jsx)(_.TextControl, {
|
|
49
|
+
label: (0, _i18n.__)('Max', 'newspack-plugin')
|
|
50
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TextControl, {
|
|
50
51
|
"data-testid": "max",
|
|
51
52
|
type: "number",
|
|
52
53
|
value: max,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
9
|
var _ = require("../");
|
|
10
|
-
var _jsxRuntime = require("
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
/**
|
|
12
12
|
* External dependencies.
|
|
13
13
|
*/
|
|
@@ -26,12 +26,12 @@ const SettingsCard = ({
|
|
|
26
26
|
...props
|
|
27
27
|
}) => {
|
|
28
28
|
const classes = (0, _classnames.default)('newspack-settings__card', noBorder && 'newspack-settings__no-border', className);
|
|
29
|
-
return (0, _jsxRuntime.jsx)(_.ActionCard, {
|
|
29
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.ActionCard, {
|
|
30
30
|
...props,
|
|
31
31
|
className: classes,
|
|
32
32
|
notificationLevel: "info",
|
|
33
33
|
noBorder: noBorder,
|
|
34
|
-
children: (0, _jsxRuntime.jsx)(_.Grid, {
|
|
34
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Grid, {
|
|
35
35
|
columns: columns,
|
|
36
36
|
gutter: gutter,
|
|
37
37
|
rowGap: rowGap,
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _ = require("../");
|
|
8
|
-
var _jsxRuntime = require("
|
|
8
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
9
|
/**
|
|
10
10
|
* Internal dependencies.
|
|
11
11
|
*/
|
|
@@ -14,18 +14,18 @@ const SettingSection = ({
|
|
|
14
14
|
title,
|
|
15
15
|
description,
|
|
16
16
|
children
|
|
17
|
-
}) => (0, _jsxRuntime.jsxs)(_.Grid, {
|
|
17
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.Grid, {
|
|
18
18
|
columns: 1,
|
|
19
19
|
gutter: 8,
|
|
20
20
|
className: "newspack-settings__section",
|
|
21
|
-
children: [(0, _jsxRuntime.jsxs)("div", {
|
|
21
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
22
22
|
className: "newspack-settings__section__title",
|
|
23
|
-
children: [(0, _jsxRuntime.jsx)("span", {
|
|
23
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
24
24
|
children: title
|
|
25
|
-
}), description && (0, _jsxRuntime.jsx)(_.InfoButton, {
|
|
25
|
+
}), description && /*#__PURE__*/(0, _jsxRuntime.jsx)(_.InfoButton, {
|
|
26
26
|
text: description
|
|
27
27
|
})]
|
|
28
|
-
}), (0, _jsxRuntime.jsx)("div", {
|
|
28
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
29
29
|
className: "newspack-settings__section__content",
|
|
30
30
|
children: children
|
|
31
31
|
})]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|