@cdc/core 4.26.1 → 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.
Files changed (249) hide show
  1. package/.claude/agents/qa-test-developer.md +126 -0
  2. package/CLAUDE.local.md +67 -0
  3. package/LICENSE +201 -0
  4. package/_stories/Gallery.Charts.stories.tsx +35 -42
  5. package/_stories/Gallery.DataBite.stories.tsx +15 -8
  6. package/_stories/Gallery.Maps.stories.tsx +37 -28
  7. package/_stories/Gallery.WaffleChart.stories.tsx +1 -1
  8. package/_stories/PageART.stories.tsx +5 -4
  9. package/_stories/PageBRFSS.stories.tsx +21 -16
  10. package/_stories/PageCancerRegistries.stories.tsx +15 -15
  11. package/_stories/PageEasternEquineEncephalitis.stories.tsx +33 -19
  12. package/_stories/PageExcessiveAlcoholUse.stories.tsx +148 -143
  13. package/_stories/PageMaternalMortality.stories.tsx +5 -4
  14. package/_stories/PageOralHealth.stories.tsx +15 -10
  15. package/_stories/PageRespiratory.stories.tsx +4 -4
  16. package/_stories/PageSmokingTobacco.stories.tsx +15 -10
  17. package/_stories/PageStateDiabetesProfiles.stories.tsx +15 -10
  18. package/_stories/PageWastewater.stories.tsx +44 -30
  19. package/_stories/VegaImport.stories.tsx +401 -0
  20. package/_stories/vega-fixtures/bars-with-line.json +444 -0
  21. package/_stories/vega-fixtures/bars.json +58 -0
  22. package/_stories/vega-fixtures/combo-bar-rolling-mean.json +88 -0
  23. package/_stories/vega-fixtures/combo.json +68 -0
  24. package/_stories/vega-fixtures/grouped-horizontal-bars.json +83 -0
  25. package/_stories/vega-fixtures/grouped-horizontal-bars2.json +231 -0
  26. package/_stories/vega-fixtures/horizontal-bar.json +427 -0
  27. package/_stories/vega-fixtures/horizontal-bars-with-bad-colors.json +197 -0
  28. package/_stories/vega-fixtures/horizontal-bars2.json +58 -0
  29. package/_stories/vega-fixtures/lines.json +227 -0
  30. package/_stories/vega-fixtures/measles-bars.json +348 -0
  31. package/_stories/vega-fixtures/measles-map.json +11101 -0
  32. package/_stories/vega-fixtures/measles-stacked-bars.json +2147 -0
  33. package/_stories/vega-fixtures/multi-dataset.json +255 -0
  34. package/_stories/vega-fixtures/no-data.json +14 -0
  35. package/_stories/vega-fixtures/pie-chart.json +94 -0
  36. package/_stories/vega-fixtures/repeat-spec.json +47 -0
  37. package/_stories/vega-fixtures/stacked-area.json +222 -0
  38. package/_stories/vega-fixtures/stacked-bar-with-rect.json +3412 -0
  39. package/_stories/vega-fixtures/stacked-bars-with-line.json +364 -0
  40. package/_stories/vega-fixtures/stacked-bars.json +212 -0
  41. package/_stories/vega-fixtures/stacked-horizontal-bars.json +140 -0
  42. package/_stories/vega-fixtures/warning-combo.json +59 -0
  43. package/_stories/vega-fixtures/warning-scatter-and-line.json +1182 -0
  44. package/assets/callout-flag.svg +7 -0
  45. package/assets/icon-chart-area.svg +1 -0
  46. package/assets/icon-chart-radar.svg +23 -0
  47. package/assets/logo2.svg +31 -0
  48. package/components/AdvancedEditor/EmbedEditor.tsx +270 -38
  49. package/components/Alert/components/Alert.styles.css +2 -2
  50. package/components/ComboBox/combobox.styles.css +48 -48
  51. package/components/CustomColorsEditor/CustomColorsEditor.css +53 -53
  52. package/components/CustomColorsEditor/CustomColorsEditor.tsx +3 -10
  53. package/components/DataTable/DataTable.tsx +46 -18
  54. package/components/DataTable/DataTableStandAlone.tsx +1 -0
  55. package/components/DataTable/components/ChartHeader.tsx +21 -12
  56. package/components/DataTable/components/MapHeader.tsx +34 -28
  57. package/components/DataTable/components/SortIcon/sort-icon.css +5 -5
  58. package/components/DataTable/data-table.css +50 -52
  59. package/components/DataTable/helpers/applyCustomOrder.ts +17 -0
  60. package/components/DataTable/helpers/getChartCellValue.ts +10 -7
  61. package/components/DataTable/helpers/getMapDataTableColumnKeys.ts +22 -0
  62. package/components/DataTable/helpers/getSeriesName.ts +6 -0
  63. package/components/DataTable/helpers/mapCellMatrix.tsx +33 -23
  64. package/components/DataTable/helpers/tests/mapCellMatrix.test.ts +33 -0
  65. package/components/DownloadButton.tsx +14 -6
  66. package/components/EditorPanel/ColumnsEditor.tsx +38 -31
  67. package/components/EditorPanel/CustomSortOrder.tsx +94 -0
  68. package/components/EditorPanel/DataTableEditor.tsx +139 -23
  69. package/components/EditorPanel/EditorPanel.styles.css +71 -71
  70. package/components/EditorPanel/EditorPanel.tsx +3 -8
  71. package/components/EditorPanel/EditorPanelDispatch.tsx +4 -4
  72. package/components/EditorPanel/FootnotesEditor.tsx +2 -2
  73. package/components/EditorPanel/VizFilterEditor/NestedDropdownEditor.tsx +21 -12
  74. package/components/EditorPanel/VizFilterEditor/VizFilterEditor.tsx +16 -10
  75. package/components/EditorPanel/VizFilterEditor/components/FilterOrder.tsx +33 -29
  76. package/components/EditorPanel/components/MarkupVariablesEditor.tsx +160 -106
  77. package/components/EditorPanel/components/PanelMarkup.tsx +5 -1
  78. package/{styles/v2/components → components/EditorPanel}/editor.scss +76 -22
  79. package/components/EditorPanel/sections/StyleTreatmentSection.tsx +99 -0
  80. package/components/EditorPanel/sections/VisualSection.tsx +11 -0
  81. package/components/EditorWrapper/editor-wrapper.style.css +1 -1
  82. package/components/Filters/Filters.tsx +3 -5
  83. package/components/Filters/components/Tabs.tsx +19 -7
  84. package/{styles → components/Filters}/filters.scss +3 -3
  85. package/components/Footnotes/FootnotesStandAlone.tsx +4 -2
  86. package/components/HeaderThemeSelector/HeaderThemeSelector.css +61 -5
  87. package/components/Layout/components/Responsive.tsx +14 -6
  88. package/components/Layout/components/Sidebar/components/Sidebar.tsx +1 -1
  89. package/components/Layout/components/Sidebar/components/sidebar.styles.scss +14 -20
  90. package/components/Layout/components/Visualization/index.tsx +50 -38
  91. package/components/Layout/components/Visualization/visualizations.scss +232 -15
  92. package/components/Layout/components/VisualizationContainer.test.tsx +67 -0
  93. package/components/Layout/components/VisualizationContainer.tsx +37 -0
  94. package/components/Layout/components/VisualizationContent.test.tsx +182 -0
  95. package/components/Layout/components/VisualizationContent.tsx +75 -0
  96. package/components/Layout/index.tsx +5 -5
  97. package/components/Layout/styles/editor-utils.scss +3 -3
  98. package/components/Layout/styles/editor.scss +4 -4
  99. package/components/Legend/Legend.Gradient.tsx +7 -1
  100. package/components/Loader/loader.styles.css +2 -2
  101. package/components/Loading.jsx +1 -1
  102. package/components/MediaControls.tsx +10 -3
  103. package/components/MultiSelect/multiselect.styles.css +19 -19
  104. package/components/NestedDropdown/nesteddropdown.styles.css +15 -15
  105. package/components/PaletteSelector/PaletteSelector.css +15 -15
  106. package/components/RichTooltip/richTooltip.css +6 -6
  107. package/components/Table/table.styles.css +2 -2
  108. package/components/Waiting.tsx +1 -1
  109. package/components/_stories/CustomColorsEditor.stories.tsx +37 -0
  110. package/components/_stories/DataTable.stories.tsx +1 -0
  111. package/components/_stories/Filters.stories.tsx +1 -1
  112. package/components/_stories/styles.scss +0 -1
  113. package/components/elements/Button.jsx +1 -1
  114. package/components/elements/Card.jsx +1 -1
  115. package/{styles/v2/components → components/elements}/button.scss +9 -8
  116. package/components/inputs/InputCheckbox.jsx +1 -1
  117. package/components/inputs/InputSelect.tsx +1 -1
  118. package/components/inputs/InputText.jsx +1 -1
  119. package/components/inputs/InputToggle.tsx +1 -1
  120. package/{styles/v2/components/input → components/inputs}/_input-check-radio.scss +2 -2
  121. package/{styles/v2/components/input → components/inputs}/_input-group.scss +3 -3
  122. package/{styles/v2/components/input → components/inputs}/_input-slider.scss +2 -2
  123. package/{styles/v2/components/input → components/inputs}/_input.scss +5 -5
  124. package/{styles/v2/components/input → components/inputs}/index.scss +2 -2
  125. package/{styles → components}/loading.scss +1 -1
  126. package/components/managers/DataDesigner.tsx +1 -1
  127. package/{styles/v2/components → components/managers}/data-designer.scss +6 -7
  128. package/components/ui/Accordion.jsx +1 -1
  129. package/components/ui/Icon.tsx +1 -1
  130. package/components/ui/LoadSpin.jsx +1 -1
  131. package/components/ui/Modal.jsx +1 -1
  132. package/components/ui/Overlay.jsx +1 -1
  133. package/components/ui/Title/index.test.tsx +34 -0
  134. package/components/ui/Title/index.tsx +24 -7
  135. package/components/ui/Title/title.styles.css +119 -25
  136. package/components/ui/Tooltip.tsx +1 -1
  137. package/components/ui/_stories/Title.stories.tsx +1 -1
  138. package/{styles/v2/components → components/ui}/accordion.scss +3 -3
  139. package/components/ui/accordion.styles.css +11 -11
  140. package/{styles/v2/components → components/ui}/modal.scss +2 -2
  141. package/{styles/v2/components → components/ui}/overlay.scss +6 -6
  142. package/{styles/v2/components → components}/ui/tooltip.scss +1 -1
  143. package/{styles → components}/waiting.scss +9 -3
  144. package/data/colorPalettes.ts +18 -5
  145. package/data/mapColorPalettes.ts +10 -0
  146. package/devTemplate/dev.js +285 -0
  147. package/devTemplate/index.html +30 -0
  148. package/devTemplate/preview.html +1503 -0
  149. package/devTemplate/sidebar.css +151 -0
  150. package/dist/cove-main.css +2530 -3901
  151. package/dist/cove-main.css.map +1 -1
  152. package/generateViteConfig.js +111 -2
  153. package/helpers/DataTransform.ts +1 -5
  154. package/helpers/backfillDefaults.ts +35 -0
  155. package/helpers/constants.ts +12 -0
  156. package/helpers/cove/date.ts +64 -3
  157. package/helpers/cove/number.ts +29 -15
  158. package/helpers/cove/string.ts +29 -0
  159. package/helpers/coveUpdateWorker.ts +14 -8
  160. package/helpers/displayDataAsText.ts +1 -1
  161. package/helpers/embed/embedCodeGenerator.ts +80 -0
  162. package/helpers/embed/embedHelper.js +169 -0
  163. package/helpers/embed/filterUtils.ts +121 -0
  164. package/helpers/embed/index.ts +17 -0
  165. package/helpers/embed/urlValidation.ts +119 -0
  166. package/helpers/extractDataAndMetadata.ts +20 -0
  167. package/helpers/fetchRemoteData.ts +14 -8
  168. package/helpers/filterVizData.ts +6 -1
  169. package/helpers/getFileExtension.ts +0 -6
  170. package/helpers/labelHash.ts +9 -0
  171. package/helpers/markupProcessor.ts +56 -38
  172. package/helpers/metrics/types.ts +3 -0
  173. package/helpers/palettes/colorDistributions.ts +1 -1
  174. package/helpers/palettes/utils.ts +12 -12
  175. package/helpers/parseCsvWithQuotes.ts +15 -14
  176. package/helpers/prepareScreenshot.ts +33 -10
  177. package/helpers/testing.ts +44 -0
  178. package/helpers/tests/DataTransform.test.ts +125 -0
  179. package/helpers/tests/abbreviateNumber.test.ts +59 -0
  180. package/helpers/tests/backfillDefaults.test.ts +253 -0
  181. package/helpers/tests/date.test.ts +110 -0
  182. package/helpers/tests/extractDataAndMetadata.test.ts +93 -0
  183. package/helpers/tests/markupProcessor.test.ts +315 -124
  184. package/helpers/tests/number.test.ts +42 -0
  185. package/helpers/tests/prepareScreenshot.test.ts +28 -28
  186. package/helpers/tests/testStandaloneBuild.ts +36 -26
  187. package/helpers/tests/useDataVizClasses.test.ts +66 -0
  188. package/helpers/tests/visualizationWrapperUsage.test.ts +57 -0
  189. package/helpers/useDataVizClasses.ts +13 -7
  190. package/helpers/vegaConfig.ts +1 -1
  191. package/helpers/vegaConfigImport.ts +160 -0
  192. package/helpers/ver/4.24.4.ts +24 -0
  193. package/helpers/ver/4.26.1.ts +1 -1
  194. package/helpers/ver/4.26.2.ts +84 -0
  195. package/helpers/ver/4.26.3.ts +44 -0
  196. package/helpers/ver/4.26.4.ts +31 -0
  197. package/helpers/ver/tests/4.26.1.test.ts +105 -0
  198. package/helpers/ver/tests/4.26.2.test.ts +298 -0
  199. package/helpers/ver/tests/4.26.3.test.ts +168 -0
  200. package/helpers/ver/tests/4.26.4.test.ts +88 -0
  201. package/helpers/ver/tests/coveUpdateWorker.test.ts +57 -0
  202. package/helpers/viewports.ts +2 -0
  203. package/package.json +27 -32
  204. package/styles/_global.scss +7 -7
  205. package/styles/_reset.scss +2 -2
  206. package/styles/{v2/base → base}/_file-selector.scss +4 -4
  207. package/styles/{v2/base → base}/_general.scss +2 -4
  208. package/styles/{v2/base → base}/index.scss +1 -1
  209. package/styles/base.scss +107 -165
  210. package/styles/cove-main.scss +3 -6
  211. package/styles/layout/_component.scss +110 -0
  212. package/styles/{v2/layout → layout}/_data-table.scss +7 -7
  213. package/styles/layout/_wrapper-padding.scss +27 -0
  214. package/styles/{v2/main.scss → main.scss} +3 -1
  215. package/styles/{v2/themes → themes}/_color-definitions.scss +46 -41
  216. package/styles/{_accessibility.scss → utils/_accessibility.scss} +1 -1
  217. package/styles/{v2/utils → utils}/_grid.scss +8 -3
  218. package/styles/{_global-variables.scss → utils/_properties.scss} +133 -112
  219. package/styles/{v2/utils → utils}/index.scss +2 -1
  220. package/types/Annotation.ts +10 -11
  221. package/types/Axis.ts +2 -0
  222. package/types/ComponentStyles.ts +1 -0
  223. package/types/ConfigureData.ts +1 -0
  224. package/types/General.ts +2 -0
  225. package/types/MarkupInclude.ts +1 -0
  226. package/types/MarkupVariable.ts +2 -1
  227. package/types/Palette.ts +22 -0
  228. package/types/Table.ts +9 -0
  229. package/types/Visualization.ts +7 -0
  230. package/_stories/StoryRenderingTests.stories.tsx +0 -164
  231. package/helpers/embedCodeGenerator.ts +0 -109
  232. package/styles/_common-components.css +0 -73
  233. package/styles/_variables.scss +0 -63
  234. package/styles/v2/layout/_component.scss +0 -21
  235. package/styles/v2/utils/_variables.scss +0 -9
  236. package/{styles/v2/components/card.scss → components/elements/card.css} +2 -2
  237. /package/{styles/v2/components → components/ui}/icon.scss +0 -0
  238. /package/{styles/v2/components → components/ui}/loadspin.scss +0 -0
  239. /package/styles/{v2/base → base}/_heading.scss +0 -0
  240. /package/styles/{v2/base → base}/_reset.scss +0 -0
  241. /package/styles/{v2/layout → layout}/_alert.scss +0 -0
  242. /package/styles/{v2/layout → layout}/_progression.scss +0 -0
  243. /package/styles/{v2/layout → layout}/_tooltip.scss +0 -0
  244. /package/styles/{v2/layout → layout}/index.scss +0 -0
  245. /package/styles/{v2/themes → themes}/index.scss +0 -0
  246. /package/styles/{v2/utils → utils}/_align.scss +0 -0
  247. /package/styles/{v2/utils → utils}/_animations.scss +0 -0
  248. /package/styles/{v2/utils → utils}/_breakpoints.scss +0 -0
  249. /package/styles/{v2/utils → utils}/_mixins.scss +0 -0
