@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
@@ -1,4 +1,4 @@
1
- @import '../../../styles/v2/utils/variables';
1
+ @import '../../../styles/utils/properties';
2
2
 
3
3
  $editorAnimationTimer: 400ms;
4
4
  $mediumGray: #e6e6e6;
@@ -81,7 +81,7 @@ $mediumGray: #e6e6e6;
81
81
 
82
82
  @at-root {
83
83
  .cove-editor {
84
- width: $editorWidth;
84
+ width: var(--editorWidth);
85
85
  }
86
86
  }
87
87
  }
@@ -127,8 +127,8 @@ $mediumGray: #e6e6e6;
127
127
  background-color: #e6e6e6;
128
128
  transition: background-color 400ms cubic-bezier(0.16, 1, 0.3, 1);
129
129
  overflow: hidden auto;
130
- width: calc(100% - $editorWidth);
131
- left: $editorWidth;
130
+ width: calc(100% - var(--editorWidth));
131
+ left: var(--editorWidth);
132
132
  @at-root {
133
133
  .cove-editor.panel-shown #{&} {
134
134
  background-color: #e7e7e7;
@@ -99,7 +99,13 @@ const LegendGradient = ({
99
99
  if (style === 'gradient') {
100
100
  return (
101
101
  // TODO: figure out why bootstrap 'overflow: visible' is not working consistently
102
- <svg className={'w-100 overflow-visible'} height={newHeight} style={{ overflow: 'visible' }} width={width}>
102
+ <svg
103
+ className={'w-100 overflow-visible'}
104
+ height={newHeight}
105
+ style={{ display: 'block', maxWidth: '100%', overflow: 'visible' }}
106
+ viewBox={`0 0 ${width} ${newHeight}`}
107
+ width='100%'
108
+ >
103
109
  {/* background border*/}
104
110
  <rect x={0} y={0} width={legendWidth + MARGIN * 2} height={boxHeight + MARGIN * 2} fill={BORDER_COLOR} />
105
111
  {/* Define the gradient */}
@@ -1,10 +1,10 @@
1
1
  .cove-loader {
2
2
  &.fullscreen {
3
3
  background: rgba(255, 255, 255, 0.8);
4
- position: absolute;
5
- width: 100%;
6
4
  display: flex;
7
5
  justify-content: center;
6
+ position: absolute;
7
+ width: 100%;
8
8
  z-index: 100;
9
9
  & > * {
10
10
  margin-top: 40vh;
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import '../styles/loading.scss'
2
+ import './loading.scss'
3
3
 
4
4
  export default function Loading({ viewport = 'lg' }) {
5
5
  return (
@@ -1,5 +1,4 @@
1
1
  import React from 'react'
2
- // import html2pdf from 'html2pdf.js'
3
2
  import { publishAnalyticsEvent } from '@cdc/core/helpers/metrics/helpers'
4
3
  import { getVizTitle, getVizSubType } from '@cdc/core/helpers/metrics/utils'
5
4
  import { prepareScreenshotContainer } from '@cdc/core/helpers/prepareScreenshot'
@@ -162,6 +161,13 @@ const Button = ({
162
161
  }) => {
163
162
  const buttonClasses = ['btn', 'btn-primary']
164
163
 
164
+ const label =
165
+ type === 'csv'
166
+ ? state?.table?.downloadDataLabel || buttonText[type]
167
+ : type === 'image'
168
+ ? state?.table?.downloadImageLabel || buttonText[type]
169
+ : buttonText[type]
170
+
165
171
  return (
166
172
  <button
167
173
  className={buttonClasses.join(' ')}
@@ -169,7 +175,7 @@ const Button = ({
169
175
  onClick={() => generateMedia(state, type, elementToCapture, interactionLabel, includeContextInDownload)}
170
176
  style={{ lineHeight: '1.4em' }}
171
177
  >
172
- {buttonText[type]}
178
+ {label}
173
179
  </button>
174
180
  )
175
181
  }
@@ -185,7 +191,8 @@ const DownloadLink = ({
185
191
  }) => {
186
192
  const vizType = state?.type === 'map' ? 'Map' : 'Chart'
187
193
  const format = type === 'pdf' ? 'PDF' : 'PNG'
188
- const linkText = `Download ${vizType} (${format})`
194
+ const defaultLinkText = `Download ${vizType} (${format})`
195
+ const linkText = type === 'image' ? state?.table?.downloadImageLabel || defaultLinkText : defaultLinkText
189
196
 
190
197
  return (
191
198
  <a
@@ -3,45 +3,45 @@
3
3
  display: block;
4
4
  }
5
5
  .wrapper {
6
- display: inline-flex;
7
6
  align-items: center;
7
+ display: inline-flex;
8
8
  width: 100%;
9
9
  .selected {
10
10
  &[aria-disabled='true'] {
11
11
  background: var(--lightestGray);
12
12
  }
13
13
  border: 1px solid var(--lightGray);
14
- padding: 7px;
14
+ border-radius: 5px;
15
+ display: inline-block;
15
16
  min-width: 200px;
17
+ padding: 7px;
16
18
  width: 100%;
17
- display: inline-block;
18
19
  :is(button) {
19
- border: none;
20
20
  background: none;
21
+ border: none;
21
22
  }
22
23
  :is(div) {
23
- display: inline-block;
24
- padding: 0 0 0 5px;
25
- margin-right: 5px;
26
- margin-bottom: 2px;
27
24
  background: var(--lightGray);
28
25
  border-radius: 5px;
26
+ display: inline-block;
27
+ margin-bottom: 2px;
28
+ margin-right: 5px;
29
+ padding: 0 0 0 5px;
29
30
  }
30
31
  .expand {
31
- padding: 2px 0px;
32
- margin-right: -6px;
32
+ color: var(--mediumGray);
33
33
  float: right;
34
34
  margin-bottom: -3px;
35
- color: var(--mediumGray);
35
+ margin-right: -6px;
36
+ padding: 2px 0px;
36
37
  &:focus {
37
38
  outline: none;
38
39
  }
39
40
  }
40
- border-radius: 5px;
41
41
  }
42
42
  .cove-tooltip__content {
43
- position: absolute;
44
43
  min-width: 120px;
44
+ position: absolute;
45
45
  :is(p) {
46
46
  margin-bottom: 0;
47
47
  }
@@ -52,15 +52,15 @@
52
52
  }
53
53
  .dropdown {
54
54
  background: white;
55
- position: absolute;
56
- top: var(--select-height);
57
- margin-top: 0px;
58
55
  border: 1px solid var(--lightGray);
59
- padding-left: 0;
60
- min-height: 40px;
56
+ margin-top: 0px;
61
57
  max-height: 200px;
62
- overflow-y: scroll;
58
+ min-height: 40px;
63
59
  min-width: 200px;
60
+ overflow-y: scroll;
61
+ padding-left: 0;
62
+ position: absolute;
63
+ top: var(--select-height);
64
64
  z-index: 4;
65
65
 
66
66
  :is(li) {
@@ -1,4 +1,4 @@
1
- .cdc-dashboard-inner-container.cove-component__content.cove-dashboard-filters-container:has(
1
+ .cdc-dashboard-inner-container.cove-visualization__body.cove-dashboard-filters-container:has(
2
2
  > .nested-dropdown.open-filter
3
3
  )
4
4
  :has(> .nested-dropdown-container) {
@@ -16,14 +16,14 @@
16
16
  }
17
17
 
18
18
  .search-input {
19
- color: var(--cool-gray-90);
20
- font-weight: 300;
21
19
 
22
20
  border: none;
23
- position: relative;
21
+ color: var(--cool-gray-90);
24
22
  display: inline-block;
25
- width: 100%;
23
+ font-weight: 300;
26
24
  padding: 0;
25
+ position: relative;
26
+ width: 100%;
27
27
  &::placeholder {
28
28
  color: var(--cool-gray-90);
29
29
  }
@@ -36,21 +36,21 @@
36
36
  [class^='main-nested-dropdown-container-'],
37
37
  .nested-dropdown-input-container {
38
38
  border: 1px solid var(--cool-gray-10);
39
+ font-size: 1em;
39
40
  min-width: 200px;
40
41
  padding: 0.4rem 0.75rem;
41
- font-size: 1em;
42
42
  }
43
43
 
44
44
  [class^='selectable-item-'] {
45
+ font-weight: normal;
45
46
  list-style: none;
46
47
  padding-left: 20px;
47
48
  position: relative;
48
- font-weight: normal;
49
49
  white-space: nowrap;
50
50
 
51
51
  & .check-mark {
52
- position: absolute;
53
52
  left: 0px;
53
+ position: absolute;
54
54
  }
55
55
 
56
56
  &:hover {
@@ -59,16 +59,16 @@
59
59
  }
60
60
 
61
61
  .nested-dropdown-input-container {
62
- display: block;
63
- width: calc(100% + 7px);
64
62
  border-radius: 0.25rem;
63
+ display: block;
65
64
  position: relative;
65
+ width: calc(100% + 7px);
66
66
  & > span.list-arrow {
67
- position: absolute;
68
- top: 9px;
69
- right: 9px;
70
67
  float: right;
71
68
  pointer-events: none;
69
+ position: absolute;
70
+ right: 9px;
71
+ top: 9px;
72
72
  }
73
73
 
74
74
  &.disabled {
@@ -80,12 +80,12 @@
80
80
  }
81
81
 
82
82
  & [class^='main-nested-dropdown-container-'] {
83
+ background: white;
83
84
  max-height: 375px;
85
+ min-width: 200px;
84
86
  overflow-y: auto;
85
87
  position: absolute;
86
88
  z-index: 3;
87
- min-width: 200px;
88
- background: white;
89
89
  }
90
90
 
91
91
  .hide {
@@ -7,12 +7,12 @@
7
7
 
8
8
  /* List item-based palette selector (used by maps) */
9
9
  .color-palette li {
10
- width: 1.5em;
11
- height: 1.5em;
10
+ border: rgba(0, 0, 0, 0.3) 3px solid;
11
+ cursor: pointer;
12
12
  display: inline-block;
13
+ height: 1.5em;
13
14
  margin-right: 0.5em;
14
- cursor: pointer;
15
- border: rgba(0, 0, 0, 0.3) 3px solid;
15
+ width: 1.5em;
16
16
  }
17
17
 
18
18
  .color-palette li.active {
@@ -33,25 +33,25 @@
33
33
  }
34
34
 
35
35
  .color-palette a {
36
- display: inline-block;
37
36
  border-bottom: 1px solid rgba(0, 0, 0, 0.8);
37
+ display: inline-block;
38
38
  }
39
39
 
40
40
  /* Series list variant */
41
41
  .color-palette.series-list {
42
+ border: none;
42
43
  flex-direction: column;
43
44
  padding: 0;
44
- border: none;
45
45
  }
46
46
 
47
47
  .color-palette.series-list li {
48
- padding: 0.3em 0.5em;
49
- display: flex;
50
48
  align-items: center;
49
+ border: 0;
50
+ display: flex;
51
+ height: auto;
51
52
  justify-content: space-between;
53
+ padding: 0.3em 0.5em;
52
54
  width: auto;
53
- height: auto;
54
- border: 0;
55
55
  }
56
56
 
57
57
  .color-palette.series-list li:not(:last-child) {
@@ -60,18 +60,18 @@
60
60
 
61
61
  /* Header variant */
62
62
  .header .color-palette li {
63
- width: 1.5em;
64
- height: 1.5em;
65
63
  display: inline-block;
64
+ height: 1.5em;
65
+ width: 1.5em;
66
66
  }
67
67
 
68
68
  /* Developer rollback component styles */
69
69
  .developer-palette-rollback {
70
- margin: 8px 0;
71
- padding: 8px;
70
+ background-color: #fffbf0;
72
71
  border: 1px dashed #ffc107;
73
72
  border-radius: 4px;
74
- background-color: #fffbf0;
73
+ margin: 8px 0;
74
+ padding: 8px;
75
75
  }
76
76
 
77
77
  .developer-palette-rollback .rollback-info {
@@ -1,16 +1,16 @@
1
1
  .tooltip-link {
2
+ color: var(--cool-gray-90);
3
+ cursor: pointer;
4
+ font-family: var(--app-font-main);
5
+ font-size: 0.833rem !important;
6
+ position: relative;
2
7
  text-decoration: underline;
3
8
  text-decoration-color: var(--cool-gray-90);
4
9
  text-decoration-style: dotted;
5
10
  text-decoration-thickness: 2px;
6
11
  text-underline-offset: 0.25rem;
7
- position: relative;
8
- cursor: pointer;
9
- color: var(--cool-gray-90);
10
- font-family: var(--app-font-main);
11
- font-size: 0.833rem !important;
12
12
  }
13
13
  .tooltip-link:hover {
14
- text-decoration-color: #009ec1;
15
14
  color: var(--cool-gray-90);
15
+ text-decoration-color: #009ec1;
16
16
  }
@@ -2,9 +2,9 @@
2
2
  clip: rect(0 0 0 0);
3
3
  clip-path: inset(50%);
4
4
  height: 1px;
5
+ left: -10000px;
5
6
  overflow: hidden;
7
+ position: fixed;
6
8
  white-space: nowrap;
7
9
  width: 1px;
8
- position: fixed;
9
- left: -10000px;
10
10
  }
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import '../styles/waiting.scss'
2
+ import './waiting.scss'
3
3
 
4
4
  const styles = {
5
5
  position: 'relative',
@@ -0,0 +1,37 @@
1
+ import React, { useState } from 'react'
2
+ import type { Meta, StoryObj } from '@storybook/react-vite'
3
+ import CustomColorsEditor from '../CustomColorsEditor/CustomColorsEditor'
4
+
5
+ const meta: Meta<typeof CustomColorsEditor> = {
6
+ title: 'Components/Atoms/CustomColorsEditor',
7
+ component: CustomColorsEditor
8
+ }
9
+
10
+ export default meta
11
+ type Story = StoryObj<typeof CustomColorsEditor>
12
+
13
+ const fiftyColors = [
14
+ '#e6194b', '#3cb44b', '#ffe119', '#4363d8', '#f58231',
15
+ '#911eb4', '#42d4f4', '#f032e6', '#bfef45', '#fabed4',
16
+ '#469990', '#dcbeff', '#9a6324', '#fffac8', '#800000',
17
+ '#aaffc3', '#808000', '#ffd8b1', '#000075', '#a9a9a9',
18
+ '#e6194b', '#3cb44b', '#ffe119', '#4363d8', '#f58231',
19
+ '#911eb4', '#42d4f4', '#f032e6', '#bfef45', '#fabed4',
20
+ '#469990', '#dcbeff', '#9a6324', '#fffac8', '#800000',
21
+ '#aaffc3', '#808000', '#ffd8b1', '#000075', '#a9a9a9',
22
+ '#e41a1c', '#377eb8', '#4daf4a', '#984ea3', '#ff7f00',
23
+ '#ffff33', '#a65628', '#f781bf', '#999999', '#66c2a5'
24
+ ]
25
+
26
+ const Wrapper = ({ initialColors }: { initialColors: string[] }) => {
27
+ const [colors, setColors] = useState(initialColors)
28
+ return <CustomColorsEditor colors={colors} onChange={setColors} label='Custom Color Order' />
29
+ }
30
+
31
+ export const Default: Story = {
32
+ render: () => <Wrapper initialColors={['#3366cc', '#dc3912', '#ff9900']} />
33
+ }
34
+
35
+ export const FiftyColors: Story = {
36
+ render: () => <Wrapper initialColors={fiftyColors} />
37
+ }
@@ -45,6 +45,7 @@ export const CityState: Story = {
45
45
  tabbingId: '#asdf',
46
46
  columns: CityStateExample.columns,
47
47
  applyLegendToRow: () => ['#000'],
48
+ getPatternForRow: () => null,
48
49
  displayGeoName
49
50
  },
50
51
  decorators: [
@@ -11,7 +11,7 @@ const meta: Meta<typeof Filters> = {
11
11
  component: Filters,
12
12
  decorators: [
13
13
  Story => (
14
- <div className='cdc-open-viz-module'>
14
+ <div className='cove-visualization'>
15
15
  <Story />
16
16
  </div>
17
17
  )
@@ -1,5 +1,4 @@
1
1
  @import '../../styles/base.scss';
2
- @import '../../styles/_variables';
3
2
  @import '../../styles/_global.scss';
4
3
 
5
4
 
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
3
3
 
4
4
  import LoadSpin from '../ui/LoadSpin'
5
5
 
6
- import '../../styles/v2/components/button.scss'
6
+ import './button.scss'
7
7
 
8
8
  const Button = ({
9
9
  style,
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
 
3
- import '../../styles/v2/components/card.scss'
3
+ import './card.css'
4
4
 
5
5
  const Card = ({ children, className, ...attributes }) => {
6
6
  return (
@@ -1,6 +1,6 @@
1
1
  @use 'sass:color';
2
- @import '../utils/variables';
3
- @import '../themes/index';
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
- .cdc-open-viz-module button.cove-button {
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 $transition-expo-out, color 500ms $transition-expo-out,
46
- border-color 500ms $transition-expo-out;
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 $transition-expo-out;
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 $transition-expo-out;
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 $transition-expo-out;
174
+ transition: all 500ms var(--transition-expo-out);
174
175
  opacity: 0;
175
176
  }
@@ -2,7 +2,7 @@ import React, { useState, useEffect, memo } from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
 
4
4
  import Check from '../../assets/icon-check.svg'
5
- import '../../styles/v2/components/input/index.scss'
5
+ import './index.scss'
6
6
 
7
7
  const InputCheckbox = memo(
8
8
  ({
@@ -1,4 +1,4 @@
1
- import '../../styles/v2/components/input/index.scss'
1
+ import './index.scss'
2
2
 
3
3
  interface InputProps {
4
4
  label?
@@ -1,7 +1,7 @@
1
1
  import React, { useState, useEffect, memo } from 'react'
2
2
  import { useDebounce } from 'use-debounce'
3
3
 
4
- import '../../styles/v2/components/input/index.scss'
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)
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useEffect } from 'react'
2
2
 
3
- import '../../styles/v2/components/input/index.scss'
3
+ import './index.scss'
4
4
 
5
5
  type InputSliderProps = {
6
6
  /** Add label to the input field */
@@ -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 $transition-expo-out;
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 $transition-expo-out;
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: $baseColor;
68
+ color: var(--baseColor);
69
69
  text-align: center;
70
70
  white-space: nowrap;
71
- background-color: $lightestGray;
72
- border: 1px solid $lightGray;
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 $transition-expo-out;
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 $transition-expo-out;
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 $transition-expo-out;
9
+ transition: border-color 200ms var(--transition-expo-out);
10
10
  font-family: sans-serif;
11
- color: $baseColor;
11
+ color: var(--baseColor);
12
12
  width: 100%;
13
13
  max-width: 100%;
14
14
 
15
15
  &::placeholder {
16
- transition: opacity 400ms $transition-expo-out;
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: $baseColor;
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: $baseColor;
55
+ color: var(--baseColor);
56
56
  }
57
57
 
58
58
  .cove-input--hidden {
@@ -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
  @import 'input';
5
5
  @import 'input-check-radio';
@@ -21,7 +21,7 @@
21
21
  }
22
22
  }
23
23
 
24
- .cdc-open-viz-module .loading {
24
+ .cove-visualization .loading {
25
25
  text-align: center;
26
26
  position: absolute;
27
27
  z-index: 3;