@cdc/core 4.24.12-2 → 4.25.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 (63) hide show
  1. package/components/DataTable/DataTable.tsx +26 -36
  2. package/components/DataTable/components/ChartHeader.tsx +3 -2
  3. package/components/DataTable/components/ExpandCollapse.tsx +1 -4
  4. package/components/DataTable/data-table.css +2 -7
  5. package/components/DataTable/helpers/customSort.ts +2 -2
  6. package/components/DataTable/helpers/mapCellMatrix.tsx +83 -60
  7. package/components/DataTable/types/TableConfig.ts +0 -1
  8. package/components/EditorPanel/FootnotesEditor.tsx +49 -7
  9. package/components/EditorPanel/VizFilterEditor/VizFilterEditor.tsx +3 -2
  10. package/components/Filters/Filters.tsx +16 -9
  11. package/components/Footnotes/Footnotes.tsx +1 -1
  12. package/components/Layout/components/Visualization/index.tsx +18 -4
  13. package/components/Layout/components/Visualization/visualizations.scss +1 -1
  14. package/components/Legend/Legend.Gradient.tsx +1 -4
  15. package/components/Legend/index.tsx +1 -1
  16. package/components/LegendShape.tsx +2 -3
  17. package/components/MediaControls.jsx +32 -8
  18. package/components/NestedDropdown/NestedDropdown.tsx +7 -12
  19. package/components/NestedDropdown/nesteddropdown.styles.css +11 -5
  20. package/components/Table/Table.tsx +0 -6
  21. package/components/Table/components/Row.tsx +2 -5
  22. package/components/_stories/DataTable.stories.tsx +1 -2
  23. package/components/elements/Button.jsx +38 -19
  24. package/components/elements/Confirm.tsx +45 -0
  25. package/components/elements/Error.tsx +24 -0
  26. package/components/managers/DataDesigner.tsx +198 -143
  27. package/components/ui/Title/Title.scss +12 -5
  28. package/components/ui/Title/index.tsx +1 -1
  29. package/dist/cove-main.css +77 -591
  30. package/dist/cove-main.css.map +1 -1
  31. package/helpers/DataTransform.ts +55 -63
  32. package/helpers/addValuesToFilters.ts +24 -9
  33. package/helpers/cove/accessibility.ts +24 -0
  34. package/helpers/cove/fontSettings.ts +1 -1
  35. package/helpers/cove/number.ts +1 -7
  36. package/helpers/coveUpdateWorker.ts +5 -1
  37. package/helpers/displayDataAsText.ts +64 -0
  38. package/helpers/formatConfigBeforeSave.ts +1 -1
  39. package/helpers/isOlderVersion.ts +20 -0
  40. package/helpers/missingRequiredSections.ts +20 -0
  41. package/helpers/tests/addValuesToFilters.test.ts +13 -0
  42. package/helpers/useDataVizClasses.ts +8 -4
  43. package/helpers/ver/4.24.11.ts +18 -0
  44. package/helpers/ver/4.25.1.ts +18 -0
  45. package/package.json +2 -2
  46. package/styles/_button-section.scss +2 -5
  47. package/styles/_global-variables.scss +17 -7
  48. package/styles/_global.scss +8 -12
  49. package/styles/_reset.scss +4 -5
  50. package/styles/_typography.scss +0 -20
  51. package/styles/_variables.scss +0 -3
  52. package/styles/base.scss +44 -5
  53. package/styles/cove-main.scss +1 -1
  54. package/styles/filters.scss +5 -6
  55. package/styles/v2/base/_general.scss +3 -2
  56. package/styles/v2/components/button.scss +0 -1
  57. package/styles/v2/main.scss +3 -4
  58. package/styles/v2/utils/index.scss +0 -1
  59. package/types/BoxPlot.ts +1 -0
  60. package/types/Runtime.ts +1 -0
  61. package/types/Table.ts +0 -1
  62. package/types/Version.ts +1 -1
  63. package/styles/v2/utils/_spacers.scss +0 -31
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdc/core",
3
- "version": "4.24.12-2",
3
+ "version": "4.25.1",
4
4
  "description": "Core components, styles, hooks, and helpers, for the CDC Open Visualization project",
5
5
  "moduleName": "CdcCore",
6
6
  "main": "dist/cdccore",
@@ -34,7 +34,7 @@
34
34
  "react": "^18.2.0",
35
35
  "react-dom": "^18.2.0"
36
36
  },
