@cdc/core 1.1.2 → 1.1.4

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.
Files changed (64) hide show
  1. package/assets/alabama-graphic.svg +23 -0
  2. package/assets/check.svg +3 -0
  3. package/assets/dashboard.svg +11 -0
  4. package/assets/file-upload-solid.svg +1 -0
  5. package/assets/horizontal-stacked-bar.svg +1 -0
  6. package/assets/icon-code.svg +3 -0
  7. package/assets/icon-grid.svg +4 -0
  8. package/assets/icon-info.svg +3 -0
  9. package/assets/icon-warning.svg +3 -0
  10. package/assets/link.svg +1 -0
  11. package/assets/map-folded.svg +1 -0
  12. package/assets/paired-bar.svg +11 -0
  13. package/assets/upload-solid.svg +1 -0
  14. package/assets/usa-region-graphic.svg +393 -0
  15. package/components/AdvancedEditor.js +74 -0
  16. package/components/GlobalContext.jsx +41 -0
  17. package/components/Loading.js +3 -2
  18. package/components/elements/Button.jsx +12 -0
  19. package/components/inputs/InputCheckbox.jsx +59 -0
  20. package/components/inputs/InputSelect.jsx +49 -0
  21. package/components/inputs/InputText.jsx +68 -0
  22. package/components/inputs/InputToggle.jsx +95 -0
  23. package/components/ui/Accordion.jsx +64 -0
  24. package/components/ui/Icon.jsx +63 -0
  25. package/components/ui/Modal.jsx +87 -0
  26. package/components/ui/Overlay.jsx +84 -0
  27. package/components/ui/OverlayFrame.jsx +16 -0
  28. package/components/ui/Tooltip.jsx +55 -0
  29. package/data/colorPalettes.js +240 -0
  30. package/helpers/events.js +15 -0
  31. package/helpers/numberFromString.js +4 -3
  32. package/helpers/updatePaletteNames.js +18 -0
  33. package/helpers/validateFipsCodeLength.js +67 -0
  34. package/package.json +16 -2
  35. package/styles/_data-table.scss +8 -2
  36. package/styles/_global.scss +5 -3
  37. package/styles/v2/base/_general.scss +46 -0
  38. package/styles/v2/base/_reset.scss +81 -0
  39. package/styles/v2/base/_typography.scss +0 -0
  40. package/styles/v2/base/index.scss +3 -0
  41. package/styles/v2/components/accordion.scss +156 -0
  42. package/styles/v2/components/button.scss +178 -0
  43. package/styles/v2/components/editor.scss +487 -0
  44. package/styles/v2/components/icon.scss +23 -0
  45. package/styles/v2/components/input.scss +372 -0
  46. package/styles/v2/components/modal.scss +64 -0
  47. package/styles/v2/components/overlay.scss +80 -0
  48. package/styles/v2/layout/_alert.scss +36 -0
  49. package/styles/v2/layout/_component.scss +31 -0
  50. package/styles/v2/layout/_data-table.scss +278 -0
  51. package/styles/v2/layout/_header.scss +13 -0
  52. package/styles/v2/layout/_link.scss +46 -0
  53. package/styles/v2/layout/_progression.scss +80 -0
  54. package/styles/v2/layout/_tooltip.scss +132 -0
  55. package/styles/v2/layout/index.scss +7 -0
  56. package/styles/v2/main.scss +15 -0
  57. package/styles/v2/themes/_color-definitions.scss +129 -0
  58. package/styles/v2/themes/index.scss +1 -0
  59. package/styles/v2/utils/_animations.scss +63 -0
  60. package/styles/v2/utils/_functions.scss +0 -0
  61. package/styles/v2/utils/_mixins.scss +29 -0
  62. package/styles/v2/utils/_variables.scss +2 -0
  63. package/styles/v2/utils/index.scss +4 -0
  64. package/LICENSE +0 -201
