@cdc/core 4.26.2 → 4.26.3
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/LICENSE +201 -0
- package/_stories/Gallery.Charts.stories.tsx +1 -1
- package/_stories/Gallery.DataBite.stories.tsx +1 -1
- package/_stories/Gallery.Maps.stories.tsx +1 -1
- package/_stories/PageART.stories.tsx +1 -1
- package/_stories/PageBRFSS.stories.tsx +1 -1
- package/_stories/PageCancerRegistries.stories.tsx +1 -1
- package/_stories/PageEasternEquineEncephalitis.stories.tsx +3 -3
- package/_stories/PageExcessiveAlcoholUse.stories.tsx +1 -1
- package/_stories/PageMaternalMortality.stories.tsx +1 -1
- package/_stories/PageOralHealth.stories.tsx +1 -1
- package/_stories/PageRespiratory.stories.tsx +4 -4
- package/_stories/PageSmokingTobacco.stories.tsx +1 -1
- package/_stories/PageStateDiabetesProfiles.stories.tsx +1 -1
- package/_stories/PageWastewater.stories.tsx +4 -4
- package/_stories/VegaImport.stories.tsx +3 -3
- package/assets/callout-flag.svg +7 -0
- package/components/AdvancedEditor/EmbedEditor.tsx +1 -1
- package/components/Alert/components/Alert.styles.css +2 -2
- package/components/ComboBox/combobox.styles.css +48 -48
- package/components/CustomColorsEditor/CustomColorsEditor.css +53 -53
- package/components/DataTable/DataTable.tsx +46 -18
- package/components/DataTable/DataTableStandAlone.tsx +1 -0
- package/components/DataTable/components/ChartHeader.tsx +21 -12
- package/components/DataTable/components/MapHeader.tsx +34 -28
- package/components/DataTable/components/SortIcon/sort-icon.css +5 -5
- package/components/DataTable/data-table.css +50 -52
- package/components/DataTable/helpers/applyCustomOrder.ts +17 -0
- package/components/DataTable/helpers/getChartCellValue.ts +10 -7
- package/components/DataTable/helpers/getMapDataTableColumnKeys.ts +22 -0
- package/components/DataTable/helpers/mapCellMatrix.tsx +33 -23
- package/components/DataTable/helpers/tests/mapCellMatrix.test.ts +33 -0
- package/components/DownloadButton.tsx +14 -6
- package/components/EditorPanel/ColumnsEditor.tsx +38 -31
- package/components/EditorPanel/CustomSortOrder.tsx +94 -0
- package/components/EditorPanel/DataTableEditor.tsx +139 -23
- package/components/EditorPanel/EditorPanel.styles.css +71 -71
- package/components/EditorPanel/EditorPanel.tsx +3 -8
- package/components/EditorPanel/EditorPanelDispatch.tsx +4 -4
- package/components/EditorPanel/FootnotesEditor.tsx +2 -2
- package/components/EditorPanel/VizFilterEditor/NestedDropdownEditor.tsx +7 -6
- package/components/EditorPanel/VizFilterEditor/VizFilterEditor.tsx +12 -10
- package/components/EditorPanel/components/MarkupVariablesEditor.tsx +160 -106
- package/components/EditorPanel/components/PanelMarkup.tsx +5 -1
- package/{styles/v2/components → components/EditorPanel}/editor.scss +67 -13
- package/components/EditorPanel/sections/StyleTreatmentSection.tsx +99 -0
- package/components/EditorPanel/sections/VisualSection.tsx +11 -0
- package/components/EditorWrapper/editor-wrapper.style.css +1 -1
- package/components/Filters/Filters.tsx +3 -5
- package/components/Filters/components/Tabs.tsx +19 -7
- package/{styles → components/Filters}/filters.scss +3 -3
- package/components/Footnotes/FootnotesStandAlone.tsx +4 -2
- package/components/HeaderThemeSelector/HeaderThemeSelector.css +61 -5
- package/components/Layout/components/Responsive.tsx +14 -6
- package/components/Layout/components/Sidebar/components/Sidebar.tsx +1 -1
- package/components/Layout/components/Sidebar/components/sidebar.styles.scss +12 -18
- package/components/Layout/components/Visualization/index.tsx +39 -38
- package/components/Layout/components/Visualization/visualizations.scss +232 -15
- package/components/Layout/components/VisualizationContainer.test.tsx +67 -0
- package/components/Layout/components/VisualizationContainer.tsx +37 -0
- package/components/Layout/components/VisualizationContent.test.tsx +182 -0
- package/components/Layout/components/VisualizationContent.tsx +75 -0
- package/components/Layout/index.tsx +5 -5
- package/components/Layout/styles/editor-utils.scss +3 -3
- package/components/Layout/styles/editor.scss +4 -4
- package/components/Legend/Legend.Gradient.tsx +7 -1
- package/components/Loader/loader.styles.css +2 -2
- package/components/Loading.jsx +1 -1
- package/components/MediaControls.tsx +10 -2
- package/components/MultiSelect/multiselect.styles.css +19 -19
- package/components/NestedDropdown/nesteddropdown.styles.css +15 -15
- package/components/PaletteSelector/PaletteSelector.css +15 -15
- package/components/RichTooltip/richTooltip.css +6 -6
- package/components/Table/table.styles.css +2 -2
- package/components/Waiting.tsx +1 -1
- package/components/_stories/Filters.stories.tsx +1 -1
- package/components/_stories/styles.scss +0 -1
- package/components/elements/Button.jsx +1 -1
- package/components/elements/Card.jsx +1 -1
- package/{styles/v2/components → components/elements}/button.scss +9 -8
- package/components/inputs/InputCheckbox.jsx +1 -1
- package/components/inputs/InputSelect.tsx +1 -1
- package/components/inputs/InputText.jsx +1 -1
- package/components/inputs/InputToggle.tsx +1 -1
- package/{styles/v2/components/input → components/inputs}/_input-check-radio.scss +2 -2
- package/{styles/v2/components/input → components/inputs}/_input-group.scss +3 -3
- package/{styles/v2/components/input → components/inputs}/_input-slider.scss +2 -2
- package/{styles/v2/components/input → components/inputs}/_input.scss +5 -5
- package/{styles/v2/components/input → components/inputs}/index.scss +2 -2
- package/{styles → components}/loading.scss +1 -1
- package/components/managers/DataDesigner.tsx +1 -1
- package/{styles/v2/components → components/managers}/data-designer.scss +6 -7
- package/components/ui/Accordion.jsx +1 -1
- package/components/ui/Icon.tsx +1 -1
- package/components/ui/LoadSpin.jsx +1 -1
- package/components/ui/Modal.jsx +1 -1
- package/components/ui/Overlay.jsx +1 -1
- package/components/ui/Title/index.test.tsx +34 -0
- package/components/ui/Title/index.tsx +24 -7
- package/components/ui/Title/title.styles.css +119 -25
- package/components/ui/Tooltip.tsx +1 -1
- package/components/ui/_stories/Title.stories.tsx +1 -1
- package/{styles/v2/components → components/ui}/accordion.scss +3 -3
- package/components/ui/accordion.styles.css +11 -11
- package/{styles/v2/components → components/ui}/modal.scss +2 -2
- package/{styles/v2/components → components/ui}/overlay.scss +6 -6
- package/{styles/v2/components → components}/ui/tooltip.scss +1 -1
- package/{styles → components}/waiting.scss +9 -3
- package/devTemplate/dev.js +50 -0
- package/dist/cove-main.css +528 -231
- package/dist/cove-main.css.map +1 -1
- package/generateViteConfig.js +2 -2
- package/helpers/backfillDefaults.ts +35 -0
- package/helpers/constants.ts +12 -0
- package/helpers/cove/date.ts +32 -3
- package/helpers/cove/number.ts +29 -15
- package/helpers/coveUpdateWorker.ts +12 -8
- package/helpers/displayDataAsText.ts +1 -1
- package/helpers/embed/embedHelper.js +13 -2
- package/helpers/embed/index.ts +0 -4
- package/helpers/extractDataAndMetadata.ts +20 -0
- package/helpers/fetchRemoteData.ts +14 -8
- package/helpers/labelHash.ts +9 -0
- package/helpers/markupProcessor.ts +56 -38
- package/helpers/prepareScreenshot.ts +6 -3
- package/helpers/testing.ts +1 -1
- package/helpers/tests/abbreviateNumber.test.ts +59 -0
- package/helpers/tests/backfillDefaults.test.ts +253 -0
- package/helpers/tests/date.test.ts +46 -0
- package/helpers/tests/extractDataAndMetadata.test.ts +93 -0
- package/helpers/tests/markupProcessor.test.ts +315 -124
- package/helpers/tests/number.test.ts +42 -0
- package/helpers/tests/prepareScreenshot.test.ts +28 -28
- package/helpers/tests/testStandaloneBuild.ts +36 -26
- package/helpers/tests/useDataVizClasses.test.ts +66 -0
- package/helpers/tests/visualizationWrapperUsage.test.ts +57 -0
- package/helpers/useDataVizClasses.ts +13 -7
- package/helpers/ver/4.24.4.ts +24 -0
- package/helpers/ver/4.26.3.ts +44 -0
- package/helpers/ver/4.26.4.ts +31 -0
- package/helpers/ver/tests/4.26.3.test.ts +168 -0
- package/helpers/ver/tests/4.26.4.test.ts +88 -0
- package/helpers/ver/tests/coveUpdateWorker.test.ts +57 -0
- package/package.json +2 -2
- package/styles/_global.scss +7 -7
- package/styles/_reset.scss +2 -2
- package/styles/{v2/base → base}/_file-selector.scss +4 -4
- package/styles/{v2/base → base}/_general.scss +2 -4
- package/styles/{v2/base → base}/index.scss +1 -1
- package/styles/base.scss +107 -165
- package/styles/cove-main.scss +3 -6
- package/styles/layout/_component.scss +110 -0
- package/styles/{v2/layout → layout}/_data-table.scss +7 -7
- package/styles/layout/_wrapper-padding.scss +27 -0
- package/styles/{v2/main.scss → main.scss} +3 -1
- package/styles/{v2/themes → themes}/_color-definitions.scss +46 -41
- package/styles/{_accessibility.scss → utils/_accessibility.scss} +1 -1
- package/styles/{_global-variables.scss → utils/_properties.scss} +133 -112
- package/styles/{v2/utils → utils}/index.scss +2 -1
- package/types/Axis.ts +2 -0
- package/types/ComponentStyles.ts +1 -0
- package/types/ConfigureData.ts +1 -0
- package/types/MarkupInclude.ts +1 -0
- package/types/MarkupVariable.ts +2 -1
- package/types/Palette.ts +1 -0
- package/types/Table.ts +9 -0
- package/types/Visualization.ts +1 -0
- package/styles/_common-components.css +0 -73
- package/styles/_variables.scss +0 -63
- package/styles/v2/layout/_component.scss +0 -21
- package/styles/v2/utils/_variables.scss +0 -9
- package/{styles/v2/components/card.scss → components/elements/card.css} +2 -2
- /package/{styles/v2/components → components/ui}/icon.scss +0 -0
- /package/{styles/v2/components → components/ui}/loadspin.scss +0 -0
- /package/styles/{v2/base → base}/_heading.scss +0 -0
- /package/styles/{v2/base → base}/_reset.scss +0 -0
- /package/styles/{v2/layout → layout}/_alert.scss +0 -0
- /package/styles/{v2/layout → layout}/_progression.scss +0 -0
- /package/styles/{v2/layout → layout}/_tooltip.scss +0 -0
- /package/styles/{v2/layout → layout}/index.scss +0 -0
- /package/styles/{v2/themes → themes}/index.scss +0 -0
- /package/styles/{v2/utils → utils}/_align.scss +0 -0
- /package/styles/{v2/utils → utils}/_animations.scss +0 -0
- /package/styles/{v2/utils → utils}/_breakpoints.scss +0 -0
- /package/styles/{v2/utils → utils}/_grid.scss +0 -0
- /package/styles/{v2/utils → utils}/_mixins.scss +0 -0
|
@@ -6,7 +6,7 @@ import 'react-tooltip/dist/react-tooltip.css'
|
|
|
6
6
|
import type { PlacesType } from 'react-tooltip'
|
|
7
7
|
|
|
8
8
|
// Styles
|
|
9
|
-
import '
|
|
9
|
+
import './tooltip.scss'
|
|
10
10
|
|
|
11
11
|
const TooltipTarget = children => children
|
|
12
12
|
const TooltipContent = children => children
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
@import '
|
|
2
|
-
@import '
|
|
1
|
+
@import '../../styles/utils/properties';
|
|
2
|
+
@import '../../styles/themes/index';
|
|
3
3
|
|
|
4
4
|
.cove {
|
|
5
5
|
.cove-accordion__item {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
.cove-accordion__heading {
|
|
17
|
-
background:
|
|
17
|
+
background: var(--lightestGray);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.cove-accordion__button {
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.accordion__button {
|
|
8
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
|
|
8
9
|
cursor: pointer;
|
|
9
10
|
font-size: 1em;
|
|
10
11
|
padding: 0.3em 1em;
|
|
11
|
-
width: 100%;
|
|
12
|
-
text-align: left;
|
|
13
12
|
position: relative;
|
|
14
|
-
|
|
13
|
+
text-align: left;
|
|
14
|
+
width: 100%;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.accordion__panel:first-child {
|
|
@@ -19,31 +19,31 @@
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
.accordion__button:before {
|
|
22
|
-
|
|
22
|
+
border-bottom: 2px solid currentColor;
|
|
23
|
+
border-right: 2px solid currentColor;
|
|
23
24
|
content: '';
|
|
25
|
+
display: inline-block;
|
|
24
26
|
height: 7px;
|
|
25
|
-
width: 7px;
|
|
26
27
|
margin-right: 1em;
|
|
27
|
-
border-bottom: 2px solid currentColor;
|
|
28
|
-
border-right: 2px solid currentColor;
|
|
29
|
-
transform: rotate(-45deg) translateY(-50%);
|
|
30
|
-
right: 0;
|
|
31
28
|
position: absolute;
|
|
29
|
+
right: 0;
|
|
32
30
|
top: 50%;
|
|
31
|
+
transform: rotate(-45deg) translateY(-50%);
|
|
33
32
|
transition: 0.1s all;
|
|
33
|
+
width: 7px;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.accordion__button[aria-expanded='true']::before,
|
|
37
37
|
.accordion__button[aria-selected='true']::before {
|
|
38
|
-
transform: rotate(45deg) translateY(-50%);
|
|
39
38
|
margin-right: 1.3em;
|
|
39
|
+
transform: rotate(45deg) translateY(-50%);
|
|
40
40
|
transition: 0.1s all;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
.accordion__panel {
|
|
44
|
+
animation: fadein 0.2s ease-in;
|
|
44
45
|
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
|
|
45
46
|
padding: 1em 1.25em 2em;
|
|
46
|
-
animation: fadein 0.2s ease-in;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.accordion__panel h5 {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
@import '
|
|
2
|
-
@import '
|
|
1
|
+
@import '../../styles/utils/properties';
|
|
2
|
+
@import '../../styles/themes/index';
|
|
3
3
|
|
|
4
4
|
.cove-overlay {
|
|
5
5
|
display: flex;
|
|
@@ -14,21 +14,21 @@
|
|
|
14
14
|
|
|
15
15
|
&.animate-in {
|
|
16
16
|
.cove-overlay__bg {
|
|
17
|
-
animation: fadeIn 400ms
|
|
17
|
+
animation: fadeIn 400ms var(--transition-expo-out) 0s 1 forwards;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.cove-overlay__container {
|
|
21
|
-
animation: fadeInUp 700ms
|
|
21
|
+
animation: fadeInUp 700ms var(--transition-expo-out) 50ms 1 forwards;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
&.animate-out {
|
|
26
26
|
.cove-overlay__bg {
|
|
27
|
-
animation: fadeOut 400ms
|
|
27
|
+
animation: fadeOut 400ms var(--transition-expo-out) 0s 1 forwards;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.cove-overlay__container {
|
|
31
|
-
animation: fadeOut 400ms
|
|
31
|
+
animation: fadeOut 400ms var(--transition-expo-out) 0s 1 forwards;
|
|
32
32
|
transform: translateY(0);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -1,25 +1,31 @@
|
|
|
1
|
-
.
|
|
2
|
-
@import '
|
|
1
|
+
.cove-visualization {
|
|
2
|
+
@import '../styles/utils/mixins';
|
|
3
|
+
|
|
3
4
|
.waiting {
|
|
4
5
|
&.collapsed {
|
|
5
6
|
padding: 2em !important;
|
|
6
7
|
}
|
|
8
|
+
|
|
7
9
|
@include emptyState;
|
|
8
10
|
align-items: flex-start;
|
|
9
11
|
padding-top: 250px;
|
|
12
|
+
|
|
10
13
|
.waiting-container {
|
|
11
14
|
max-width: 400px;
|
|
12
15
|
}
|
|
16
|
+
|
|
13
17
|
h3 {
|
|
14
18
|
font-size: 1.3rem;
|
|
15
19
|
font-weight: 600;
|
|
16
20
|
margin-bottom: 0.3rem;
|
|
17
21
|
}
|
|
22
|
+
|
|
18
23
|
p {
|
|
19
24
|
font-size: 1em;
|
|
25
|
+
|
|
20
26
|
strong {
|
|
21
27
|
font-weight: bold;
|
|
22
28
|
}
|
|
23
29
|
}
|
|
24
30
|
}
|
|
25
|
-
}
|
|
31
|
+
}
|
package/devTemplate/dev.js
CHANGED
|
@@ -6,6 +6,56 @@ const params = new URLSearchParams(window.location.search)
|
|
|
6
6
|
const configParam = params.get('config')
|
|
7
7
|
let editorEnabled = params.get('editor') === 'true'
|
|
8
8
|
const previewEnabled = params.get('preview') === 'true'
|
|
9
|
+
const sectionGapParam = params.get('sectionGap')
|
|
10
|
+
const fontSizeParam = params.get('fontSize')
|
|
11
|
+
const metaFontSizeParam = params.get('metaFontSize')
|
|
12
|
+
|
|
13
|
+
if (sectionGapParam) {
|
|
14
|
+
const numericGap = Number(sectionGapParam)
|
|
15
|
+
if (!Number.isNaN(numericGap) && numericGap >= 0) {
|
|
16
|
+
document.documentElement.style.setProperty('--cove-visualization-section-gap', `${numericGap}px`)
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (fontSizeParam) {
|
|
21
|
+
const numericFontSize = Number(fontSizeParam)
|
|
22
|
+
if (!Number.isNaN(numericFontSize) && numericFontSize > 0) {
|
|
23
|
+
document.documentElement.style.setProperty('--app-font-size', `${numericFontSize}px`)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (metaFontSizeParam) {
|
|
28
|
+
const numericMetaFontSize = Number(metaFontSizeParam)
|
|
29
|
+
if (!Number.isNaN(numericMetaFontSize) && numericMetaFontSize > 0) {
|
|
30
|
+
document.documentElement.style.setProperty('--visualization-meta-font-size', `${numericMetaFontSize}px`)
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
window.addEventListener('message', event => {
|
|
35
|
+
const { data } = event
|
|
36
|
+
if (!data) return
|
|
37
|
+
|
|
38
|
+
if (data.type === 'cove:setSectionGap') {
|
|
39
|
+
const numericGap = Number(data.value)
|
|
40
|
+
if (Number.isNaN(numericGap) || numericGap < 0) return
|
|
41
|
+
|
|
42
|
+
document.documentElement.style.setProperty('--cove-visualization-section-gap', `${numericGap}px`)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (data.type === 'cove:setFontSize') {
|
|
46
|
+
const numericFontSize = Number(data.value)
|
|
47
|
+
if (Number.isNaN(numericFontSize) || numericFontSize <= 0) return
|
|
48
|
+
|
|
49
|
+
document.documentElement.style.setProperty('--app-font-size', `${numericFontSize}px`)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (data.type === 'cove:setMetaFontSize') {
|
|
53
|
+
const numericMetaFontSize = Number(data.value)
|
|
54
|
+
if (Number.isNaN(numericMetaFontSize) || numericMetaFontSize <= 0) return
|
|
55
|
+
|
|
56
|
+
document.documentElement.style.setProperty('--visualization-meta-font-size', `${numericMetaFontSize}px`)
|
|
57
|
+
}
|
|
58
|
+
})
|
|
9
59
|
|
|
10
60
|
if (configParam) {
|
|
11
61
|
document.querySelector('.react-container').setAttribute('data-config', configParam)
|