@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.
- package/components/DataTable/DataTable.tsx +26 -36
- package/components/DataTable/components/ChartHeader.tsx +3 -2
- package/components/DataTable/components/ExpandCollapse.tsx +1 -4
- package/components/DataTable/data-table.css +2 -7
- package/components/DataTable/helpers/customSort.ts +2 -2
- package/components/DataTable/helpers/mapCellMatrix.tsx +83 -60
- package/components/DataTable/types/TableConfig.ts +0 -1
- package/components/EditorPanel/FootnotesEditor.tsx +49 -7
- package/components/EditorPanel/VizFilterEditor/VizFilterEditor.tsx +3 -2
- package/components/Filters/Filters.tsx +16 -9
- package/components/Footnotes/Footnotes.tsx +1 -1
- package/components/Layout/components/Visualization/index.tsx +18 -4
- package/components/Layout/components/Visualization/visualizations.scss +1 -1
- package/components/Legend/Legend.Gradient.tsx +1 -4
- package/components/Legend/index.tsx +1 -1
- package/components/LegendShape.tsx +2 -3
- package/components/MediaControls.jsx +32 -8
- package/components/NestedDropdown/NestedDropdown.tsx +7 -12
- package/components/NestedDropdown/nesteddropdown.styles.css +11 -5
- package/components/Table/Table.tsx +0 -6
- package/components/Table/components/Row.tsx +2 -5
- package/components/_stories/DataTable.stories.tsx +1 -2
- package/components/elements/Button.jsx +38 -19
- package/components/elements/Confirm.tsx +45 -0
- package/components/elements/Error.tsx +24 -0
- package/components/managers/DataDesigner.tsx +198 -143
- package/components/ui/Title/Title.scss +12 -5
- package/components/ui/Title/index.tsx +1 -1
- package/dist/cove-main.css +77 -591
- package/dist/cove-main.css.map +1 -1
- package/helpers/DataTransform.ts +55 -63
- package/helpers/addValuesToFilters.ts +24 -9
- package/helpers/cove/accessibility.ts +24 -0
- package/helpers/cove/fontSettings.ts +1 -1
- package/helpers/cove/number.ts +1 -7
- package/helpers/coveUpdateWorker.ts +5 -1
- package/helpers/displayDataAsText.ts +64 -0
- package/helpers/formatConfigBeforeSave.ts +1 -1
- package/helpers/isOlderVersion.ts +20 -0
- package/helpers/missingRequiredSections.ts +20 -0
- package/helpers/tests/addValuesToFilters.test.ts +13 -0
- package/helpers/useDataVizClasses.ts +8 -4
- package/helpers/ver/4.24.11.ts +18 -0
- package/helpers/ver/4.25.1.ts +18 -0
- package/package.json +2 -2
- package/styles/_button-section.scss +2 -5
- package/styles/_global-variables.scss +17 -7
- package/styles/_global.scss +8 -12
- package/styles/_reset.scss +4 -5
- package/styles/_typography.scss +0 -20
- package/styles/_variables.scss +0 -3
- package/styles/base.scss +44 -5
- package/styles/cove-main.scss +1 -1
- package/styles/filters.scss +5 -6
- package/styles/v2/base/_general.scss +3 -2
- package/styles/v2/components/button.scss +0 -1
- package/styles/v2/main.scss +3 -4
- package/styles/v2/utils/index.scss +0 -1
- package/types/BoxPlot.ts +1 -0
- package/types/Runtime.ts +1 -0
- package/types/Table.ts +0 -1
- package/types/Version.ts +1 -1
- 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.
|
|
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": "
|
|
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:
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
:
|
|
96
|
-
|
|
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
|
}
|
package/styles/_global.scss
CHANGED
|
@@ -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
|
|
164
|
-
|
|
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(--
|
|
194
|
-
color: var(--
|
|
195
|
-
}
|
|
189
|
+
border: 1px solid var(--cool-gray-10);
|
|
190
|
+
color: var(--cool-gray-90);
|
|
191
|
+
}
|
package/styles/_reset.scss
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
.cdc-open-viz-module {
|
|
2
2
|
margin: 0;
|
|
3
|
-
font:
|
|
4
|
-
|
|
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:
|
|
92
|
+
font-family: var(--app-font-main);
|
|
94
93
|
font-weight: normal;
|
|
95
94
|
vertical-align: baseline;
|
|
96
95
|
}
|
package/styles/_typography.scss
CHANGED
|
@@ -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
|
-
}
|
package/styles/_variables.scss
CHANGED
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
|
}
|
package/styles/cove-main.scss
CHANGED
package/styles/filters.scss
CHANGED
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
&__wrapper {
|
|
3
3
|
flex-wrap: wrap;
|
|
4
4
|
display: flex;
|
|
5
|
-
gap:
|
|
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:
|
|
12
|
-
font-size:
|
|
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:
|
|
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;
|
package/styles/v2/main.scss
CHANGED
|
@@ -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:
|
|
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;
|
package/types/BoxPlot.ts
CHANGED
package/types/Runtime.ts
CHANGED
package/types/Table.ts
CHANGED
package/types/Version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export type
|
|
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'));
|