@cdc/core 4.25.10 → 4.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/_stories/Gallery.Charts.stories.tsx +307 -0
  2. package/_stories/Gallery.DataBite.stories.tsx +72 -0
  3. package/_stories/Gallery.Maps.stories.tsx +230 -0
  4. package/_stories/Gallery.WaffleChart.stories.tsx +187 -0
  5. package/_stories/PageART.stories.tsx +192 -0
  6. package/_stories/PageBRFSS.stories.tsx +289 -0
  7. package/_stories/PageCancerRegistries.stories.tsx +199 -0
  8. package/_stories/PageEasternEquineEncephalitis.stories.tsx +202 -0
  9. package/_stories/PageExcessiveAlcoholUse.stories.tsx +196 -0
  10. package/_stories/PageMaternalMortality.stories.tsx +192 -0
  11. package/_stories/PageOralHealth.stories.tsx +196 -0
  12. package/_stories/PageRespiratory.stories.tsx +332 -0
  13. package/_stories/PageSmokingTobacco.stories.tsx +195 -0
  14. package/_stories/PageStateDiabetesProfiles.stories.tsx +196 -0
  15. package/_stories/PageWastewater.stories.tsx +463 -0
  16. package/_stories/StoryRenderingTests.stories.tsx +164 -0
  17. package/assets/icon-magnifying-glass.svg +5 -0
  18. package/assets/icon-warming-stripes.svg +13 -0
  19. package/components/AdvancedEditor/AdvancedEditor.tsx +7 -1
  20. package/components/AdvancedEditor/EmbedEditor.tsx +281 -0
  21. package/components/ComboBox/ComboBox.tsx +345 -0
  22. package/components/ComboBox/combobox.styles.css +185 -0
  23. package/components/ComboBox/index.ts +1 -0
  24. package/components/CustomColorsEditor/CustomColorsEditor.css +299 -0
  25. package/components/CustomColorsEditor/CustomColorsEditor.tsx +209 -0
  26. package/components/CustomColorsEditor/index.ts +1 -0
  27. package/components/DataTable/DataTable.tsx +132 -58
  28. package/components/DataTable/DataTableStandAlone.tsx +8 -3
  29. package/components/DataTable/components/DataTableEditorPanel.tsx +12 -2
  30. package/components/DataTable/data-table.css +217 -210
  31. package/components/DataTable/helpers/mapCellMatrix.tsx +28 -9
  32. package/components/DataTable/helpers/standardizeState.js +2 -2
  33. package/components/DataTable/helpers/tests/standardizeState.test.js +54 -0
  34. package/components/EditorPanel/ColumnsEditor.tsx +37 -19
  35. package/components/EditorPanel/DataTableEditor.tsx +54 -28
  36. package/components/EditorPanel/EditorPanel.styles.css +439 -0
  37. package/components/EditorPanel/EditorPanel.tsx +144 -0
  38. package/components/EditorPanel/EditorPanelDispatch.tsx +75 -0
  39. package/components/EditorPanel/FieldSetWrapper.tsx +66 -23
  40. package/components/EditorPanel/FootnotesEditor.tsx +44 -37
  41. package/components/EditorPanel/Inputs.tsx +44 -8
  42. package/components/EditorPanel/VizFilterEditor/NestedDropdownEditor.tsx +35 -62
  43. package/components/EditorPanel/VizFilterEditor/VizFilterEditor.tsx +246 -175
  44. package/components/EditorPanel/components/MarkupVariablesEditor.tsx +61 -22
  45. package/components/EditorPanel/sections/VisualSection.tsx +169 -0
  46. package/components/Filters/Filters.tsx +57 -10
  47. package/components/Filters/components/Dropdown.tsx +6 -1
  48. package/components/Filters/helpers/getNestedOptions.ts +2 -1
  49. package/components/Filters/helpers/handleSorting.ts +1 -1
  50. package/components/Footnotes/Footnotes.tsx +35 -25
  51. package/components/Footnotes/FootnotesStandAlone.tsx +42 -6
  52. package/components/HeaderThemeSelector/HeaderThemeSelector.css +43 -0
  53. package/components/HeaderThemeSelector/HeaderThemeSelector.stories.tsx +74 -0
  54. package/components/HeaderThemeSelector/HeaderThemeSelector.tsx +61 -0
  55. package/components/HeaderThemeSelector/index.ts +2 -0
  56. package/components/Layout/components/Sidebar/components/sidebar.styles.scss +82 -0
  57. package/components/Layout/components/Visualization/index.tsx +16 -1
  58. package/components/Layout/components/Visualization/visualizations.scss +7 -0
  59. package/components/Layout/styles/editor.scss +2 -1
  60. package/components/Legend/Legend.Gradient.tsx +1 -1
  61. package/components/Loader/Loader.tsx +1 -1
  62. package/components/MediaControls.tsx +63 -34
  63. package/components/PaletteConversionModal.tsx +7 -4
  64. package/components/PaletteSelector/PaletteSelector.css +49 -6
  65. package/components/Table/components/Cell.tsx +23 -2
  66. package/components/Table/components/Row.tsx +5 -3
  67. package/components/_stories/Filters.stories.tsx +20 -1
  68. package/components/_stories/Footnotes.CSV.stories.tsx +247 -0
  69. package/components/_stories/Footnotes.stories.tsx +768 -3
  70. package/components/_stories/Inputs.stories.tsx +2 -2
  71. package/components/_stories/styles.scss +0 -1
  72. package/components/ui/Accordion.jsx +1 -1
  73. package/components/ui/Icon.tsx +3 -1
  74. package/components/ui/Title/index.tsx +30 -2
  75. package/components/ui/Title/title.styles.css +42 -0
  76. package/components/ui/accordion.styles.css +57 -0
  77. package/data/chartColorPalettes.ts +1 -1
  78. package/dist/cove-main.css +75 -6
  79. package/dist/cove-main.css.map +1 -1
  80. package/generateViteConfig.js +8 -1
  81. package/helpers/addValuesToFilters.ts +11 -1
  82. package/helpers/constants.ts +37 -0
  83. package/helpers/cove/number.ts +33 -12
  84. package/helpers/coveUpdateWorker.ts +20 -11
  85. package/helpers/embedCodeGenerator.ts +109 -0
  86. package/helpers/fetchRemoteData.ts +3 -15
  87. package/helpers/getUniqueValues.ts +19 -0
  88. package/helpers/hashObj.ts +25 -0
  89. package/helpers/isRightAlignedTableValue.js +5 -0
  90. package/helpers/markupProcessor.ts +27 -12
  91. package/helpers/mergeCustomOrderValues.ts +37 -0
  92. package/helpers/metrics/helpers.ts +1 -0
  93. package/helpers/parseCsvWithQuotes.ts +65 -0
  94. package/helpers/pivotData.ts +2 -2
  95. package/helpers/prepareScreenshot.ts +268 -0
  96. package/helpers/queryStringUtils.ts +29 -0
  97. package/helpers/testing.ts +17 -4
  98. package/helpers/tests/prepareScreenshot.test.ts +414 -0
  99. package/helpers/tests/queryStringUtils.test.ts +381 -0
  100. package/helpers/tests/testStandaloneBuild.ts +23 -5
  101. package/helpers/useDataVizClasses.ts +0 -1
  102. package/helpers/ver/4.25.11.ts +13 -0
  103. package/helpers/ver/4.26.1.ts +80 -0
  104. package/helpers/viewports.ts +2 -0
  105. package/hooks/useDataColumns.ts +63 -0
  106. package/hooks/useFilterManagement.ts +94 -0
  107. package/hooks/useLegendSeparators.ts +26 -0
  108. package/hooks/useListManagement.ts +192 -0
  109. package/package.json +6 -4
  110. package/styles/_button-section.scss +0 -3
  111. package/styles/_common-components.css +73 -0
  112. package/styles/_global.scss +25 -5
  113. package/styles/base.scss +0 -50
  114. package/styles/cove-main.scss +3 -1
  115. package/styles/filters.scss +10 -3
  116. package/styles/v2/base/index.scss +0 -1
  117. package/styles/v2/components/editor.scss +14 -6
  118. package/styles/v2/utils/_breakpoints.scss +1 -1
  119. package/styles/v2/utils/index.scss +0 -1
  120. package/styles/waiting.scss +1 -1
  121. package/types/Axis.ts +1 -0
  122. package/types/ForecastingSeriesKey.ts +1 -0
  123. package/types/MarkupInclude.ts +5 -3
  124. package/types/MarkupVariable.ts +1 -1
  125. package/types/Series.ts +3 -0
  126. package/types/Table.ts +1 -0
  127. package/types/Visualization.ts +1 -0
  128. package/types/VizFilter.ts +2 -0
  129. package/LICENSE +0 -201
  130. package/styles/_mixins.scss +0 -13
  131. package/styles/_typography.scss +0 -0
  132. package/styles/v2/base/_typography.scss +0 -0
  133. package/styles/v2/components/guidance-block.scss +0 -74
  134. package/styles/v2/utils/_functions.scss +0 -0
