@cdc/core 4.22.10 → 4.23.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.
Files changed (75) hide show
  1. package/README.md +1 -1
  2. package/components/AdvancedEditor.js +52 -67
  3. package/components/ErrorBoundary.jsx +10 -11
  4. package/components/GlobalContext.jsx +2 -6
  5. package/components/LegendCircle.jsx +3 -4
  6. package/components/Loading.jsx +14 -12
  7. package/components/Waiting.jsx +14 -5
  8. package/components/elements/Button.jsx +34 -45
  9. package/components/elements/Card.jsx +1 -1
  10. package/components/inputs/InputCheckbox.jsx +32 -35
  11. package/components/inputs/InputGroup.jsx +38 -17
  12. package/components/inputs/InputSelect.jsx +27 -23
  13. package/components/inputs/InputText.jsx +9 -25
  14. package/components/inputs/InputToggle.jsx +29 -33
  15. package/components/managers/DataDesigner.jsx +87 -64
  16. package/components/ui/Accordion.jsx +18 -30
  17. package/components/ui/Icon.jsx +34 -35
  18. package/components/ui/LoadSpin.jsx +6 -11
  19. package/components/ui/Modal.jsx +40 -44
  20. package/components/ui/Overlay.jsx +12 -23
  21. package/components/ui/OverlayFrame.jsx +1 -5
  22. package/components/ui/Tooltip.jsx +8 -28
  23. package/data/colorPalettes.js +29 -266
  24. package/data/dataDesignerTables.js +107 -107
  25. package/data/themes.js +13 -13
  26. package/helpers/CoveMediaControls.js +139 -0
  27. package/helpers/DataTransform.js +92 -92
  28. package/helpers/cacheBustingString.js +3 -3
  29. package/helpers/events.js +5 -6
  30. package/helpers/fetchRemoteData.js +33 -33
  31. package/helpers/getViewport.js +15 -15
  32. package/helpers/numberFromString.js +7 -7
  33. package/helpers/updatePaletteNames.js +15 -17
  34. package/helpers/useDataVizClasses.js +38 -35
  35. package/helpers/validateFipsCodeLength.js +41 -56
  36. package/package.json +4 -2
  37. package/styles/_button-section.scss +35 -0
  38. package/styles/_data-table.scss +39 -27
  39. package/styles/_global.scss +29 -24
  40. package/styles/_mixins.scss +12 -12
  41. package/styles/_reset.scss +85 -16
  42. package/styles/_variables.scss +5 -5
  43. package/styles/base.scss +100 -48
  44. package/styles/heading-colors.scss +6 -2
  45. package/styles/loading.scss +62 -60
  46. package/styles/v2/base/_file-selector.scss +2 -2
  47. package/styles/v2/base/_general.scss +1 -1
  48. package/styles/v2/base/_reset.scss +2 -2
  49. package/styles/v2/base/index.scss +4 -4
  50. package/styles/v2/components/accordion.scss +13 -13
  51. package/styles/v2/components/button.scss +3 -3
  52. package/styles/v2/components/card.scss +1 -1
  53. package/styles/v2/components/data-designer.scss +7 -6
  54. package/styles/v2/components/editor.scss +52 -51
  55. package/styles/v2/components/guidance-block.scss +6 -6
  56. package/styles/v2/components/input/_input-check-radio.scss +7 -7
  57. package/styles/v2/components/input/_input-group.scss +2 -2
  58. package/styles/v2/components/input/_input-slider.scss +2 -3
  59. package/styles/v2/components/input/index.scss +6 -6
  60. package/styles/v2/components/loadspin.scss +1 -1
  61. package/styles/v2/components/modal.scss +2 -2
  62. package/styles/v2/components/overlay.scss +4 -4
  63. package/styles/v2/layout/_alert.scss +8 -8
  64. package/styles/v2/layout/_component.scss +1 -1
  65. package/styles/v2/layout/_data-table.scss +12 -11
  66. package/styles/v2/layout/_progression.scss +8 -6
  67. package/styles/v2/layout/index.scss +5 -5
  68. package/styles/v2/main.scss +7 -7
  69. package/styles/v2/themes/_color-definitions.scss +77 -24
  70. package/styles/v2/themes/index.scss +1 -1
  71. package/styles/v2/utils/_animations.scss +2 -2
  72. package/styles/v2/utils/_breakpoints.scss +53 -12
  73. package/styles/v2/utils/_variables.scss +5 -5
  74. package/styles/v2/utils/index.scss +8 -8
  75. package/styles/waiting.scss +22 -23
