@cdc/data-bite 4.25.10 → 4.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,3 @@
1
-
2
1
  &.theme-blue {
3
2
  .bite-value {
4
3
  color: var(--primary);
@@ -80,6 +79,7 @@
80
79
  }
81
80
 
82
81
  .cove-component__content {
82
+ padding: 0;
83
83
  // Visual: Shadow
84
84
  &.shadow {
85
85
  box-shadow: rgba(0, 0, 0, 0.2) 0 3px 10px;
@@ -116,6 +116,89 @@
116
116
  }
117
117
  }
118
118
 
119
+ // TP5 Style (default: callout with blue background)
120
+ &.bite__style--tp5 {
121
+ padding: 0 !important;
122
+ border: none !important;
123
+ height: 100%; // Allow height to fill parent container
124
+ background: none !important;
125
+ container-type: inline-size;
126
+
127
+ .cdc-callout {
128
+ gap: 0.7rem;
129
+ box-shadow: 0 2px 4px rgb(159 159 159 / 10%);
130
+ border: 1px solid #dff2f6 !important;
131
+ margin: 0 !important;
132
+ padding: 1.25rem;
133
+ border-radius: 0.25rem;
134
+ background-color: var(--colors-cyan-10, #eff9fa);
135
+ }
136
+
137
+ // Most layout handled by Bootstrap classes in JSX, minimal custom CSS
138
+ .cdc-callout__heading {
139
+ padding-right: 1.5rem;
140
+ width: 100%;
141
+ font-size: 1.1rem;
142
+ font-family: var(--fonts-nunito) !important;
143
+ }
144
+
145
+ .cdc-callout__body {
146
+ flex-wrap: nowrap;
147
+ gap: 0.5rem;
148
+ flex: auto;
149
+ }
150
+
151
+ // Container query: wrap when width is less than 576px
152
+ @container (max-width: 576px) {
153
+ .cdc-callout__body {
154
+ flex-wrap: wrap;
155
+ }
156
+ }
157
+
158
+ .cdc-callout__databite {
159
+ padding-top: 2px;
160
+ width: auto;
161
+ line-height: 1; // Tight line height for numbers
162
+ color: var(--colors-cyan-60v, #007a99);
163
+ font-size: 2rem;
164
+ }
165
+
166
+ .cdc-callout__flag {
167
+ position: absolute;
168
+ top: -0.36rem;
169
+ right: 1.08rem;
170
+ width: 1.84rem;
171
+ height: auto;
172
+ }
173
+
174
+ .cdc-callout__content {
175
+ font-size: 1rem;
176
+ }
177
+
178
+ .bite-subtext {
179
+ margin-top: auto; // Push to bottom on desktop
180
+ font-style: italic;
181
+ }
182
+
183
+ // White background variant (when "Use White Background Style" is checked)
184
+ &.white-background-style {
185
+ background: white;
186
+
187
+ .cdc-callout {
188
+ border: 1px solid #009ec1 !important;
189
+ background: transparent;
190
+ box-shadow: 0 2px 4px rgb(159 159 159 / 10%);
191
+ }
192
+ }
193
+
194
+ // White background with border (when both white background and Display Border are checked)
195
+ &.white-background-style.display-border {
196
+ .cdc-callout {
197
+ box-shadow: 0 2px 4px rgb(159 159 159 / 10%);
198
+ }
199
+ }
200
+ }
201
+
119
202
  // General: Compact View
120
203
  &.bite--isCompactStyle .bite .cove-component__content .bite-content {
121
204
  align-items: center;
@@ -1,3 +1,6 @@
1
+ // Data-bite-specific Editor Panel Styles
2
+ // Common editor panel styles are imported from @cdc/core/styles/editor-panel-base via cove-main.scss
3
+
1
4
  .spacing-wrapper {
2
5
  padding-left: 350px;
3
6
  }
@@ -10,9 +13,11 @@
10
13
  .text-center {
11
14
  text-align: center;
12
15
  }
16
+
13
17
  .text-capitalize {
14
18
  text-transform: capitalize;
15
19
  }
20
+
16
21
  .two-col-inputs {
17
22
  display: flex;
18
23
  margin-top: 1em;
@@ -22,518 +27,37 @@
22
27
  margin-top: 0 !important;
23
28
  }
24
29
  }
25
- .divider-heading {
26
- display: block;
27
- font-size: 1em;
28
- margin-top: 1em;
29
- }
30
- .series-list {
31
- list-style: none;
32
- border: $lightGray 1px solid;
33
- &:empty {
34
- border: none !important;
35
- }
36
- li {
37
- padding: 0.3em 0.5em;
38
- display: flex;
39
- align-items: center;
40
- justify-content: space-between;
41
- font-size: 0.9em;
42
- &:hover {
43
- background-color: $lightestGray;
44
- }
45
- span {
46
- font-size: 0.8em;
47
- color: #f00;
48
- cursor: pointer;
49
- }
50
- + li {
51
- border-top: $lightGray 1px solid;
52
- }
53
- }
54
- }
55
- background: #fff;
56
- // width: $editorWidth;
57
- overflow-y: overlay;
58
- position: absolute;
59
- z-index: 8;
60
- display: flex;
61
- flex-direction: column;
62
- left: 0;
63
- top: 0;
64
- bottom: 0;
65
- .accordion__heading {
66
- background: $lightestGray;
67
- }
68
- .accordion__item {
69
- select {
70
- text-transform: capitalize;
71
- }
72
- .number-narrow {
73
- min-width: auto;
74
- width: 75px;
75
- }
76
- }
30
+
77
31
  .accordion__divider {
78
32
  border: 0;
79
33
  border-top: 1px solid #e2e2e2;
80
34
  margin-top: 1.5rem;
81
35
  margin-bottom: 1.5rem;
82
36
  }
83
- .form-container {
84
- border-right: $lightGray 1px solid;
85
- flex-grow: 1;
86
- }
87
- .guidance-link {
88
- margin: 2em 1em 0;
89
- padding: 0.75em 1em;
90
- svg {
91
- width: 60px;
92
- color: $blue;
93
- margin-right: 1rem;
94
- height: 60px; // IE11
95
- path {
96
- fill: currentColor;
97
- }
98
- }
99
- }
100
- .warning {
101
- color: #d8000c;
102
- background-color: #ffd2d2;
103
- padding: 0.75em 1em;
104
- margin: 1em 0;
105
- font-size: 0.8em;
106
- border: #d8000c 1px solid;
107
- border-radius: 0.4em;
108
- strong {
109
- font-weight: 600;
110
- display: block;
111
- }
112
- }
113
- .accordion__button {
114
- cursor: pointer;
115
- font-size: 1em;
116
- padding: 0.3em 1em;
117
- width: 100%;
118
- text-align: left;
119
- position: relative;
120
- border-bottom: 1px solid rgba(0, 0, 0, 0.2);
121
- }
122
- .accordion__panel:first-child {
123
- margin-top: 0;
124
- }
125
- .accordion__button:before {
126
- display: inline-block;
127
- content: '';
128
- height: 7px;
129
- width: 7px;
130
- margin-right: 1em;
131
- border-bottom: 2px solid currentColor;
132
- border-right: 2px solid currentColor;
133
- transform: rotate(-45deg);
134
- right: 0;
135
- position: absolute;
136
- top: 50%;
137
- transform: rotate(-45deg) translateY(-50%);
138
- transition: 0.1s all;
139
- }
140
-
141
- .accordion__button[aria-expanded='true']::before,
142
- .accordion__button[aria-selected='true']::before {
143
- transform: rotate(45deg) translateY(-50%);
144
- margin-right: 1.3em;
145
- transition: 0.1s all;
146
- }
147
-
148
- .accordion__panel {
149
- border-bottom: 1px solid rgba(0, 0, 0, 0.2);
150
- padding: 1em 1.25em 2em;
151
- animation: fadein 0.2s ease-in;
152
- h5 {
153
- font-size: 0.8em;
154
- }
155
-
156
- .accordion__panel-row {
157
- display: flex;
158
- justify-content: flex-start;
159
- margin-left: -4px;
160
- margin-right: -4px;
161
- margin-bottom: 0.75em;
162
- }
163
-
164
- .accordion__panel-col {
165
- flex: 0 0 0;
166
- padding-left: 4px;
167
- padding-right: 4px;
168
-
169
- select {
170
- padding: 0.425em 0.5em;
171
- }
172
-
173
- select.border-dashed {
174
- border: rgba(0, 0, 0, 0.3) 1px dashed !important;
175
- border-radius: 0.25rem;
176
- }
177
- }
178
-
179
- .d-flex {
180
- display: flex;
181
- }
182
-
183
- .align-center {
184
- align-items: center;
185
- }
186
-
187
- .justify-end {
188
- justify-content: flex-end;
189
- }
190
-
191
- .flex-grow {
192
- flex-grow: 1;
193
- }
194
- .flex-shrink {
195
- flex-shrink: 1;
196
- }
197
- .flex-auto {
198
- flex-basis: auto;
199
- }
200
- }
201
-
202
- .advanced {
203
- padding: 0 1em 1em;
204
- text-align: left;
205
- p {
206
- font-size: 0.8rem;
207
- }
208
- .advanced-toggle-link {
209
- padding-top: 1em;
210
- display: block;
211
- text-align: left;
212
- cursor: pointer;
213
- text-decoration: underline;
214
- span {
215
- text-decoration: none;
216
- display: inline-block;
217
- font-family: monospace;
218
- padding-right: 5px;
219
- }
220
- &:hover {
221
- color: rgba(0, 0, 0, 0.7);
222
- }
223
- }
224
- textarea {
225
- height: 400px;
226
- width: 100%;
227
- font-size: 0.9em;
228
- padding: 0.5em;
229
- font-family: monospace;
230
- box-sizing: border-box;
231
- }
232
- }
233
-
234
- @keyframes fadein {
235
- 0% {
236
- opacity: 0;
237
- }
238
-
239
- 100% {
240
- opacity: 1;
241
- }
242
- }
243
-
244
- .heading-2 {
245
- background: #565656;
246
- color: #fff;
247
- font-size: 1.1em;
248
- padding: 0.6em 1em;
249
- position: relative;
250
- border-bottom: #565656 3px solid;
251
- z-index: 3;
252
- }
253
37
 
254
38
  label {
255
- text-transform: uppercase;
256
- display: block;
257
- font-size: 0.8em;
258
- font-weight: 600;
259
- &:not(:first-child) {
260
- margin-top: 1em;
261
- }
262
39
  span.edit-label {
263
- margin-bottom: 0.3em;
264
- display: block;
265
- }
266
- span.column-heading {
267
- font-size: 1em;
268
- }
269
- &.checkbox {
270
40
  display: flex;
271
- span {
272
- display: inline;
273
- }
274
- input {
275
- margin-left: 0;
276
- width: inherit;
277
- display: inline;
278
- }
279
41
  }
280
42
  }
281
- input[type='text'],
282
- input[role='combobox'],
283
- input[type='number'],
284
- textarea {
285
- min-width: 100%;
286
- max-width: 100%; // Doing this prevents width of textarea from being changed
287
- }
43
+
288
44
  textarea {
289
45
  min-height: 140px;
290
46
  }
291
- .header .color-palette li {
292
- width: 21px;
293
- height: 21px;
294
- border-radius: 40px;
295
- margin-right: 2.8px;
296
- }
297
- .color-palette {
298
- display: flex;
299
- max-width: 100%;
300
- padding: 0;
301
- margin: 0.5em 0 0 0;
302
- list-style: none;
303
- flex-wrap: wrap;
304
- li {
305
- width: 45px;
306
- height: 23px;
307
- margin-right: 4px;
308
- margin-bottom: 10px;
309
- display: flex;
310
- border-radius: 5px;
311
- overflow: hidden;
312
- cursor: pointer;
313
- position: relative;
314
- .click-target {
315
- position: absolute;
316
- top: 0;
317
- left: 0;
318
- right: 0;
319
- bottom: 0;
320
- }
321
- &.selected {
322
- border: rgba(0, 0, 0, 0.8) 2px solid;
323
- }
324
- span {
325
- width: 33.3%;
326
- }
327
- }
328
- }
329
-
330
- fieldset {
331
- display: block;
332
- }
333
-
334
- .primary-fieldset {
335
- padding: 0;
336
- margin: 0;
337
- border: 0;
338
- }
339
47
 
340
48
  ul.column-edit {
341
- list-style: none;
342
- li {
343
- margin-top: 1em;
344
- }
345
- .three-col,
346
49
  .two-col {
347
50
  display: flex;
348
51
  justify-content: space-between;
349
- > label {
350
- margin-top: 0;
351
- display: inline-block;
352
- input[type='text'],
353
- input[type='number'] {
354
- width: 50px;
355
- }
356
- }
357
- }
358
- .three-col {
359
- > label {
360
- width: 30%;
361
- }
362
- }
363
- .two-col {
364
52
  > label {
365
53
  margin-top: 0;
366
54
  width: 49%;
367
55
  }
368
56
  }
369
57
  }
370
-
371
- &.hidden {
372
- display: none;
373
- }
374
-
375
- .remove-column {
376
- float: right;
377
- text-transform: uppercase;
378
- color: #c32b2b;
379
- font-size: 0.7em;
380
- line-height: 1.6em;
381
- border-radius: 5px;
382
- margin: 0 auto;
383
- transition: 0.1s all;
384
- border: 0;
385
- text-decoration: underline;
386
- outline: 0;
387
- cursor: pointer;
388
- font-weight: bold;
389
- }
390
-
391
- .edit-block {
392
- padding-left: 1em;
393
- border-left: rgba(0, 0, 0, 0.2) 4px solid;
394
- transition: 0.2s all;
395
- &:not(:first-child) {
396
- margin-top: 2em;
397
- }
398
- input[type='text'],
399
- input[type='number'] {
400
- font-size: 1em;
401
- }
402
- label {
403
- margin-top: 0;
404
- }
405
- label + label {
406
- margin-top: 1em;
407
- }
408
- &:hover {
409
- border-left: rgba(0, 0, 0, 0.7) 4px solid;
410
- transition: 0.2s all;
411
- }
412
- }
413
-
414
- span.subtext {
415
- display: block;
416
- color: rgba(0, 0, 0, 0.5);
417
- text-transform: none;
418
- font-weight: normal;
419
- }
420
-
421
- .sort-list {
422
- list-style: none;
423
- > li {
424
- margin-right: 0.3em;
425
- margin-bottom: 0.3em;
426
- }
427
- }
428
- .sort-list li > div {
429
- display: block;
430
- box-sizing: border-box;
431
- border: 1px solid #d1d1d1;
432
- border-radius: 2px;
433
- background: #f1f1f1;
434
- padding: 0.4em 0.6em;
435
- font-size: 0.8em;
436
- margin-bottom: 0.3em;
437
- cursor: move;
438
- }
439
-
440
- .info {
441
- font-size: 0.8em;
442
- line-height: 1.4em;
443
- font-style: italic;
444
- padding-top: 10px;
445
- }
446
-
447
- .react-tags__search {
448
- width: 100%;
449
- }
450
-
451
- .react-tags {
452
- position: relative;
453
- input.react-tags__search-input {
454
- font-size: 0.8rem;
455
- }
456
- /* clicking anywhere will focus the input */
457
- cursor: text;
458
- span {
459
- display: inline;
460
- }
461
- }
462
-
463
- .react-tags.is-focused {
464
- border-color: rgba(0, 0, 0, 0.7);
465
- }
466
-
467
- .react-tags__selected {
468
- display: inline;
469
- }
470
-
471
- .react-tags__selected-tag {
472
- display: inline-block;
473
- box-sizing: border-box;
474
- border: 1px solid #d1d1d1;
475
- border-radius: 2px;
476
- background: #f1f1f1;
477
- padding: 0.4em 0.6em;
478
- font-size: 0.8em;
479
- margin-right: 0.3em;
480
- margin-bottom: 0.3em;
481
- }
482
-
483
- .react-tags__selected-tag:after {
484
- content: '\2715';
485
- color: #aaa;
486
- margin-left: 8px;
487
- }
488
-
489
- .react-tags__selected-tag:hover,
490
- .react-tags__selected-tag:focus {
491
- border-color: #b1b1b1;
492
- }
493
-
494
- .react-tags__search {
495
- display: inline-block;
496
-
497
- /* prevent autoresize overflowing the container */
498
- max-width: 100%;
499
- }
500
-
501
- .react-tags__suggestions ul {
502
- margin: 4px -1px;
503
- padding: 0;
504
- list-style: none;
505
- background: white;
506
- border: 1px solid #d1d1d1;
507
- border-radius: 2px;
508
- box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
509
- }
510
-
511
- .react-tags__suggestions li {
512
- border-bottom: 1px solid #ddd;
513
- padding: 6px 8px;
514
- }
515
-
516
- .react-tags__suggestions li mark {
517
- text-decoration: underline;
518
- background: none;
519
- font-weight: 600;
520
- }
521
-
522
- .react-tags__suggestions li:hover {
523
- cursor: pointer;
524
- background: #eee;
525
- }
526
-
527
- .react-tags__suggestions li.is-active {
528
- background: #b7cfe0;
529
- }
530
-
531
- .react-tags__suggestions li.is-disabled {
532
- opacity: 0.5;
533
- cursor: auto;
534
- }
535
58
  }
536
- .editor-toggle {
59
+
60
+ .editor-panel__toggle {
537
61
  background: #f2f2f2;
538
62
  border-radius: 60px;
539
63
  color: #000;
@@ -547,6 +71,7 @@
547
71
  height: 25px;
548
72
  left: 307px;
549
73
  box-shadow: rgba(0, 0, 0, 0.5) 0 1px 2px;
74
+
550
75
  &:before {
551
76
  top: 43%;
552
77
  left: 50%;
@@ -554,13 +79,16 @@
554
79
  position: absolute;
555
80
  content: '\00ab';
556
81
  }
82
+
557
83
  &.collapsed {
558
84
  left: 1em;
559
85
  margin-left: 0;
86
+
560
87
  &:before {
561
88
  content: '\00bb';
562
89
  }
563
90
  }
91
+
564
92
  &:hover {
565
93
  background: rgba(255, 255, 255, 1);
566
94
  }
@@ -1,38 +1,6 @@
1
- @import 'variables';
2
-
3
1
  .cdc-open-viz-module.type-data-bite {
4
2
  @import 'bite';
5
-
6
- .checkbox-group {
7
- padding: 16px;
8
- border: 1px solid #c4c4c4;
9
- border-radius: 8px;
10
- margin-top: 8px;
11
- margin-bottom: 24px;
12
- }
13
-
14
- .loader {
15
- width: 100%;
16
- text-align: center;
17
- display: inline-block;
18
- animation: spin 1s linear infinite;
19
-
20
- &::before {
21
- content: '\21BB';
22
- }
23
- }
24
-
25
- .warning-icon {
26
- position: relative;
27
- top: 2px;
28
- width: 15px;
29
- height: 15px;
30
- margin-left: 5px;
31
-
32
- path {
33
- fill: #d8000c;
34
- }
35
- }
3
+ @import 'editor-panel';
36
4
 
37
5
  .tooltip {
38
6
  background-color: #fff;
@@ -1,7 +1,7 @@
1
1
  import { Config } from '../types/Config'
2
2
  import DataBiteActions from './db.actions'
3
3
 
4
- export type DataBiteState = {
4
+ type DataBiteState = {
5
5
  config?: Config
6
6
  loading: boolean
7
7
  currentViewport: string
@@ -7,5 +7,5 @@ describe('Data Bite', () => {
7
7
  const pkgDir = path.join(__dirname, '..')
8
8
  const result = testStandaloneBuild(pkgDir)
9
9
  expect(result).toBe(true)
10
- })
10
+ }, 300000)
11
11
  })
@@ -37,6 +37,7 @@ export type Config = {
37
37
  hideBackgroundColor: boolean
38
38
  borderColorTheme: boolean
39
39
  showTitle: boolean
40
+ whiteBackground: boolean
40
41
  }
41
42
  general: {
42
43
  isCompactStyle: boolean