@@ -0,0 +1,26 @@
1
+ import { clamp } from 'lodash'
2
+
3
+ // TODO: generalize this to be used in legends other than linear block gradient
4
+
5
+ const LEGEND_SEPARATOR_SIZE = 0.02
6
+ const LEGEND_SEPARATOR_SIZE_MAX = 20
7
+ const LEGEND_SEPARATOR_SIZE_MIN = 8
8
+
9
+ const useLegendSeparators = (separators, legendWidth, allowsLegendSeparators) => {
10
+ const legendSeparators = allowsLegendSeparators
11
+ ? separators?.replace(' ', '').split(',').map(Number).filter(Boolean) || []
12
+ : []
13
+ const separatorSize = clamp(legendWidth * LEGEND_SEPARATOR_SIZE, LEGEND_SEPARATOR_SIZE_MIN, LEGEND_SEPARATOR_SIZE_MAX)
14
+ const legendSeparatorsToSubtract = legendSeparators.length * separatorSize
15
+ const getTickSeparatorsAdjustment = (index: number) =>
16
+ legendSeparators.reduce((acc, separators) => (index >= separators ? acc + separatorSize : acc), 0)
17
+
18
+ return {
19
+ legendSeparators,
20
+ separatorSize,
21
+ legendSeparatorsToSubtract,
22
+ getTickSeparatorsAdjustment
23
+ }
24
+ }
25
+
26
+ export default useLegendSeparators
@@ -0,0 +1,192 @@
1
+ import { useCallback } from 'react'
2
+
3
+ export interface UseListManagementOptions<TItem> {
4
+ /** Config object containing the list */
5
+ config: any
6
+ /** Function to update entire config */
7
+ updateConfig: (config: any) => void
8
+ /** Path to the list in config (e.g., 'items' or 'imageData.options') */
9
+ listPath: string
10
+ /** Factory function to create new items */
11
+ createItem: () => TItem
12
+ }
13
+
14
+ /**
15
+ * Hook for managing dynamic lists in EditorPanel configs
16
+ *
17
+ * Standardizes add/remove/update operations for dynamic arrays,
18
+ * eliminating the need for repetitive boilerplate code.
19
+ *
20
+ * @example
21
+ * // Basic usage
22
+ * const { items, add, remove, update } = useListManagement({
23
+ * config,
24
+ * updateConfig,
25
+ * listPath: 'imageData.options',
26
+ * createItem: () => ({ source: '', alt: '' })
27
+ * })
28
+ *
29
+ * @example
30
+ * // Usage in render
31
+ * {items.map((image, index) => (
32
+ * <div key={index}>
33
+ * <button onClick={() => remove(index)}>Remove</button>
34
+ * <input
35
+ * value={image.source}
36
+ * onChange={e => updateField(index, 'source', e.target.value)}
37
+ * />
38
+ * </div>
39
+ * ))}
40
+ * <button onClick={add}>Add Image</button>
41
+ */
42
+ export const useListManagement = <TItem = any>({
43
+ config,
44
+ updateConfig,
45
+ listPath,
46
+ createItem
47
+ }: UseListManagementOptions<TItem>) => {
48
+ /**
49
+ * Parse nested path (e.g., 'imageData.options' → config.imageData.options)
50
+ */
51
+ const getList = useCallback((): TItem[] => {
52
+ const parts = listPath.split('.')
53
+ let current = config
54
+ for (const part of parts) {
55
+ current = current?.[part]
56
+ }
57
+ return current || []
58
+ }, [config, listPath])
59
+
60
+ /**
61
+ * Update list at nested path
62
+ */
63
+ const setList = useCallback(
64
+ (newList: TItem[]) => {
65
+ const parts = listPath.split('.')
66
+ if (parts.length === 1) {
67
+ // Simple top-level path
68
+ updateConfig({ ...config, [parts[0]]: newList })
69
+ } else {
70
+ // Nested path - need to reconstruct nested structure
71
+ const updated = { ...config }
72
+ let current = updated
73
+ for (let i = 0; i < parts.length - 1; i++) {
74
+ current[parts[i]] = { ...current[parts[i]] }
75
+ current = current[parts[i]]
76
+ }
77
+ current[parts[parts.length - 1]] = newList
78
+ updateConfig(updated)
79
+ }
80
+ },
81
+ [config, updateConfig, listPath]
82
+ )
83
+
84
+ /**
85
+ * Add a new item to the list
86
+ */
87
+ const add = useCallback(() => {
88
+ const list = getList()
89
+ setList([...list, createItem()])
90
+ }, [getList, setList, createItem])
91
+
92
+ /**
93
+ * Remove an item at the specified index
94
+ */
95
+ const remove = useCallback(
96
+ (index: number) => {
97
+ const list = getList()
98
+ setList(list.filter((_, i) => i !== index))
99
+ },
100
+ [getList, setList]
101
+ )
102
+
103
+ /**
104
+ * Update an item with partial changes
105
+ */
106
+ const update = useCallback(
107
+ (index: number, partial: Partial<TItem>) => {
108
+ const list = getList()
109
+ const updated = [...list]
110
+ updated[index] = { ...updated[index], ...partial }
111
+ setList(updated)
112
+ },
113
+ [getList, setList]
114
+ )
115
+
116
+ /**
117
+ * Update a specific field of an item
118
+ */
119
+ const updateField = useCallback(
120
+ (index: number, field: keyof TItem, value: any) => {
121
+ const list = getList()
122
+ const updated = [...list]
123
+ updated[index] = { ...updated[index], [field]: value }
124
+ setList(updated)
125
+ },
126
+ [getList, setList]
127
+ )
128
+
129
+ /**
130
+ * Update a nested field within an array field
131
+ * Useful for imageData.options[i].arguments[j].threshold patterns
132
+ */
133
+ const updateNested = useCallback(
134
+ (index: number, field: keyof TItem, nestedIndex: number, nestedField: string, value: any) => {
135
+ const list = getList()
136
+ const updated = [...list]
137
+ const item = { ...updated[index] }
138
+ const nestedArray = [...(item[field] as any)]
139
+ nestedArray[nestedIndex] = { ...nestedArray[nestedIndex], [nestedField]: value }
140
+ item[field] = nestedArray as any
141
+ updated[index] = item
142
+ setList(updated)
143
+ },
144
+ [getList, setList]
145
+ )
146
+
147
+ /**
148
+ * Replace entire item at index
149
+ */
150
+ const replace = useCallback(
151
+ (index: number, item: TItem) => {
152
+ const list = getList()
153
+ const updated = [...list]
154
+ updated[index] = item
155
+ setList(updated)
156
+ },
157
+ [getList, setList]
158
+ )
159
+
160
+ /**
161
+ * Move an item from one index to another (for drag-and-drop)
162
+ */
163
+ const move = useCallback(
164
+ (fromIndex: number, toIndex: number) => {
165
+ const list = getList()
166
+ const updated = [...list]
167
+ const [removed] = updated.splice(fromIndex, 1)
168
+ updated.splice(toIndex, 0, removed)
169
+ setList(updated)
170
+ },
171
+ [getList, setList]
172
+ )
173
+
174
+ return {
175
+ /** Current list items */
176
+ items: getList(),
177
+ /** Add a new item to the end of the list */
178
+ add,
179
+ /** Remove an item at index */
180
+ remove,
181
+ /** Update item with partial changes */
182
+ update,
183
+ /** Update a specific field of an item */
184
+ updateField,
185
+ /** Update nested array field (e.g., item.arguments[i].threshold) */
186
+ updateNested,
187
+ /** Replace entire item at index */
188
+ replace,
189
+ /** Move item from one index to another */
190
+ move
191
+ }
192
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdc/core",
3
- "version": "4.25.10",
3
+ "version": "4.26.1",
4
4
  "description": "Core components, styles, hooks, and helpers, for the CDC Open Visualization project",
5
5
  "moduleName": "CdcCore",
6
6
  "main": "dist/cdccore",
@@ -22,8 +22,10 @@
22
22
  },