37
- "gitHead": "a60edf1148396309eb473ac9f65426ee40797ddf",
37
+ "gitHead": "c32d727f516fe3525178e3a6480abbe70b2a20d6",
38
38
  "devDependencies": {
39
39
  "sass": "^1.79.4"
40
40
  }
@@ -17,6 +17,7 @@
17
17
  display: flex;
18
18
  justify-content: flex-end;
19
19
  width: 100%;
20
+ line-height: 1;
20
21
  &.brush-active {
21
22
  margin-top: 2em;
22
23
  }
@@ -24,11 +25,7 @@
24
25
  margin-right: 10px;
25
26
  }
26
27
  & a {
27
- font-size: 16px;
28
- }
29
- margin-top: 20px;
30
- &.below-table {
31
- margin-top: 5px;
28
+ font-size: var(--download-link-font-size);
32
29
  }
33
30
  }
34
31
 
@@ -81,18 +81,28 @@ $colors: (
81
81
  @include theme();
82
82
 
83
83
  :root {
84
+ // Spacing
84
85
  --editorContentPadding: 30px;
85
86
  --editorWidth: 350px;
87
+ --space-between-legend-item-rows: 1rem;
88
+ --space-between-legend-item-columns: 1.5rem;
89
+ // Breakpoints
86
90
  --breakpoint-xs: 480px;
87
91
  --breakpoint-sm: 768px;
88
92
  --breakpoint-md: 960px;
89
93
  --breakpoint-lg: 1170px;
90
94
  --breakpoint-xl: 1280px;
91
- --font-size: 17px;
92
- }
93
-
94
- @media (max-width: 576px) {
95
- :root {
96
- --font-size: 13px;
97
- }
95
+ // Font
96
+ --app-font-main: 'Nunito', sans-serif;
97
+ --app-font-secondary: 'Poppins', sans-serif;
98
+ // Font sizes
99
+ --legend-title-font-size: 1rem;
100
+ --legend-description-font-size: 1rem;
101
+ --legend-item-font-size: 0.889rem;
102
+ --download-link-font-size: 0.772rem;
103
+ --filter-select-font-size: 0.833rem;
104
+ --filter-label-font-size: 0.889rem;
105
+ --filter-buttons-font-size: 0.889rem;
106
+ --superTitle-font-size: 0.833rem;
107
+ --title-font-size: 1.222rem;
98
108
  }
@@ -156,17 +156,11 @@ textarea {
156
156
 
157
157
  section.introText {
158
158
  width: 100%;
159
- margin-bottom: 25px;
160
159
  }
161
160
 
162
161
  section.footnotes {
163
- border-top: 1px solid #ddd;
164
- margin-top: 20px;
165
- padding: 15px;
166
- }
167
-
168
- .cdc-chart-inner-container .subtext {
169
- margin-top: 20px;
162
+ border-top: 1px solid var(--cool-gray-10);
163
+ width: 100%;
170
164
  }
171
165
 
172
166
  .margin-left-href {
@@ -182,14 +176,16 @@ section.footnotes {
182
176
  }
183
177
  }
184
178
 
185
-
186
179
  // after migration to TP5 this declaration should be removed and all references
187
180
  // to it should be replaced with .form-select
188
181
  .cove-form-select {
182
+ font-family: var(--app-font-secondary);
183
+ font-weight: 300;
184
+ font-size: var(--filter-select-font-size);
189
185
  display: block;
190
186
  width: 100%;
191
187
  padding: 0.375rem 0.75rem;
192
188
  border-radius: 0.25rem;
193
- border: 1px solid var(--lightGray);
194
- color: var(--darkGray);
195
- }
189
+ border: 1px solid var(--cool-gray-10);
190
+ color: var(--cool-gray-90);
191
+ }
@@ -1,12 +1,11 @@
1
1
  .cdc-open-viz-module {
2
2
  margin: 0;
3
- font: 1em/1.6 system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Droid Sans,
4
- Helvetica Neue, Fira Sans, sans-serif;
3
+ font-family: var(--app-font-main);
4
+ font-size: 1em;
5
+ line-height: 1.5;
5
6
  font-weight: 400;
6
7
  font-style: normal;
7
8
  text-rendering: optimizeLegibility;
8
- -webkit-font-smoothing: antialiased;
9
- color: #111;
10
9
 
11
10
  // match cdc site outline
12
11
  :focus,
@@ -90,7 +89,7 @@
90
89
  margin: 0;
91
90
  padding: 0;
92
91
  border: 0;
93
- font-family: sans-serif;
92
+ font-family: var(--app-font-main);
94
93
  font-weight: normal;
95
94
  vertical-align: baseline;
96
95
  }
@@ -1,20 +0,0 @@
1
- &.font-small {
2
- .chart-container {
3
- font-size: 0.9em !important;
4
- }
5
- }
6
-
7
- &.font-medium {
8
- font-size: 1em !important;
9
- }
10
-
11
- &.font-large {
12
- .chart-container {
13
- font-size: 1.1em !important;
14
- }
15
- }
16
-
17
- .subtext {
18
- font-style: italic;
19
- font-size: 0.9em !important;
20
- }
@@ -61,6 +61,3 @@ $amber-primary: #fbab18 !default;
61
61
  $amber-secondary: #ffd54f !default;
62
62
  $amber-tertiary: #ffecb3 !default;
63
63
  $amber-quaternary: #fff7e1 !default;
64
-
65
- /// Fonts
66
- $font-small: 0.7em;
package/styles/base.scss CHANGED
@@ -65,12 +65,7 @@ body.post-type-cdc_visualization .cdc-editor .configure .editor-panel {
65
65
 
66
66
  .cdc-open-viz-module {
67
67
  position: relative;
68
- color: $baseColor;
69
- font-size: 14px !important;
70
68
  line-height: 1.4;
71
- @include breakpointClass(md) {
72
- font-size: 16px !important;
73
- }
74
69
  @import 'global';
75
70
  @import 'button-section';
76
71
  @import 'series-list';
@@ -153,4 +148,48 @@ body.post-type-cdc_visualization .cdc-editor .configure .editor-panel {
153
148
  '#ebf7f5'
154
149
  )
155
150
  );
151
+
152
+ // These are required because Chronic has pages that still use TP4 and these Bootstrap5 margin classes aren't defined on those pages
153
+ .me-0 {
154
+ margin-right: 0 !important;
155
+ }
156
+ .me-1 {
157
+ margin-right: 0.25rem !important;
158
+ }
159
+ .me-2 {
160
+ margin-right: 0.5rem !important;
161
+ }
162
+ .me-3 {
163
+ margin-right: 1rem !important;
164
+ }
165
+ .me-4 {
166
+ margin-right: 1.5rem !important;
167
+ }
168
+ .me-5 {
169
+ margin-right: 3rem !important;
170
+ }
171
+ .me-auto {
172
+ margin-right: auto !important;
173
+ }
174
+ .ms-0 {
175
+ margin-left: 0 !important;
176
+ }
177
+ .ms-1 {
178
+ margin-left: 0.25rem !important;
179
+ }
180
+ .ms-2 {
181
+ margin-left: 0.5rem !important;
182
+ }
183
+ .ms-3 {
184
+ margin-left: 1rem !important;
185
+ }
186
+ .ms-4 {
187
+ margin-left: 1.5rem !important;
188
+ }
189
+ .ms-5 {
190
+ margin-left: 3rem !important;
191
+ }
192
+ .ms-auto {
193
+ margin-left: auto !important;
194
+ }
156
195
  }
@@ -3,4 +3,4 @@
3
3
  @import 'v2/themes/color-definitions';
4
4
  @import 'variables';
5
5
  @import 'v2/components/ui/tooltip';
6
- @import 'v2/main.scss'
6
+ @import 'v2/main.scss';
@@ -2,14 +2,12 @@
2
2
  &__wrapper {
3
3
  flex-wrap: wrap;
4
4
  display: flex;
5
- gap: 7px 15px;
6
- margin-top: 15px;
7
- margin-bottom: 15px;
5
+ gap: 18px 27px;
8
6
  label {
9
7
  display: inherit;
10
8
  margin-bottom: 5px;
11
- font-weight: 600;
12
- font-size: 16px;
9
+ font-weight: 700;
10
+ font-size: var(--filter-label-font-size);
13
11
  }
14
12
  }
15
13
 
@@ -20,6 +18,7 @@
20
18
 
21
19
  &__buttons {
22
20
  width: 100%;
21
+ font-size: var(--filter-buttons-font-size);
23
22
  .apply {
24
23
  margin-right: 10px;
25
24
  }
@@ -27,9 +26,9 @@
27
26
  }
28
27
 
29
28
  div.single-filters {
30
-
31
29
  label {
32
30
  width: 100%;
31
+ font-weight: 700;
33
32
  }
34
33
 
35
34
  &__tab-bar {
@@ -2,13 +2,14 @@
2
2
 
3
3
  .cove {
4
4
  margin: 0;
5
- font: 1em/1.6 system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Droid Sans, Helvetica Neue, Fira Sans, sans-serif;
5
+ font-family: var(--app-font-main);
6
+ font-size: 1em;
7
+ line-height: 1.5;
6
8
  font-weight: 400;
7
9
  font-style: normal;
8
10
  line-height: 1.4;
9
11
  color: $baseColor;
10
12
  text-rendering: optimizeLegibility;
11
- -webkit-font-smoothing: antialiased;
12
13
 
13
14
  small {
14
15
  display: block;
@@ -16,7 +16,6 @@
16
16
  position: relative;
17
17
  min-height: 2.125rem;
18
18
  padding: 0.375rem 0.75rem;
19
- font-size: 1rem;
20
19
  text-align: center;
21
20
  text-decoration: none;
22
21
  vertical-align: middle;
@@ -3,7 +3,6 @@
3
3
 
4
4
  .cove {
5
5
  @import 'base';
6
- color: $baseColor;
7
6
  font-size: 16px;
8
7
  line-height: 1.4;
9
8
 
@@ -13,12 +12,12 @@
13
12
  }
14
13
 
15
14
  margin: 0;
16
- font: 1em/1.6 system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Droid Sans, Helvetica Neue, Fira Sans, sans-serif;
15
+ font-family: var(--app-font-main);
16
+ font-size: 1em;
17
+ line-height: 1.5;
17
18
  font-weight: 400;
18
19
  font-style: normal;
19
20
  text-rendering: optimizeLegibility;
20
- -webkit-font-smoothing: antialiased;
21
- color: #111;
22
21
 
23
22
  strong {
24
23
  font-weight: 600;
@@ -6,4 +6,3 @@
6
6
  @import 'breakpoints';
7
7
  @import 'functions';
8
8
  @import 'grid';
9
- @import 'spacers';
package/types/BoxPlot.ts CHANGED
@@ -15,6 +15,7 @@ export type BoxPlot = {
15
15
  upperBounds: string
16
16
  }
17
17
  plotNonOutlierValues: boolean
18
+ plotOutlierValues: boolean
18
19
  plots: [{ columnOutliers: []; columnLowerBounds: number; columnUpperBounds: number }]
19
20
  categories: string[]
20
21
  geoType: string
package/types/Runtime.ts CHANGED
@@ -10,6 +10,7 @@ export type ForecastingSeriesKey = {
10
10
 
11
11
  export type Runtime = {
12
12
  barSeriesKeys?: string[]
13
+ areaSeriesKeys: object[]
13
14
  forecastingSeriesKeys?: ForecastingSeriesKey[]
14
15
  originalXAxis: {
15
16
  dataKey: string
package/types/Table.ts CHANGED
@@ -13,7 +13,6 @@ export type Table = {
13
13
  downloadPdfButton?: boolean
14
14
  excludeColumns?: string[]
15
15
  expanded?: boolean
16
- fontSize: 'small' | 'medium' | 'large'
17
16
  groupBy?: string
18
17
  height?: number
19
18
  indexLabel?: string
package/types/Version.ts CHANGED
@@ -1 +1 @@
1
- export type version = `${number}.${number}.${number}`
1
+ export type Version = `${number}.${number}.${number}` | `${number}.${number}.${number}-${string}`
@@ -1,31 +0,0 @@
1
- // Content Spacer Classes
2
- $cove-spacers-offset: 8;
3
- $cove-spacers-max: 64;
4
-
5
- @mixin spacers($className, $styleNameCollection) {
6
- $i: 0;
7
- @while ($i * $cove-spacers-offset) <= $cove-spacers-max {
8
- #{$className + $i} {
9
- @each $styleName in $styleNameCollection {
10
- #{$styleName}: #{($i * $cove-spacers-offset) + 'px'} !important;
11
- }
12
- }
13
- $i: $i + 1;
14
- }
15
- }
16
-
17
- @include spacers('.p-', 'padding');
18
- @include spacers('.pt-', 'padding-top');
19
- @include spacers('.pr-', 'padding-right');
20
- @include spacers('.pb-', 'padding-bottom');
21
- @include spacers('.pl-', 'padding-left');
22
- @include spacers('.px-', ('padding-left', 'padding-right'));
23
- @include spacers('.py-', ('padding-top', 'padding-bottom'));
24
-
25
- @include spacers('.m-', 'margin');
26
- @include spacers('.mt-', 'margin-top');
27
- @include spacers('.mr-', 'margin-right');
28
- @include spacers('.mb-', 'margin-bottom');
29
- @include spacers('.ml-', 'margin-left');
30
- @include spacers('.mx-', ('margin-left', 'margin-right'));
31
- @include spacers('.mx-', ('margin-top', 'margin-bottom'));