newspack-components 3.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/colors/colors.module.scss +277 -0
- package/copy-styles.js +8 -1
- package/dist/cjs/action-card/action-card.d.js +5 -0
- package/dist/cjs/action-card/index.js +282 -186
- package/dist/cjs/action-card/style.scss +142 -44
- package/dist/cjs/autocomplete-tokenfield/index.js +6 -2
- package/dist/cjs/box-contrast/index.js +49 -0
- package/dist/cjs/button/index.js +1 -1
- package/dist/cjs/button-props/button-props.js +41 -0
- package/dist/cjs/button-props/index.js +13 -0
- package/dist/cjs/color-picker/index.js +11 -0
- package/dist/cjs/custom-select-control/style.scss +7 -12
- package/dist/cjs/footer/index.js +17 -24
- package/dist/cjs/footer/style.scss +0 -36
- package/dist/cjs/handoff-message/index.js +0 -3
- package/dist/cjs/hooks/useObjectState.js +9 -0
- package/dist/cjs/hooks/useObjectState.test.js +6 -6
- package/dist/cjs/image-upload/index.test.js +2 -2
- package/dist/cjs/index.js +7 -21
- package/dist/cjs/modal/index.js +16 -18
- package/dist/cjs/modal/style.scss +18 -7
- package/dist/cjs/newspack-icon/index.js +2 -2
- package/dist/cjs/newspack-icon/style.scss +3 -5
- package/dist/cjs/notice/index.js +1 -2
- package/dist/cjs/notice/style.scss +11 -9
- package/dist/cjs/plugin-installer/index.js +3 -3
- package/dist/cjs/plugin-settings/SettingsSection.js +2 -0
- package/dist/cjs/plugin-settings/index.js +4 -1
- package/dist/cjs/plugin-toggle/index.js +2 -0
- package/dist/cjs/popover/style.scss +5 -6
- package/dist/cjs/progress-bar/index.test.js +8 -9
- package/dist/cjs/progress-bar/style.scss +1 -2
- package/dist/cjs/proxied-imports/router.js +1 -2
- package/dist/cjs/radio-control/style.scss +8 -11
- package/dist/cjs/section-header/index.js +21 -1
- package/dist/cjs/select-control/ButtonGroupControl.js +2 -0
- package/dist/cjs/settings/SettingsCard.js +2 -6
- package/dist/cjs/sortable-newsletter-list-control/index.js +7 -5
- package/dist/cjs/sortable-newsletter-list-control/style.scss +11 -1
- package/dist/cjs/steps-list/style.scss +0 -3
- package/dist/cjs/steps-list-item/style.scss +1 -2
- package/dist/cjs/style-card/index.js +1 -0
- package/dist/cjs/style-card/style.scss +4 -5
- package/dist/cjs/style.scss +15 -0
- package/dist/cjs/tabbed-navigation/index.js +17 -7
- package/dist/cjs/tabbed-navigation/style.scss +2 -6
- package/dist/cjs/utils/color.js +35 -0
- package/dist/cjs/web-preview/index.js +1 -1
- package/dist/cjs/web-preview/style.scss +11 -11
- package/dist/cjs/with-wizard/index.js +80 -3
- package/dist/cjs/with-wizard/style.scss +34 -13
- package/dist/cjs/with-wizard-screen/index.js +3 -3
- package/dist/cjs/with-wizard-screen/style.scss +9 -9
- package/dist/cjs/wizard/index.js +38 -13
- package/dist/cjs/wizard/store/index.js +13 -5
- package/dist/cjs/wizard/store/utils.js +3 -1
- package/dist/esm/action-card/action-card.d.js +1 -0
- package/dist/esm/action-card/index.js +286 -188
- package/dist/esm/action-card/style.scss +142 -44
- package/dist/esm/autocomplete-tokenfield/index.js +6 -2
- package/dist/esm/box-contrast/index.js +44 -0
- package/dist/esm/button/index.js +1 -1
- package/dist/esm/button-props/button-props.js +34 -0
- package/dist/esm/button-props/index.js +1 -0
- package/dist/esm/color-picker/index.js +11 -0
- package/dist/esm/custom-select-control/style.scss +7 -12
- package/dist/esm/footer/index.js +18 -25
- package/dist/esm/footer/style.scss +0 -36
- package/dist/esm/handoff-message/index.js +0 -3
- package/dist/esm/hooks/useObjectState.js +12 -2
- package/dist/esm/hooks/useObjectState.test.js +7 -7
- package/dist/esm/hooks/usePrompt.js +2 -2
- package/dist/esm/image-upload/index.test.js +2 -2
- package/dist/esm/index.js +1 -3
- package/dist/esm/modal/index.js +17 -19
- package/dist/esm/modal/style.scss +18 -7
- package/dist/esm/newspack-icon/index.js +2 -2
- package/dist/esm/newspack-icon/style.scss +3 -5
- package/dist/esm/notice/index.js +1 -2
- package/dist/esm/notice/style.scss +11 -9
- package/dist/esm/plugin-installer/index.js +3 -3
- package/dist/esm/plugin-settings/SettingsSection.js +2 -0
- package/dist/esm/plugin-settings/index.js +4 -1
- package/dist/esm/plugin-toggle/index.js +2 -0
- package/dist/esm/popover/style.scss +5 -6
- package/dist/esm/progress-bar/index.test.js +7 -7
- package/dist/esm/progress-bar/style.scss +1 -2
- package/dist/esm/radio-control/style.scss +8 -11
- package/dist/esm/section-header/index.js +22 -0
- package/dist/esm/select-control/ButtonGroupControl.js +2 -0
- package/dist/esm/settings/SettingsCard.js +2 -6
- package/dist/esm/sortable-newsletter-list-control/index.js +8 -6
- package/dist/esm/sortable-newsletter-list-control/style.scss +11 -1
- package/dist/esm/steps-list/style.scss +0 -3
- package/dist/esm/steps-list-item/style.scss +1 -2
- package/dist/esm/style-card/index.js +1 -0
- package/dist/esm/style-card/style.scss +4 -5
- package/dist/esm/style.scss +15 -0
- package/dist/esm/tabbed-navigation/index.js +17 -7
- package/dist/esm/tabbed-navigation/style.scss +2 -6
- package/dist/esm/utils/color.js +29 -0
- package/dist/esm/web-preview/index.js +1 -1
- package/dist/esm/web-preview/style.scss +11 -11
- package/dist/esm/with-wizard/index.js +81 -4
- package/dist/esm/with-wizard/style.scss +34 -13
- package/dist/esm/with-wizard-screen/index.js +1 -1
- package/dist/esm/with-wizard-screen/style.scss +9 -9
- package/dist/esm/wizard/index.js +39 -13
- package/dist/esm/wizard/store/index.js +14 -6
- package/dist/esm/wizard/store/utils.js +3 -1
- package/package.json +2 -2
- package/src/accordion/index.js +1 -3
- package/src/action-card/action-card.d.ts +40 -0
- package/src/action-card/index.js +284 -201
- package/src/action-card/style.scss +142 -44
- package/src/autocomplete-tokenfield/index.js +3 -2
- package/src/autocomplete-with-suggestions/index.js +52 -63
- package/src/box-contrast/index.tsx +44 -0
- package/src/button/index.tsx +1 -1
- package/src/button-card/index.js +1 -12
- package/src/card/index.js +1 -11
- package/src/category-autocomplete/index.js +4 -19
- package/src/color-picker/index.js +11 -7
- package/src/custom-select-control/style.scss +7 -12
- package/src/footer/index.js +6 -18
- package/src/footer/style.scss +0 -36
- package/src/form-token-field/index.js +1 -2
- package/src/grid/index.tsx +1 -8
- package/src/handoff/index.js +4 -11
- package/src/handoff-message/index.js +0 -3
- package/src/hooks/useObjectState.js +10 -2
- package/src/hooks/useObjectState.test.js +14 -14
- package/src/image-upload/index.js +3 -23
- package/src/index.js +1 -3
- package/src/modal/index.js +11 -17
- package/src/modal/style.scss +18 -7
- package/src/newspack-icon/index.js +3 -14
- package/src/newspack-icon/style.scss +3 -5
- package/src/notice/index.js +0 -2
- package/src/notice/style.scss +11 -9
- package/src/plugin-installer/index.js +8 -17
- package/src/plugin-settings/SettingsSection.js +3 -7
- package/src/plugin-settings/index.js +7 -14
- package/src/plugin-toggle/README.md +3 -3
- package/src/plugin-toggle/index.js +10 -13
- package/src/popover/index.js +1 -5
- package/src/popover/style.scss +5 -6
- package/src/position-control/index.js +65 -75
- package/src/progress-bar/index.js +2 -9
- package/src/progress-bar/index.test.js +4 -13
- package/src/progress-bar/style.scss +1 -2
- package/src/radio-control/style.scss +8 -11
- package/src/section-header/index.js +20 -0
- package/src/select-control/ButtonGroupControl.js +2 -9
- package/src/select-control/GroupedSelectControl.js +1 -9
- package/src/select-control/index.js +1 -5
- package/src/settings/MinMaxSetting.js +2 -14
- package/src/settings/SettingsCard.js +2 -11
- package/src/sortable-newsletter-list-control/index.js +10 -26
- package/src/sortable-newsletter-list-control/style.scss +11 -1
- package/src/steps-list/style.scss +0 -3
- package/src/steps-list-item/index.js +1 -4
- package/src/steps-list-item/style.scss +1 -2
- package/src/style-card/index.js +6 -21
- package/src/style-card/style.scss +4 -5
- package/src/style.scss +15 -0
- package/src/tabbed-navigation/index.js +19 -7
- package/src/tabbed-navigation/style.scss +2 -6
- package/src/text-control/index.tsx +2 -12
- package/src/utils/color.ts +32 -0
- package/src/web-preview/style.scss +11 -11
- package/src/with-wizard/index.js +67 -16
- package/src/with-wizard/style.scss +34 -13
- package/src/with-wizard-screen/index.js +1 -1
- package/src/with-wizard-screen/style.scss +9 -9
- package/src/wizard/components/WizardError.js +2 -7
- package/src/wizard/index.js +64 -62
- package/src/wizard/store/index.js +8 -10
- package/src/wizard/store/utils.js +3 -4
- package/dist/cjs/date-range-picker/index.js +0 -39
- package/dist/cjs/date-range-picker/style.scss +0 -148
- package/dist/cjs/newspack-logo/index.js +0 -54
- package/dist/cjs/newspack-logo/style.scss +0 -30
- package/dist/cjs/patrons-logo/index.js +0 -77
- package/dist/esm/date-range-picker/index.js +0 -31
- package/dist/esm/date-range-picker/style.scss +0 -148
- package/dist/esm/newspack-logo/index.js +0 -46
- package/dist/esm/newspack-logo/style.scss +0 -30
- package/dist/esm/patrons-logo/index.js +0 -70
- package/shared/scss/_colors.scss +0 -27
- package/src/date-range-picker/index.js +0 -31
- package/src/date-range-picker/style.scss +0 -148
- package/src/newspack-logo/index.js +0 -45
- package/src/newspack-logo/style.scss +0 -30
- package/src/patrons-logo/index.js +0 -76
- /package/{shared/js → src/button-props}/button-props.js +0 -0
- /package/{shared/js → src/button-props}/index.js +0 -0
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
padding: 0;
|
|
10
10
|
border-color: wp-colors.$gray-300;
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
/* Clickable */
|
|
14
13
|
&.newspack-card--is-clickable {
|
|
15
14
|
transition: box-shadow 125ms ease-in-out;
|
|
16
15
|
|
|
@@ -19,8 +18,7 @@
|
|
|
19
18
|
}
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
/* Status */
|
|
24
22
|
&.newspack-card__is-disabled,
|
|
25
23
|
&.newspack-card__is-primary,
|
|
26
24
|
&.newspack-card__is-secondary,
|
|
@@ -49,7 +47,7 @@
|
|
|
49
47
|
box-shadow: inset 4px 0 0 wp-colors.$alert-red;
|
|
50
48
|
}
|
|
51
49
|
|
|
52
|
-
|
|
50
|
+
/* Small */
|
|
53
51
|
&.is-small {
|
|
54
52
|
.newspack-action-card__region-top {
|
|
55
53
|
padding: 8px 16px;
|
|
@@ -116,8 +114,7 @@
|
|
|
116
114
|
}
|
|
117
115
|
}
|
|
118
116
|
|
|
119
|
-
|
|
120
|
-
|
|
117
|
+
/* Medium */
|
|
121
118
|
&.is-medium {
|
|
122
119
|
.newspack-action-card__region-top {
|
|
123
120
|
padding: 16px;
|
|
@@ -146,8 +143,7 @@
|
|
|
146
143
|
}
|
|
147
144
|
}
|
|
148
145
|
|
|
149
|
-
|
|
150
|
-
|
|
146
|
+
/* Nested children */
|
|
151
147
|
&.newspack-card--has-children {
|
|
152
148
|
.newspack-action-card {
|
|
153
149
|
&:first-child {
|
|
@@ -164,8 +160,7 @@
|
|
|
164
160
|
}
|
|
165
161
|
}
|
|
166
162
|
|
|
167
|
-
|
|
168
|
-
|
|
163
|
+
/* Has grey header */
|
|
169
164
|
&.newspack-card--has-grey-header {
|
|
170
165
|
overflow: hidden;
|
|
171
166
|
|
|
@@ -198,8 +193,7 @@
|
|
|
198
193
|
}
|
|
199
194
|
}
|
|
200
195
|
|
|
201
|
-
|
|
202
|
-
|
|
196
|
+
/* Indent */
|
|
203
197
|
&.newspack-card--indent {
|
|
204
198
|
margin-left: 56px;
|
|
205
199
|
position: relative;
|
|
@@ -216,8 +210,7 @@
|
|
|
216
210
|
}
|
|
217
211
|
}
|
|
218
212
|
|
|
219
|
-
|
|
220
|
-
|
|
213
|
+
/* Typography */
|
|
221
214
|
h2,
|
|
222
215
|
p:not([class*="components-base-control"]) {
|
|
223
216
|
margin: 0;
|
|
@@ -247,8 +240,7 @@
|
|
|
247
240
|
}
|
|
248
241
|
}
|
|
249
242
|
|
|
250
|
-
|
|
251
|
-
|
|
243
|
+
/* Regions */
|
|
252
244
|
.newspack-action-card__region {
|
|
253
245
|
align-items: center;
|
|
254
246
|
display: flex;
|
|
@@ -264,7 +256,7 @@
|
|
|
264
256
|
display: flex;
|
|
265
257
|
}
|
|
266
258
|
|
|
267
|
-
|
|
259
|
+
/* Toggle Control */
|
|
268
260
|
.components-toggle-control {
|
|
269
261
|
margin-bottom: 24px;
|
|
270
262
|
margin-top: 0;
|
|
@@ -359,14 +351,12 @@
|
|
|
359
351
|
}
|
|
360
352
|
}
|
|
361
353
|
|
|
362
|
-
|
|
363
|
-
|
|
354
|
+
/* Waiting */
|
|
364
355
|
.newspack-action-card__container {
|
|
365
356
|
display: flex;
|
|
366
357
|
}
|
|
367
358
|
|
|
368
|
-
|
|
369
|
-
|
|
359
|
+
/* Notifications */
|
|
370
360
|
.newspack-action-card__notification {
|
|
371
361
|
.newspack-notice {
|
|
372
362
|
margin: 0;
|
|
@@ -383,8 +373,7 @@
|
|
|
383
373
|
}
|
|
384
374
|
}
|
|
385
375
|
|
|
386
|
-
|
|
387
|
-
|
|
376
|
+
/* Image */
|
|
388
377
|
.newspack-action-card__image {
|
|
389
378
|
background-position: center;
|
|
390
379
|
background-repeat: no-repeat;
|
|
@@ -394,40 +383,52 @@
|
|
|
394
383
|
width: 48px;
|
|
395
384
|
}
|
|
396
385
|
|
|
397
|
-
|
|
398
|
-
|
|
386
|
+
/* Icon */
|
|
399
387
|
.newspack_plugin-installer__icon {
|
|
400
388
|
margin: 0;
|
|
401
389
|
}
|
|
402
390
|
|
|
403
|
-
|
|
404
|
-
|
|
391
|
+
/* Badge */
|
|
405
392
|
.newspack-action-card__badge {
|
|
406
393
|
background: wp-colors.$gray-100;
|
|
407
394
|
border-radius: 2px;
|
|
408
395
|
color: wp-colors.$gray-900;
|
|
409
396
|
display: block;
|
|
410
397
|
flex: 0 0 auto;
|
|
411
|
-
font-size:
|
|
412
|
-
font-weight:
|
|
413
|
-
line-height: 1.
|
|
398
|
+
font-size: 12px;
|
|
399
|
+
font-weight: 400;
|
|
400
|
+
line-height: 1.333;
|
|
414
401
|
margin: 0 8px 0 0;
|
|
415
|
-
padding: 2px
|
|
416
|
-
|
|
402
|
+
padding: 2px 4px;
|
|
403
|
+
|
|
404
|
+
&.newspack-action-card__badge-level-warning {
|
|
405
|
+
background-color: color-mix(in srgb, #fff 90%, wp-colors.$alert-yellow);
|
|
406
|
+
color: color-mix(in srgb, #000 50%, wp-colors.$alert-yellow);
|
|
407
|
+
}
|
|
408
|
+
&.newspack-action-card__badge-level-error {
|
|
409
|
+
background-color: color-mix(in srgb, #fff 90%, wp-colors.$alert-red);
|
|
410
|
+
color: color-mix(in srgb, #000 50%, wp-colors.$alert-red);
|
|
411
|
+
}
|
|
412
|
+
&.newspack-action-card__badge-level-success {
|
|
413
|
+
background-color: color-mix(in srgb, #fff 90%, wp-colors.$alert-green);
|
|
414
|
+
color: color-mix(in srgb, #000 50%, wp-colors.$alert-green);
|
|
415
|
+
}
|
|
416
|
+
&.newspack-action-card__badge-level-brand {
|
|
417
|
+
background-color: color-mix(in srgb, #fff 90%, var(--wp-admin-theme-color));
|
|
418
|
+
color: color-mix(in srgb, #000 50%, var(--wp-admin-theme-color));
|
|
419
|
+
}
|
|
417
420
|
|
|
418
421
|
+ .newspack-action-card__badge {
|
|
419
422
|
margin-left: -4px;
|
|
420
423
|
}
|
|
421
424
|
}
|
|
422
425
|
|
|
423
|
-
|
|
424
|
-
|
|
426
|
+
/* Description Card */
|
|
425
427
|
&.newspack-description-card {
|
|
426
428
|
font-style: italic;
|
|
427
429
|
}
|
|
428
430
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
+
/* Expandable card children */
|
|
431
432
|
&.is-expandable {
|
|
432
433
|
.newspack-action-card__title .components-button.is-link {
|
|
433
434
|
color: inherit;
|
|
@@ -439,6 +440,10 @@
|
|
|
439
440
|
.newspack-action-card__region-children {
|
|
440
441
|
border-top: 1px solid wp-colors.$gray-100;
|
|
441
442
|
padding-top: 24px;
|
|
443
|
+
|
|
444
|
+
+ .newspack-action-card__region-children {
|
|
445
|
+
border-top: none;
|
|
446
|
+
}
|
|
442
447
|
}
|
|
443
448
|
|
|
444
449
|
&.is-medium .newspack-action-card__region-children {
|
|
@@ -460,7 +465,7 @@
|
|
|
460
465
|
}
|
|
461
466
|
}
|
|
462
467
|
|
|
463
|
-
|
|
468
|
+
/* Action content with multiple buttons */
|
|
464
469
|
&.has-action-content .newspack-action-card__region-right {
|
|
465
470
|
flex-direction: row;
|
|
466
471
|
|
|
@@ -468,16 +473,109 @@
|
|
|
468
473
|
margin-left: 8px;
|
|
469
474
|
}
|
|
470
475
|
}
|
|
476
|
+
}
|
|
471
477
|
|
|
472
|
-
|
|
478
|
+
.newspack-card {
|
|
479
|
+
.newspack-card.newspack-action-card {
|
|
480
|
+
&:not(.newspack-card__no-border) {
|
|
481
|
+
border: 1px solid wp-colors.$gray-200;
|
|
482
|
+
}
|
|
483
|
+
&.newspack-card__no-border {
|
|
484
|
+
border: none;
|
|
485
|
+
.newspack-action-card__region-top,
|
|
486
|
+
.newspack-action-card__region-children {
|
|
487
|
+
padding: 0;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
.newspack-action-card__draggable-wrapper {
|
|
494
|
+
margin: 16px 0;
|
|
473
495
|
|
|
474
|
-
|
|
475
|
-
|
|
496
|
+
&.is-dragging {
|
|
497
|
+
opacity: 0.5;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
.newspack-card {
|
|
501
|
+
margin: 0;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
.newspack-action-card {
|
|
505
|
+
display: flex;
|
|
506
|
+
flex-direction: row;
|
|
507
|
+
flex-wrap: wrap;
|
|
508
|
+
|
|
509
|
+
.newspack-action-card__draggable-controls {
|
|
510
|
+
flex: 0 0 50px;
|
|
511
|
+
align-items: center;
|
|
512
|
+
display: flex;
|
|
513
|
+
height: 100%;
|
|
514
|
+
min-height: 100%;
|
|
515
|
+
width: fit-content;
|
|
516
|
+
justify-content: center;
|
|
517
|
+
margin-left: 8px;
|
|
518
|
+
margin-right: 8px;
|
|
519
|
+
padding: 8px 12px 8px 0;
|
|
520
|
+
border-right: 1px solid wp-colors.$gray-300;
|
|
521
|
+
|
|
522
|
+
.drag-handle {
|
|
523
|
+
align-items: center;
|
|
524
|
+
cursor: grab;
|
|
525
|
+
display: flex;
|
|
526
|
+
height: 100%;
|
|
527
|
+
justify-content: flex-end;
|
|
528
|
+
margin-left: -8px;
|
|
529
|
+
width: 32px;
|
|
530
|
+
|
|
531
|
+
.is-dragging & {
|
|
532
|
+
cursor: grabbing;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
svg {
|
|
536
|
+
padding: 3px;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
.movers {
|
|
541
|
+
display: flex;
|
|
542
|
+
flex-direction: column;
|
|
543
|
+
|
|
544
|
+
.components-button {
|
|
545
|
+
color: wp-colors.$gray-900;
|
|
546
|
+
display: block;
|
|
547
|
+
height: 24px;
|
|
548
|
+
line-height: 24px;
|
|
549
|
+
min-width: 24px;
|
|
550
|
+
padding: 0;
|
|
551
|
+
width: 24px;
|
|
552
|
+
+ .components-button {
|
|
553
|
+
margin-top: -4px;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
.newspack-action-card__region-top {
|
|
560
|
+
flex: 1 1 auto;
|
|
561
|
+
padding: 8px 16px 8px 0 !important;
|
|
562
|
+
flex: 1;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
.newspack-action-card__region-children {
|
|
566
|
+
flex: 0 0 100%;
|
|
567
|
+
padding: 0 0 0 16px;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
&.is-draggable {
|
|
571
|
+
display: flex;
|
|
572
|
+
align-items: center;
|
|
573
|
+
}
|
|
476
574
|
}
|
|
477
575
|
}
|
|
478
576
|
|
|
479
|
-
.
|
|
480
|
-
.newspack-card
|
|
481
|
-
|
|
577
|
+
.components-draggable__clone {
|
|
578
|
+
.newspack-card {
|
|
579
|
+
box-shadow: 0 0 8px 4px rgba(black, 0.08);
|
|
482
580
|
}
|
|
483
581
|
}
|
|
@@ -228,7 +228,9 @@ class AutocompleteTokenField extends Component {
|
|
|
228
228
|
help,
|
|
229
229
|
label = '',
|
|
230
230
|
placeholder = '',
|
|
231
|
-
maxLength
|
|
231
|
+
maxLength,
|
|
232
|
+
style,
|
|
233
|
+
__next40pxDefaultSize
|
|
232
234
|
} = this.props;
|
|
233
235
|
const {
|
|
234
236
|
suggestions,
|
|
@@ -240,6 +242,7 @@ class AutocompleteTokenField extends Component {
|
|
|
240
242
|
}
|
|
241
243
|
return /*#__PURE__*/_jsxs("div", {
|
|
242
244
|
className: "newspack-autocomplete-tokenfield",
|
|
245
|
+
style: style,
|
|
243
246
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
244
247
|
className: classNames.join(' '),
|
|
245
248
|
children: [/*#__PURE__*/_jsx(FormTokenField, {
|
|
@@ -249,7 +252,8 @@ class AutocompleteTokenField extends Component {
|
|
|
249
252
|
onInputChange: input => this.debouncedUpdateSuggestions(input),
|
|
250
253
|
label: label,
|
|
251
254
|
maxLength: maxLength,
|
|
252
|
-
placeholder: placeholder
|
|
255
|
+
placeholder: placeholder,
|
|
256
|
+
__next40pxDefaultSize: __next40pxDefaultSize
|
|
253
257
|
}), loading && /*#__PURE__*/_jsx(Spinner, {})]
|
|
254
258
|
}), help && /*#__PURE__*/_jsx("p", {
|
|
255
259
|
className: "newspack-autocomplete-tokenfield__help",
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Box Contrast
|
|
3
|
+
*
|
|
4
|
+
* can be used to dynamically assign black or white color/background-color based on a hex color.
|
|
5
|
+
* Black/white can be assigned to either text or background-color.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Dependencies
|
|
10
|
+
*/
|
|
11
|
+
import { getContrast } from '../utils/color';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Box Contrast component
|
|
15
|
+
*
|
|
16
|
+
* @return JSX.Element
|
|
17
|
+
*/
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
const BoxContrast = ({
|
|
20
|
+
hexColor,
|
|
21
|
+
isInverted = false,
|
|
22
|
+
children,
|
|
23
|
+
...props
|
|
24
|
+
}) => {
|
|
25
|
+
let contrastColor;
|
|
26
|
+
if (hexColor === '#f0f0f0') {
|
|
27
|
+
contrastColor = '#1e1e1e';
|
|
28
|
+
} else {
|
|
29
|
+
contrastColor = getContrast(hexColor);
|
|
30
|
+
}
|
|
31
|
+
const style = isInverted ? {
|
|
32
|
+
color: hexColor,
|
|
33
|
+
backgoundColor: contrastColor
|
|
34
|
+
} : {
|
|
35
|
+
backgroundColor: hexColor,
|
|
36
|
+
color: contrastColor
|
|
37
|
+
};
|
|
38
|
+
return /*#__PURE__*/_jsx("div", {
|
|
39
|
+
...props,
|
|
40
|
+
style: style,
|
|
41
|
+
children: children
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
export default BoxContrast;
|
package/dist/esm/button/index.js
CHANGED
|
@@ -40,7 +40,7 @@ const Button = ({
|
|
|
40
40
|
if (isAwaitingOnClick) {
|
|
41
41
|
otherProps.disabled = true;
|
|
42
42
|
}
|
|
43
|
-
// @ts-
|
|
43
|
+
// @ts-expect-error - @wordpress/components' Button can only have either href or onClick, not both.
|
|
44
44
|
return /*#__PURE__*/_jsx(BaseComponent, {
|
|
45
45
|
...otherProps
|
|
46
46
|
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import isFunction from 'lodash/isFunction';
|
|
5
|
+
import isObject from 'lodash/isObject';
|
|
6
|
+
import isString from 'lodash/isString';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Creates button props based on an action
|
|
10
|
+
*/
|
|
11
|
+
export default function buttonProps(action) {
|
|
12
|
+
const props = {};
|
|
13
|
+
if (isFunction(action)) {
|
|
14
|
+
props.onClick = action;
|
|
15
|
+
}
|
|
16
|
+
if (isString(action)) {
|
|
17
|
+
props.href = action;
|
|
18
|
+
}
|
|
19
|
+
if (isObject(action)) {
|
|
20
|
+
if (action.handoff) {
|
|
21
|
+
props.plugin = action.handoff;
|
|
22
|
+
if (action.editLink) {
|
|
23
|
+
props.editLink = action.editLink;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (action.onClick) {
|
|
27
|
+
props.onClick = action.onClick;
|
|
28
|
+
}
|
|
29
|
+
if (action.href) {
|
|
30
|
+
props.href = action.href;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return props;
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as buttonProps } from './button-props';
|
|
@@ -22,6 +22,17 @@ extend([a11yPlugin]);
|
|
|
22
22
|
const {
|
|
23
23
|
InteractiveDiv
|
|
24
24
|
} = utils;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* ColorPicker component.
|
|
28
|
+
*
|
|
29
|
+
* @param {Object} props - Component props.
|
|
30
|
+
* @param {JSX.Element|string} props.label - Label for the color picker.
|
|
31
|
+
* @param {string} [props.color] - Default color.
|
|
32
|
+
* @param {Function} props.onChange - Function to call when the color changes.
|
|
33
|
+
* @param {string} [props.className] - Additional class name.
|
|
34
|
+
* @return {JSX.Element} ColorPicker component.
|
|
35
|
+
*/
|
|
25
36
|
const ColorPicker = ({
|
|
26
37
|
label,
|
|
27
38
|
color = '#fff',
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
margin-bottom: 8px;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
button {
|
|
14
14
|
border-color: wp-colors.$gray-700;
|
|
15
15
|
border-radius: 2px;
|
|
16
16
|
color: wp-colors.$gray-900;
|
|
@@ -41,6 +41,10 @@
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
button + div {
|
|
45
|
+
min-width: 200px;
|
|
46
|
+
}
|
|
47
|
+
|
|
44
48
|
.components-custom-select-control__menu {
|
|
45
49
|
border-color: wp-colors.$gray-700;
|
|
46
50
|
border-radius: 2px;
|
|
@@ -54,7 +58,6 @@
|
|
|
54
58
|
cursor: pointer;
|
|
55
59
|
display: flex;
|
|
56
60
|
line-height: inherit;
|
|
57
|
-
margin: 0 0 0 28px;
|
|
58
61
|
padding: 6px 8px;
|
|
59
62
|
transition: color 125ms ease-in-out;
|
|
60
63
|
|
|
@@ -77,16 +80,8 @@
|
|
|
77
80
|
|
|
78
81
|
&.is-selected {
|
|
79
82
|
margin-left: 0;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
background:
|
|
83
|
-
url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cGF0aCBkPSJNMTguMyA1LjZMOS45IDE2LjlsLTQuNi0zLjQtLjkgMS4yIDUuOCA0LjMgOS4zLTEyLjZ6IiBmaWxsPSIjMzM2NmZmIj48L3BhdGg+PC9zdmc+Cg==")
|
|
84
|
-
0 0 no-repeat;
|
|
85
|
-
content: "";
|
|
86
|
-
display: block;
|
|
87
|
-
height: 24px;
|
|
88
|
-
margin: 0 4px 0 0;
|
|
89
|
-
width: 24px;
|
|
83
|
+
span svg {
|
|
84
|
+
fill: var(--wp-admin-theme-color);
|
|
90
85
|
}
|
|
91
86
|
}
|
|
92
87
|
}
|
package/dist/esm/footer/index.js
CHANGED
|
@@ -11,11 +11,10 @@ import { ExternalLink } from '@wordpress/components';
|
|
|
11
11
|
/**
|
|
12
12
|
* Internal dependencies.
|
|
13
13
|
*/
|
|
14
|
-
import { PatronsLogo } from '../';
|
|
15
14
|
import './style.scss';
|
|
16
|
-
import { jsx as _jsx
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
16
|
const Footer = ({
|
|
18
|
-
simple
|
|
17
|
+
simple = undefined
|
|
19
18
|
}) => {
|
|
20
19
|
const {
|
|
21
20
|
components_demo: componentsDemo = false,
|
|
@@ -71,29 +70,23 @@ const Footer = ({
|
|
|
71
70
|
url: `mailto:${supportEmail}`
|
|
72
71
|
});
|
|
73
72
|
}
|
|
74
|
-
return /*#__PURE__*/
|
|
73
|
+
return /*#__PURE__*/_jsx("div", {
|
|
75
74
|
className: "newspack-footer",
|
|
76
|
-
children:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
children:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}, index))
|
|
92
|
-
})
|
|
93
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
94
|
-
className: "newspack-footer__logo",
|
|
95
|
-
children: /*#__PURE__*/_jsx(PatronsLogo, {})
|
|
96
|
-
})]
|
|
75
|
+
children: !simple && /*#__PURE__*/_jsx("ul", {
|
|
76
|
+
children: footerElements.map(({
|
|
77
|
+
url,
|
|
78
|
+
label,
|
|
79
|
+
external
|
|
80
|
+
}, index) => /*#__PURE__*/_jsx("li", {
|
|
81
|
+
children: external ? /*#__PURE__*/_jsx(ExternalLink, {
|
|
82
|
+
href: url,
|
|
83
|
+
children: label
|
|
84
|
+
}) : /*#__PURE__*/_jsx("a", {
|
|
85
|
+
href: url,
|
|
86
|
+
children: label
|
|
87
|
+
})
|
|
88
|
+
}, index))
|
|
89
|
+
})
|
|
97
90
|
});
|
|
98
91
|
};
|
|
99
92
|
export default Footer;
|
|
@@ -5,16 +5,13 @@
|
|
|
5
5
|
@use "~@wordpress/base-styles/colors" as wp-colors;
|
|
6
6
|
|
|
7
7
|
.newspack-footer {
|
|
8
|
-
align-items: stretch;
|
|
9
8
|
background: white;
|
|
10
9
|
border: 0 solid wp-colors.$gray-300;
|
|
11
10
|
border-width: 1px 0;
|
|
12
11
|
bottom: 0;
|
|
13
12
|
color: wp-colors.$gray-700;
|
|
14
13
|
display: flex;
|
|
15
|
-
flex-wrap: wrap;
|
|
16
14
|
font-size: 12px;
|
|
17
|
-
justify-content: space-between;
|
|
18
15
|
left: 0;
|
|
19
16
|
line-height: 16px;
|
|
20
17
|
position: absolute;
|
|
@@ -22,17 +19,6 @@
|
|
|
22
19
|
|
|
23
20
|
@media screen and ( min-width: 783px ) {
|
|
24
21
|
bottom: 40px;
|
|
25
|
-
flex-wrap: nowrap;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&__inner {
|
|
29
|
-
align-items: center;
|
|
30
|
-
display: flex;
|
|
31
|
-
flex: 0 0 100%;
|
|
32
|
-
|
|
33
|
-
@media screen and ( min-width: 783px ) {
|
|
34
|
-
flex: 1 1 auto;
|
|
35
|
-
}
|
|
36
22
|
}
|
|
37
23
|
|
|
38
24
|
ul {
|
|
@@ -57,26 +43,4 @@
|
|
|
57
43
|
}
|
|
58
44
|
}
|
|
59
45
|
}
|
|
60
|
-
|
|
61
|
-
&__logo {
|
|
62
|
-
align-items: center;
|
|
63
|
-
background: wp-colors.$gray-900;
|
|
64
|
-
display: flex;
|
|
65
|
-
margin: 0 0 -1px;
|
|
66
|
-
padding: 16px;
|
|
67
|
-
width: 100%;
|
|
68
|
-
|
|
69
|
-
@media screen and ( min-width: 783px ) {
|
|
70
|
-
margin: -1px 0 -1px 8px;
|
|
71
|
-
max-width: 33.33%;
|
|
72
|
-
width: auto;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.patrons-logo {
|
|
76
|
-
display: block;
|
|
77
|
-
fill: white;
|
|
78
|
-
max-height: 16px;
|
|
79
|
-
width: auto;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
46
|
}
|
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
import { useState } from '@wordpress/element';
|
|
5
5
|
import isArray from 'lodash/isArray';
|
|
6
6
|
import mergeWith from 'lodash/mergeWith';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {Object} StateObjectUpdate
|
|
10
|
+
* @property {Object.<string, any>} [update] The update object with key-value pairs to merge into the state.
|
|
11
|
+
*/
|
|
12
|
+
|
|
7
13
|
const mergeCustomizer = (objValue, srcValue) => {
|
|
8
14
|
if (isArray(objValue)) {
|
|
9
15
|
// If it's an array, replace it (instead of concatenating).
|
|
@@ -14,8 +20,12 @@ const mergeCustomizer = (objValue, srcValue) => {
|
|
|
14
20
|
/**
|
|
15
21
|
* A useState for an object.
|
|
16
22
|
* Nested objects will be nested, but arrays replaced.
|
|
23
|
+
*
|
|
24
|
+
* @template T
|
|
25
|
+
* @param {T} initial Initial state object.
|
|
26
|
+
* @return {[T, (keyOrUpdate: string | Partial<T>) => (value?: any) => void]} The state object and a function to update it.
|
|
17
27
|
*/
|
|
18
|
-
export default (
|
|
28
|
+
export default (initial = {}) => {
|
|
19
29
|
const [stateObject, setStateObject] = useState(initial);
|
|
20
30
|
const runUpdate = update => setStateObject(_stateObject => mergeWith({}, _stateObject, update, mergeCustomizer));
|
|
21
31
|
const updateStateObject = keyOrUpdate => {
|
|
@@ -27,4 +37,4 @@ export default ((initial = {}) => {
|
|
|
27
37
|
runUpdate(keyOrUpdate);
|
|
28
38
|
};
|
|
29
39
|
return [stateObject, updateStateObject];
|
|
30
|
-
}
|
|
40
|
+
};
|