23
23
  "license": "Apache-2.0",
24
24
  "dependencies": {
25
+ "@hello-pangea/dnd": "^16.2.0",
25
26
  "chroma-js": "3.1.2",
26
27
  "dompurify": "^3.2.4",
28
+ "html-react-parser": "5.2.3",
27
29
  "html2canvas": "^1.4.1",
28
30
  "json-edit-react": "^1.27.0",
29
31
  "papaparse": "5.5.2",
@@ -40,13 +42,13 @@
40
42
  "react": "^18.2.0",
41
43
  "react-dom": "^18.2.0"
42
44
  },
43
- "gitHead": "c2db758e74ab9b9ca1667a6f9cb41dd0dccf985d",
45
+ "gitHead": "7e3b27098c4eb7a24bc9c3654ad53f88d6419f16",
44
46
  "devDependencies": {
45
47
  "@rollup/plugin-dsv": "^3.0.2",
46
48
  "@vitejs/plugin-react": "^4.3.4",
47
49
  "sass": "^1.89.2",
48
- "vite": "^4.4.11",
50
+ "vite": "^5.4.21",
49
51
  "vite-plugin-css-injected-by-js": "^2.4.0",
50
- "vite-plugin-svgr": "^2.4.0"
52
+ "vite-plugin-svgr": "^4.2.0"
51
53
  }
