newspack-components 3.0.0-alpha.2 → 3.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/babel.config.cjs.js +26 -0
- package/babel.config.js +1 -0
- package/copy-styles.js +10 -2
- package/dist/esm/accordion/index.js +42 -0
- package/dist/esm/accordion/style.scss +31 -0
- package/dist/esm/action-card/index.js +218 -0
- package/dist/esm/action-card/style.scss +483 -0
- package/dist/esm/autocomplete-tokenfield/index.js +261 -0
- package/dist/esm/autocomplete-tokenfield/style.scss +49 -0
- package/dist/esm/autocomplete-with-suggestions/index.js +274 -0
- package/dist/esm/autocomplete-with-suggestions/style.scss +163 -0
- package/dist/esm/button/style.scss +11 -0
- package/dist/esm/button-card/index.js +64 -0
- package/dist/esm/button-card/style.scss +180 -0
- package/dist/esm/card/index.js +43 -0
- package/dist/esm/card/style.scss +168 -0
- package/dist/esm/category-autocomplete/index.js +183 -0
- package/dist/esm/category-autocomplete/style.scss +34 -0
- package/dist/esm/color-picker/index.js +59 -0
- package/dist/esm/color-picker/style.scss +37 -0
- package/dist/esm/consts.js +1 -0
- package/dist/esm/custom-select-control/index.js +37 -0
- package/dist/esm/custom-select-control/style.scss +93 -0
- 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 +99 -0
- package/dist/esm/footer/style.scss +82 -0
- package/dist/esm/form-token-field/index.js +49 -0
- package/dist/esm/form-token-field/style.scss +37 -0
- package/dist/esm/global-notices/index.js +30 -0
- package/dist/esm/grid/style.scss +166 -0
- package/dist/esm/handoff/index.js +175 -0
- package/dist/esm/handoff-message/index.js +47 -0
- package/dist/esm/hooks/useObjectState.js +30 -0
- package/dist/esm/hooks/useObjectState.test.js +82 -0
- package/dist/esm/hooks/useOnClickOutside.js +31 -0
- package/dist/esm/image-upload/index.js +140 -0
- package/dist/esm/image-upload/index.test.js +34 -0
- package/dist/esm/image-upload/style.scss +103 -0
- package/dist/esm/index.js +47 -0
- package/dist/esm/info-button/index.js +42 -0
- package/dist/esm/info-button/style.scss +18 -0
- package/dist/esm/modal/index.js +39 -0
- package/dist/esm/modal/style.scss +56 -0
- package/dist/esm/newspack-icon/index.js +50 -0
- package/dist/esm/newspack-icon/style.scss +26 -0
- package/dist/esm/newspack-logo/index.js +46 -0
- package/dist/esm/newspack-logo/style.scss +30 -0
- package/dist/esm/notice/index.js +65 -0
- package/dist/esm/notice/style.scss +111 -0
- package/dist/esm/patrons-logo/index.js +70 -0
- package/dist/esm/plugin-installer/index.js +289 -0
- package/dist/esm/plugin-installer/style.scss +72 -0
- package/dist/esm/plugin-settings/SettingsSection.js +133 -0
- package/dist/esm/plugin-settings/index.js +220 -0
- package/dist/esm/plugin-settings/style.scss +7 -0
- package/dist/esm/plugin-toggle/index.js +216 -0
- package/dist/esm/plugin-toggle/style.scss +20 -0
- package/dist/esm/popover/index.js +41 -0
- package/dist/esm/popover/style.scss +161 -0
- package/dist/esm/position-control/index.js +106 -0
- package/dist/esm/position-control/style.scss +66 -0
- package/dist/esm/progress-bar/index.js +68 -0
- package/dist/esm/progress-bar/index.test.js +108 -0
- package/dist/esm/progress-bar/style.scss +42 -0
- package/dist/esm/proxied-imports/router.js +8 -0
- package/dist/esm/radio-control/index.js +37 -0
- package/dist/esm/radio-control/style.scss +92 -0
- package/dist/esm/section-header/index.js +67 -0
- package/dist/esm/section-header/style.scss +45 -0
- package/dist/esm/select-control/ButtonGroupControl.js +53 -0
- package/dist/esm/select-control/GroupedSelectControl.js +78 -0
- package/dist/esm/select-control/index.js +51 -0
- package/dist/esm/select-control/style.scss +108 -0
- package/dist/esm/settings/MinMaxSetting.js +53 -0
- package/dist/esm/settings/SettingsCard.js +38 -0
- package/dist/esm/settings/SettingsSection.js +26 -0
- package/dist/esm/settings/index.js +9 -0
- package/dist/esm/settings/style.scss +119 -0
- package/dist/esm/sortable-newsletter-list-control/index.js +127 -0
- package/dist/esm/sortable-newsletter-list-control/style.scss +45 -0
- 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 +47 -0
- package/dist/esm/steps-list-item/style.scss +47 -0
- package/dist/esm/style-card/index.js +74 -0
- package/dist/esm/style-card/style.scss +94 -0
- package/dist/esm/style.scss +55 -0
- package/dist/esm/tabbed-navigation/index.js +53 -0
- package/dist/esm/tabbed-navigation/style.scss +86 -0
- package/dist/esm/text-control/style.scss +32 -0
- package/dist/esm/utils/index.js +29 -0
- package/dist/esm/waiting/index.js +44 -0
- package/dist/esm/waiting/style.scss +27 -0
- package/dist/esm/web-preview/index.js +183 -0
- package/dist/esm/web-preview/style.scss +155 -0
- package/dist/esm/with-wizard/index.js +320 -0
- package/dist/esm/with-wizard/style.scss +282 -0
- package/dist/esm/with-wizard-screen/index.js +109 -0
- package/dist/esm/with-wizard-screen/style.scss +160 -0
- package/dist/esm/wizard/components/WizardError.js +66 -0
- package/dist/esm/wizard/index.js +119 -0
- package/dist/esm/wizard/store/index.js +155 -0
- package/dist/esm/wizard/store/utils.js +14 -0
- package/package.json +7 -4
- package/dist/button/index.js +0 -51
- package/dist/button/index.tsx +0 -48
- package/dist/grid/index.js +0 -44
- package/dist/grid/index.tsx +0 -34
- package/dist/hooks/index.js +0 -29
- package/dist/hooks/index.ts +0 -15
- package/dist/hooks/usePrompt.js +0 -47
- package/dist/hooks/usePrompt.ts +0 -46
- package/dist/plugin-toggle/README.md +0 -53
- package/dist/text-control/index.js +0 -76
- package/dist/text-control/index.tsx +0 -71
- /package/dist/{accordion → cjs/accordion}/index.js +0 -0
- /package/dist/{accordion → cjs/accordion}/style.scss +0 -0
- /package/dist/{action-card → cjs/action-card}/index.js +0 -0
- /package/dist/{action-card → cjs/action-card}/style.scss +0 -0
- /package/dist/{autocomplete-tokenfield → cjs/autocomplete-tokenfield}/index.js +0 -0
- /package/dist/{autocomplete-tokenfield → cjs/autocomplete-tokenfield}/style.scss +0 -0
- /package/dist/{autocomplete-with-suggestions → cjs/autocomplete-with-suggestions}/index.js +0 -0
- /package/dist/{autocomplete-with-suggestions → cjs/autocomplete-with-suggestions}/style.scss +0 -0
- /package/dist/{button → cjs/button}/style.scss +0 -0
- /package/dist/{button-card → cjs/button-card}/index.js +0 -0
- /package/dist/{button-card → cjs/button-card}/style.scss +0 -0
- /package/dist/{card → cjs/card}/index.js +0 -0
- /package/dist/{card → cjs/card}/style.scss +0 -0
- /package/dist/{category-autocomplete → cjs/category-autocomplete}/index.js +0 -0
- /package/dist/{category-autocomplete → cjs/category-autocomplete}/style.scss +0 -0
- /package/dist/{color-picker → cjs/color-picker}/index.js +0 -0
- /package/dist/{color-picker → cjs/color-picker}/style.scss +0 -0
- /package/dist/{consts.js → cjs/consts.js} +0 -0
- /package/dist/{custom-select-control → cjs/custom-select-control}/index.js +0 -0
- /package/dist/{custom-select-control → cjs/custom-select-control}/style.scss +0 -0
- /package/dist/{date-range-picker → cjs/date-range-picker}/index.js +0 -0
- /package/dist/{date-range-picker → cjs/date-range-picker}/style.scss +0 -0
- /package/dist/{footer → cjs/footer}/index.js +0 -0
- /package/dist/{footer → cjs/footer}/style.scss +0 -0
- /package/dist/{form-token-field → cjs/form-token-field}/index.js +0 -0
- /package/dist/{form-token-field → cjs/form-token-field}/style.scss +0 -0
- /package/dist/{global-notices → cjs/global-notices}/index.js +0 -0
- /package/dist/{grid → cjs/grid}/style.scss +0 -0
- /package/dist/{handoff → cjs/handoff}/index.js +0 -0
- /package/dist/{handoff-message → cjs/handoff-message}/index.js +0 -0
- /package/dist/{hooks → cjs/hooks}/useObjectState.js +0 -0
- /package/dist/{hooks → cjs/hooks}/useObjectState.test.js +0 -0
- /package/dist/{hooks → cjs/hooks}/useOnClickOutside.js +0 -0
- /package/dist/{image-upload → cjs/image-upload}/index.js +0 -0
- /package/dist/{image-upload → cjs/image-upload}/index.test.js +0 -0
- /package/dist/{image-upload → cjs/image-upload}/style.scss +0 -0
- /package/dist/{index.js → cjs/index.js} +0 -0
- /package/dist/{info-button → cjs/info-button}/index.js +0 -0
- /package/dist/{info-button → cjs/info-button}/style.scss +0 -0
- /package/dist/{modal → cjs/modal}/index.js +0 -0
- /package/dist/{modal → cjs/modal}/style.scss +0 -0
- /package/dist/{newspack-icon → cjs/newspack-icon}/index.js +0 -0
- /package/dist/{newspack-icon → cjs/newspack-icon}/style.scss +0 -0
- /package/dist/{newspack-logo → cjs/newspack-logo}/index.js +0 -0
- /package/dist/{newspack-logo → cjs/newspack-logo}/style.scss +0 -0
- /package/dist/{notice → cjs/notice}/index.js +0 -0
- /package/dist/{notice → cjs/notice}/style.scss +0 -0
- /package/dist/{patrons-logo → cjs/patrons-logo}/index.js +0 -0
- /package/dist/{plugin-installer → cjs/plugin-installer}/index.js +0 -0
- /package/dist/{plugin-installer → cjs/plugin-installer}/style.scss +0 -0
- /package/dist/{plugin-settings → cjs/plugin-settings}/SettingsSection.js +0 -0
- /package/dist/{plugin-settings → cjs/plugin-settings}/index.js +0 -0
- /package/dist/{plugin-settings → cjs/plugin-settings}/style.scss +0 -0
- /package/dist/{plugin-toggle → cjs/plugin-toggle}/index.js +0 -0
- /package/dist/{plugin-toggle → cjs/plugin-toggle}/style.scss +0 -0
- /package/dist/{popover → cjs/popover}/index.js +0 -0
- /package/dist/{popover → cjs/popover}/style.scss +0 -0
- /package/dist/{position-control → cjs/position-control}/index.js +0 -0
- /package/dist/{position-control → cjs/position-control}/style.scss +0 -0
- /package/dist/{progress-bar → cjs/progress-bar}/index.js +0 -0
- /package/dist/{progress-bar → cjs/progress-bar}/index.test.js +0 -0
- /package/dist/{progress-bar → cjs/progress-bar}/style.scss +0 -0
- /package/dist/{proxied-imports → cjs/proxied-imports}/router.js +0 -0
- /package/dist/{radio-control → cjs/radio-control}/index.js +0 -0
- /package/dist/{radio-control → cjs/radio-control}/style.scss +0 -0
- /package/dist/{section-header → cjs/section-header}/index.js +0 -0
- /package/dist/{section-header → cjs/section-header}/style.scss +0 -0
- /package/dist/{select-control → cjs/select-control}/ButtonGroupControl.js +0 -0
- /package/dist/{select-control → cjs/select-control}/GroupedSelectControl.js +0 -0
- /package/dist/{select-control → cjs/select-control}/index.js +0 -0
- /package/dist/{select-control → cjs/select-control}/style.scss +0 -0
- /package/dist/{settings → cjs/settings}/MinMaxSetting.js +0 -0
- /package/dist/{settings → cjs/settings}/SettingsCard.js +0 -0
- /package/dist/{settings → cjs/settings}/SettingsSection.js +0 -0
- /package/dist/{settings → cjs/settings}/index.js +0 -0
- /package/dist/{settings → cjs/settings}/style.scss +0 -0
- /package/dist/{sortable-newsletter-list-control → cjs/sortable-newsletter-list-control}/index.js +0 -0
- /package/dist/{sortable-newsletter-list-control → cjs/sortable-newsletter-list-control}/style.scss +0 -0
- /package/dist/{steps-list → cjs/steps-list}/index.js +0 -0
- /package/dist/{steps-list → cjs/steps-list}/style.scss +0 -0
- /package/dist/{steps-list-item → cjs/steps-list-item}/index.js +0 -0
- /package/dist/{steps-list-item → cjs/steps-list-item}/style.scss +0 -0
- /package/dist/{style-card → cjs/style-card}/index.js +0 -0
- /package/dist/{style-card → cjs/style-card}/style.scss +0 -0
- /package/dist/{style.scss → cjs/style.scss} +0 -0
- /package/dist/{tabbed-navigation → cjs/tabbed-navigation}/index.js +0 -0
- /package/dist/{tabbed-navigation → cjs/tabbed-navigation}/style.scss +0 -0
- /package/dist/{text-control → cjs/text-control}/style.scss +0 -0
- /package/dist/{utils → cjs/utils}/index.js +0 -0
- /package/dist/{waiting → cjs/waiting}/index.js +0 -0
- /package/dist/{waiting → cjs/waiting}/style.scss +0 -0
- /package/dist/{web-preview → cjs/web-preview}/index.js +0 -0
- /package/dist/{web-preview → cjs/web-preview}/style.scss +0 -0
- /package/dist/{with-wizard → cjs/with-wizard}/index.js +0 -0
- /package/dist/{with-wizard → cjs/with-wizard}/style.scss +0 -0
- /package/dist/{with-wizard-screen → cjs/with-wizard-screen}/index.js +0 -0
- /package/dist/{with-wizard-screen → cjs/with-wizard-screen}/style.scss +0 -0
- /package/dist/{wizard → cjs/wizard}/components/WizardError.js +0 -0
- /package/dist/{wizard → cjs/wizard}/index.js +0 -0
- /package/dist/{wizard → cjs/wizard}/store/index.js +0 -0
- /package/dist/{wizard → cjs/wizard}/store/utils.js +0 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Image Upload
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
@use "~@wordpress/base-styles/colors" as wp-colors;
|
|
6
|
+
|
|
7
|
+
.newspack-image-upload {
|
|
8
|
+
margin: 32px 0;
|
|
9
|
+
&__header {
|
|
10
|
+
display: flex;
|
|
11
|
+
}
|
|
12
|
+
&__label {
|
|
13
|
+
margin: 0 0 8px;
|
|
14
|
+
}
|
|
15
|
+
&__image {
|
|
16
|
+
align-items: center;
|
|
17
|
+
background-repeat: no-repeat;
|
|
18
|
+
background-size: contain;
|
|
19
|
+
background-position: center;
|
|
20
|
+
border: 1px dashed wp-colors.$gray-700;
|
|
21
|
+
border-radius: 2px;
|
|
22
|
+
display: flex;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
max-width: 100%;
|
|
25
|
+
min-height: 48px;
|
|
26
|
+
position: relative;
|
|
27
|
+
&--covering {
|
|
28
|
+
background-size: cover;
|
|
29
|
+
}
|
|
30
|
+
&:not(&--has-image) {
|
|
31
|
+
.newspack-button {
|
|
32
|
+
background: white !important;
|
|
33
|
+
border-radius: 2px !important;
|
|
34
|
+
padding: 4px 16px !important;
|
|
35
|
+
|
|
36
|
+
&:active,
|
|
37
|
+
&:focus,
|
|
38
|
+
&:hover {
|
|
39
|
+
background: white !important;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&:focus {
|
|
43
|
+
outline-offset: -3px !important;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
&--has-image {
|
|
48
|
+
border: none;
|
|
49
|
+
overflow: hidden;
|
|
50
|
+
&::before,
|
|
51
|
+
&::after {
|
|
52
|
+
border: 1px solid rgba(black, 0.54);
|
|
53
|
+
border-radius: 2px;
|
|
54
|
+
content: "";
|
|
55
|
+
inset: 0;
|
|
56
|
+
position: absolute;
|
|
57
|
+
z-index: 0;
|
|
58
|
+
}
|
|
59
|
+
button,
|
|
60
|
+
&::after {
|
|
61
|
+
opacity: 0;
|
|
62
|
+
transition: opacity 125ms;
|
|
63
|
+
}
|
|
64
|
+
button {
|
|
65
|
+
z-index: 1;
|
|
66
|
+
position: relative;
|
|
67
|
+
}
|
|
68
|
+
&::after {
|
|
69
|
+
background: rgba(white, 0.9);
|
|
70
|
+
border-color: wp-colors.$gray-700;
|
|
71
|
+
}
|
|
72
|
+
&:focus-within,
|
|
73
|
+
&:hover {
|
|
74
|
+
button,
|
|
75
|
+
&::after {
|
|
76
|
+
opacity: 1;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
img {
|
|
80
|
+
max-height: 100%;
|
|
81
|
+
max-width: 100%;
|
|
82
|
+
}
|
|
83
|
+
.sep {
|
|
84
|
+
background: transparent;
|
|
85
|
+
display: block;
|
|
86
|
+
height: 8px;
|
|
87
|
+
margin: 0;
|
|
88
|
+
width: 100%;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
&__image + &__help {
|
|
93
|
+
color: wp-colors.$gray-700;
|
|
94
|
+
font-size: 12px;
|
|
95
|
+
margin: 1em 0 0;
|
|
96
|
+
}
|
|
97
|
+
&__controls {
|
|
98
|
+
align-items: center;
|
|
99
|
+
display: flex;
|
|
100
|
+
flex-direction: column;
|
|
101
|
+
position: absolute;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export { default as Accordion } from './accordion';
|
|
2
|
+
export { default as ActionCard } from './action-card';
|
|
3
|
+
export { default as AutocompleteTokenField } from './autocomplete-tokenfield';
|
|
4
|
+
export { default as AutocompleteWithSuggestions } from './autocomplete-with-suggestions';
|
|
5
|
+
export { default as Button } from './button';
|
|
6
|
+
export { default as ButtonCard } from './button-card';
|
|
7
|
+
export { default as Card } from './card';
|
|
8
|
+
export { default as CategoryAutocomplete } from './category-autocomplete';
|
|
9
|
+
export { default as ColorPicker } from './color-picker';
|
|
10
|
+
export { default as CustomSelectControl } from './custom-select-control';
|
|
11
|
+
export { default as FormTokenField } from './form-token-field';
|
|
12
|
+
export { default as Footer } from './footer';
|
|
13
|
+
export { default as Handoff } from './handoff';
|
|
14
|
+
export { default as HandoffMessage } from './handoff-message';
|
|
15
|
+
export { default as InfoButton } from './info-button';
|
|
16
|
+
export { default as ImageUpload } from './image-upload';
|
|
17
|
+
export { default as GlobalNotices } from './global-notices';
|
|
18
|
+
export { default as Grid } from './grid';
|
|
19
|
+
export { default as Modal } from './modal';
|
|
20
|
+
export { default as NewspackIcon } from './newspack-icon';
|
|
21
|
+
export { default as NewspackLogo } from './newspack-logo';
|
|
22
|
+
export { default as Notice } from './notice';
|
|
23
|
+
export { default as PatronsLogo } from './patrons-logo';
|
|
24
|
+
export { default as PluginInstaller } from './plugin-installer';
|
|
25
|
+
export { default as PluginSettings } from './plugin-settings';
|
|
26
|
+
export { default as PluginToggle } from './plugin-toggle';
|
|
27
|
+
export { default as Popover } from './popover';
|
|
28
|
+
export { default as ProgressBar } from './progress-bar';
|
|
29
|
+
export { default as RadioControl } from './radio-control';
|
|
30
|
+
export { default as SectionHeader } from './section-header';
|
|
31
|
+
export { default as SelectControl } from './select-control';
|
|
32
|
+
export { default as DateRangePicker } from './date-range-picker';
|
|
33
|
+
export { default as Settings } from './settings';
|
|
34
|
+
export { default as StepsList } from './steps-list';
|
|
35
|
+
export { default as StepsListItem } from './steps-list-item';
|
|
36
|
+
export { default as StyleCard } from './style-card';
|
|
37
|
+
export { default as TabbedNavigation } from './tabbed-navigation';
|
|
38
|
+
export { default as TextControl } from './text-control';
|
|
39
|
+
export { default as Waiting } from './waiting';
|
|
40
|
+
export { default as WebPreview } from './web-preview';
|
|
41
|
+
export { default as Wizard } from './wizard';
|
|
42
|
+
export { default as withWizard } from './with-wizard';
|
|
43
|
+
export { default as withWizardScreen } from './with-wizard-screen';
|
|
44
|
+
export { default as Router } from './proxied-imports/router';
|
|
45
|
+
export { default as hooks } from './hooks';
|
|
46
|
+
export { default as utils } from './utils';
|
|
47
|
+
import './style.scss';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Info Button
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* WordPress dependencies.
|
|
7
|
+
*/
|
|
8
|
+
import { Component } from '@wordpress/element';
|
|
9
|
+
import { Tooltip } from '@wordpress/components';
|
|
10
|
+
import { Icon, info } from '@wordpress/icons';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* External dependencies.
|
|
14
|
+
*/
|
|
15
|
+
import classnames from 'classnames';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Internal dependencies.
|
|
19
|
+
*/
|
|
20
|
+
import './style.scss';
|
|
21
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
class InfoButton extends Component {
|
|
23
|
+
/**
|
|
24
|
+
* Render.
|
|
25
|
+
*/
|
|
26
|
+
render() {
|
|
27
|
+
const {
|
|
28
|
+
className,
|
|
29
|
+
...otherProps
|
|
30
|
+
} = this.props;
|
|
31
|
+
return /*#__PURE__*/_jsx(Tooltip, {
|
|
32
|
+
...otherProps,
|
|
33
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
34
|
+
className: classnames('newspack-info-button', className),
|
|
35
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
36
|
+
icon: info
|
|
37
|
+
})
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export default InfoButton;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Info Button
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
.newspack-info-button {
|
|
6
|
+
display: inline-block;
|
|
7
|
+
flex: 0 0 24px;
|
|
8
|
+
height: 24px;
|
|
9
|
+
margin: 0;
|
|
10
|
+
margin-left: 4px;
|
|
11
|
+
width: 24px;
|
|
12
|
+
vertical-align: middle;
|
|
13
|
+
|
|
14
|
+
svg {
|
|
15
|
+
display: block;
|
|
16
|
+
fill: currentcolor;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modal
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* WordPress dependencies.
|
|
7
|
+
*/
|
|
8
|
+
import { Component } from '@wordpress/element';
|
|
9
|
+
import { Modal as BaseComponent } from '@wordpress/components';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Internal dependencies.
|
|
13
|
+
*/
|
|
14
|
+
import './style.scss';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* External dependencies.
|
|
18
|
+
*/
|
|
19
|
+
import classnames from 'classnames';
|
|
20
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
|
+
class Modal extends Component {
|
|
22
|
+
/**
|
|
23
|
+
* Render.
|
|
24
|
+
*/
|
|
25
|
+
render() {
|
|
26
|
+
const {
|
|
27
|
+
className,
|
|
28
|
+
isWide,
|
|
29
|
+
isNarrow,
|
|
30
|
+
...otherProps
|
|
31
|
+
} = this.props;
|
|
32
|
+
const classes = classnames('newspack-modal', isWide && 'newspack-modal--wide', isNarrow && 'newspack-modal--narrow', className);
|
|
33
|
+
return /*#__PURE__*/_jsx(BaseComponent, {
|
|
34
|
+
className: classes,
|
|
35
|
+
...otherProps
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export default Modal;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modal
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
@use "../../../shared/scss/colors";
|
|
6
|
+
|
|
7
|
+
.newspack-modal {
|
|
8
|
+
// Color
|
|
9
|
+
--wp-admin-theme-color: #{colors.$primary-500};
|
|
10
|
+
--wp-admin-theme-color--rgb: #{colors.$primary-500--rgb};
|
|
11
|
+
--wp-admin-theme-color-darker-10: #{colors.$primary-600};
|
|
12
|
+
--wp-admin-theme-color-darker-10--rgb: #{colors.$primary-600--rgb};
|
|
13
|
+
--wp-admin-theme-color-darker-20: #{colors.$primary-700};
|
|
14
|
+
--wp-admin-theme-color-darker-20--rgb: #{colors.$primary-700--rgb};
|
|
15
|
+
|
|
16
|
+
@media screen and ( min-width: 744px ) {
|
|
17
|
+
max-width: 680px;
|
|
18
|
+
width: 680px;
|
|
19
|
+
|
|
20
|
+
&--wide {
|
|
21
|
+
max-width: 1168px;
|
|
22
|
+
width: 1168px;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&--narrow {
|
|
27
|
+
max-width: 360px;
|
|
28
|
+
width: 360px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@media screen and ( min-width: 960px ) {
|
|
32
|
+
max-height: calc(100% - 128px);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Links
|
|
36
|
+
a {
|
|
37
|
+
color: var(--wp-admin-theme-color);
|
|
38
|
+
|
|
39
|
+
&:active,
|
|
40
|
+
&:focus,
|
|
41
|
+
&:hover {
|
|
42
|
+
color: var(--wp-admin-theme-color-darker-10);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&:focus {
|
|
46
|
+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
47
|
+
outline: 3px solid transparent;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.components-modal__content {
|
|
52
|
+
> *:last-child {
|
|
53
|
+
margin-bottom: 0;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Newspack Icon.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* WordPress dependencies.
|
|
7
|
+
*/
|
|
8
|
+
import { Component } from '@wordpress/element';
|
|
9
|
+
import { Path, SVG } from '@wordpress/components';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* External dependencies.
|
|
13
|
+
*/
|
|
14
|
+
import classnames from 'classnames';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Internal dependencies.
|
|
18
|
+
*/
|
|
19
|
+
import './style.scss';
|
|
20
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
|
+
class NewspackIcon extends Component {
|
|
22
|
+
/**
|
|
23
|
+
* Render
|
|
24
|
+
*/
|
|
25
|
+
render() {
|
|
26
|
+
const {
|
|
27
|
+
className,
|
|
28
|
+
simple,
|
|
29
|
+
size,
|
|
30
|
+
white
|
|
31
|
+
} = this.props;
|
|
32
|
+
const classes = classnames('newspack-icon', simple && 'newspack-icon--simple', white && 'newspack-icon--white', className);
|
|
33
|
+
return /*#__PURE__*/_jsx(SVG, {
|
|
34
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
35
|
+
height: size,
|
|
36
|
+
width: size,
|
|
37
|
+
viewBox: "0 0 32 32",
|
|
38
|
+
className: classes,
|
|
39
|
+
children: /*#__PURE__*/_jsx(Path, {
|
|
40
|
+
fillRule: "evenodd",
|
|
41
|
+
clipRule: "evenodd",
|
|
42
|
+
d: "M32 16c0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16S7.164 0 16 0s16 7.164 16 16zm-10.732.622h1.72v-1.124h-2.823l1.103 1.124zm-3.249-3.31h4.97v-1.124h-6.072l1.102 1.124zm-3.248-3.31h8.217V8.877h-9.32l1.103 1.125zM9.01 8.877l13.977 14.246h-4.66l-5.866-5.98v5.98h-3.45V8.877z"
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
NewspackIcon.defaultProps = {
|
|
48
|
+
size: 32
|
|
49
|
+
};
|
|
50
|
+
export default NewspackIcon;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Newspack Icon
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
@use "../../../shared/scss/colors";
|
|
6
|
+
|
|
7
|
+
.newspack-icon {
|
|
8
|
+
background: colors.$primary-500;
|
|
9
|
+
fill: white;
|
|
10
|
+
padding: 12px;
|
|
11
|
+
|
|
12
|
+
&--white {
|
|
13
|
+
background: white;
|
|
14
|
+
fill: colors.$primary-500;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&--simple {
|
|
18
|
+
background: none;
|
|
19
|
+
fill: colors.$primary-500;
|
|
20
|
+
padding: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&#{&}--simple#{&}--white {
|
|
24
|
+
fill: white;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Newspack Logo.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* WordPress dependencies.
|
|
7
|
+
*/
|
|
8
|
+
import { Component } from '@wordpress/element';
|
|
9
|
+
import { Path, SVG } from '@wordpress/components';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* External dependencies.
|
|
13
|
+
*/
|
|
14
|
+
import classnames from 'classnames';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Internal dependencies.
|
|
18
|
+
*/
|
|
19
|
+
import './style.scss';
|
|
20
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
|
+
class NewspackLogo extends Component {
|
|
22
|
+
/**
|
|
23
|
+
* Render
|
|
24
|
+
*/
|
|
25
|
+
render() {
|
|
26
|
+
const {
|
|
27
|
+
centered,
|
|
28
|
+
className,
|
|
29
|
+
height
|
|
30
|
+
} = this.props;
|
|
31
|
+
const classes = classnames('newspack-logo__svg', centered && 'is-centered', className);
|
|
32
|
+
return /*#__PURE__*/_jsx(SVG, {
|
|
33
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
34
|
+
height: height,
|
|
35
|
+
viewBox: "0 0 221 64",
|
|
36
|
+
className: classes,
|
|
37
|
+
children: /*#__PURE__*/_jsx(Path, {
|
|
38
|
+
d: "M32 0c17.672 0 32 14.328 32 32S49.672 64 32 64C14.326 64 0 49.672 0 32S14.328 0 32 0zm130.57 27.247c3.611 0 6.475 2.521 6.475 7.974 0 5.417-3.134 8.995-8.314 8.995-1.262 0-2.248-.172-3.305-.376v8.551h-4.022V27.67h3.85v1.486c1.534-1.191 3.237-1.908 5.316-1.908zM18.023 17.755v28.49h6.902V34.287l11.733 11.958h9.319l-27.954-28.49zm178.552 9.495c2.009 0 3.219.34 4.581.784v3.407c-1.158-.444-2.878-.921-4.513-.921-2.453 0-4.532 1.294-4.532 5.076 0 4.156 2.077 5.383 4.736 5.387 1.262 0 2.676-.273 4.516-.99v3.34c-1.636.544-3.118.92-5.025.92-6.033 0-8.417-3.442-8.417-8.45 0-5.283 3.305-8.553 8.654-8.553zm-18.195-.003c3.919 0 6.44 1.567 6.435 6.235V43.84h-3.747v-1.771h-.103c-1.327 1.022-2.93 2.079-5.314 2.079-2.112 0-4.36-1.534-4.36-4.6 0-4.133 3.545-4.912 5.997-5.252l3.51-.477v-.47c0-2.181-.886-2.897-2.93-2.897-.989 0-3.338.305-5.28 1.09l-.341-3.237c1.738-.614 4.123-1.058 6.133-1.058zm-73.55-.12c5.145 0 6.951 3.579 6.951 6.987 0 .936-.047 1.518-.102 2.06l-.034.325h-10.358c.101 3.542 2.106 4.36 5.104 4.36 1.637 0 3.158-.372 4.845-.991v3.342c-2.093.644-3.89.921-5.968.921-5.141 0-8.308-2.556-8.308-8.586 0-4.398 2.69-8.417 7.87-8.417zm39.998 0c1.771 0 3.305.172 4.804.614v3.338s-2.188-.714-4.497-.714c-1.43 0-2.76.477-2.76 1.703 0 2.725 8.042 1.262 8.04 6.883 0 4.053-3.611 5.178-7.394 5.178-1.738 0-3.487-.467-4.736-.958v-3.305c1.5.52 3.578 1.026 4.873 1.026 1.84 0 3.1-.374 3.1-1.771 0-2.829-8.04-1.33-8.04-7.156 0-2.998 2.724-4.837 6.61-4.837zm64.01-6.114v13.63c.34-.376.615-.785 5.657-6.952h5.213l-6.543 7.666 7.156 8.485h-5.248l-6.235-7.665v7.665h-4.02v-22.83h4.02zm-127.634 0l8.633 15.263V21.013h4.022v22.83h-4.416L80.81 28.578v15.263h-4.021v-22.83h4.416zm36.758 6.678l2.476 11.469 2.801-11.469h3.572l2.438 11.469 2.75-11.469h4.038l-4.54 16.151h-4.83l-1.714-9.495-2.325 9.495h-4.814l-4.268-16.15h4.416zm62.836 8.616l-3.305.512c-.987.136-2.044.732-2.044 2.231 0 1.322.75 2.067 1.84 2.067 1.157 0 2.452-.716 3.509-1.466v-3.344zm-19.318-5.752c-1.193 0-2.657.545-4.054 1.771v8.415c.885.17 1.77.306 2.997.306 2.829 0 4.464-1.805 4.464-5.517 0-3.476-1.158-4.975-3.407-4.975zm-56.685-.394c-2.009 0-3.235 1.43-3.475 3.678h6.268c0-1.975-.646-3.678-2.793-3.678zm-58.818.836H40.33l2.205 2.248h3.442v-2.248zm0-6.621H33.833l2.205 2.248h9.939v-2.248zm0-6.621h-18.64l2.204 2.248h16.436v-2.248z"
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
NewspackLogo.defaultProps = {
|
|
44
|
+
height: 56
|
|
45
|
+
};
|
|
46
|
+
export default NewspackLogo;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Newspack Logo
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
@use "../../../shared/scss/colors";
|
|
6
|
+
|
|
7
|
+
.newspack-logo {
|
|
8
|
+
&__svg {
|
|
9
|
+
display: block;
|
|
10
|
+
fill: currentcolor;
|
|
11
|
+
margin: 0;
|
|
12
|
+
padding-bottom: 32px;
|
|
13
|
+
width: auto;
|
|
14
|
+
|
|
15
|
+
&.is-centered {
|
|
16
|
+
margin-left: auto;
|
|
17
|
+
margin-right: auto;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&__wrapper {
|
|
22
|
+
background: colors.$primary-500;
|
|
23
|
+
color: white;
|
|
24
|
+
position: relative;
|
|
25
|
+
|
|
26
|
+
a {
|
|
27
|
+
color: inherit;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notice
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* WordPress dependencies.
|
|
7
|
+
*/
|
|
8
|
+
import { Component, RawHTML } from '@wordpress/element';
|
|
9
|
+
import { Icon, bug, check, help, info } from '@wordpress/icons';
|
|
10
|
+
import { __ } from '@wordpress/i18n';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Internal dependencies.
|
|
14
|
+
*/
|
|
15
|
+
import './style.scss';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* External dependencies.
|
|
19
|
+
*/
|
|
20
|
+
import classnames from 'classnames';
|
|
21
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
+
class Notice extends Component {
|
|
23
|
+
/**
|
|
24
|
+
* Render
|
|
25
|
+
*/
|
|
26
|
+
render() {
|
|
27
|
+
const {
|
|
28
|
+
className,
|
|
29
|
+
debugMode,
|
|
30
|
+
isError,
|
|
31
|
+
isHandoff,
|
|
32
|
+
isHelp,
|
|
33
|
+
isSuccess,
|
|
34
|
+
isWarning,
|
|
35
|
+
noticeText,
|
|
36
|
+
rawHTML,
|
|
37
|
+
style = {},
|
|
38
|
+
children = null
|
|
39
|
+
} = this.props;
|
|
40
|
+
const classes = classnames('newspack-notice', className, debugMode && 'newspack-notice__is-debug', isError && 'newspack-notice__is-error', isHandoff && 'newspack-notice__is-handoff', isHelp && 'newspack-notice__is-help', isSuccess && 'newspack-notice__is-success', isWarning && 'newspack-notice__is-warning');
|
|
41
|
+
let noticeIcon;
|
|
42
|
+
if (isHelp) {
|
|
43
|
+
noticeIcon = help;
|
|
44
|
+
} else if (isSuccess) {
|
|
45
|
+
noticeIcon = check;
|
|
46
|
+
} else if (debugMode) {
|
|
47
|
+
noticeIcon = bug;
|
|
48
|
+
} else {
|
|
49
|
+
noticeIcon = info;
|
|
50
|
+
}
|
|
51
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
52
|
+
className: classes,
|
|
53
|
+
style: style,
|
|
54
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
55
|
+
icon: noticeIcon
|
|
56
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
57
|
+
className: "newspack-notice__content",
|
|
58
|
+
children: [rawHTML ? /*#__PURE__*/_jsx(RawHTML, {
|
|
59
|
+
children: noticeText
|
|
60
|
+
}) : noticeText, debugMode && __('Debug Mode', 'newspack-plugin'), children || null]
|
|
61
|
+
})]
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export default Notice;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notice
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
@use "sass:color";
|
|
6
|
+
@use "~@wordpress/base-styles/colors" as wp-colors;
|
|
7
|
+
@use "../../../shared/scss/colors";
|
|
8
|
+
|
|
9
|
+
.newspack-notice {
|
|
10
|
+
align-items: center;
|
|
11
|
+
background: wp-colors.$gray-100;
|
|
12
|
+
color: wp-colors.$gray-900;
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: flex-start;
|
|
15
|
+
margin: 32px 0;
|
|
16
|
+
padding: 6px 8px;
|
|
17
|
+
|
|
18
|
+
> svg {
|
|
19
|
+
display: block;
|
|
20
|
+
fill: wp-colors.$gray-900;
|
|
21
|
+
flex: 0 0 24px;
|
|
22
|
+
margin-right: 4px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&__is-debug {
|
|
26
|
+
background: colors.$primary-700;
|
|
27
|
+
border-radius: 2px;
|
|
28
|
+
bottom: 16px;
|
|
29
|
+
box-shadow: 0 0 8px 4px rgba(black, 0.08);
|
|
30
|
+
color: white;
|
|
31
|
+
font-weight: bold;
|
|
32
|
+
margin: 0 16px;
|
|
33
|
+
position: fixed;
|
|
34
|
+
text-transform: uppercase;
|
|
35
|
+
z-index: 9997;
|
|
36
|
+
|
|
37
|
+
> svg {
|
|
38
|
+
fill: white;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&__is-error {
|
|
43
|
+
background: color.adjust(wp-colors.$alert-red, $lightness: 51%);
|
|
44
|
+
|
|
45
|
+
> svg {
|
|
46
|
+
fill: wp-colors.$alert-red;
|
|
47
|
+
transform: rotate(180deg);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&__is-handoff {
|
|
52
|
+
background: color.adjust(wp-colors.$alert-yellow, $lightness: 30%);
|
|
53
|
+
margin-top: 0;
|
|
54
|
+
position: sticky;
|
|
55
|
+
top: 46px;
|
|
56
|
+
z-index: 100;
|
|
57
|
+
|
|
58
|
+
@media ( min-width: 782px ) {
|
|
59
|
+
top: 32px;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&__is-help {
|
|
64
|
+
background: colors.$primary-050;
|
|
65
|
+
|
|
66
|
+
> svg {
|
|
67
|
+
fill: colors.$primary-500;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&__is-success {
|
|
72
|
+
background: color.adjust(wp-colors.$alert-green, $lightness: 42%);
|
|
73
|
+
|
|
74
|
+
> svg {
|
|
75
|
+
fill: wp-colors.$alert-green;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&__is-warning {
|
|
80
|
+
background: color.adjust(wp-colors.$alert-yellow, $lightness: 30%);
|
|
81
|
+
|
|
82
|
+
> svg {
|
|
83
|
+
fill: wp-colors.$alert-yellow;
|
|
84
|
+
transform: rotate(180deg);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
& &__content {
|
|
89
|
+
> div > * {
|
|
90
|
+
margin: 0 !important;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
a {
|
|
94
|
+
color: inherit;
|
|
95
|
+
|
|
96
|
+
&:active,
|
|
97
|
+
&:focus,
|
|
98
|
+
&:hover {
|
|
99
|
+
color: inherit;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&:focus {
|
|
103
|
+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) currentcolor;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
& + & {
|
|
109
|
+
margin-top: -16px;
|
|
110
|
+
}
|
|
111
|
+
}
|