@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@use 'sass:color';
|
|
2
|
-
@import '
|
|
3
|
-
@import '
|
|
2
|
+
@import '../../styles/utils/properties';
|
|
3
|
+
@import '../../styles/themes/index';
|
|
4
4
|
|
|
5
5
|
:root {
|
|
6
6
|
--cove-button-primary: var(--colors-blue-vivid-60);
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
.
|
|
32
|
+
.cove-visualization button.cove-button {
|
|
33
33
|
display: inline-block;
|
|
34
34
|
position: relative;
|
|
35
35
|
min-height: 2.125rem;
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
border-radius: 6px;
|
|
43
43
|
border: 0;
|
|
44
44
|
outline: none;
|
|
45
|
-
transition: background-color 500ms
|
|
46
|
-
border-color 500ms
|
|
45
|
+
transition: background-color 500ms var(--transition-expo-out), color 500ms var(--transition-expo-out),
|
|
46
|
+
border-color 500ms var(--transition-expo-out);
|
|
47
47
|
|
|
48
48
|
&.secondary {
|
|
49
49
|
background-color: var(--cove-button-secondary);
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
&:disabled {
|
|
71
71
|
background-color: var(--cove-button-primary-disabled);
|
|
72
72
|
color: var(--cove-button-primary-disabled-font-color);
|
|
73
|
+
border: none;
|
|
73
74
|
cursor: not-allowed;
|
|
74
75
|
}
|
|
75
76
|
|
|
@@ -140,7 +141,7 @@
|
|
|
140
141
|
|
|
141
142
|
.cove-button__text {
|
|
142
143
|
position: relative;
|
|
143
|
-
transition: width 500ms
|
|
144
|
+
transition: width 500ms var(--transition-expo-out);
|
|
144
145
|
align-self: stretch;
|
|
145
146
|
|
|
146
147
|
.cove-button__text--loading {
|
|
@@ -157,7 +158,7 @@
|
|
|
157
158
|
top: 0;
|
|
158
159
|
left: 0;
|
|
159
160
|
white-space: nowrap;
|
|
160
|
-
transition: all 500ms
|
|
161
|
+
transition: all 500ms var(--transition-expo-out);
|
|
161
162
|
}
|
|
162
163
|
}
|
|
163
164
|
|
|
@@ -170,6 +171,6 @@
|
|
|
170
171
|
.cove-button__text--loading,
|
|
171
172
|
.cove-button__load-spin {
|
|
172
173
|
white-space: nowrap;
|
|
173
|
-
transition: all 500ms
|
|
174
|
+
transition: all 500ms var(--transition-expo-out);
|
|
174
175
|
opacity: 0;
|
|
175
176
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect, memo } from 'react'
|
|
2
2
|
import { useDebounce } from 'use-debounce'
|
|
3
3
|
|
|
4
|
-
import '
|
|
4
|
+
import './index.scss'
|
|
5
5
|
|
|
6
6
|
const InputText = memo(({ label, section = null, subsection = null, fieldName, updateField, value: stateValue, type = 'input', tooltip, placeholder, i = null, min = null, max = null, className, ...attributes }) => {
|
|
7
7
|
const [value, setValue] = useState(stateValue)
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
background-color: #f4f4f4;
|
|
80
80
|
border-radius: 3px;
|
|
81
81
|
box-shadow: inset 0 0 0 1px #c4c4c4;
|
|
82
|
-
transition: all 150ms
|
|
82
|
+
transition: all 150ms var(--transition-expo-out);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
.cove-input__checkbox-check {
|
|
@@ -92,6 +92,6 @@
|
|
|
92
92
|
fill: #fff;
|
|
93
93
|
pointer-events: none;
|
|
94
94
|
transform: translateY(-1px);
|
|
95
|
-
transition: all 250ms
|
|
95
|
+
transition: all 250ms var(--transition-expo-out);
|
|
96
96
|
opacity: 0;
|
|
97
97
|
}
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
font-size: 1rem;
|
|
66
66
|
font-weight: 400;
|
|
67
67
|
line-height: 1.5;
|
|
68
|
-
color:
|
|
68
|
+
color: var(--baseColor);
|
|
69
69
|
text-align: center;
|
|
70
70
|
white-space: nowrap;
|
|
71
|
-
background-color:
|
|
72
|
-
border: 1px solid
|
|
71
|
+
background-color: var(--lightestGray);
|
|
72
|
+
border: 1px solid var(--lightGray);
|
|
73
73
|
border-radius: 0.1875rem;
|
|
74
74
|
}
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
background-color: #fff;
|
|
168
168
|
box-shadow: -2px 4px 10px -7px rgb(0 0 0);
|
|
169
169
|
border-radius: 100%;
|
|
170
|
-
transition: all 200ms
|
|
170
|
+
transition: all 200ms var(--transition-expo-out);
|
|
171
171
|
z-index: 2;
|
|
172
172
|
}
|
|
173
173
|
|
|
@@ -179,5 +179,5 @@
|
|
|
179
179
|
height: 100%;
|
|
180
180
|
background-color: #ccc;
|
|
181
181
|
border-radius: 999px;
|
|
182
|
-
transition: all 200ms
|
|
182
|
+
transition: all 200ms var(--transition-expo-out);
|
|
183
183
|
}
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
border-style: solid !important; // intentional use of !important for CDC
|
|
7
7
|
border-color: #cbcbcb !important; // intentional use of !important for CDC
|
|
8
8
|
border-radius: 0.1875rem;
|
|
9
|
-
transition: border-color 200ms
|
|
9
|
+
transition: border-color 200ms var(--transition-expo-out);
|
|
10
10
|
font-family: sans-serif;
|
|
11
|
-
color:
|
|
11
|
+
color: var(--baseColor);
|
|
12
12
|
width: 100%;
|
|
13
13
|
max-width: 100%;
|
|
14
14
|
|
|
15
15
|
&::placeholder {
|
|
16
|
-
transition: opacity 400ms
|
|
16
|
+
transition: opacity 400ms var(--transition-expo-out);
|
|
17
17
|
color: #b3b3b3;
|
|
18
18
|
opacity: 1;
|
|
19
19
|
}
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
display: inline-block;
|
|
43
43
|
margin-bottom: 0.5rem;
|
|
44
44
|
font-size: 0.75rem;
|
|
45
|
-
color:
|
|
45
|
+
color: var(--baseColor);
|
|
46
46
|
text-transform: uppercase;
|
|
47
47
|
user-select: none;
|
|
48
48
|
}
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
min-height: 140px;
|
|
53
53
|
max-width: 100%;
|
|
54
54
|
line-height: 1.5em;
|
|
55
|
-
color:
|
|
55
|
+
color: var(--baseColor);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
.cove-input--hidden {
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
DATA_TABLE_SINGLE_ROW,
|
|
10
10
|
DATA_TABLE_MULTI_ROW
|
|
11
11
|
} from '../../templates/dataDesignerTables'
|
|
12
|
-
import '
|
|
12
|
+
import './data-designer.scss'
|
|
13
13
|
import { ConfigureData } from '../../types/ConfigureData'
|
|
14
14
|
|
|
15
15
|
type DataDesignerProps = {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
@import '
|
|
2
|
-
@import '../themes/color-definitions';
|
|
1
|
+
@import '../../styles/utils/properties';
|
|
3
2
|
|
|
4
3
|
.cove-modal__content {
|
|
5
4
|
.dataset-selector-container {
|
|
@@ -59,7 +58,7 @@
|
|
|
59
58
|
right: 0;
|
|
60
59
|
bottom: 0;
|
|
61
60
|
left: 0;
|
|
62
|
-
border: 1px solid
|
|
61
|
+
border: 1px solid var(--lightGray);
|
|
63
62
|
border-radius: 0.25rem;
|
|
64
63
|
}
|
|
65
64
|
}
|
|
@@ -82,20 +81,20 @@
|
|
|
82
81
|
table {
|
|
83
82
|
font-size: 0.8rem;
|
|
84
83
|
background-color: #fff;
|
|
85
|
-
border: 1px solid
|
|
84
|
+
border: 1px solid var(--lightGray);
|
|
86
85
|
border-collapse: collapse;
|
|
87
86
|
|
|
88
87
|
th {
|
|
89
88
|
color: white;
|
|
90
89
|
text-align: left;
|
|
91
|
-
background-color:
|
|
90
|
+
background-color: var(--primary);
|
|
92
91
|
}
|
|
93
92
|
|
|
94
93
|
th,
|
|
95
94
|
td {
|
|
96
95
|
padding: 0 5px;
|
|
97
|
-
border-top: 1px solid
|
|
98
|
-
border-bottom: 1px solid
|
|
96
|
+
border-top: 1px solid var(--lightGray);
|
|
97
|
+
border-bottom: 1px solid var(--lightGray);
|
|
99
98
|
}
|
|
100
99
|
}
|
|
101
100
|
}
|
|
@@ -11,7 +11,7 @@ import PropTypes from 'prop-types'
|
|
|
11
11
|
import Icon from './Icon'
|
|
12
12
|
import Tooltip from './Tooltip'
|
|
13
13
|
|
|
14
|
-
import '
|
|
14
|
+
import './accordion.scss'
|
|
15
15
|
import './accordion.styles.css'
|
|
16
16
|
|
|
17
17
|
//Define the "slots" to be populated by subcomponents
|
package/components/ui/Icon.tsx
CHANGED
|
@@ -38,7 +38,7 @@ import iconRotateLeft from '../../assets/icon-rotate-left.svg'
|
|
|
38
38
|
import iconCommand from '../../assets/icon-command.svg'
|
|
39
39
|
import iconMagnifyingGlass from '../../assets/icon-magnifying-glass.svg'
|
|
40
40
|
|
|
41
|
-
import '
|
|
41
|
+
import './icon.scss'
|
|
42
42
|
|
|
43
43
|
const iconHash = {
|
|
44
44
|
caretUp: iconCaretUp,
|
package/components/ui/Modal.jsx
CHANGED
|
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types'
|
|
|
4
4
|
import { useGlobalContext } from '../GlobalContext'
|
|
5
5
|
import Icon from './Icon'
|
|
6
6
|
|
|
7
|
-
import '
|
|
7
|
+
import './modal.scss'
|
|
8
8
|
|
|
9
9
|
//Define the "slots" to be populated by subcomponents
|
|
10
10
|
const ModalHeader = () => null
|
|
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react'
|
|
|
2
2
|
|
|
3
3
|
import { useGlobalContext } from '../GlobalContext'
|
|
4
4
|
|
|
5
|
-
import '
|
|
5
|
+
import './overlay.scss'
|
|
6
6
|
|
|
7
7
|
const Overlay = ({ disableBgClose, children, override = null }) => {
|
|
8
8
|
//Access global modal state
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { render, screen } from '@testing-library/react'
|
|
3
|
+
import { describe, expect, it } from 'vitest'
|
|
4
|
+
import Title from './index'
|
|
5
|
+
|
|
6
|
+
const baseConfig = {
|
|
7
|
+
type: 'chart',
|
|
8
|
+
theme: 'theme-blue'
|
|
9
|
+
} as any
|
|
10
|
+
|
|
11
|
+
describe('Title', () => {
|
|
12
|
+
it('does not add legacy bottom margin classes for wrapped visualizations', () => {
|
|
13
|
+
render(<Title title='Wrapped title' titleStyle='legacy' config={baseConfig} />)
|
|
14
|
+
|
|
15
|
+
expect(screen.getByRole('banner')).not.toHaveClass('mb-3')
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
it('keeps legacy dashboard title spacing classes', () => {
|
|
19
|
+
render(<Title title='Dashboard title' titleStyle='legacy' config={baseConfig} isDashboard={true} />)
|
|
20
|
+
|
|
21
|
+
expect(screen.getByRole('banner')).toHaveClass('mb-3')
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
it('renders legacy custom header markup via modern shim wrapper', () => {
|
|
25
|
+
const legacyHeaderTitle =
|
|
26
|
+
'<header class="cove-component__header component__header theme-blue mb-0"><h2>Medicaid Coverage of Cessation Treatments, 2024-Q2</h2></header>'
|
|
27
|
+
|
|
28
|
+
const { container } = render(<Title title={legacyHeaderTitle} titleStyle='small' config={baseConfig} />)
|
|
29
|
+
|
|
30
|
+
expect(container.querySelector('.cove-title__legacy-shim')).toBeInTheDocument()
|
|
31
|
+
expect(container.querySelector('.cove-title h3')).not.toBeInTheDocument()
|
|
32
|
+
expect(container.querySelector('header.cove-component__header.component__header')).toBeInTheDocument()
|
|
33
|
+
})
|
|
34
|
+
})
|
|
@@ -19,6 +19,7 @@ type HeaderProps = {
|
|
|
19
19
|
|
|
20
20
|
const Title = (props: HeaderProps) => {
|
|
21
21
|
const {
|
|
22
|
+
config,
|
|
22
23
|
isDashboard,
|
|
23
24
|
title,
|
|
24
25
|
superTitle,
|
|
@@ -29,6 +30,10 @@ const Title = (props: HeaderProps) => {
|
|
|
29
30
|
noContent = false
|
|
30
31
|
} = props
|
|
31
32
|
|
|
33
|
+
// Temporary visual verification gate for the legacy title shim.
|
|
34
|
+
const SHOW_SHIM_TITLE = false
|
|
35
|
+
const shimThemeClass = props.theme || config?.theme || 'theme-blue'
|
|
36
|
+
|
|
32
37
|
if (titleStyle === 'large' || titleStyle === 'small') {
|
|
33
38
|
const TitleElement = titleStyle === 'large' ? 'h2' : 'h3'
|
|
34
39
|
|
|
@@ -47,17 +52,29 @@ const Title = (props: HeaderProps) => {
|
|
|
47
52
|
}
|
|
48
53
|
|
|
49
54
|
// LEGACY BLOCKY HEADER (Original design with colored backgrounds)
|
|
50
|
-
const updatedClasses = [
|
|
55
|
+
const updatedClasses = [
|
|
56
|
+
'cove-visualization__title',
|
|
57
|
+
'cove-visualization__header',
|
|
58
|
+
...(isDashboard ? ['mb-3'] : []),
|
|
59
|
+
...classes
|
|
60
|
+
]
|
|
51
61
|
|
|
52
62
|
return (
|
|
53
63
|
title &&
|
|
54
64
|
showTitle && (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
65
|
+
<>
|
|
66
|
+
<header className={updatedClasses.join(' ')} style={props.style}>
|
|
67
|
+
{superTitle && <sup>{parse(superTitle)}</sup>}
|
|
68
|
+
<h2>
|
|
69
|
+
{parse(title)} {isDashboard}
|
|
70
|
+
</h2>
|
|
71
|
+
</header>
|
|
72
|
+
{SHOW_SHIM_TITLE && (
|
|
73
|
+
<div className='cove-title__legacy-preview'>
|
|
74
|
+
<header class="cove-component__header component__header theme-blue mb-0"><h2>Medicaid Coverage of Cessation Treatments, 2024-Q2</h2></header>
|
|
75
|
+
</div>
|
|
76
|
+
)}
|
|
77
|
+
</>
|
|
61
78
|
)
|
|
62
79
|
)
|
|
63
80
|
}
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
.cove-visualization header.cove-visualization__title,
|
|
2
|
+
.cove-visualization header.cove-visualization__header {
|
|
3
|
+
|
|
4
|
+
border-top-left-radius: 3px;
|
|
5
|
+
border-top-right-radius: 3px;
|
|
5
6
|
color: var(--white);
|
|
7
|
+
margin: 0;
|
|
8
|
+
padding: 1rem;
|
|
9
|
+
position: relative;
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
font-size: var(--superTitle-font-size);
|
|
11
|
+
&>sup {
|
|
9
12
|
font-family: var(--app-font-secondary);
|
|
13
|
+
font-size: var(--superTitle-font-size);
|
|
10
14
|
font-weight: 500;
|
|
11
15
|
text-transform: uppercase;
|
|
12
16
|
top: 0;
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
h2 {
|
|
16
|
-
font-size: var(--title-font-size);
|
|
17
|
-
font-family: var(--app-font-secondary);
|
|
18
20
|
color: var(--white);
|
|
21
|
+
font-family: var(--app-font-secondary);
|
|
22
|
+
font-size: var(--title-font-size);
|
|
19
23
|
margin: 0;
|
|
20
24
|
}
|
|
21
25
|
|
|
22
|
-
border-top-left-radius: 3px;
|
|
23
|
-
border-top-right-radius: 3px;
|
|
24
|
-
|
|
25
26
|
&.mb-0 {
|
|
26
27
|
margin-bottom: 0 !important;
|
|
27
28
|
}
|
|
@@ -35,8 +36,8 @@
|
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
&:not(:empty) {
|
|
38
|
-
border-bottom-width: 4px;
|
|
39
39
|
border-bottom-style: solid;
|
|
40
|
+
border-bottom-width: 4px;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
&.bite-header {
|
|
@@ -47,42 +48,52 @@
|
|
|
47
48
|
background: #712177;
|
|
48
49
|
border-bottom-color: #b890bb;
|
|
49
50
|
}
|
|
51
|
+
|
|
50
52
|
&.theme-brown {
|
|
51
53
|
background: #705043;
|
|
52
54
|
border-bottom-color: #ad907b;
|
|
53
55
|
}
|
|
56
|
+
|
|
54
57
|
&.theme-teal {
|
|
55
58
|
background: #00695c;
|
|
56
59
|
border-bottom-color: #4ebaaa;
|
|
57
60
|
}
|
|
61
|
+
|
|
58
62
|
&.theme-pink {
|
|
59
63
|
background: #af4448;
|
|
60
64
|
border-bottom-color: #e57373;
|
|
61
65
|
}
|
|
66
|
+
|
|
62
67
|
&.theme-orange {
|
|
63
68
|
background: #bb4d00;
|
|
64
69
|
border-bottom-color: #ffad42;
|
|
65
70
|
}
|
|
71
|
+
|
|
66
72
|
&.theme-slate {
|
|
67
73
|
background: #29434e;
|
|
68
74
|
border-bottom-color: #7e9ba5;
|
|
69
75
|
}
|
|
76
|
+
|
|
70
77
|
&.theme-indigo {
|
|
71
78
|
background: #26418f;
|
|
72
79
|
border-bottom-color: #92a6dd;
|
|
73
80
|
}
|
|
81
|
+
|
|
74
82
|
&.theme-cyan {
|
|
75
83
|
background: #007b91;
|
|
76
84
|
border-bottom-color: #65b0bd;
|
|
77
85
|
}
|
|
86
|
+
|
|
78
87
|
&.theme-green {
|
|
79
88
|
background: #4b830d;
|
|
80
89
|
border-bottom-color: #84bc49;
|
|
81
90
|
}
|
|
91
|
+
|
|
82
92
|
&.theme-amber {
|
|
83
93
|
background: #fbab18;
|
|
84
94
|
border-bottom-color: #ffd54f;
|
|
85
95
|
}
|
|
96
|
+
|
|
86
97
|
&.theme-blue {
|
|
87
98
|
background: #005eaa;
|
|
88
99
|
border-bottom-color: #88c3ea;
|
|
@@ -93,48 +104,131 @@
|
|
|
93
104
|
}
|
|
94
105
|
}
|
|
95
106
|
|
|
96
|
-
.type-sparkline.type-chart .cove-
|
|
107
|
+
.type-sparkline.type-chart .cove-visualization__title,
|
|
108
|
+
.type-sparkline.type-chart .cove-visualization__header {
|
|
97
109
|
margin: 0px !important;
|
|
98
110
|
}
|
|
99
111
|
|
|
112
|
+
/* ============================================================================
|
|
113
|
+
LEGACY SHIM PREVIEW
|
|
114
|
+
============================================================================ */
|
|
115
|
+
|
|
116
|
+
header.cove-component__header {
|
|
117
|
+
border-bottom-style: solid;
|
|
118
|
+
border-bottom-width: 4px;
|
|
119
|
+
border-top-left-radius: 3px;
|
|
120
|
+
border-top-right-radius: 3px;
|
|
121
|
+
color: var(--white);
|
|
122
|
+
margin: 0;
|
|
123
|
+
padding: 1rem;
|
|
124
|
+
position: relative;
|
|
125
|
+
|
|
126
|
+
h2 {
|
|
127
|
+
color: var(--white);
|
|
128
|
+
font-family: var(--app-font-secondary);
|
|
129
|
+
font-size: var(--title-font-size);
|
|
130
|
+
margin: 0;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&.theme-purple {
|
|
134
|
+
background: #712177;
|
|
135
|
+
border-bottom-color: #b890bb;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&.theme-brown {
|
|
139
|
+
background: #705043;
|
|
140
|
+
border-bottom-color: #ad907b;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&.theme-teal {
|
|
144
|
+
background: #00695c;
|
|
145
|
+
border-bottom-color: #4ebaaa;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&.theme-pink {
|
|
149
|
+
background: #af4448;
|
|
150
|
+
border-bottom-color: #e57373;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&.theme-orange {
|
|
154
|
+
background: #bb4d00;
|
|
155
|
+
border-bottom-color: #ffad42;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&.theme-slate {
|
|
159
|
+
background: #29434e;
|
|
160
|
+
border-bottom-color: #7e9ba5;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&.theme-indigo {
|
|
164
|
+
background: #26418f;
|
|
165
|
+
border-bottom-color: #92a6dd;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&.theme-cyan {
|
|
169
|
+
background: #007b91;
|
|
170
|
+
border-bottom-color: #65b0bd;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&.theme-green {
|
|
174
|
+
background: #4b830d;
|
|
175
|
+
border-bottom-color: #84bc49;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&.theme-amber {
|
|
179
|
+
background: #fbab18;
|
|
180
|
+
border-bottom-color: #ffd54f;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
&.theme-blue {
|
|
184
|
+
background: #005eaa;
|
|
185
|
+
border-bottom-color: #88c3ea;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
&.mb-0 {
|
|
189
|
+
margin-bottom: 0 !important;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
100
193
|
/* ============================================================================
|
|
101
194
|
MODERN TITLE
|
|
102
195
|
============================================================================ */
|
|
103
196
|
|
|
104
|
-
.
|
|
197
|
+
.cove-visualization .cove-title--small {
|
|
105
198
|
margin-bottom: 0.75rem;
|
|
106
199
|
}
|
|
107
200
|
|
|
108
|
-
.
|
|
201
|
+
.cove-visualization .cove-title--large {
|
|
109
202
|
margin-bottom: 1.33rem;
|
|
110
203
|
}
|
|
111
204
|
|
|
112
205
|
/* Used in dashboards to more closely associate a title-only component with the content below it */
|
|
113
|
-
.
|
|
114
|
-
margin-top: 1rem;
|
|
206
|
+
.cove-visualization .cove-title--no-content {
|
|
115
207
|
margin-bottom: 0;
|
|
208
|
+
margin-top: 1rem;
|
|
116
209
|
}
|
|
117
210
|
|
|
118
|
-
.
|
|
211
|
+
.cove-visualization .cove-title h2 {
|
|
212
|
+
border-bottom: 1px solid var(--cool-gray-10);
|
|
119
213
|
color: #0b4778;
|
|
120
|
-
font-size: 1.95rem;
|
|
121
214
|
font-family: var(--app-font-secondary);
|
|
122
|
-
|
|
215
|
+
font-size: 1.95rem;
|
|
123
216
|
font-weight: 300;
|
|
124
217
|
}
|
|
125
218
|
|
|
126
|
-
.
|
|
127
|
-
font-size: 1.5rem;
|
|
219
|
+
.cove-visualization .cove-title h3 {
|
|
128
220
|
font-family: var(--app-font-secondary);
|
|
221
|
+
font-size: 1.5rem;
|
|
129
222
|
}
|
|
130
223
|
|
|
131
|
-
.
|
|
224
|
+
.cove-visualization .cove-title sup {
|
|
225
|
+
color: #666;
|
|
132
226
|
font-family: var(--app-font-secondary);
|
|
133
227
|
font-size: 0.75rem;
|
|
134
228
|
font-weight: 600;
|
|
135
229
|
text-transform: uppercase;
|
|
136
|
-
|
|
230
|
+
|
|
137
231
|
sup {
|
|
138
232
|
font-size: 75%;
|
|
139
233
|
}
|
|
140
|
-
}
|
|
234
|
+
}
|