52
54
  }
@@ -16,9 +16,6 @@
16
16
  .download-links {
17
17
  justify-content: flex-end;
18
18
  line-height: 1;
19
- &.brush-active {
20
- margin-top: 2em;
21
- }
22
19
  a:not(:last-child) {
23
20
  margin-right: 10px;
24
21
  }
@@ -0,0 +1,73 @@
1
+ /* Common component styles shared across packages */
2
+ /* This file combines loader, warning-icon, and checkbox-group styles */
3
+
4
+ /* Shared loader component */
5
+ /* Used across: chart, dashboard, data-bite, waffle-chart packages */
6
+ .loader {
7
+ width: 100%;
8
+ text-align: center;
9
+ display: inline-block;
10
+ animation: spin 1s linear infinite;
11
+ }
12
+
13
+ .loader::before {
14
+ content: '\21BB';
15
+ }
16
+
17
+ /* Shared warning icon component */
18
+ /* TODO: Currently different panel classes on different packages */
19
+ .accordion__button svg.warning-icon,
20
+ .cove-accordion__button svg.warning-icon {
21
+ position: absolute;
22
+ right: 35px;
23
+ left: auto;
24
+ top: 50%;
25
+ transform: translateY(-50%);
26
+
27
+ }
28
+
29
+ .warning-icon {
30
+ color: #d72f00;
31
+ width: 15px;
32
+ height: 15px;
33
+ }
34
+
35
+ .warning-icon path {
36
+ fill: #d8000c;
37
+ }
38
+
39
+ /* Shared checkbox group component */
40
+ /* Used across: chart, data-bite, markup-include packages */
41
+ .checkbox-group {
42
+ padding: 16px;
43
+ border: 1px solid #c4c4c4;
44
+ border-radius: 8px;
45
+ margin-top: 8px;
46
+ margin-bottom: 24px;
47
+ }
48
+
49
+ .cove-accordion__panel.panel-visual .checkbox-group label.checkbox,
50
+ .cove-accordion__panel.panel-visual .reverse-labels label.checkbox,
51
+ .panel-visual .checkbox-group label.checkbox,
52
+ .panel-visual .reverse-labels label.checkbox {
53
+ display: flex !important;
54
+ align-items: center !important;
55
+ width: 100% !important;
56
+ margin-bottom: 8px !important;
57
+ }
58
+
59
+ .cove-accordion__panel.panel-visual .checkbox-group label.checkbox input[type="checkbox"],
60
+ .cove-accordion__panel.panel-visual .reverse-labels label.checkbox input[type="checkbox"],
61
+ .panel-visual .checkbox-group label.checkbox input[type="checkbox"],
62
+ .panel-visual .reverse-labels label.checkbox input[type="checkbox"] {
63
+ flex-shrink: 0 !important;
64
+ margin-right: 8px !important;
65
+ }
66
+
67
+ .cove-accordion__panel.panel-visual .checkbox-group label.checkbox span,
68
+ .cove-accordion__panel.panel-visual .reverse-labels label.checkbox span,
69
+ .panel-visual .checkbox-group label.checkbox span,
70
+ .panel-visual .reverse-labels label.checkbox span {
71
+ flex: 1 !important;
72
+ display: inline-block !important;
73
+ }
@@ -10,12 +10,15 @@ strong {
10
10
  justify-content: space-between;
11
11
  padding: 0.3rem 1rem;
12
12
  font-size: 0.9rem;
13
+
13
14
  strong {
14
15
  font-weight: 600;
15
16
  }
17
+
16
18
  p {
17
19
  margin: 0;
18
20
  }
21
+
19
22
  .dismiss-error {
20
23
  flex-shrink: 0;
21
24
  font-size: 0.8rem;
@@ -36,19 +39,23 @@ strong {
36
39
  border: 0 !important;
37
40
  display: flex;
38
41
  }
42
+
39
43
  .cdcdataviz-sr-only-focusable:focus {
40
44
  width: fit-content;
41
45
  margin-bottom: 0.5em;
42
46
  margin-left: 1em;
43
47
  }
48
+
44
49
  .inline-icon {
45
50
  width: 1em !important;
46
51
  height: auto !important;
47
52
  font-size: 1rem;
48
53
  color: inherit;
54
+
49
55
  @media all and (-ms-high-contrast: none) {
50
56
  height: 30px !important;
51
57
  }
58
+
52
59
  path {
53
60
  fill: currentColor;
54
61
  }
@@ -58,25 +65,30 @@ strong {
58
65
  &.full-width {
59
66
  width: 100%;
60
67
  }
68
+
61
69
  &:hover {
62
70
  transition: 0.1s background-color;
63
71
  }
72
+
64
73
  &.secondary {
65
74
  font-size: 0.8em;
66
75
  padding: 0.3em 1em;
67
76
  background: rgba(0, 0, 0, 0.3);
68
77
  display: inline-block;
69
78
  margin-bottom: 1em;
79
+
70
80
  &:hover {
71
81
  background: rgba(0, 0, 0, 0.5);
72
82
  }
73
83
  }
84
+
74
85
  &.danger {
75
86
  background-color: $red;
76
87
  padding: 0em 0.6em 0em;
77
88
  height: 1.6em;
78
89
  font-size: 0.8 em;
79
90
  color: #fff;
91
+
80
92
  &:hover {
81
93
  background-color: color.adjust($red, $lightness: -5%);
82
94
  }
@@ -101,6 +113,7 @@ textarea {
101
113
  font-weight: normal;
102
114
  font-family: sans-serif;
103
115
  border: rgba(0, 0, 0, 0.3) 1px solid !important;
116
+
104
117
  &:focus {
105
118
  border: rgba(0, 0, 0, 0.7) 1px solid !important;
106
119
  outline: 0;
@@ -122,6 +135,7 @@ textarea {
122
135
  position: relative;
123
136
  transition: 0.2s all;
124
137
  font-size: 1em;
138
+
125
139
  &:before {
126
140
  content: ' ';
127
141
  width: 5px;
@@ -131,22 +145,27 @@ textarea {
131
145
  bottom: -1px;
132
146
  position: absolute;
133
147
  }
148
+
134
149
  &:hover {
135
150
  background: $lightestGray;
136
151
  transition: 0.2s all;
137
152
  color: #444;
138
153
  }
139
- > div {
154
+
155
+ >div {
140
156
  font-size: 0.9em;
141
157
  }
158
+
142
159
  svg {
143
160
  width: 60px;
144
161
  color: $blue;
145
162
  margin-right: 1rem;
163
+
146
164
  path {
147
165
  fill: currentColor;
148
166
  }
149
167
  }
168
+
150
169
  h3 {
151
170
  font-weight: 600;
152
171
  font-size: 1.2rem;
@@ -169,6 +188,7 @@ section.footnotes {
169
188
  .btn.btn-primary:not([disabled]) {
170
189
  background-color: $blue;
171
190
  border-color: $blue;
191
+
172
192
  &:hover:not([disabled]) {
173
193
  background-color: color.adjust($blue, $lightness: -5%);
174
194
  border-color: color.adjust($blue, $lightness: -5%);
@@ -177,15 +197,15 @@ section.footnotes {
177
197
 
178
198
  // after migration to TP5 this declaration should be removed and all references
179
199
  // to it should be replaced with .form-select
180
- .cove-form-select {
200
+ select.cove-form-select {
181
201
  font-family: var(--app-font-secondary);
182
202
  font-weight: 300;
183
203
  font-size: var(--filter-select-font-size);
184
204
  line-height: normal;
185
205
  padding-right: 3rem;
186
206
  border-radius: 0.333rem;
187
- border: 1px solid var(--colors-gray-cool-10);
188
- color: var(--colors-primary-text);
207
+ border: 1px solid var(--cool-gray-10) !important;
208
+ color: var(--cool-gray-90);
189
209
  // recreate caret using svg
190
210
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
191
211
  background-repeat: no-repeat;
@@ -195,4 +215,4 @@ section.footnotes {
195
215
  -webkit-appearance: none;
196
216
  -moz-appearance: none;
197
217
  cursor: pointer;
198
- }
218
+ }
package/styles/base.scss CHANGED
@@ -1,58 +1,9 @@
1
1
  @use 'sass:string';
2
2
 
3
- @mixin breakpoint($class) {
4
- @if $class == xs {
5
- @media (max-width: 767px) {
6
- @content;
7
- }
8
- } @else if $class == sm {
9
- @media (min-width: 768px) {
10
- @content;
11
- }
12
- } @else if $class == md {
13
- @media (min-width: 960px) {
14
- @content;
15
- }
16
- } @else if $class == lg {
17
- @media (min-width: 1300px) {
18
- @content;
19
- }
20
- } @else {
21
- @warn "Breakpoint mixin supports: xs, sm, md, lg";
22
- }
23
- }
24
-
25
- @mixin breakpointClass($class) {
26
- @if $class == xs {
27
- &.xs,
28
- &.xxs {
29
- @content;
30
- }
31
- } @else if $class == sm {
32
- &.sm,
33
- &.md,
34
- &.lg {
35
- @content;
36
- }
37
- } @else if $class == md {
38
- &.md,
39
- &.lg {
40
- @content;
41
- }
42
- } @else if $class == lg {
43
- &.lg {
44
- @content;
45
- }
46
- } @else {
47
- @warn "Breakpoint Class mixin supports: xs, sm, md, lg";
48
- }
49
- }
50
-
51
3
  // Imports
52
4
  @import 'reset';
53
5
  @import 'variables';
54
6
  @import 'global-variables';
55
- @import 'mixins';
56
7
  @import 'filters';
57
8
 
58
9
  body.post-type-cdc_visualization .visx-tooltip {
@@ -74,7 +25,6 @@ body.post-type-cdc_visualization .cdc-editor .configure .editor-panel {
74
25
  @import 'global';
75
26
  @import 'button-section';
76
27
  @import 'series-list';
77
- @import 'typography';
78
28
 
79
29
  input[type='range'] {
80
30
  appearance: auto !important;
@@ -1,6 +1,8 @@
1
+ @import 'v2/utils/breakpoints';
1
2
  @import 'base';
2
3
  @import 'heading-colors';
3
4
  @import 'v2/themes/color-definitions';
4
5
  @import 'variables';
6
+ @import '_common-components';
5
7
  @import 'v2/components/ui/tooltip';
6
- @import 'v2/main.scss';
8
+ @import 'v2/main.scss';
@@ -1,9 +1,12 @@
1
+ @import 'v2/utils/breakpoints';
2
+
1
3
  .filters-section {
2
4
  &__wrapper {
3
5
  flex-wrap: wrap;
4
6
  display: flex;
5
7
  gap: 1rem 1.5rem;
6
8
  margin-bottom: 2rem;
9
+
7
10
  label {
8
11
  display: inherit;
9
12
  margin-bottom: 5px;
@@ -35,8 +38,9 @@ div.single-filters {
35
38
  border-bottom-left-radius: 15px;
36
39
  }
37
40
  }
38
- & > select.cove-form-select,
39
- & > div.nested-dropdown {
41
+
42
+ &>select.cove-form-select,
43
+ &>div.nested-dropdown {
40
44
  width: fit-content;
41
45
  }
42
46
  }
@@ -89,6 +93,7 @@ div.single-filters {
89
93
  color: var(--colors-blue-vivid-60, #005ea2);
90
94
  background: var(--colors-cyan-cool-10, #eff9fa);
91
95
  }
96
+
92
97
  // TODO - focus styles have to be heavy handed to override the project's global styles
93
98
  &:focus:not(:focus-visible) {
94
99
  outline: none !important;
@@ -101,6 +106,7 @@ div.single-filters {
101
106
  }
102
107
  }
103
108
  }
109
+
104
110
  .cdc-open-viz-module {
105
111
  @include breakpointClass(xs) {
106
112
  .single-filters--tab-simple .tab-simple-container .tab.tab--simple {
@@ -147,9 +153,10 @@ div.single-filters {
147
153
  padding: 10px;
148
154
  background: none;
149
155
  transition: background 2s;
156
+
150
157
  &--active {
151
158
  background: #fff;
152
159
  border-radius: 15px;
153
160
  }
154
161
  }
155
- }
162
+ }
@@ -1,5 +1,4 @@
1
1
  // @import 'reset'; //TODO: Enable after cove refactor
2
- @import 'typography';
3
2
 
4
3
  @import 'general';
5
4
  @import 'heading';
@@ -1,5 +1,7 @@
1
1
  @import '../utils/variables';
2
2
  @import '../themes/index';
3
+ @import '../../../components/HeaderThemeSelector/HeaderThemeSelector.css';
4
+ @import '../../_common-components';
3
5
 
4
6
  .cove-editor {
5
7
  display: grid;
@@ -91,7 +93,7 @@
91
93
  margin-top: 1em;
92
94
  justify-content: space-between;
93
95
 
94
- > label {
96
+ >label {
95
97
  width: 48%;
96
98
  margin-top: 0 !important;
97
99
  }
@@ -128,7 +130,7 @@
128
130
  cursor: pointer;
129
131
  }
130
132
 
131
- + li {
133
+ +li {
132
134
  border-top: $lightGray 1px solid;
133
135
  }
134
136
  }
@@ -148,6 +150,7 @@
148
150
  color: $blue;
149
151
  margin-right: 1rem;
150
152
  height: 60px; // IE11
153
+
151
154
  path {
152
155
  fill: currentColor;
153
156
  }
@@ -186,7 +189,7 @@
186
189
  display: flex;
187
190
  justify-content: space-between;
188
191
 
189
- > label {
192
+ >label {
190
193
  margin-top: 0;
191
194
  width: 30%;
192
195
  display: inline-block;
@@ -234,7 +237,7 @@
234
237
  margin-top: 0;
235
238
  }
236
239
 
237
- label + label {
240
+ label+label {
238
241
  margin-top: 1em;
239
242
  }
240
243
 
@@ -254,12 +257,12 @@
254
257
  .sort-list {
255
258
  list-style: none;
256
259
 
257
- > li {
260
+ >li {
258
261
  margin-right: 0.3em;
259
262
  margin-bottom: 0.3em;
260
263
  }
261
264
 
262
- li > div {
265
+ li>div {
263
266
  display: block;
264
267
  box-sizing: border-box;
265
268
  border: 1px solid #d1d1d1;
@@ -484,3 +487,8 @@ ul.color-palette {
484
487
  }
485
488
  }
486
489
  }
490
+
491
+ // CheckBox component styling for EditorPanel/Inputs
492
+ .edit-checkbox {
493
+ margin-right: 8px;
494
+ }
@@ -13,7 +13,7 @@
13
13
  @content;
14
14
  }
15
15
  } @else if $class == lg {
16
- @media (min-width: 1170px) {
16
+ @media (min-width: 1300px) {
17
17
  @content;
18
18
  }
19
19
  } @else if $class == xl {