package/styles/base.scss CHANGED
@@ -1,61 +1,57 @@
1
- @use "sass:string";
1
+ @use 'sass:string';
2
2
 
3
3
  @mixin breakpoint($class) {
4
4
  @if $class == xs {
5
- @media (max-width: 767px) { @content; }
6
- }
7
-
8
- @else if $class == sm {
9
- @media (min-width: 768px) { @content; }
10
- }
11
-
12
- @else if $class == md {
13
- @media (min-width: 960px) { @content; }
14
- }
15
-
16
- @else if $class == lg {
17
- @media (min-width: 1300px) { @content; }
18
- }
19
-
20
- @else {
5
+ @media (max-width: 767px) {
6
+ @content;
7
+ }
8
+ } @else if $class == sm {
9
+ @media (min-width: 768px) {
10
+ @content;
11
+ }
12
+ } @else if $class == md {
13
+ @media (min-width: 960px) {
14
+ @content;
15
+ }
16
+ } @else if $class == lg {
17
+ @media (min-width: 1300px) {
18
+ @content;
19
+ }
20
+ } @else {
21
21
  @warn "Breakpoint mixin supports: xs, sm, md, lg";
22
22
  }
23
23
  }
24
24
 
25
25
  @mixin breakpointClass($class) {
26
26
  @if $class == xs {
27
- &.xs, &.xxs {
27
+ &.xs,
28
+ &.xxs {
28
29
  @content;
29
30
  }
30
- }
31
-
32
- @else if $class == sm {
33
- &.sm, &.md, &.lg {
31
+ } @else if $class == sm {
32
+ &.sm,
33
+ &.md,
34
+ &.lg {
34
35
  @content;
35
36
  }
36
- }
37
-
38
- @else if $class == md {
39
- &.md, &.lg {
37
+ } @else if $class == md {
38
+ &.md,
39
+ &.lg {
40
40
  @content;
41
41
  }
42
- }
43
-
44
- @else if $class == lg {
42
+ } @else if $class == lg {
45
43
  &.lg {
46
44
  @content;
47
45
  }
48
- }
49
-
50
- @else {
46
+ } @else {
51
47
  @warn "Breakpoint Class mixin supports: xs, sm, md, lg";
52
48
  }
53
49
  }
54
50
 
55
51
  // Imports
56
- @import "reset";
57
- @import "variables";
58
- @import "mixins";
52
+ @import 'reset';
53
+ @import 'variables';
54
+ @import 'mixins';
59
55
 
60
56
  .cdc-open-viz-module {
61
57
  position: relative;
@@ -65,20 +61,76 @@
65
61
  @include breakpointClass(md) {
66
62
  font-size: 16px !important;
67
63
  }
68
- @import "data-table";
69
- @import "global";
64
+ @import 'data-table';
65
+ @import 'global';
66
+ @import 'button-section';
70
67
  }
71
68
 
72
69
  $theme: (
73
- 'amber': ('#fbab18', '#ffd54f', '#ffecb3', '#fff7e1'),
74
- 'blue': ('#005eaa', '#88c3ea', '#c0e9ff', '#edf9ff'),
75
- 'brown': ('#705043', '#ad907b', '#d7ccc8', '#f2ebe8'),
76
- 'cyan': ('#006778', '#65b0bd', '#cce5e9', '#ebf5f6'),
77
- 'green': ('#4b830d', '#84bc49', '#dcedc8', '#f1f8e9'),
78
- 'indigo': ('#26418f', '#92a6dd', '#dee8ff', '#f2f6ff'),
79
- 'orange': ('#bb4d00', '#ffad42', '#ffe97d', '#fff4cf'),
80
- 'pink': ('#af4448', '#e57373', '#ffc2c2', '#ffe7e7'),
81
- 'purple': ('#712177', '#b890bb', '#e3d3e4', '#f7f2f7'),
82
- 'slate': ('#29434e', '#7e9ba5', '#b6c6d2', '#e2e8ed'),
83
- 'teal': ('#00695c', '#4ebaaa', '#ceece7', '#ebf7f5' )
70
+ 'amber': (
71
+ '#fbab18',
72
+ '#ffd54f',
73
+ '#ffecb3',
74
+ '#fff7e1'
75
+ ),
76
+ 'blue': (
77
+ '#005eaa',
78
+ '#88c3ea',
79
+ '#c0e9ff',
80
+ '#edf9ff'
81
+ ),
82
+ 'brown': (
83
+ '#705043',
84
+ '#ad907b',
85
+ '#d7ccc8',
86
+ '#f2ebe8'
87
+ ),
88
+ 'cyan': (
89
+ '#006778',
90
+ '#65b0bd',
91
+ '#cce5e9',
92
+ '#ebf5f6'
93
+ ),
94
+ 'green': (
95
+ '#4b830d',
96
+ '#84bc49',
97
+ '#dcedc8',
98
+ '#f1f8e9'
99
+ ),
100
+ 'indigo': (
101
+ '#26418f',
102
+ '#92a6dd',
103
+ '#dee8ff',
104
+ '#f2f6ff'
105
+ ),
106
+ 'orange': (
107
+ '#bb4d00',
108
+ '#ffad42',
109
+ '#ffe97d',
110
+ '#fff4cf'
111
+ ),
112
+ 'pink': (
113
+ '#af4448',
114
+ '#e57373',
115
+ '#ffc2c2',
116
+ '#ffe7e7'
117
+ ),
118
+ 'purple': (
119
+ '#712177',
120
+ '#b890bb',
121
+ '#e3d3e4',
122
+ '#f7f2f7'
123
+ ),
124
+ 'slate': (
125
+ '#29434e',
126
+ '#7e9ba5',
127
+ '#b6c6d2',
128
+ '#e2e8ed'
129
+ ),
130
+ 'teal': (
131
+ '#00695c',
132
+ '#4ebaaa',
133
+ '#ceece7',
134
+ '#ebf7f5'
135
+ )
84
136
  );
@@ -1,4 +1,8 @@
1
- div.dashboard-title, div.chart-title, div.map-title, .color-palette li, .btn {
1
+ div.dashboard-title,
2
+ div.chart-title,
3
+ div.map-title,
4
+ .color-palette li,
5
+ .btn {
2
6
  &.theme-purple {
3
7
  background: #712177;
4
8
  border-bottom-color: #b890bb;
@@ -43,4 +47,4 @@ div.dashboard-title, div.chart-title, div.map-title, .color-palette li, .btn {
43
47
  background: #005eaa;
44
48
  border-bottom-color: #88c3ea;
45
49
  }
46
- }
50
+ }
@@ -5,68 +5,70 @@
5
5
  * Licensed under MIT
6
6
  */
7
7
  @keyframes ball-beat {
8
- 50% {
9
- opacity: .2;
10
- -webkit-transform: scale(.75);
11
- -moz-transform: scale(.75);
12
- -o-transform: scale(.75);
13
- transform: scale(.75);
14
- }
15
- 100% {
16
- opacity: 1;
17
- -webkit-transform: scale(1);
18
- -moz-transform: scale(1);
19
- -o-transform: scale(1);
20
- transform: scale(1);
21
- }
8
+ 50% {
9
+ opacity: 0.2;
10
+ -webkit-transform: scale(0.75);
11
+ -moz-transform: scale(0.75);
12
+ -o-transform: scale(0.75);
13
+ transform: scale(0.75);
14
+ }
15
+ 100% {
16
+ opacity: 1;
17
+ -webkit-transform: scale(1);
18
+ -moz-transform: scale(1);
19
+ -o-transform: scale(1);
20
+ transform: scale(1);
21
+ }
22
22
  }
23
23
 
24
24
  .cdc-open-viz-module .loading {
25
- text-align: center;
26
- position: absolute;
27
- z-index: 3;
28
- background: rgba(255,255,255,.5);
29
- left: 0;
30
- right: 0;
31
- bottom: 0;
32
- top: 0;
33
- min-height: 30%;
34
- span {
35
- display: block;
36
- margin-bottom: 1em;
37
- font-size: 1.3em;
38
- }
39
- .la-ball-beat {
25
+ text-align: center;
26
+ position: absolute;
27
+ z-index: 3;
28
+ background: rgba(255, 255, 255, 0.5);
29
+ left: 0;
30
+ right: 0;
31
+ bottom: 0;
32
+ top: 0;
33
+ min-height: 30%;
34
+ span {
35
+ display: block;
36
+ margin-bottom: 1em;
37
+ font-size: 1.3em;
38
+ }
39
+ .la-ball-beat {
40
+ position: relative;
41
+ box-sizing: border-box;
42
+ margin: 0 auto;
43
+ transform: scale(1.3);
44
+ font-size: 0;
45
+ color: #777;
46
+ display: flex;
47
+ justify-content: center;
48
+ align-items: center;
49
+ width: 108px;
50
+ height: 36px;
51
+ &.sm,
52
+ &.xs,
53
+ &.xxs {
54
+ transform: scale(0.7);
55
+ }
56
+ div + div {
57
+ margin-left: 10px;
58
+ }
59
+ > div {
40
60
  position: relative;
41
- box-sizing: border-box;
42
- margin: 0 auto;
43
- transform: scale(1.3);
44
- font-size: 0;
45
- color: #777;
46
- display: flex;
47
- justify-content: center;
48
- align-items: center;
49
- width: 108px;
50
- height: 36px;
51
- &.sm, &.xs, &.xxs {
52
- transform: scale(0.7)
61
+ box-sizing: border-box;
62
+ width: 20px;
63
+ height: 20px;
64
+ border-radius: 100%;
65
+ animation: ball-beat 0.7s -0.15s infinite linear;
66
+ display: inline-block;
67
+ background-color: currentColor;
68
+ border: 0 solid currentColor;
69
+ &:nth-child(2n-1) {
70
+ animation-delay: -0.5s;
53
71
  }
54
- div + div {
55
- margin-left: 10px;
56
- }
57
- > div {
58
- position: relative;
59
- box-sizing: border-box;
60
- width: 20px;
61
- height: 20px;
62
- border-radius: 100%;
63
- animation: ball-beat .7s -.15s infinite linear;
64
- display: inline-block;
65
- background-color: currentColor;
66
- border: 0 solid currentColor;
67
- &:nth-child(2n-1) {
68
- animation-delay: -.5s;
69
- }
70
- }
71
- }
72
- }
72
+ }
73
+ }
74
+ }
@@ -4,9 +4,9 @@
4
4
  font-size: 0.875rem;
5
5
  color: $mediumGray;
6
6
  border: $lightGray 2px dashed;
7
- border-radius: .2rem;
7
+ border-radius: 0.2rem;
8
8
  cursor: pointer;
9
- transition: .1s all;
9
+ transition: 0.1s all;
10
10
 
11
11
  &.drag-active {
12
12
  background-color: $lightestGray;
@@ -12,7 +12,7 @@
12
12
 
13
13
  small {
14
14
  display: block;
15
- font-size: .8rem;
15
+ font-size: 0.8rem;
16
16
  font-style: italic;
17
17
  color: $mediumGray;
18
18
  }
@@ -37,7 +37,6 @@ a:not([class]) {
37
37
  text-decoration-skip-ink: auto;
38
38
  }
39
39
 
40
-
41
40
  img,
42
41
  picture {
43
42
  max-width: 100%;
@@ -51,7 +50,8 @@ select {
51
50
  font: inherit;
52
51
  }
53
52
 
54
- sub, sup {
53
+ sub,
54
+ sup {
55
55
  font-size: 75%;
56
56
  line-height: 0;
57
57
  position: relative;
@@ -1,7 +1,7 @@
1
1
  //@import "reset"; TODO: Enable after cove refactor
2
- @import "typography";
2
+ @import 'typography';
3
3
 
4
- @import "general";
5
- @import "heading";
4
+ @import 'general';
5
+ @import 'heading';
6
6
 
7
- @import "file-selector";
7
+ @import 'file-selector';
@@ -1,5 +1,5 @@
1
- @import "../utils/variables";
2
- @import "../themes/index";
1
+ @import '../utils/variables';
2
+ @import '../themes/index';
3
3
 
4
4
  .cove {
5
5
  .cove-accordion__item {
@@ -9,7 +9,7 @@
9
9
 
10
10
  .number-narrow {
11
11
  min-width: auto;
12
- width: 75px
12
+ width: 75px;
13
13
  }
14
14
  }
15
15
 
@@ -22,7 +22,7 @@
22
22
  justify-content: space-between;
23
23
  position: relative;
24
24
  width: 100%;
25
- padding: .3em 1em;
25
+ padding: 0.3em 1em;
26
26
  font-size: 1em;
27
27
  text-align: left;
28
28
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
@@ -41,14 +41,14 @@
41
41
  position: absolute;
42
42
  top: 50%;
43
43
  transform: rotate(-45deg) translateX(0) translateY(-50%);
44
- transition: .1s all;
44
+ transition: 0.1s all;
45
45
  }
46
46
 
47
47
  &[aria-expanded='true']::before,
48
48
  &[aria-selected='true']::before {
49
49
  transform: rotate(45deg) translateX(-2px) translateY(-70%);
50
50
  margin-right: 1.3em;
51
- transition: .1s all;
51
+ transition: 0.1s all;
52
52
  }
53
53
 
54
54
  .cove-tooltip,
@@ -71,7 +71,7 @@
71
71
  }
72
72
 
73
73
  h5 {
74
- font-size: .8em;
74
+ font-size: 0.8em;
75
75
  }
76
76
  }
77
77
 
@@ -114,7 +114,7 @@
114
114
  }
115
115
 
116
116
  .cove-accordion__small-inputs {
117
- input[type="text"] {
117
+ input[type='text'] {
118
118
  display: block;
119
119
  width: 100%;
120
120
  height: 22px;
@@ -139,14 +139,14 @@
139
139
  }
140
140
 
141
141
  .cove-accordion__input-error {
142
- color: #D8000C;
143
- border: #D8000C 1px solid;
142
+ color: #d8000c;
143
+ border: #d8000c 1px solid;
144
144
  }
145
145
 
146
146
  .cove-accordion__panel-error {
147
- color: #D8000C;
148
- background-color: #FFD2D2;
149
- border: #D8000C 1px solid;
147
+ color: #d8000c;
148
+ background-color: #ffd2d2;
149
+ border: #d8000c 1px solid;
150
150
  margin-top: 12px;
151
151
  padding: 4px 8px;
152
152
  line-height: 1.2em;
@@ -1,5 +1,5 @@
1
- @import "../utils/variables";
2
- @import "../themes/index";
1
+ @import '../utils/variables';
2
+ @import '../themes/index';
3
3
 
4
4
  .sbdocs .cove-button {
5
5
  margin-right: 1rem;
@@ -56,7 +56,7 @@
56
56
  position: absolute;
57
57
  inset: 0;
58
58
  outline: 2px solid rgba(161, 161, 161, 0.6);
59
- border-radius: .3125em;
59
+ border-radius: 0.3125em;
60
60
  margin: -2px;
61
61
  pointer-events: none;
62
62
  }
@@ -2,6 +2,6 @@
2
2
  border: 1px solid #c7c7c7;
3
3
  border-radius: 0.25rem;
4
4
  background-color: #f2f2f2;
5
- padding: .75rem;
5
+ padding: 0.75rem;
6
6
  height: 100%;
7
7
  }
@@ -1,10 +1,10 @@
1
- @import "../utils/variables";
2
- @import "../themes/color-definitions";
1
+ @import '../utils/variables';
2
+ @import '../themes/color-definitions';
3
3
 
4
4
  .cove-modal__content {
5
5
  .dataset-selector-container {
6
6
  padding: 1em;
7
-
7
+
8
8
  .dataset-selector {
9
9
  margin: 0 0.5em;
10
10
  padding: 0.5em;
@@ -71,7 +71,7 @@
71
71
  }
72
72
 
73
73
  p {
74
- font-size: .8rem;
74
+ font-size: 0.8rem;
75
75
  margin-bottom: 1rem;
76
76
  }
77
77
 
@@ -80,7 +80,7 @@
80
80
  }
81
81
 
82
82
  table {
83
- font-size: .8rem;
83
+ font-size: 0.8rem;
84
84
  background-color: #fff;
85
85
  border: 1px solid $lightGray;
86
86
  border-collapse: collapse;
@@ -91,7 +91,8 @@
91
91
  background-color: $primary;
92
92
  }
93
93
 
94
- th, td {
94
+ th,
95
+ td {
95
96
  padding: 0 5px;
96
97
  border-top: 1px solid $lightGray;
97
98
  border-bottom: 1px solid $lightGray;