@@ -9,7 +9,7 @@ import {
9
9
  DATA_TABLE_SINGLE_ROW,
10
10
  DATA_TABLE_MULTI_ROW
11
11
  } from '../../templates/dataDesignerTables'
12
- import '../../styles/v2/components/data-designer.scss'
12
+ import './data-designer.scss'
13
13
  import { ConfigureData } from '../../types/ConfigureData'
14
14
 
15
15
  type DataDesignerProps = {
@@ -1,5 +1,4 @@
1
- @import '../utils/variables';
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 $lightGray;
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 $lightGray;
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: $primary;
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 $lightGray;
98
- border-bottom: 1px solid $lightGray;
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 '../../styles/v2/components/accordion.scss'
14
+ import './accordion.scss'
15
15
  import './accordion.styles.css'
16
16
 
17
17
  //Define the "slots" to be populated by subcomponents
@@ -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 '../../styles/v2/components/icon.scss'
41
+ import './icon.scss'
42
42
 
43
43
  const iconHash = {
44
44
  caretUp: iconCaretUp,
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import '../../styles/v2/components/loadspin.scss'
2
+ import './loadspin.scss'
3
3
 
4
4
  const LoadSpin = ({ color = '#fff', opacity = 100, size = 100, className }) => {
5
5
  const n = 8
@@ -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 '../../styles/v2/components/modal.scss'
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 '../../styles/v2/components/overlay.scss'
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 = ['cove-component__header', 'component__header', 'mb-3', ...classes]
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
- <header className={updatedClasses.join(' ')} style={props.style}>
56
- {superTitle && <sup>{parse(superTitle)}</sup>}
57
- <h2>
58
- {parse(title)} {isDashboard}
59
- </h2>
60
- </header>
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
- .cdc-open-viz-module header.cove-component__header {
2
- position: relative;
3
- padding: 1rem;
4
- margin: 0;
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
- & > sup {
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-component__header {
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
- .cdc-open-viz-module .cove-title--small {
197
+ .cove-visualization .cove-title--small {
105
198
  margin-bottom: 0.75rem;
106
199
  }
107
200
 
108
- .cdc-open-viz-module .cove-title--large {
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
- .cdc-open-viz-module .cove-title--no-content {
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
- .cdc-open-viz-module .cove-title h2 {
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
- border-bottom: 1px solid var(--cool-gray-10);
215
+ font-size: 1.95rem;
123
216
  font-weight: 300;
124
217
  }
125
218
 
126
- .cdc-open-viz-module .cove-title h3 {
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
- .cdc-open-viz-module .cove-title sup {
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
- color: #666;
230
+
137
231
  sup {
138
232
  font-size: 75%;
139
233
  }
140
- }
234
+ }
@@ -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 '../../styles/v2/components/ui/tooltip.scss'
9
+ import './tooltip.scss'
10
10
 
11
11
  const TooltipTarget = children => children
12
12
  const TooltipContent = children => children
@@ -6,7 +6,7 @@ const meta: Meta = {
6
6
  component: Title,
7
7
  decorators: [
8
8
  Story => (
9
- <div className='cdc-open-viz-module'>
9
+ <div className='cove-visualization'>
10
10
  <Story />
11
11
  </div>
12
12
  )
@@ -1,5 +1,5 @@
1
- @import '../utils/variables';
2
- @import '../themes/index';
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: $lightestGray;
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
- border-bottom: 1px solid rgba(0, 0, 0, 0.2);
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
- display: inline-block;
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 '../utils/variables';
2
- @import '../themes/index';
1
+ @import '../../styles/utils/properties';
2
+ @import '../../styles/themes/index';
3
3
 
4
4
  .cove-overlay {
5
5
  .cove-modal {
@@ -1,5 +1,5 @@
1
- @import '../utils/variables';
2
- @import '../themes/index';
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 $transition-expo-out 0s 1 forwards;
17
+ animation: fadeIn 400ms var(--transition-expo-out) 0s 1 forwards;
18
18
  }
19
19
 
20
20
  .cove-overlay__container {
21
- animation: fadeInUp 700ms $transition-expo-out 50ms 1 forwards;
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 $transition-expo-out 0s 1 forwards;
27
+ animation: fadeOut 400ms var(--transition-expo-out) 0s 1 forwards;
28
28
  }
29
29
 
30
30
  .cove-overlay__container {
31
- animation: fadeOut 400ms $transition-expo-out 0s 1 forwards;
31
+ animation: fadeOut 400ms var(--transition-expo-out) 0s 1 forwards;
32
32
  transform: translateY(0);
33
33
  }
34
34
  }
@@ -11,7 +11,7 @@
11
11
 
12
12
  // Namespace to cove project, inconveniently using two different classes.
13
13
  .cove,
14
- .cdc-open-viz-module {
14
+ .cove-visualization {
15
15
  // todo: move to a utils folder.
16
16
  .capitalize {
17
17
  text-transform: capitalize;
@@ -1,25 +1,31 @@
1
- .cdc-open-viz-module {
2
- @import 'v2/utils/mixins';
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
+ }
@@ -1,9 +1,22 @@
1
- import { mapColorPalettes, mapColorPalettesV1, mapColorPalettesV2 } from './mapColorPalettes'
2
- import { chartColorPalettes, sequentialPalettes, colorPalettesChart, colorPalettesChartV1, colorPalettesChartV2, twoColorPalette } from './chartColorPalettes'
3
-
1
+ import { mapColorPalettes, mapColorPalettesV1, mapColorPalettesV2, sequentialZeroColors } from './mapColorPalettes'
2
+ import {
3
+ chartColorPalettes,
4
+ sequentialPalettes,
5
+ colorPalettesChart,
6
+ colorPalettesChartV1,
7
+ colorPalettesChartV2,
8
+ twoColorPalette
9
+ } from './chartColorPalettes'
4
10
 
5
11
  // Re-export map palettes (already processed in mapColorPalettes.ts)
6
- export { mapColorPalettes, mapColorPalettesV1, mapColorPalettesV2 }
12
+ export { mapColorPalettes, mapColorPalettesV1, mapColorPalettesV2, sequentialZeroColors }
7
13
 
8
14
  // Re-export chart palettes (already processed in chartColorPalettes.ts)
9
- export { chartColorPalettes, sequentialPalettes, colorPalettesChart, colorPalettesChartV1, colorPalettesChartV2, twoColorPalette }
15
+ export {
16
+ chartColorPalettes,
17
+ sequentialPalettes,
18
+ colorPalettesChart,
19
+ colorPalettesChartV1,
20
+ colorPalettesChartV2,
21
+ twoColorPalette
22
+ }
@@ -43,3 +43,13 @@ export const mapColorPalettes = {
43
43
 
44
44
  export const mapColorPalettesV1 = mapColorPalettes.v1
45
45
  export const mapColorPalettesV2 = mapColorPalettes.v2
46
+
47
+ // Lighter colors (first palette color 75% toward white) for zero-value categories in v2 sequential palettes
48
+ // Used when: categorical map, gradient legend, first category value is "0", palette not reversed
49
+ export const sequentialZeroColors: Record<string, string> = {
50
+ sequential_blue: '#F6F9FD',
51
+ sequential_teal: '#F9FEFE',
52
+ sequential_purple: '#F8F4F7',
53
+ sequential_orange: '#FFF8F5',
54
+ sequential_green: '#F5FEFD'
55
+ }