@@ -0,0 +1,487 @@
1
+ @import "../utils/variables";
2
+ @import "../themes/index";
3
+
4
+ .cove-editor {
5
+ display: grid;
6
+ grid-template-columns: auto 1fr;
7
+ grid-template-areas: "panel content";
8
+ height: 100vh;
9
+
10
+ .cove-editor__panel {
11
+ grid-area: panel;
12
+ width: $editorWidth;
13
+ transition: width 500ms ease;
14
+ font-size: 15px;
15
+ background: #fff;
16
+ border-right: 1px solid #c2c2c2;
17
+ overflow-x: hidden;
18
+ overflow-y: auto;
19
+ z-index: 7;
20
+ }
21
+
22
+ .cove-editor__heading {
23
+ font-size: 1.125em;
24
+ user-select: none;
25
+ padding: .625rem 1.125rem;
26
+ }
27
+
28
+ .cove-editor__panel-container {
29
+ width: $editorWidth;
30
+ min-width: $editorWidth;
31
+ }
32
+
33
+ .cove-editor__content {
34
+ grid-area: content;
35
+
36
+ .cove-editor__content-wrap {
37
+ margin: 3em auto 0;
38
+ max-width: 35em;
39
+ }
40
+ }
41
+
42
+ .cove-editor--toggle {
43
+ position: absolute;
44
+ top: 10px;
45
+ left: 307px;
46
+ width: 25px;
47
+ height: 25px;
48
+ background-color: #f2f2f2;
49
+ border-radius: 60px;
50
+ color: #000;
51
+ font-size: 1em;
52
+ border: 0;
53
+ cursor: pointer;
54
+ transition: left 400ms ease 65ms, background-color 200ms ease;
55
+ box-shadow: rgba(0, 0, 0, .5) 0 1px 2px;
56
+ user-select: none;
57
+ z-index: 8;
58
+
59
+ &:before {
60
+ top: 43%;
61
+ left: 50%;
62
+ transform: translate(-50%, -50%);
63
+ position: absolute;
64
+ content: "\00ab";
65
+ }
66
+
67
+ &.collapsed {
68
+ left: 1em;
69
+ margin-left: 0;
70
+
71
+ &:before {
72
+ content: "\00bb";
73
+ }
74
+ }
75
+
76
+ &:hover {
77
+ background-color: #ffffff
78
+ }
79
+ }
80
+ }
81
+
82
+ .cove-editor__panel {
83
+ &.hidden {
84
+ width: 0;
85
+ }
86
+
87
+ .two-col-inputs {
88
+ display: flex;
89
+ margin-top: 1em;
90
+ justify-content: space-between;
91
+
92
+ > label {
93
+ width: 48%;
94
+ margin-top: 0 !important
95
+ }
96
+ }
97
+
98
+ .divider-heading {
99
+ display: block;
100
+ font-size: 1em;
101
+ margin-top: 1em;
102
+ }
103
+
104
+ .series-list {
105
+ list-style: none;
106
+ border: $lightGray 1px solid;
107
+
108
+ &:empty {
109
+ border: none !important
110
+ }
111
+
112
+ li {
113
+ padding: .3em .5em;
114
+ display: flex;
115
+ align-items: center;
116
+ justify-content: space-between;
117
+ font-size: .9em;
118
+
119
+ &:hover {
120
+ background-color: $lightestGray;
121
+ }
122
+
123
+ span {
124
+ font-size: .8em;
125
+ color: #f00;
126
+ cursor: pointer;
127
+ }
128
+
129
+ + li {
130
+ border-top: $lightGray 1px solid;
131
+ }
132
+ }
133
+ }
134
+
135
+ .form-container {
136
+ border-right: $lightGray 1px solid;
137
+ flex-grow: 1;
138
+ }
139
+
140
+ .guidance-link {
141
+ margin: 2em 1em 0;
142
+ padding: .75em 1em;
143
+
144
+ svg {
145
+ width: 60px;
146
+ color: $blue;
147
+ margin-right: 1rem;
148
+ height: 60px; // IE11
149
+ path {
150
+ fill: currentColor;
151
+ }
152
+ }
153
+ }
154
+
155
+ h2 {
156
+ background: #565656;
157
+ color: #fff;
158
+ font-size: 1.1em;
159
+ padding: .6em 1em;
160
+ position: relative;
161
+ border-bottom: #565656 3px solid;
162
+ z-index: 3;
163
+ }
164
+
165
+ fieldset {
166
+ display: block;
167
+ }
168
+
169
+ .primary-fieldset {
170
+ padding: 0;
171
+ margin: 0;
172
+ border: 0;
173
+ }
174
+
175
+ ul.column-edit {
176
+ list-style: none;
177
+ padding-left: 0;
178
+
179
+ li {
180
+ margin-top: 1em;
181
+ }
182
+
183
+ .three-col {
184
+ display: flex;
185
+ justify-content: space-between;
186
+
187
+ > label {
188
+ margin-top: 0;
189
+ width: 30%;
190
+ display: inline-block;
191
+
192
+ input[type="text"], input[type="number"] {
193
+ width: 50px;
194
+ }
195
+ }
196
+ }
197
+ }
198
+
199
+ .remove-column {
200
+ margin: 0 auto;
201
+ color: #C32B2B;
202
+ font-size: .7em;
203
+ font-weight: bold;
204
+ line-height: 1.6em;
205
+ text-decoration: underline;
206
+ text-transform: uppercase;
207
+ border: 0;
208
+ border-radius: 5px;
209
+ transition: .1s all;
210
+ float: right;
211
+ outline: 0;
212
+ cursor: pointer;
213
+ }
214
+
215
+ .edit-block {
216
+ padding-left: 1em;
217
+ border: 0;
218
+ border-left: rgba(0, 0, 0, 0.2) 4px solid;
219
+ transition: .2s all;
220
+
221
+ &:not(:first-child) {
222
+ margin-top: 2em;
223
+ }
224
+
225
+ input[type="text"], input[type="number"] {
226
+ font-size: 1em;
227
+ }
228
+
229
+ label {
230
+ margin-top: 0;
231
+ }
232
+
233
+ label + label {
234
+ margin-top: 1em;
235
+ }
236
+
237
+ &:hover {
238
+ border-left: rgba(0, 0, 0, 0.7) 4px solid;
239
+ transition: .2s all;
240
+ }
241
+ }
242
+
243
+ span.subtext {
244
+ display: block;
245
+ color: rgba(0, 0, 0, .5);
246
+ text-transform: none;
247
+ font-weight: normal;
248
+ }
249
+
250
+ .btn {
251
+ margin-top: 1em;
252
+ }
253
+
254
+ .sort-list {
255
+ list-style: none;
256
+
257
+ > li {
258
+ margin-right: .3em;
259
+ margin-bottom: .3em;
260
+ }
261
+
262
+ li > div {
263
+ display: block;
264
+ box-sizing: border-box;
265
+ border: 1px solid #D1D1D1;
266
+ border-radius: 2px;
267
+ background: #F1F1F1;
268
+ padding: .4em .6em;
269
+ font-size: .8em;
270
+ margin-bottom: .3em;
271
+ cursor: move;
272
+ }
273
+ }
274
+
275
+ .info {
276
+ font-size: .8em;
277
+ line-height: 1.4em;
278
+ font-style: italic;
279
+ padding-top: 10px;
280
+ }
281
+
282
+ .react-tags__search {
283
+ width: 100%;
284
+ }
285
+
286
+ .react-tags {
287
+ position: relative;
288
+ cursor: text;
289
+
290
+ input.react-tags__search-input {
291
+ font-size: .8rem;
292
+ }
293
+
294
+ span {
295
+ display: inline
296
+ }
297
+
298
+ &.is-focused {
299
+ border-color: rgba(0, 0, 0, 0.7);
300
+ }
301
+ }
302
+
303
+ .react-tags__selected {
304
+ display: inline;
305
+ }
306
+
307
+ .react-tags__selected-tag {
308
+ display: inline-block;
309
+ box-sizing: border-box;
310
+ border: 1px solid #D1D1D1;
311
+ border-radius: 2px;
312
+ background: #F1F1F1;
313
+ padding: .4em .6em;
314
+ font-size: .8em;
315
+ margin-right: .3em;
316
+ margin-bottom: .3em;
317
+
318
+ &::after {
319
+ content: '\2715';
320
+ color: #AAA;
321
+ margin-left: 8px;
322
+ }
323
+
324
+ &:hover,
325
+ &:focus {
326
+ border-color: #B1B1B1;
327
+ }
328
+ }
329
+
330
+ .react-tags__search {
331
+ display: inline-block;
332
+ max-width: 100%;
333
+
334
+ input {
335
+ max-width: 100%;
336
+ margin: 0;
337
+ outline: none;
338
+ padding: .5em .3em;
339
+ font-size: inherit;
340
+ line-height: inherit;
341
+ }
342
+
343
+ input::-ms-clear {
344
+ display: none;
345
+ }
346
+ }
347
+
348
+ @media screen and (min-width: 30em) {
349
+ .react-tags__search {
350
+ position: relative;
351
+ }
352
+ }
353
+
354
+ .react-tags__suggestions {
355
+ position: absolute;
356
+ top: 100%;
357
+ left: 0;
358
+ width: 100%;
359
+
360
+ ul {
361
+ margin: 4px -1px;
362
+ padding: 0;
363
+ list-style: none;
364
+ background: white;
365
+ border: 1px solid #D1D1D1;
366
+ border-radius: 2px;
367
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
368
+ }
369
+
370
+ li {
371
+ border-bottom: 1px solid #ddd;
372
+ padding: 6px 8px;
373
+
374
+ &:hover {
375
+ cursor: pointer;
376
+ background: #eee;
377
+ }
378
+
379
+ &.is-active {
380
+ background: #b7cfe0;
381
+ }
382
+
383
+ &.is-disabled {
384
+ opacity: 0.5;
385
+ cursor: auto;
386
+ }
387
+
388
+ mark {
389
+ text-decoration: underline;
390
+ background: none;
391
+ font-weight: 600;
392
+ }
393
+ }
394
+ }
395
+
396
+ @media screen and (min-width: 30em) {
397
+ .react-tags__suggestions {
398
+ width: 240px;
399
+ }
400
+ }
401
+ }
402
+
403
+ // TODO: Advanced??? What is this? -----------------------------------------------
404
+ .advanced {
405
+ padding: 0 1em 1em;
406
+ text-align: left;
407
+
408
+ p {
409
+ font-size: .8rem;
410
+ }
411
+
412
+ .advanced-toggle-link {
413
+ padding-top: 1em;
414
+ display: block;
415
+ text-align: left;
416
+ cursor: pointer;
417
+ color: rgba(0, 0, 0, .5);
418
+ text-decoration: underline;
419
+
420
+ span {
421
+ text-decoration: none;
422
+ display: inline-block;
423
+ font-family: monospace;
424
+ padding-right: 5px;
425
+ }
426
+
427
+ &:hover {
428
+ color: rgba(0, 0, 0, .7);
429
+ }
430
+ }
431
+
432
+ textarea {
433
+ height: 400px;
434
+ width: 100%;
435
+ font-size: .9em;
436
+ padding: .5em;
437
+ font-family: monospace;
438
+ box-sizing: border-box
439
+ }
440
+ }
441
+
442
+ // -------------------------------------------------------------------------------
443
+
444
+ ul.color-palette {
445
+ display: flex;
446
+ max-width: 100%;
447
+ padding: 0;
448
+ list-style: none;
449
+ flex-wrap: wrap;
450
+
451
+ li {
452
+ display: flex;
453
+ width: 21px;
454
+ height: 21px;
455
+ border-radius: 40px;
456
+ margin-right: 4px;
457
+ margin-bottom: 10px;
458
+ overflow: hidden;
459
+ cursor: pointer;
460
+ position: relative;
461
+
462
+ .click-target {
463
+ position: absolute;
464
+ top: 0;
465
+ left: 0;
466
+ right: 0;
467
+ bottom: 0;
468
+ }
469
+
470
+ &.selected {
471
+ border: rgba(0, 0, 0, .8) 2px solid;
472
+ }
473
+
474
+ span {
475
+ width: 33.3%;
476
+ }
477
+ }
478
+
479
+ @at-root .header #{&} {
480
+ li {
481
+ width: 21px;
482
+ height: 21px;
483
+ border-radius: 40px;
484
+ margin-right: 2.8px;
485
+ }
486
+ }
487
+ }
@@ -0,0 +1,23 @@
1
+ .cove-icon {
2
+ display: inline-flex;
3
+ width: 1em;
4
+ height: auto;
5
+ justify-content: center;
6
+ align-items: center;
7
+
8
+ @media all and (-ms-high-contrast: none) {
9
+ height: 30px;
10
+ }
11
+
12
+ > svg {
13
+ width: auto;
14
+ height: auto;
15
+ max-width: 100%;
16
+ max-height: 100%;
17
+ pointer-events: none;
18
+
19
+ path {
20
+ fill: currentColor;
21
+ }
22
+ }
23
+ }