newspack-components 2.2.1 → 3.0.0-alpha.2
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.js +25 -0
- package/copy-styles.js +2 -10
- package/dist/{cjs/accordion → accordion}/index.js +17 -13
- package/dist/{cjs/accordion → accordion}/style.scss +7 -3
- package/dist/{cjs/action-card → action-card}/index.js +39 -43
- package/dist/{esm/action-card → action-card}/style.scss +9 -9
- package/dist/{cjs/autocomplete-tokenfield → autocomplete-tokenfield}/index.js +67 -29
- package/dist/{esm/autocomplete-tokenfield → autocomplete-tokenfield}/style.scss +14 -8
- package/dist/{cjs/autocomplete-with-suggestions → autocomplete-with-suggestions}/index.js +61 -73
- package/dist/{esm/autocomplete-with-suggestions → autocomplete-with-suggestions}/style.scss +9 -17
- package/dist/button/index.js +51 -0
- package/{src/button/index.js → dist/button/index.tsx} +12 -5
- package/dist/{cjs/button → button}/style.scss +1 -1
- package/dist/{cjs/button-card → button-card}/index.js +9 -10
- package/dist/{cjs/button-card → button-card}/style.scss +19 -13
- package/dist/{cjs/card → card}/index.js +4 -5
- package/dist/{esm/card → card}/style.scss +1 -1
- package/dist/{cjs/category-autocomplete → category-autocomplete}/index.js +51 -53
- package/dist/{esm/category-autocomplete → category-autocomplete}/style.scss +2 -2
- package/dist/{cjs/color-picker → color-picker}/index.js +14 -16
- package/dist/{cjs/color-picker → color-picker}/style.scss +3 -3
- package/dist/consts.js +7 -0
- package/dist/{cjs/custom-select-control → custom-select-control}/index.js +4 -5
- package/dist/{cjs/custom-select-control → custom-select-control}/style.scss +11 -10
- package/dist/{cjs/date-range-picker → date-range-picker}/index.js +9 -11
- package/dist/{cjs/date-range-picker → date-range-picker}/style.scss +6 -6
- package/dist/{cjs/footer → footer}/index.js +33 -36
- package/dist/{cjs/footer → footer}/style.scss +1 -1
- package/dist/{cjs/form-token-field → form-token-field}/index.js +6 -7
- package/dist/{esm/form-token-field → form-token-field}/style.scss +1 -1
- package/dist/{cjs/global-notices → global-notices}/index.js +4 -5
- package/dist/grid/index.js +44 -0
- package/dist/grid/index.tsx +34 -0
- package/dist/{cjs/grid → grid}/style.scss +9 -9
- package/dist/{cjs/handoff → handoff}/index.js +73 -71
- package/dist/{cjs/handoff-message → handoff-message}/index.js +5 -3
- package/dist/hooks/index.js +29 -0
- package/{src/hooks/index.js → dist/hooks/index.ts} +1 -1
- package/dist/{cjs/hooks → hooks}/useObjectState.js +2 -3
- package/dist/{cjs/hooks → hooks}/useObjectState.test.js +9 -9
- package/dist/{cjs/hooks → hooks}/useOnClickOutside.js +1 -2
- package/dist/hooks/usePrompt.js +47 -0
- package/{src/hooks/usePrompt.js → dist/hooks/usePrompt.ts} +4 -8
- package/dist/image-upload/index.js +148 -0
- package/dist/{cjs/image-upload → image-upload}/index.test.js +13 -6
- package/dist/{esm/image-upload → image-upload}/style.scss +5 -5
- package/dist/{cjs/index.js → index.js} +1 -1
- package/dist/{cjs/info-button → info-button}/index.js +6 -7
- package/dist/{cjs/modal → modal}/index.js +4 -5
- package/dist/{esm/modal → modal}/style.scss +5 -5
- package/dist/{cjs/newspack-icon → newspack-icon}/index.js +5 -6
- package/dist/{cjs/newspack-icon → newspack-icon}/style.scss +1 -1
- package/dist/{cjs/newspack-logo → newspack-logo}/index.js +5 -6
- package/dist/{cjs/newspack-logo → newspack-logo}/style.scss +1 -1
- package/dist/{cjs/notice → notice}/index.js +12 -10
- package/dist/{cjs/notice → notice}/style.scss +11 -11
- package/dist/patrons-logo/index.js +77 -0
- package/dist/plugin-installer/index.js +297 -0
- package/dist/{cjs/plugin-installer → plugin-installer}/style.scss +1 -1
- package/dist/{cjs/plugin-settings → plugin-settings}/SettingsSection.js +13 -13
- package/dist/plugin-settings/index.js +228 -0
- package/dist/{cjs/plugin-settings → plugin-settings}/style.scss +1 -1
- package/dist/plugin-toggle/README.md +53 -0
- package/dist/plugin-toggle/index.js +222 -0
- package/dist/{esm/plugin-toggle → plugin-toggle}/style.scss +1 -1
- package/dist/{cjs/popover → popover}/index.js +4 -5
- package/dist/{cjs/popover → popover}/style.scss +7 -7
- package/dist/{cjs/position-control → position-control}/index.js +33 -32
- package/dist/{cjs/position-control → position-control}/style.scss +8 -8
- package/dist/{cjs/progress-bar → progress-bar}/index.js +9 -10
- package/dist/{cjs/progress-bar → progress-bar}/index.test.js +16 -16
- package/dist/{cjs/progress-bar → progress-bar}/style.scss +2 -2
- package/dist/proxied-imports/router.js +15 -0
- package/dist/{cjs/radio-control → radio-control}/index.js +4 -5
- package/dist/{cjs/radio-control → radio-control}/style.scss +3 -3
- package/dist/{cjs/section-header → section-header}/index.js +20 -21
- package/dist/{esm/section-header → section-header}/style.scss +5 -1
- package/dist/{cjs/select-control → select-control}/ButtonGroupControl.js +17 -19
- package/dist/{cjs/select-control → select-control}/GroupedSelectControl.js +32 -35
- package/dist/{cjs/select-control → select-control}/index.js +7 -8
- package/dist/{cjs/select-control → select-control}/style.scss +4 -4
- package/dist/settings/MinMaxSetting.js +60 -0
- package/dist/{cjs/settings → settings}/SettingsCard.js +14 -16
- package/dist/settings/SettingsSection.js +33 -0
- package/dist/{cjs/settings → settings}/index.js +3 -4
- package/dist/{cjs/settings → settings}/style.scss +15 -2
- package/dist/sortable-newsletter-list-control/index.js +135 -0
- package/dist/sortable-newsletter-list-control/style.scss +45 -0
- package/dist/{cjs/steps-list → steps-list}/index.js +5 -6
- package/dist/{esm/steps-list → steps-list}/style.scss +2 -2
- package/dist/{cjs/steps-list-item → steps-list-item}/index.js +6 -7
- package/dist/{cjs/steps-list-item → steps-list-item}/style.scss +5 -5
- package/dist/{cjs/style-card → style-card}/index.js +21 -19
- package/dist/{esm/style-card → style-card}/style.scss +4 -4
- package/dist/{esm/style.scss → style.scss} +14 -2
- package/dist/{cjs/tabbed-navigation → tabbed-navigation}/index.js +16 -19
- package/dist/{cjs/tabbed-navigation → tabbed-navigation}/style.scss +4 -4
- package/dist/text-control/index.js +76 -0
- package/dist/text-control/index.tsx +71 -0
- package/dist/utils/index.js +36 -0
- package/dist/{cjs/waiting → waiting}/index.js +4 -5
- package/dist/web-preview/index.js +191 -0
- package/dist/{cjs/web-preview → web-preview}/style.scss +5 -5
- package/dist/with-wizard/index.js +328 -0
- package/dist/{esm/with-wizard → with-wizard}/style.scss +44 -22
- package/dist/{cjs/with-wizard-screen → with-wizard-screen}/index.js +40 -43
- package/dist/{esm/with-wizard-screen → with-wizard-screen}/style.scss +7 -7
- package/dist/{cjs/wizard → wizard}/components/WizardError.js +16 -17
- package/dist/{cjs/wizard → wizard}/index.js +44 -46
- package/dist/{cjs/wizard → wizard}/store/index.js +37 -38
- package/dist/{cjs/wizard → wizard}/store/utils.js +1 -4
- package/package.json +16 -14
- package/shared/scss/_mixins.scss +2 -2
- package/src/accordion/index.js +4 -1
- package/src/accordion/style.scss +7 -3
- package/src/action-card/style.scss +9 -9
- package/src/autocomplete-tokenfield/index.js +48 -15
- package/src/autocomplete-tokenfield/style.scss +14 -8
- package/src/autocomplete-with-suggestions/index.js +59 -62
- package/src/autocomplete-with-suggestions/style.scss +9 -17
- package/src/button/index.tsx +48 -0
- 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/consts.js +0 -2
- package/src/custom-select-control/style.scss +11 -10
- package/src/date-range-picker/style.scss +6 -6
- package/src/footer/index.js +7 -7
- package/src/footer/style.scss +1 -1
- package/src/form-token-field/style.scss +1 -1
- package/src/grid/index.tsx +34 -0
- package/src/grid/style.scss +9 -9
- package/src/handoff/index.js +7 -6
- package/src/handoff-message/index.js +3 -1
- package/src/hooks/index.ts +15 -0
- package/src/hooks/usePrompt.ts +46 -0
- package/src/image-upload/index.js +5 -5
- package/src/image-upload/index.test.js +6 -1
- package/src/image-upload/style.scss +5 -5
- 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/index.js +1 -1
- package/src/notice/style.scss +11 -11
- package/src/patrons-logo/index.js +4 -1
- package/src/plugin-installer/index.js +7 -7
- package/src/plugin-installer/style.scss +1 -1
- package/src/plugin-settings/index.js +1 -1
- package/src/plugin-settings/style.scss +1 -1
- package/src/plugin-toggle/index.js +13 -12
- package/src/plugin-toggle/style.scss +1 -1
- package/src/popover/style.scss +7 -7
- package/src/position-control/index.js +63 -64
- 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/index.js +3 -3
- package/src/section-header/style.scss +5 -1
- package/src/select-control/GroupedSelectControl.js +1 -1
- package/src/select-control/style.scss +4 -4
- package/src/settings/MinMaxSetting.js +8 -6
- package/src/settings/style.scss +15 -2
- package/src/sortable-newsletter-list-control/index.js +137 -0
- package/src/sortable-newsletter-list-control/style.scss +45 -0
- package/src/steps-list/style.scss +2 -2
- package/src/steps-list-item/style.scss +5 -5
- package/src/style-card/index.js +11 -5
- package/src/style-card/style.scss +4 -4
- package/src/style.scss +14 -2
- package/src/tabbed-navigation/style.scss +4 -4
- package/src/text-control/index.tsx +65 -0
- package/src/web-preview/index.js +6 -6
- package/src/web-preview/style.scss +5 -5
- package/src/with-wizard/index.js +4 -4
- package/src/with-wizard/style.scss +44 -22
- package/src/with-wizard-screen/index.js +1 -1
- package/src/with-wizard-screen/style.scss +7 -7
- package/src/wizard/components/WizardError.js +1 -1
- package/src/wizard/index.js +3 -3
- package/src/wizard/store/index.js +9 -2
- package/dist/cjs/action-card/style.scss +0 -483
- package/dist/cjs/autocomplete-tokenfield/style.scss +0 -43
- package/dist/cjs/autocomplete-with-suggestions/style.scss +0 -171
- package/dist/cjs/button/index.js +0 -57
- package/dist/cjs/card/style.scss +0 -168
- package/dist/cjs/category-autocomplete/style.scss +0 -34
- package/dist/cjs/consts.js +0 -12
- package/dist/cjs/form-token-field/style.scss +0 -37
- package/dist/cjs/grid/index.js +0 -54
- package/dist/cjs/hooks/index.js +0 -26
- package/dist/cjs/hooks/usePrompt.js +0 -52
- package/dist/cjs/image-upload/index.js +0 -144
- package/dist/cjs/image-upload/style.scss +0 -103
- package/dist/cjs/modal/style.scss +0 -56
- package/dist/cjs/patrons-logo/index.js +0 -82
- package/dist/cjs/plugin-installer/index.js +0 -299
- package/dist/cjs/plugin-settings/index.js +0 -222
- package/dist/cjs/plugin-toggle/index.js +0 -222
- package/dist/cjs/plugin-toggle/style.scss +0 -20
- package/dist/cjs/proxied-imports/router.js +0 -15
- package/dist/cjs/section-header/style.scss +0 -41
- package/dist/cjs/settings/MinMaxSetting.js +0 -57
- package/dist/cjs/settings/SettingsSection.js +0 -37
- package/dist/cjs/steps-list/style.scss +0 -11
- package/dist/cjs/style-card/style.scss +0 -94
- package/dist/cjs/style.scss +0 -43
- package/dist/cjs/text-control/index.js +0 -71
- package/dist/cjs/utils/index.js +0 -40
- package/dist/cjs/web-preview/index.js +0 -189
- package/dist/cjs/with-wizard/index.js +0 -318
- package/dist/cjs/with-wizard/style.scss +0 -260
- package/dist/cjs/with-wizard-screen/style.scss +0 -160
- package/dist/esm/accordion/index.js +0 -38
- package/dist/esm/accordion/style.scss +0 -27
- package/dist/esm/action-card/index.js +0 -222
- package/dist/esm/autocomplete-tokenfield/index.js +0 -223
- package/dist/esm/autocomplete-with-suggestions/index.js +0 -289
- package/dist/esm/button/index.js +0 -48
- package/dist/esm/button/style.scss +0 -11
- package/dist/esm/button-card/index.js +0 -65
- package/dist/esm/button-card/style.scss +0 -174
- package/dist/esm/card/index.js +0 -43
- package/dist/esm/category-autocomplete/index.js +0 -185
- package/dist/esm/color-picker/index.js +0 -61
- package/dist/esm/color-picker/style.scss +0 -37
- package/dist/esm/consts.js +0 -3
- package/dist/esm/custom-select-control/index.js +0 -37
- package/dist/esm/custom-select-control/style.scss +0 -92
- package/dist/esm/date-range-picker/index.js +0 -32
- package/dist/esm/date-range-picker/style.scss +0 -148
- package/dist/esm/footer/index.js +0 -105
- package/dist/esm/footer/style.scss +0 -82
- package/dist/esm/form-token-field/index.js +0 -50
- package/dist/esm/global-notices/index.js +0 -30
- package/dist/esm/grid/index.js +0 -45
- package/dist/esm/grid/style.scss +0 -166
- package/dist/esm/handoff/index.js +0 -177
- package/dist/esm/handoff-message/index.js +0 -45
- package/dist/esm/hooks/index.js +0 -17
- package/dist/esm/hooks/useObjectState.js +0 -31
- package/dist/esm/hooks/useObjectState.test.js +0 -83
- package/dist/esm/hooks/useOnClickOutside.js +0 -31
- package/dist/esm/hooks/usePrompt.js +0 -43
- package/dist/esm/image-upload/index.js +0 -141
- package/dist/esm/image-upload/index.test.js +0 -28
- package/dist/esm/index.js +0 -47
- package/dist/esm/info-button/index.js +0 -42
- package/dist/esm/info-button/style.scss +0 -18
- package/dist/esm/modal/index.js +0 -39
- package/dist/esm/newspack-icon/index.js +0 -50
- package/dist/esm/newspack-icon/style.scss +0 -26
- package/dist/esm/newspack-logo/index.js +0 -46
- package/dist/esm/newspack-logo/style.scss +0 -30
- package/dist/esm/notice/index.js +0 -67
- package/dist/esm/notice/style.scss +0 -111
- package/dist/esm/patrons-logo/index.js +0 -76
- package/dist/esm/plugin-installer/index.js +0 -295
- package/dist/esm/plugin-installer/style.scss +0 -72
- package/dist/esm/plugin-settings/SettingsSection.js +0 -136
- package/dist/esm/plugin-settings/index.js +0 -217
- package/dist/esm/plugin-settings/style.scss +0 -7
- package/dist/esm/plugin-toggle/index.js +0 -217
- package/dist/esm/popover/index.js +0 -41
- package/dist/esm/popover/style.scss +0 -161
- package/dist/esm/position-control/index.js +0 -109
- package/dist/esm/position-control/style.scss +0 -66
- package/dist/esm/progress-bar/index.js +0 -69
- package/dist/esm/progress-bar/index.test.js +0 -110
- package/dist/esm/progress-bar/style.scss +0 -42
- package/dist/esm/proxied-imports/router.js +0 -8
- package/dist/esm/radio-control/index.js +0 -37
- package/dist/esm/radio-control/style.scss +0 -92
- package/dist/esm/section-header/index.js +0 -68
- package/dist/esm/select-control/ButtonGroupControl.js +0 -54
- package/dist/esm/select-control/GroupedSelectControl.js +0 -84
- package/dist/esm/select-control/index.js +0 -51
- package/dist/esm/select-control/style.scss +0 -108
- package/dist/esm/settings/MinMaxSetting.js +0 -53
- package/dist/esm/settings/SettingsCard.js +0 -39
- package/dist/esm/settings/SettingsSection.js +0 -30
- package/dist/esm/settings/index.js +0 -9
- package/dist/esm/settings/style.scss +0 -106
- package/dist/esm/steps-list/index.js +0 -43
- package/dist/esm/steps-list-item/index.js +0 -48
- package/dist/esm/steps-list-item/style.scss +0 -47
- package/dist/esm/style-card/index.js +0 -76
- package/dist/esm/tabbed-navigation/index.js +0 -56
- package/dist/esm/tabbed-navigation/style.scss +0 -86
- package/dist/esm/text-control/index.js +0 -66
- package/dist/esm/text-control/style.scss +0 -32
- package/dist/esm/utils/index.js +0 -32
- package/dist/esm/waiting/index.js +0 -44
- package/dist/esm/waiting/style.scss +0 -27
- package/dist/esm/web-preview/index.js +0 -184
- package/dist/esm/web-preview/style.scss +0 -155
- package/dist/esm/with-wizard/index.js +0 -313
- package/dist/esm/with-wizard-screen/index.js +0 -116
- package/dist/esm/wizard/components/WizardError.js +0 -69
- package/dist/esm/wizard/index.js +0 -126
- package/dist/esm/wizard/store/index.js +0 -155
- package/dist/esm/wizard/store/utils.js +0 -17
- package/src/grid/index.js +0 -44
- package/src/text-control/index.js +0 -56
- /package/dist/{cjs/info-button → info-button}/style.scss +0 -0
- /package/dist/{cjs/text-control → text-control}/style.scss +0 -0
- /package/dist/{cjs/waiting → waiting}/style.scss +0 -0
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* With Wizard
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
@use '~@wordpress/base-styles/colors' as wp-colors;
|
|
6
|
-
@use '../../../shared/scss/colors';
|
|
7
|
-
|
|
8
|
-
// Reset Padding of the Admin Page
|
|
9
|
-
|
|
10
|
-
.toplevel_page_newspack:not( .menu-top ),
|
|
11
|
-
body[class*='newspack_page_newspack-'],
|
|
12
|
-
body[class*='admin_page_newspack-'] {
|
|
13
|
-
background: white;
|
|
14
|
-
|
|
15
|
-
#wpcontent {
|
|
16
|
-
padding-left: 0;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
#wpbody-content {
|
|
20
|
-
padding-bottom: 220px;
|
|
21
|
-
min-height: 100vh;
|
|
22
|
-
|
|
23
|
-
@media screen and ( min-width: 783px ) {
|
|
24
|
-
padding-bottom: 202px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@media screen and ( min-width: 1128px ) {
|
|
28
|
-
padding-bottom: 168px;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
svg {
|
|
34
|
-
&.newspack--error {
|
|
35
|
-
fill: wp-colors.$alert-red;
|
|
36
|
-
transform: rotate( 180deg );
|
|
37
|
-
}
|
|
38
|
-
&.newspack--success {
|
|
39
|
-
fill: wp-colors.$alert-green;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Blue Screen
|
|
44
|
-
|
|
45
|
-
.newspack-wizard__blue {
|
|
46
|
-
#wpwrap {
|
|
47
|
-
background: colors.$primary-500;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.newspack-footer {
|
|
51
|
-
background: colors.$primary-500;
|
|
52
|
-
border-color: colors.$primary-500;
|
|
53
|
-
justify-content: center;
|
|
54
|
-
|
|
55
|
-
&__logo {
|
|
56
|
-
background: inherit;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
#wpfooter {
|
|
61
|
-
color: white;
|
|
62
|
-
|
|
63
|
-
a {
|
|
64
|
-
color: inherit;
|
|
65
|
-
|
|
66
|
-
&:active,
|
|
67
|
-
&:focus,
|
|
68
|
-
&:hover {
|
|
69
|
-
opacity: 0.75;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// Loading
|
|
76
|
-
|
|
77
|
-
.newspack-wizard__is-loading {
|
|
78
|
-
background: white;
|
|
79
|
-
cursor: wait;
|
|
80
|
-
inset: 0;
|
|
81
|
-
position: absolute;
|
|
82
|
-
|
|
83
|
-
> * {
|
|
84
|
-
display: none !important;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
&::before,
|
|
88
|
-
&::after {
|
|
89
|
-
animation: loading 2s ease-in-out infinite;
|
|
90
|
-
content: '';
|
|
91
|
-
display: block;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
&::before {
|
|
95
|
-
background: colors.$primary-500;
|
|
96
|
-
box-shadow: 24px 0 0 white, 69px 0 0 -15px wp-colors.$gray-900,
|
|
97
|
-
99px 0 0 -15px wp-colors.$gray-900, 129px 0 0 -15px wp-colors.$gray-900,
|
|
98
|
-
159px 0 0 -15px wp-colors.$gray-900, 189px 0 0 -15px wp-colors.$gray-900;
|
|
99
|
-
height: 60px;
|
|
100
|
-
width: 60px;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
&::after {
|
|
104
|
-
background: wp-colors.$gray-900;
|
|
105
|
-
box-shadow: inset -40vw 0 0 0 white, 0 64px 0 0 wp-colors.$gray-700, 40vw 96px 0 0 white,
|
|
106
|
-
0 96px 0 0 wp-colors.$gray-700;
|
|
107
|
-
height: 24px;
|
|
108
|
-
margin: 68px auto 0;
|
|
109
|
-
max-width: 1040px;
|
|
110
|
-
width: calc( 100% - ( 32px * 2 ) );
|
|
111
|
-
|
|
112
|
-
@media screen and ( min-width: 744px ) {
|
|
113
|
-
box-shadow: inset -400px 0 0 0 white, 0 64px 0 0 wp-colors.$gray-700, 200px 96px 0 0 white,
|
|
114
|
-
0 96px 0 0 wp-colors.$gray-700;
|
|
115
|
-
width: calc( 100% - ( 64px * 2 ) );
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
@media screen and ( min-width: 1224px ) {
|
|
119
|
-
box-shadow: inset -600px 0 0 0 white, 0 64px 0 0 wp-colors.$gray-700, 512px 96px 0 0 white,
|
|
120
|
-
0 96px 0 0 wp-colors.$gray-700;
|
|
121
|
-
width: calc( 100% - ( 64px * 2 ) );
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// Blue Screen
|
|
126
|
-
.newspack-wizard__blue & {
|
|
127
|
-
background: colors.$primary-500;
|
|
128
|
-
|
|
129
|
-
&::before {
|
|
130
|
-
animation: loading-quiet 1.25s ease-in-out infinite;
|
|
131
|
-
background: white;
|
|
132
|
-
border-radius: 0;
|
|
133
|
-
box-shadow: 0;
|
|
134
|
-
height: 8px;
|
|
135
|
-
left: 0;
|
|
136
|
-
margin: 0;
|
|
137
|
-
position: absolute;
|
|
138
|
-
right: 100%;
|
|
139
|
-
top: 0;
|
|
140
|
-
width: auto;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
&::after {
|
|
144
|
-
display: none;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// Quiet
|
|
149
|
-
&-quiet {
|
|
150
|
-
position: relative;
|
|
151
|
-
|
|
152
|
-
&::before,
|
|
153
|
-
&::after {
|
|
154
|
-
content: '';
|
|
155
|
-
cursor: wait;
|
|
156
|
-
display: block;
|
|
157
|
-
left: 0;
|
|
158
|
-
position: fixed;
|
|
159
|
-
top: 46px;
|
|
160
|
-
|
|
161
|
-
@media screen and ( min-width: 783px ) {
|
|
162
|
-
top: 32px;
|
|
163
|
-
margin-left: 160px;
|
|
164
|
-
|
|
165
|
-
body.auto-fold & {
|
|
166
|
-
margin-left: 36px;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
@media screen and ( min-width: 961px ) {
|
|
171
|
-
body.auto-fold & {
|
|
172
|
-
margin-left: 160px;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
body.folded & {
|
|
176
|
-
margin-left: 36px;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
&::before {
|
|
182
|
-
animation: loading-quiet 1.25s ease-in-out infinite;
|
|
183
|
-
background: colors.$primary-500;
|
|
184
|
-
height: 8px;
|
|
185
|
-
right: 100%;
|
|
186
|
-
z-index: 9999;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
&::after {
|
|
190
|
-
background: rgba( white, 0.7 );
|
|
191
|
-
bottom: 0;
|
|
192
|
-
right: 0;
|
|
193
|
-
z-index: 9998;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.newspack-wizard-section__is-loading {
|
|
199
|
-
background: white;
|
|
200
|
-
cursor: wait;
|
|
201
|
-
min-height: 150px;
|
|
202
|
-
|
|
203
|
-
> * {
|
|
204
|
-
display: none !important;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
&::after {
|
|
208
|
-
animation: loading 2s ease-in-out infinite;
|
|
209
|
-
content: '';
|
|
210
|
-
display: block;
|
|
211
|
-
background: wp-colors.$gray-900;
|
|
212
|
-
box-shadow: inset -40vw 0 0 0 white, 0 64px 0 0 wp-colors.$gray-700, 40vw 96px 0 0 white,
|
|
213
|
-
0 96px 0 0 wp-colors.$gray-700;
|
|
214
|
-
height: 24px;
|
|
215
|
-
margin: 0 auto;
|
|
216
|
-
max-width: 1040px;
|
|
217
|
-
width: 100%;
|
|
218
|
-
|
|
219
|
-
@media screen and ( min-width: 744px ) {
|
|
220
|
-
box-shadow: inset -400px 0 0 0 white, 0 64px 0 0 wp-colors.$gray-700, 200px 96px 0 0 white,
|
|
221
|
-
0 96px 0 0 wp-colors.$gray-700;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
@media screen and ( min-width: 1224px ) {
|
|
225
|
-
box-shadow: inset -600px 0 0 0 white, 0 64px 0 0 wp-colors.$gray-700, 520px 96px 0 0 white,
|
|
226
|
-
0 96px 0 0 wp-colors.$gray-700;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
@keyframes loading {
|
|
232
|
-
0% {
|
|
233
|
-
opacity: 1;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
50% {
|
|
237
|
-
opacity: 0.1;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
100% {
|
|
241
|
-
opacity: 1;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
@keyframes loading-quiet {
|
|
246
|
-
0% {
|
|
247
|
-
left: 0;
|
|
248
|
-
right: 100%;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
50% {
|
|
252
|
-
left: 0;
|
|
253
|
-
right: 0;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
100% {
|
|
257
|
-
left: 100%;
|
|
258
|
-
right: 0;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* With Wizard Screen
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
@use '~@wordpress/base-styles/colors' as wp-colors;
|
|
6
|
-
@use '../../../shared/scss/colors';
|
|
7
|
-
|
|
8
|
-
.newspack-wizard {
|
|
9
|
-
// Color
|
|
10
|
-
--wp-admin-theme-color: #{colors.$primary-500};
|
|
11
|
-
--wp-admin-theme-color--rgb: #{colors.$primary-500--rgb};
|
|
12
|
-
--wp-admin-theme-color-darker-10: #{colors.$primary-600};
|
|
13
|
-
--wp-admin-theme-color-darker-10--rgb: #{colors.$primary-600--rgb};
|
|
14
|
-
--wp-admin-theme-color-darker-20: #{colors.$primary-700};
|
|
15
|
-
--wp-admin-theme-color-darker-20--rgb: #{colors.$primary-700--rgb};
|
|
16
|
-
|
|
17
|
-
color: wp-colors.$gray-900;
|
|
18
|
-
|
|
19
|
-
// Headings
|
|
20
|
-
h1,
|
|
21
|
-
h2,
|
|
22
|
-
h3 {
|
|
23
|
-
color: inherit;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
h1 {
|
|
27
|
-
line-height: 1.4;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Links
|
|
31
|
-
a {
|
|
32
|
-
color: var( --wp-admin-theme-color );
|
|
33
|
-
|
|
34
|
-
&:active,
|
|
35
|
-
&:focus,
|
|
36
|
-
&:hover {
|
|
37
|
-
color: var( --wp-admin-theme-color-darker-10 );
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
&:focus {
|
|
41
|
-
box-shadow: 0 0 0 var( --wp-admin-border-width-focus ) var( --wp-admin-theme-color );
|
|
42
|
-
outline: 3px solid transparent;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
&__header {
|
|
47
|
-
background: white;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
&__title {
|
|
51
|
-
align-items: center;
|
|
52
|
-
border-bottom: 1px solid wp-colors.$gray-300;
|
|
53
|
-
display: flex;
|
|
54
|
-
|
|
55
|
-
h2 {
|
|
56
|
-
margin: 0;
|
|
57
|
-
padding: 0;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
> div {
|
|
61
|
-
align-items: baseline;
|
|
62
|
-
display: flex;
|
|
63
|
-
padding: 0 24px;
|
|
64
|
-
|
|
65
|
-
span {
|
|
66
|
-
color: wp-colors.$gray-700;
|
|
67
|
-
display: none;
|
|
68
|
-
margin-left: 8px;
|
|
69
|
-
|
|
70
|
-
@media screen and ( min-width: 744px ) {
|
|
71
|
-
display: block;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
svg {
|
|
77
|
-
fill: white;
|
|
78
|
-
margin: 0 !important;
|
|
79
|
-
|
|
80
|
-
&.newspack-icon {
|
|
81
|
-
flex: 0 0 36px;
|
|
82
|
-
margin-bottom: -1px !important;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
&:not( .newspack-icon ) {
|
|
86
|
-
background: colors.$primary-500;
|
|
87
|
-
left: 50%;
|
|
88
|
-
margin: -28px 0 0 -28px !important;
|
|
89
|
-
opacity: 0;
|
|
90
|
-
padding: 10px;
|
|
91
|
-
position: absolute;
|
|
92
|
-
top: 50%;
|
|
93
|
-
transition: opacity 125ms ease-in-out;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.components-button.has-icon {
|
|
98
|
-
padding: 0;
|
|
99
|
-
position: relative;
|
|
100
|
-
|
|
101
|
-
&:hover {
|
|
102
|
-
svg {
|
|
103
|
-
opacity: 1;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
&:focus-visible {
|
|
108
|
-
outline: none !important;
|
|
109
|
-
|
|
110
|
-
&::before {
|
|
111
|
-
border: 2px solid white;
|
|
112
|
-
border-radius: 2px;
|
|
113
|
-
content: '';
|
|
114
|
-
display: block;
|
|
115
|
-
inset: 6px 6px 5px;
|
|
116
|
-
position: absolute;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
&__content {
|
|
123
|
-
margin: 0 auto;
|
|
124
|
-
max-width: 1208px;
|
|
125
|
-
padding: 0 16px;
|
|
126
|
-
|
|
127
|
-
@media screen and ( min-width: 744px ) {
|
|
128
|
-
padding: 32px 84px;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// Typography
|
|
132
|
-
|
|
133
|
-
strong {
|
|
134
|
-
font-weight: bold;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
small {
|
|
138
|
-
font-size: 12px;
|
|
139
|
-
line-height: 1.4;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// Thematic Break
|
|
143
|
-
|
|
144
|
-
hr {
|
|
145
|
-
background: wp-colors.$gray-300;
|
|
146
|
-
border: 0;
|
|
147
|
-
height: 1px;
|
|
148
|
-
margin: 48px 0;
|
|
149
|
-
|
|
150
|
-
@media screen and ( min-width: 744px ) {
|
|
151
|
-
margin: 64px 0;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
&__above-header {
|
|
157
|
-
border-radius: 0;
|
|
158
|
-
margin: 0;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useState } from '@wordpress/element';
|
|
5
|
-
import { Icon, chevronRight } from '@wordpress/icons';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* External dependencies
|
|
9
|
-
*/
|
|
10
|
-
import classNames from 'classnames';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
|
-
import './style.scss';
|
|
16
|
-
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
17
|
-
import { jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
18
|
-
const Accordion = _ref => {
|
|
19
|
-
let {
|
|
20
|
-
children,
|
|
21
|
-
title
|
|
22
|
-
} = _ref;
|
|
23
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
24
|
-
return _jsxs("details", {
|
|
25
|
-
className: classNames('newspack-accordion', {
|
|
26
|
-
'newspack-accordion--is-open': isOpen
|
|
27
|
-
}),
|
|
28
|
-
children: [_jsxs("summary", {
|
|
29
|
-
onClick: () => setIsOpen(!isOpen),
|
|
30
|
-
children: [title, _jsx(Icon, {
|
|
31
|
-
className: "newspack-accordion__icon",
|
|
32
|
-
icon: chevronRight,
|
|
33
|
-
size: 24
|
|
34
|
-
})]
|
|
35
|
-
}), children]
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
export default Accordion;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
@use '~@wordpress/base-styles/colors' as wp-colors;
|
|
2
|
-
|
|
3
|
-
.newspack-accordion {
|
|
4
|
-
border: 1px solid wp-colors.$gray-300;
|
|
5
|
-
|
|
6
|
-
&__icon {
|
|
7
|
-
transition: transform 200ms ease-out;
|
|
8
|
-
transform: rotate( 90deg );
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
&--is-open {
|
|
12
|
-
.newspack-accordion {
|
|
13
|
-
&__icon {
|
|
14
|
-
transform: rotate( -90deg );
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
summary {
|
|
19
|
-
padding: 16px 32px;
|
|
20
|
-
display: flex;
|
|
21
|
-
align-items: center;
|
|
22
|
-
justify-content: space-between;
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
font-size: 14px;
|
|
25
|
-
font-weight: bold;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
/**
|
|
3
|
-
* Action Card
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { Component } from '@wordpress/element';
|
|
10
|
-
import { ExternalLink, ToggleControl } from '@wordpress/components';
|
|
11
|
-
import { Icon, check, chevronDown, chevronUp } from '@wordpress/icons';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Internal dependencies
|
|
15
|
-
*/
|
|
16
|
-
import { Button, Card, Grid, Handoff, Notice, Waiting } from '../';
|
|
17
|
-
import './style.scss';
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* External dependencies
|
|
21
|
-
*/
|
|
22
|
-
import classnames from 'classnames';
|
|
23
|
-
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
24
|
-
import { jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
25
|
-
class ActionCard extends Component {
|
|
26
|
-
constructor() {
|
|
27
|
-
super(...arguments);
|
|
28
|
-
_defineProperty(this, "state", {
|
|
29
|
-
expanded: false
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* When the collapse prop is updated to true, collapse the card if already expanded.
|
|
34
|
-
*/
|
|
35
|
-
componentDidUpdate(prevProps) {
|
|
36
|
-
if (!prevProps.collapse && this.props.collapse && this.state.expanded) {
|
|
37
|
-
this.setState({
|
|
38
|
-
expanded: false
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Render.
|
|
45
|
-
*/
|
|
46
|
-
render() {
|
|
47
|
-
const {
|
|
48
|
-
badge,
|
|
49
|
-
className,
|
|
50
|
-
checkbox,
|
|
51
|
-
children,
|
|
52
|
-
disabled,
|
|
53
|
-
title,
|
|
54
|
-
description,
|
|
55
|
-
handoff,
|
|
56
|
-
editLink,
|
|
57
|
-
href,
|
|
58
|
-
notification,
|
|
59
|
-
notificationLevel,
|
|
60
|
-
notificationHTML,
|
|
61
|
-
actionContent,
|
|
62
|
-
actionText,
|
|
63
|
-
secondaryActionText,
|
|
64
|
-
secondaryDestructive,
|
|
65
|
-
image,
|
|
66
|
-
imageLink,
|
|
67
|
-
indent,
|
|
68
|
-
isSmall,
|
|
69
|
-
isMedium,
|
|
70
|
-
simple,
|
|
71
|
-
onClick,
|
|
72
|
-
onSecondaryActionClick,
|
|
73
|
-
isWaiting,
|
|
74
|
-
titleLink,
|
|
75
|
-
toggleChecked,
|
|
76
|
-
toggleOnChange,
|
|
77
|
-
hasGreyHeader,
|
|
78
|
-
hasWhiteHeader,
|
|
79
|
-
isPending,
|
|
80
|
-
expandable = false
|
|
81
|
-
} = this.props;
|
|
82
|
-
const {
|
|
83
|
-
expanded
|
|
84
|
-
} = this.state;
|
|
85
|
-
const hasChildren = notification || children;
|
|
86
|
-
const classes = classnames('newspack-action-card', simple && 'newspack-card--is-clickable', hasGreyHeader && 'newspack-card--has-grey-header', hasWhiteHeader && 'newspack-card--has-white-header', hasChildren && 'newspack-card--has-children', indent && 'newspack-card--indent', isSmall && 'is-small', isMedium && 'is-medium', checkbox && 'has-checkbox', expandable && 'is-expandable', actionContent && 'has-action-content', className);
|
|
87
|
-
const backgroundImageStyles = url => {
|
|
88
|
-
return url ? {
|
|
89
|
-
backgroundImage: `url(${url})`
|
|
90
|
-
} : {};
|
|
91
|
-
};
|
|
92
|
-
const titleProps = toggleOnChange && !titleLink && !disabled ? {
|
|
93
|
-
onClick: () => toggleOnChange(!toggleChecked),
|
|
94
|
-
tabIndex: '0'
|
|
95
|
-
} : {};
|
|
96
|
-
const hasInternalLink = href && href.indexOf('http') !== 0;
|
|
97
|
-
const isDisplayingSecondaryAction = secondaryActionText && onSecondaryActionClick;
|
|
98
|
-
const badges = !Array.isArray(badge) && badge ? [badge] : badge;
|
|
99
|
-
return _jsxs(Card, {
|
|
100
|
-
className: classes,
|
|
101
|
-
onClick: simple && onClick,
|
|
102
|
-
children: [_jsxs("div", {
|
|
103
|
-
className: "newspack-action-card__region newspack-action-card__region-top",
|
|
104
|
-
children: [toggleOnChange && _jsx(ToggleControl, {
|
|
105
|
-
checked: toggleChecked,
|
|
106
|
-
onChange: toggleOnChange,
|
|
107
|
-
disabled: disabled
|
|
108
|
-
}), image && !toggleOnChange && _jsx("div", {
|
|
109
|
-
className: "newspack-action-card__region newspack-action-card__region-left",
|
|
110
|
-
children: _jsx("a", {
|
|
111
|
-
href: imageLink,
|
|
112
|
-
children: _jsx("div", {
|
|
113
|
-
className: "newspack-action-card__image",
|
|
114
|
-
style: backgroundImageStyles(image)
|
|
115
|
-
})
|
|
116
|
-
})
|
|
117
|
-
}), checkbox && !toggleOnChange && _jsx("div", {
|
|
118
|
-
className: "newspack-action-card__region newspack-action-card__region-left",
|
|
119
|
-
children: _jsx("span", {
|
|
120
|
-
className: classnames('newspack-checkbox-icon', 'is-primary', 'checked' === checkbox && 'newspack-checkbox-icon--checked', isPending && 'newspack-checkbox-icon--pending'),
|
|
121
|
-
children: 'checked' === checkbox && _jsx(Icon, {
|
|
122
|
-
icon: check
|
|
123
|
-
})
|
|
124
|
-
})
|
|
125
|
-
}), _jsx("div", {
|
|
126
|
-
className: "newspack-action-card__region newspack-action-card__region-center",
|
|
127
|
-
children: _jsxs(Grid, {
|
|
128
|
-
columns: 1,
|
|
129
|
-
gutter: 8,
|
|
130
|
-
noMargin: true,
|
|
131
|
-
children: [_jsxs("h2", {
|
|
132
|
-
children: [_jsxs("span", {
|
|
133
|
-
className: "newspack-action-card__title",
|
|
134
|
-
...titleProps,
|
|
135
|
-
children: [titleLink && _jsx("a", {
|
|
136
|
-
href: titleLink,
|
|
137
|
-
children: title
|
|
138
|
-
}), !titleLink && expandable && _jsx(Button, {
|
|
139
|
-
isLink: true,
|
|
140
|
-
onClick: () => this.setState({
|
|
141
|
-
expanded: !expanded
|
|
142
|
-
}),
|
|
143
|
-
children: title
|
|
144
|
-
}), !titleLink && !expandable && title]
|
|
145
|
-
}), badges?.length && badges.map((badgeText, i) => _jsx("span", {
|
|
146
|
-
className: "newspack-action-card__badge",
|
|
147
|
-
children: badgeText
|
|
148
|
-
}, `badge-${i}`))]
|
|
149
|
-
}), description && _jsxs("p", {
|
|
150
|
-
children: [typeof description === 'string' && description, typeof description === 'function' && description()]
|
|
151
|
-
})]
|
|
152
|
-
})
|
|
153
|
-
}), !expandable && (actionText || isDisplayingSecondaryAction || actionContent) && _jsxs("div", {
|
|
154
|
-
className: "newspack-action-card__region newspack-action-card__region-right",
|
|
155
|
-
children: [actionContent && actionContent, actionText && (handoff ? _jsx(Handoff, {
|
|
156
|
-
plugin: handoff,
|
|
157
|
-
editLink: editLink,
|
|
158
|
-
compact: true,
|
|
159
|
-
isLink: true,
|
|
160
|
-
children: actionText
|
|
161
|
-
}) : onClick || hasInternalLink ? _jsx(Button, {
|
|
162
|
-
disabled: disabled,
|
|
163
|
-
isLink: true,
|
|
164
|
-
href: href,
|
|
165
|
-
onClick: onClick,
|
|
166
|
-
className: "newspack-action-card__primary_button",
|
|
167
|
-
children: actionText
|
|
168
|
-
}) : href ? _jsx(ExternalLink, {
|
|
169
|
-
href: href,
|
|
170
|
-
className: "newspack-action-card__primary_button",
|
|
171
|
-
children: actionText
|
|
172
|
-
}) : _jsxs("div", {
|
|
173
|
-
className: "newspack-action-card__container",
|
|
174
|
-
children: [actionText, isWaiting && _jsx(Waiting, {
|
|
175
|
-
isRight: true
|
|
176
|
-
})]
|
|
177
|
-
})), isDisplayingSecondaryAction && _jsx(Button, {
|
|
178
|
-
isLink: true,
|
|
179
|
-
onClick: onSecondaryActionClick,
|
|
180
|
-
className: "newspack-action-card__secondary_button",
|
|
181
|
-
isDestructive: secondaryDestructive,
|
|
182
|
-
children: secondaryActionText
|
|
183
|
-
})]
|
|
184
|
-
}), expandable && _jsx(Button, {
|
|
185
|
-
onClick: () => this.setState({
|
|
186
|
-
expanded: !expanded
|
|
187
|
-
}),
|
|
188
|
-
children: _jsx(Icon, {
|
|
189
|
-
icon: expanded ? chevronUp : chevronDown,
|
|
190
|
-
height: 24,
|
|
191
|
-
width: 24
|
|
192
|
-
})
|
|
193
|
-
})]
|
|
194
|
-
}), notification && _jsxs("div", {
|
|
195
|
-
className: "newspack-action-card__notification newspack-action-card__region-children",
|
|
196
|
-
children: ['error' === notificationLevel && _jsx(Notice, {
|
|
197
|
-
noticeText: notification,
|
|
198
|
-
isError: true,
|
|
199
|
-
rawHTML: notificationHTML
|
|
200
|
-
}), 'info' === notificationLevel && _jsx(Notice, {
|
|
201
|
-
noticeText: notification,
|
|
202
|
-
rawHTML: notificationHTML
|
|
203
|
-
}), 'success' === notificationLevel && _jsx(Notice, {
|
|
204
|
-
noticeText: notification,
|
|
205
|
-
isSuccess: true,
|
|
206
|
-
rawHTML: notificationHTML
|
|
207
|
-
}), 'warning' === notificationLevel && _jsx(Notice, {
|
|
208
|
-
noticeText: notification,
|
|
209
|
-
isWarning: true,
|
|
210
|
-
rawHTML: notificationHTML
|
|
211
|
-
})]
|
|
212
|
-
}), children && (expandable && expanded || !expandable) && _jsx("div", {
|
|
213
|
-
className: "newspack-action-card__region-children",
|
|
214
|
-
children: children
|
|
215
|
-
})]
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
ActionCard.defaultProps = {
|
|
220
|
-
toggleChecked: false
|
|
221
|
-
};
|
|
222
|
-
export default ActionCard;
|