@cdc/core 4.25.8 → 4.25.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_stories/StoryRenderingTests.stories.tsx +164 -0
- package/components/AdvancedEditor/AdvancedEditor.tsx +32 -9
- package/components/CustomColorsEditor/CustomColorsEditor.css +299 -0
- package/components/CustomColorsEditor/CustomColorsEditor.tsx +209 -0
- package/components/CustomColorsEditor/index.ts +1 -0
- package/components/DataTable/DataTable.tsx +56 -38
- package/components/DataTable/DataTableStandAlone.tsx +8 -3
- package/components/DataTable/components/ChartHeader.tsx +44 -14
- package/components/DataTable/components/DataTableEditorPanel.tsx +12 -2
- package/components/DataTable/components/ExpandCollapse.tsx +10 -1
- package/components/DataTable/components/MapHeader.tsx +24 -13
- package/components/DataTable/data-table.css +12 -0
- package/components/DataTable/helpers/chartCellMatrix.tsx +11 -8
- package/components/DataTable/helpers/mapCellMatrix.tsx +33 -4
- package/components/DataTable/helpers/standardizeState.js +2 -2
- package/components/DataTable/helpers/tests/standardizeState.test.js +54 -0
- package/components/DownloadButton.tsx +40 -14
- package/components/EditorPanel/DataTableEditor.tsx +3 -3
- package/components/EditorPanel/EditorPanel.styles.css +423 -0
- package/components/EditorPanel/FootnotesEditor.tsx +44 -37
- package/components/EditorPanel/Inputs.tsx +12 -2
- package/components/EditorPanel/VizFilterEditor/NestedDropdownEditor.tsx +35 -62
- package/components/EditorPanel/VizFilterEditor/VizFilterEditor.tsx +12 -2
- package/components/EditorPanel/components/MarkupHighlightedTextField.tsx +227 -0
- package/components/EditorPanel/components/MarkupVariablesEditor.tsx +450 -0
- package/components/EditorPanel/components/PanelMarkup.tsx +59 -0
- package/components/ErrorBoundary.jsx +3 -1
- package/components/Filters/Filters.tsx +52 -24
- package/components/Filters/components/Dropdown.tsx +6 -1
- package/components/Filters/components/Tabs.tsx +1 -0
- package/components/Footnotes/Footnotes.tsx +35 -25
- package/components/Footnotes/FootnotesStandAlone.tsx +42 -6
- package/components/HeaderThemeSelector/HeaderThemeSelector.css +43 -0
- package/components/HeaderThemeSelector/HeaderThemeSelector.stories.tsx +74 -0
- package/components/HeaderThemeSelector/HeaderThemeSelector.tsx +61 -0
- package/components/HeaderThemeSelector/index.ts +2 -0
- package/components/Layout/styles/editor.scss +2 -1
- package/components/Legend/Legend.Gradient.tsx +3 -6
- package/components/LegendShape.tsx +121 -3
- package/components/Loader/Loader.tsx +1 -1
- package/components/MediaControls.tsx +72 -21
- package/components/PaletteConversionModal.tsx +90 -0
- package/components/PaletteSelector/DeveloperPaletteRollback.tsx +114 -0
- package/components/PaletteSelector/PaletteSelector.css +94 -0
- package/components/PaletteSelector/PaletteSelector.tsx +112 -0
- package/components/PaletteSelector/index.ts +2 -0
- package/components/RichTooltip/RichTooltip.tsx +1 -0
- package/components/Table/Table.tsx +3 -1
- package/components/Table/components/Cell.tsx +23 -2
- package/components/Table/components/Row.tsx +5 -3
- package/components/_stories/BlurStrokeTest.stories.tsx +1 -1
- package/components/_stories/DataTable.stories.tsx +1 -1
- package/components/_stories/Filters.stories.tsx +21 -2
- package/components/_stories/Footnotes.CSV.stories.tsx +247 -0
- package/components/_stories/Footnotes.stories.tsx +769 -4
- package/components/_stories/Inputs.stories.tsx +3 -3
- package/components/_stories/MultiSelect.stories.tsx +3 -3
- package/components/_stories/NestedDropdown.stories.tsx +1 -1
- package/components/_stories/Table.stories.tsx +1 -1
- package/components/_stories/styles.scss +0 -1
- package/components/elements/_stories/Button.stories.tsx +1 -1
- package/components/elements/_stories/Card.stories.tsx +1 -1
- package/components/inputs/InputToggle.tsx +2 -0
- package/components/managers/DataDesigner.tsx +10 -9
- package/components/managers/_stories/DataDesigner.stories.tsx +1 -1
- package/components/ui/Accordion.jsx +1 -1
- package/components/ui/Tooltip.tsx +2 -1
- package/components/ui/_stories/Accordion.stories.tsx +1 -1
- package/components/ui/_stories/ColorPaletteMigration.stories.mdx +275 -0
- package/components/ui/_stories/Colors.stories.tsx +330 -0
- package/components/ui/_stories/IconGallery.stories.tsx +316 -0
- package/components/ui/_stories/Title.stories.tsx +1 -1
- package/components/ui/accordion.styles.css +57 -0
- package/contexts/EditorContext.ts +18 -0
- package/contexts/editor.actions.ts +28 -0
- package/contexts/editor.reducer.ts +94 -0
- package/data/chartColorPalettes.ts +118 -0
- package/data/colorPalettes.ts +9 -0
- package/data/mapColorPalettes.ts +45 -0
- package/data/sharedPalettes.ts +50 -0
- package/dist/cove-main.css +63 -14
- package/dist/cove-main.css.map +1 -1
- package/generateViteConfig.js +80 -0
- package/helpers/addValuesToFilters.ts +7 -3
- package/helpers/cloneConfig.ts +31 -0
- package/helpers/configDataHelpers.ts +128 -0
- package/helpers/configHelpers.ts +27 -0
- package/helpers/constants.ts +42 -2
- package/helpers/cove/number.ts +33 -12
- package/helpers/coveUpdateWorker.ts +15 -3
- package/helpers/fetchRemoteData.ts +3 -15
- package/helpers/filterColorPalettes.ts +152 -0
- package/helpers/generateColorsArray.ts +13 -0
- package/helpers/getColorPaletteVersion.ts +33 -0
- package/helpers/getPaletteAccessor.ts +18 -0
- package/helpers/markupProcessor.ts +220 -0
- package/helpers/mergeCustomOrderValues.ts +37 -0
- package/helpers/metrics/helpers.ts +42 -19
- package/helpers/metrics/types.ts +48 -9
- package/helpers/metrics/utils.ts +34 -0
- package/helpers/palettes/colorDistributions.ts +56 -0
- package/helpers/palettes/migratePaletteName.ts +150 -0
- package/helpers/palettes/standardizePaletteNames.ts +77 -0
- package/helpers/palettes/utils.ts +267 -0
- package/helpers/parseCsvWithQuotes.ts +65 -0
- package/helpers/queryStringUtils.ts +13 -0
- package/helpers/testing.ts +358 -0
- package/helpers/tests/addValuesToFilters.test.ts +1 -2
- package/helpers/tests/generateColorsArray.test.ts +24 -0
- package/helpers/tests/markupProcessor.test.ts +538 -0
- package/helpers/tests/testStandaloneBuild.ts +44 -0
- package/helpers/useMarkupVariables.ts +31 -0
- package/helpers/vegaConfig.ts +0 -1
- package/helpers/ver/4.24.10.ts +2 -1
- package/helpers/ver/4.24.11.ts +2 -1
- package/helpers/ver/4.24.3.ts +2 -1
- package/helpers/ver/4.24.4.ts +2 -1
- package/helpers/ver/4.24.5.ts +2 -1
- package/helpers/ver/4.24.7.ts +2 -1
- package/helpers/ver/4.24.9.ts +2 -1
- package/helpers/ver/4.25.1.ts +2 -1
- package/helpers/ver/4.25.10.ts +36 -0
- package/helpers/ver/4.25.11.ts +13 -0
- package/helpers/ver/4.25.3.ts +2 -1
- package/helpers/ver/4.25.4.ts +2 -1
- package/helpers/ver/4.25.6.ts +2 -1
- package/helpers/ver/4.25.7.ts +2 -1
- package/helpers/ver/4.25.8.ts +2 -1
- package/helpers/ver/4.25.9.ts +293 -0
- package/helpers/ver/tests/4.25.10.test.ts +204 -0
- package/helpers/ver/tests/4.25.8.test.ts +1 -1
- package/helpers/ver/tests/4.25.9.test.ts +51 -0
- package/helpers/viewports.ts +2 -0
- package/hooks/useColorPalette.ts +79 -0
- package/package.json +13 -4
- package/styles/_common-components.css +73 -0
- package/styles/_global.scss +32 -10
- package/styles/base.scss +8 -55
- package/styles/cove-main.scss +3 -1
- package/styles/filters.scss +10 -3
- package/styles/v2/base/index.scss +0 -1
- package/styles/v2/components/button.scss +4 -3
- package/styles/v2/components/editor.scss +16 -7
- package/styles/v2/layout/_data-table.scss +3 -2
- package/styles/v2/themes/_color-definitions.scss +18 -17
- package/styles/v2/utils/_breakpoints.scss +1 -1
- package/styles/v2/utils/index.scss +0 -1
- package/styles/waiting.scss +1 -1
- package/testing-setup.js +32 -0
- package/types/MarkupInclude.ts +8 -2
- package/types/MarkupVariable.ts +19 -0
- package/types/VizFilter.ts +2 -0
- package/vitest.config.ts +16 -0
- package/components/ui/_stories/Colors.stories.mdx +0 -220
- package/components/ui/_stories/IconGallery.stories.mdx +0 -14
- package/data/colorPalettes.js +0 -171
- package/helpers/formatConfigBeforeSave.ts +0 -135
- package/helpers/tests/formatConfigBeforeSave.test.ts +0 -68
- package/styles/_mixins.scss +0 -13
- package/styles/v2/base/_typography.scss +0 -0
- package/styles/v2/components/guidance-block.scss +0 -74
- package/styles/v2/utils/_functions.scss +0 -0
- /package/{styles/_typography.scss → testBuild.js} +0 -0
|
@@ -1,3 +1,60 @@
|
|
|
1
|
+
/* Accordion component styles */
|
|
2
|
+
|
|
1
3
|
.accordion__heading {
|
|
2
4
|
background: var(--lightestGray);
|
|
3
5
|
}
|
|
6
|
+
|
|
7
|
+
.accordion__button {
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
font-size: 1em;
|
|
10
|
+
padding: 0.3em 1em;
|
|
11
|
+
width: 100%;
|
|
12
|
+
text-align: left;
|
|
13
|
+
position: relative;
|
|
14
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.accordion__panel:first-child {
|
|
18
|
+
margin-top: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.accordion__button:before {
|
|
22
|
+
display: inline-block;
|
|
23
|
+
content: '';
|
|
24
|
+
height: 7px;
|
|
25
|
+
width: 7px;
|
|
26
|
+
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
|
+
position: absolute;
|
|
32
|
+
top: 50%;
|
|
33
|
+
transition: 0.1s all;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.accordion__button[aria-expanded='true']::before,
|
|
37
|
+
.accordion__button[aria-selected='true']::before {
|
|
38
|
+
transform: rotate(45deg) translateY(-50%);
|
|
39
|
+
margin-right: 1.3em;
|
|
40
|
+
transition: 0.1s all;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.accordion__panel {
|
|
44
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
|
|
45
|
+
padding: 1em 1.25em 2em;
|
|
46
|
+
animation: fadein 0.2s ease-in;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.accordion__panel h5 {
|
|
50
|
+
font-size: 0.8em;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@keyframes fadein {
|
|
54
|
+
0% {
|
|
55
|
+
opacity: 0;
|
|
56
|
+
}
|
|
57
|
+
100% {
|
|
58
|
+
opacity: 1;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { WCMSProps } from '@cdc/core/types/WCMSProps'
|
|
2
|
+
import { Dispatch, createContext } from 'react'
|
|
3
|
+
import EditorActions from './editor.actions'
|
|
4
|
+
import { EditorState } from '@cdc/core/contexts/editor.reducer'
|
|
5
|
+
|
|
6
|
+
export type EditorCTX = WCMSProps &
|
|
7
|
+
EditorState & {
|
|
8
|
+
displayName?: string
|
|
9
|
+
setTempConfig: Function
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const ConfigContext = createContext<EditorCTX>({
|
|
13
|
+
displayName: 'ConfigContext',
|
|
14
|
+
setTempConfig: () => {}
|
|
15
|
+
} as unknown as EditorCTX)
|
|
16
|
+
|
|
17
|
+
export default ConfigContext
|
|
18
|
+
export const EditorDispatchContext = createContext<Dispatch<EditorActions>>(() => {})
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type Action } from '@cdc/core/types/Action'
|
|
2
|
+
import { type ViewPort } from '@cdc/core/types/ViewPort'
|
|
3
|
+
import { type Visualization } from '@cdc/core/types/Visualization'
|
|
4
|
+
import { type DataSet } from '@cdc/core/types/DataSet'
|
|
5
|
+
|
|
6
|
+
type EDITOR_SAVE = Action<'EDITOR_SAVE', Visualization>
|
|
7
|
+
type EDITOR_SET_CONFIG = Action<'EDITOR_SET_CONFIG', Visualization>
|
|
8
|
+
type EDITOR_TEMP_SAVE = Action<'EDITOR_TEMP_SAVE', Visualization>
|
|
9
|
+
type EDITOR_SET_ERRORS = Action<'EDITOR_SET_ERRORS', string[]>
|
|
10
|
+
type EDITOR_SET_VIEWPORT = Action<'EDITOR_SET_VIEWPORT', ViewPort>
|
|
11
|
+
type EDITOR_SET_GLOBALACTIVE = Action<'EDITOR_SET_GLOBALACTIVE', number>
|
|
12
|
+
type SET_DASHBOARD_DATASET = Action<
|
|
13
|
+
'SET_DASHBOARD_DATASET',
|
|
14
|
+
{ datasetKey: string; oldDatasetKey?: string; dataset: DataSet }
|
|
15
|
+
>
|
|
16
|
+
type DELETE_DATASET = Action<'DELETE_DASHBOARD_DATASET', { datasetKey: string }>
|
|
17
|
+
|
|
18
|
+
type actions =
|
|
19
|
+
| EDITOR_SAVE
|
|
20
|
+
| EDITOR_TEMP_SAVE
|
|
21
|
+
| EDITOR_SET_ERRORS
|
|
22
|
+
| EDITOR_SET_VIEWPORT
|
|
23
|
+
| EDITOR_SET_GLOBALACTIVE
|
|
24
|
+
| EDITOR_SET_CONFIG
|
|
25
|
+
| DELETE_DATASET
|
|
26
|
+
| SET_DASHBOARD_DATASET
|
|
27
|
+
|
|
28
|
+
export default actions
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import _ from 'lodash'
|
|
2
|
+
import EditorActions from './editor.actions'
|
|
3
|
+
import { Visualization } from '@cdc/core/types/Visualization'
|
|
4
|
+
import { devToolsWrapper } from '@cdc/core/helpers/withDevTools'
|
|
5
|
+
import { cloneConfig } from '@cdc/core/helpers/cloneConfig'
|
|
6
|
+
|
|
7
|
+
export type EditorState = {
|
|
8
|
+
config?: Visualization
|
|
9
|
+
tempConfig?: Visualization | null
|
|
10
|
+
errors: string[]
|
|
11
|
+
currentViewport: string
|
|
12
|
+
globalActive: number
|
|
13
|
+
newViz?: boolean
|
|
14
|
+
}
|
|
15
|
+
const reducer = (state: EditorState, action: EditorActions): EditorState => {
|
|
16
|
+
switch (action.type) {
|
|
17
|
+
case 'EDITOR_SAVE': {
|
|
18
|
+
return { ...state, config: action.payload, tempConfig: null }
|
|
19
|
+
}
|
|
20
|
+
case 'EDITOR_SET_CONFIG': {
|
|
21
|
+
return { ...state, config: action.payload }
|
|
22
|
+
}
|
|
23
|
+
case 'SET_DASHBOARD_DATASET': {
|
|
24
|
+
const { dataset, datasetKey, oldDatasetKey } = action.payload
|
|
25
|
+
const oldDataset = oldDatasetKey ? state.config?.datasets[oldDatasetKey] : {}
|
|
26
|
+
const config = cloneConfig(state.config)
|
|
27
|
+
if (oldDatasetKey) {
|
|
28
|
+
const changeDatasets = _config => {
|
|
29
|
+
_config.rows?.forEach(row => {
|
|
30
|
+
if (row.dataKey === oldDatasetKey) {
|
|
31
|
+
row.dataKey = datasetKey
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
Object.values(_config.visualizations || {}).forEach((viz: any) => {
|
|
35
|
+
if (viz.dataKey === oldDatasetKey) {
|
|
36
|
+
viz.dataKey = datasetKey
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
applyMultiDashboards(config, changeDatasets)
|
|
41
|
+
delete config.datasets[oldDatasetKey]
|
|
42
|
+
}
|
|
43
|
+
Object.values(config.datasets).forEach(dataset => {
|
|
44
|
+
dataset.preview = false
|
|
45
|
+
})
|
|
46
|
+
config.datasets[datasetKey] = { ...oldDataset, ...dataset }
|
|
47
|
+
return { ...state, config }
|
|
48
|
+
}
|
|
49
|
+
case 'DELETE_DASHBOARD_DATASET': {
|
|
50
|
+
const { datasetKey } = action.payload
|
|
51
|
+
const deleteDatasetKeys = _config => {
|
|
52
|
+
_config.rows?.forEach(row => {
|
|
53
|
+
if (row.dataKey === datasetKey) {
|
|
54
|
+
delete row.dataKey
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
Object.values(_config.visualizations || {}).forEach((viz: any) => {
|
|
58
|
+
if (viz.dataKey === datasetKey) {
|
|
59
|
+
delete viz.dataKey
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
const config = cloneConfig(state.config)
|
|
64
|
+
applyMultiDashboards(config, deleteDatasetKeys)
|
|
65
|
+
delete config.datasets[datasetKey]
|
|
66
|
+
return { ...state, config }
|
|
67
|
+
}
|
|
68
|
+
case 'EDITOR_TEMP_SAVE': {
|
|
69
|
+
return { ...state, tempConfig: action.payload }
|
|
70
|
+
}
|
|
71
|
+
case 'EDITOR_SET_ERRORS': {
|
|
72
|
+
return { ...state, errors: action.payload }
|
|
73
|
+
}
|
|
74
|
+
case 'EDITOR_SET_VIEWPORT': {
|
|
75
|
+
return { ...state, currentViewport: action.payload }
|
|
76
|
+
}
|
|
77
|
+
case 'EDITOR_SET_GLOBALACTIVE': {
|
|
78
|
+
return { ...state, globalActive: action.payload }
|
|
79
|
+
}
|
|
80
|
+
default:
|
|
81
|
+
return state
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const applyMultiDashboards = (config: Record<string, any>, mutationFunc: Function) => {
|
|
86
|
+
if (config.multiDashboards) {
|
|
87
|
+
config.multiDashboards.forEach(dashboard => {
|
|
88
|
+
mutationFunc(dashboard)
|
|
89
|
+
})
|
|
90
|
+
}
|
|
91
|
+
mutationFunc(config)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export default devToolsWrapper<EditorState, EditorActions>(reducer)
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { updatePaletteNames } from '../helpers/updatePaletteNames'
|
|
2
|
+
import { sharedPalettes } from './sharedPalettes'
|
|
3
|
+
|
|
4
|
+
// Chart-specific color palettes with versioned structure
|
|
5
|
+
|
|
6
|
+
const chartColorPalettesData = {
|
|
7
|
+
v1: {
|
|
8
|
+
'qualitative_bold': [
|
|
9
|
+
'#377eb8',
|
|
10
|
+
'#ff7f00',
|
|
11
|
+
'#4daf4a',
|
|
12
|
+
'#984ea3',
|
|
13
|
+
'#e41a1c',
|
|
14
|
+
'#ffff33',
|
|
15
|
+
'#a65628',
|
|
16
|
+
'#f781bf',
|
|
17
|
+
'#3399CC'
|
|
18
|
+
],
|
|
19
|
+
|
|
20
|
+
'qualitative_soft': [
|
|
21
|
+
'#a6cee3',
|
|
22
|
+
'#1f78b4',
|
|
23
|
+
'#b2df8a',
|
|
24
|
+
'#33a02c',
|
|
25
|
+
'#fb9a99',
|
|
26
|
+
'#e31a1c',
|
|
27
|
+
'#fdbf6f',
|
|
28
|
+
'#ff7f00',
|
|
29
|
+
'#aca9eb'
|
|
30
|
+
],
|
|
31
|
+
qualitative1: sharedPalettes.qualitative1,
|
|
32
|
+
|
|
33
|
+
qualitative2: sharedPalettes.qualitative2,
|
|
34
|
+
|
|
35
|
+
qualitative3: sharedPalettes.qualitative3,
|
|
36
|
+
|
|
37
|
+
qualitative4: sharedPalettes.qualitative4,
|
|
38
|
+
|
|
39
|
+
'sequential_blue': ['#c6dbef', '#9ecae1', '#6baed6', '#4292c6', '#2171b5', '#084594'],
|
|
40
|
+
'sequential_blue_extended': ['#d5f6f9', '#99e2ed', '#5fb6d1', '#3189b0', '#116091', '#0a3e72'],
|
|
41
|
+
'sequential_orange_extended': ['#ffefcf', '#ffd49c', '#f7a866', '#eb7723', '#b95117', '#862b0b'],
|
|
42
|
+
'sequential_green': ['#c7e9c0', '#a1d99b', '#74c476', '#41ab5d', '#238b45', '#005a32'],
|
|
43
|
+
|
|
44
|
+
colorblindsafe: sharedPalettes.colorblindsafe
|
|
45
|
+
},
|
|
46
|
+
v2: {
|
|
47
|
+
// New standardized v2 palettes per migration guide (underscore naming convention)
|
|
48
|
+
'sequential_orange': ['#FFE4D5', '#FED0B6', '#F7B99A', '#ED9E7C', '#E58061', '#DB6B49', '#C95936', '#A8462C', '#702B1D'],
|
|
49
|
+
'sequential_purple': ['#E2D3DF', '#CDB2C8', '#B78FAF', '#A6739B', '#935586', '#823A73', '#722161', '#5F2359', '#47264F'],
|
|
50
|
+
'sequential_blue': ['#DBE8F7', '#BED5ED', '#99BCE1', '#73A1D5', '#4E88C7', '#1E6BC0', '#0057B7', '#01418D', '#032659'],
|
|
51
|
+
'sequential_green': ['#D5F9F6', '#AEECE7', '#85DED7', '#63D2CA', '#3BBCAF', '#14A594', '#0A937F', '#0F7A68', '#105B4D'],
|
|
52
|
+
'qualitative_standard': ['#0057B7', '#722161', '#00B1CE', '#D94E5F', '#5A8E3F', '#FFB24D', '#FB7E38', '#032659', '#975722'],
|
|
53
|
+
|
|
54
|
+
// New v2-only palettes (no migration needed)
|
|
55
|
+
'sequential_teal': ['#e5fafc', '#b3e3ed', '#80cddf', '#4db8d1', '#00b1ce', '#03a2bd', '#0690a6', '#0d6e81', '#125261'],
|
|
56
|
+
'divergent_blue_cyan': ['#032659', '#014697', '#1D6ABF', '#6197D2', '#C1D2DB', '#5CCBDE', '#01ACC9', '#097F95', '#125261'],
|
|
57
|
+
'divergent_blue_purple': ['#032659', '#014697', '#1D6ABF', '#6197D2', '#C4CDE1', '#AF8CAA', '#935586', '#7C256B', '#47264F'],
|
|
58
|
+
'divergent_green_orange': ['#105B4D', '#16806E', '#3EA394', '#5EBFB3', '#FABF61', '#EE956C', '#E27447', '#AC4726', '#702B1D'],
|
|
59
|
+
'divergent_blue_orange': ['#032659', '#0057B7', '#0092C6', '#55B1A3', '#FFB24D', '#EA803B', '#DD622F', '#AF3423', '#660F14']
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const twoColorPaletteData = {
|
|
64
|
+
v1: {
|
|
65
|
+
'monochrome-1': ['#a6cee3', '#15017a'],
|
|
66
|
+
'monochrome-2': ['#c2c0fc', '#15017a'],
|
|
67
|
+
'monochrome-3': ['#cab2d6', '#6a3d9a'],
|
|
68
|
+
'monochrome-4': ['#c2c0fc', '#6a3d9a'],
|
|
69
|
+
'monochrome-5': ['#fedab8', '#bf5b17'],
|
|
70
|
+
'cool-1': ['#b2df8a', '#1f78b4'],
|
|
71
|
+
'cool-2': ['#a6cee3', '#72d66b'],
|
|
72
|
+
'cool-3': ['#c2c0fc', '#386cb0'],
|
|
73
|
+
'cool-4': ['#72d66b', '#6a3d9a'],
|
|
74
|
+
'cool-5': ['#a6cee3', '#6a3d9a'],
|
|
75
|
+
'warm-1': ['#e31a1c', '#fedab8'],
|
|
76
|
+
'complementary-1': ['#1f78b4', '#e6ab02'],
|
|
77
|
+
'complementary-2': ['#1f78b4', '#ff7f00'],
|
|
78
|
+
'complementary-3': ['#6a3d9a', '#ff7f00'],
|
|
79
|
+
'complementary-4': ['#6a3d9a', '#e6ab02'],
|
|
80
|
+
'complementary-5': ['#df168c', '#1eb386']
|
|
81
|
+
},
|
|
82
|
+
v2: {
|
|
83
|
+
// All palettes using indexes [2,6] from their respective divergent palettes
|
|
84
|
+
'divergent_blue_purple': ['#1D6ABF', '#935586'],
|
|
85
|
+
|
|
86
|
+
'divergent_green_orange': ['#3EA394', '#E27447'],
|
|
87
|
+
|
|
88
|
+
'divergent_blue_cyan': ['#1D6ABF', '#01ACC9'],
|
|
89
|
+
|
|
90
|
+
'divergent_blue_orange': ['#0092C6', '#DD622F']
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Forecasting Palettes should be refactored to use versioned palettes
|
|
95
|
+
const sequentialColors = {
|
|
96
|
+
'Sequential Blue': ['#c6dbef', '#9ecae1', '#6baed6', '#4292c6', '#2171b5', '#084594'],
|
|
97
|
+
'Sequential Blue Two': ['#d5f6f9', '#99e2ed', '#5fb6d1', '#3189b0', '#116091', '#0a3e72'],
|
|
98
|
+
'Sequential Blue Three': sharedPalettes.sequentialBlueNine,
|
|
99
|
+
'Sequential Orange': ['#ffefcf', '#ffd49c', '#f7a866', '#eb7723', '#b95117', '#862b0b'],
|
|
100
|
+
'Sequential Orange Two': sharedPalettes.sequentialOrangeNine,
|
|
101
|
+
'Sequential Green': ['#c7e9c0', '#a1d99b', '#74c476', '#41ab5d', '#238b45', '#005a32']
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Process and export chart color palettes with versioned structure
|
|
105
|
+
export const chartColorPalettes = {
|
|
106
|
+
v1: updatePaletteNames(chartColorPalettesData.v1),
|
|
107
|
+
v2: updatePaletteNames(chartColorPalettesData.v2)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export const twoColorPalette = {
|
|
111
|
+
v1: updatePaletteNames(twoColorPaletteData.v1),
|
|
112
|
+
v2: updatePaletteNames(twoColorPaletteData.v2) // No changes for v2, but structured for consistency
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export const sequentialPalettes = sequentialColors
|
|
116
|
+
export const colorPalettesChart = chartColorPalettes
|
|
117
|
+
export const colorPalettesChartV1 = chartColorPalettes.v1
|
|
118
|
+
export const colorPalettesChartV2 = chartColorPalettes.v2
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { mapColorPalettes, mapColorPalettesV1, mapColorPalettesV2 } from './mapColorPalettes'
|
|
2
|
+
import { chartColorPalettes, sequentialPalettes, colorPalettesChart, colorPalettesChartV1, colorPalettesChartV2, twoColorPalette } from './chartColorPalettes'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// Re-export map palettes (already processed in mapColorPalettes.ts)
|
|
6
|
+
export { mapColorPalettes, mapColorPalettesV1, mapColorPalettesV2 }
|
|
7
|
+
|
|
8
|
+
// Re-export chart palettes (already processed in chartColorPalettes.ts)
|
|
9
|
+
export { chartColorPalettes, sequentialPalettes, colorPalettesChart, colorPalettesChartV1, colorPalettesChartV2, twoColorPalette }
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { updatePaletteNames } from '../helpers/updatePaletteNames'
|
|
2
|
+
import { sharedPalettes } from './sharedPalettes'
|
|
3
|
+
|
|
4
|
+
// Map-specific color palettes extracted from main colorPalettes.ts
|
|
5
|
+
|
|
6
|
+
const mapColorPalettesData = {
|
|
7
|
+
v1: {
|
|
8
|
+
sequential_yellow_orange_red: ['#ffffcc', '#ffeda0', '#fed976', '#feb24c', '#fd8d3c', '#fc4e2a', '#e31a1c', '#bd0026', '#800026'],
|
|
9
|
+
sequential_yellow_orange_brown: ['#ffffe5', '#fff7bc', '#fee391', '#fec44f', '#fe9929', '#ec7014', '#cc4c02', '#993404', '#662506'],
|
|
10
|
+
sequential_pink_purple: ['#fff7f3', '#fde0dd', '#fcc5c0', '#fa9fb5', '#f768a1', '#dd3497', '#ae017e', '#7a0177', '#49006a'],
|
|
11
|
+
sequential_blue_green: ['#fff7fb', '#ece2f0', '#d0d1e6', '#a6bddb', '#67a9cf', '#3690c0', '#02818a', '#016c59', '#014636'],
|
|
12
|
+
sequential_orange_red: ['#fff7ec', '#fee8c8', '#fdd49e', '#fdbb84', '#fc8d59', '#ef6548', '#d7301f', '#b30000', '#7f0000'],
|
|
13
|
+
sequential_red: ['#fff5f0', '#fee0d2', '#fcbba1', '#fc9272', '#fb6a4a', '#ef3b2c', '#cb181d', '#a50f15', '#67000d'],
|
|
14
|
+
sequential_green_blue: ['#f7fcf0', '#e0f3db', '#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#267ba6', '#0868ac', '#084081'],
|
|
15
|
+
divergent_yellow_purple: ['#fff0b0', '#f5cc76', '#edae4b', '#e3683c', '#bf2a48', '#6d2059', '#8f0c4b', '#310958', '#0e0943'],
|
|
16
|
+
qualitative1: sharedPalettes.qualitative1,
|
|
17
|
+
qualitative2: sharedPalettes.qualitative2,
|
|
18
|
+
qualitative3: sharedPalettes.qualitative3,
|
|
19
|
+
qualitative4: sharedPalettes.qualitative4,
|
|
20
|
+
sequential_blue_extended: sharedPalettes.sequentialBlueNine,
|
|
21
|
+
sequential_orange_extended: sharedPalettes.sequentialOrangeNine,
|
|
22
|
+
colorblindsafe: sharedPalettes.colorblindsafe
|
|
23
|
+
},
|
|
24
|
+
v2: {
|
|
25
|
+
sequential_blue: ["#dbe8f7", "#bed5ed", "#99bce1", "#73a1d5", "#4e88c7", "#1e6bc0", "#0057b7", "#01418d", "#032659"],
|
|
26
|
+
sequential_teal: ["#e5fafc", "#b3e3ed", "#80cddf", "#4db8d1", "#00b1ce", "#03a2bd", "#0690a6", "#0d6e81", "#125261"],
|
|
27
|
+
sequential_purple: ["#e2d3df", "#cdb2c8", "#b78faf", "#a6739b", "#935586", "#823a73", "#722161", "#5f2359", "#47264f"],
|
|
28
|
+
sequential_orange: ["#ffe4d5", "#fed0b6", "#f7b99a", "#ed9e7c", "#e58061", "#db6b49", "#c95936", "#a8462c", "#702b1d"],
|
|
29
|
+
sequential_green: ["#d5f9f6", "#aeece7", "#85ded7", "#63d2ca", "#3bbcaf", "#14a594", "#0a937f", "#0f7a68", "#105b4d"],
|
|
30
|
+
divergent_blue_cyan: ["#032659", "#014697", "#1d6abf", "#6197d2", "#c1d2db", "#5ccbde", "#01acc9", "#097f95", "#125261"],
|
|
31
|
+
divergent_blue_purple: ["#032659", "#014697", "#1d6abf", "#6197d2", "#c4cde1", "#af8caa", "#935586", "#7c256b", "#47264f"],
|
|
32
|
+
divergent_green_orange: ["#105b4d", "#16806e", "#3ea394", "#5ebfb3", "#fabf61", "#ee956c", "#e27447", "#ac4726", "#702b1d"],
|
|
33
|
+
divergent_blue_orange: ["#032659", "#0057b7", "#0092c6", "#55b1a3", "#ffb24d", "#ea803b", "#dd622f", "#af3423", "#660f14"],
|
|
34
|
+
qualitative_standard: ["#0057b7", "#722161", "#00b1ce", "#d94e5f", "#5a8e3f", "#ffb24d", "#fb7e38", "#032659", "#975722"],
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Process and export map color palettes
|
|
39
|
+
export const mapColorPalettes = {
|
|
40
|
+
v1: updatePaletteNames(mapColorPalettesData.v1),
|
|
41
|
+
v2: updatePaletteNames(mapColorPalettesData.v2)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const mapColorPalettesV1 = mapColorPalettes.v1
|
|
45
|
+
export const mapColorPalettesV2 = mapColorPalettes.v2
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Shared color palettes used across multiple components
|
|
2
|
+
// These are exact matches found in both chart and map color palette files
|
|
3
|
+
|
|
4
|
+
export const sharedPalettes = {
|
|
5
|
+
qualitative1: [
|
|
6
|
+
'#a6cee3',
|
|
7
|
+
'#1f78b4',
|
|
8
|
+
'#b2df8a',
|
|
9
|
+
'#33a02c',
|
|
10
|
+
'#fb9a99',
|
|
11
|
+
'#e31a1c',
|
|
12
|
+
'#6a3d9a',
|
|
13
|
+
'#cab2d6',
|
|
14
|
+
'#e31a90',
|
|
15
|
+
'#15017a',
|
|
16
|
+
'#c2c0fc'
|
|
17
|
+
],
|
|
18
|
+
|
|
19
|
+
qualitative2: ['#7fc97f', '#beaed4', '#ff9', '#386cb0', '#f0027f', '#bf5b17', '#666', '#fedab8'],
|
|
20
|
+
|
|
21
|
+
qualitative3: ['#1b9e77', '#d95f02', '#7570b3', '#e7298a', '#66a61e', '#e6ab02', '#a6761d', '#666'],
|
|
22
|
+
|
|
23
|
+
qualitative4: ['#e41a1c', '#377eb8', '#4daf4a', '#984ea3', '#ff7f00', '#ff3', '#a65628', '#f781bf'],
|
|
24
|
+
|
|
25
|
+
colorblindsafe: ['#e69f00', '#56b4e9', '#009e73', '#f0e442', '#0072b2', '#d55e00', '#cc79a7', '#000000', '#7e5803'],
|
|
26
|
+
|
|
27
|
+
sequentialBlueNine: [
|
|
28
|
+
'#f5feff',
|
|
29
|
+
'#e1fbff',
|
|
30
|
+
'#c0f2fd',
|
|
31
|
+
'#94e2ed',
|
|
32
|
+
'#5ebad4',
|
|
33
|
+
'#3695be',
|
|
34
|
+
'#2273a0',
|
|
35
|
+
'#0e5181',
|
|
36
|
+
'#093460'
|
|
37
|
+
],
|
|
38
|
+
|
|
39
|
+
sequentialOrangeNine: [
|
|
40
|
+
'#fffdf0',
|
|
41
|
+
'#fff7dc',
|
|
42
|
+
'#ffe9c2',
|
|
43
|
+
'#ffd097',
|
|
44
|
+
'#f7a866',
|
|
45
|
+
'#eb7723',
|
|
46
|
+
'#b95117',
|
|
47
|
+
'#853209',
|
|
48
|
+
'#661f00'
|
|
49
|
+
]
|
|
50
|
+
}
|
package/dist/cove-main.css
CHANGED
|
@@ -519,15 +519,15 @@ body.post-type-cdc_visualization .cdc-editor .configure .editor-panel {
|
|
|
519
519
|
background-color: rgb(0, 79.9, 144.5);
|
|
520
520
|
border-color: rgb(0, 79.9, 144.5);
|
|
521
521
|
}
|
|
522
|
-
.cdc-open-viz-module .cove-form-select {
|
|
522
|
+
.cdc-open-viz-module select.cove-form-select {
|
|
523
523
|
font-family: var(--app-font-secondary);
|
|
524
524
|
font-weight: 300;
|
|
525
525
|
font-size: var(--filter-select-font-size);
|
|
526
526
|
line-height: normal;
|
|
527
527
|
padding-right: 3rem;
|
|
528
528
|
border-radius: 0.333rem;
|
|
529
|
-
border: 1px solid var(--
|
|
530
|
-
color: var(--
|
|
529
|
+
border: 1px solid var(--cool-gray-10) !important;
|
|
530
|
+
color: var(--cool-gray-90);
|
|
531
531
|
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>');
|
|
532
532
|
background-repeat: no-repeat;
|
|
533
533
|
background-position: right 0.5rem center;
|
|
@@ -728,6 +728,9 @@ body.post-type-cdc_visualization .cdc-editor .configure .editor-panel {
|
|
|
728
728
|
.cdc-open-viz-module .ps-auto {
|
|
729
729
|
padding-left: auto !important;
|
|
730
730
|
}
|
|
731
|
+
.cdc-open-viz-module .fw-bold {
|
|
732
|
+
font-weight: 700 !important;
|
|
733
|
+
}
|
|
731
734
|
|
|
732
735
|
.color-palette li.theme-purple,
|
|
733
736
|
.btn.theme-purple {
|
|
@@ -1854,6 +1857,52 @@ body.post-type-cdc_visualization .cdc-editor .configure .editor-panel {
|
|
|
1854
1857
|
background-color: #00695c;
|
|
1855
1858
|
}
|
|
1856
1859
|
|
|
1860
|
+
/* Common component styles shared across packages */
|
|
1861
|
+
/* This file combines loader, warning-icon, and checkbox-group styles */
|
|
1862
|
+
/* Shared loader component */
|
|
1863
|
+
/* Used across: chart, dashboard, data-bite, waffle-chart packages */
|
|
1864
|
+
.loader {
|
|
1865
|
+
width: 100%;
|
|
1866
|
+
text-align: center;
|
|
1867
|
+
display: inline-block;
|
|
1868
|
+
animation: spin 1s linear infinite;
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
.loader::before {
|
|
1872
|
+
content: "↻";
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1875
|
+
/* Shared warning icon component */
|
|
1876
|
+
/* TODO: Currently different panel classes on different packages */
|
|
1877
|
+
.accordion__button svg.warning-icon,
|
|
1878
|
+
.cove-accordion__button svg.warning-icon {
|
|
1879
|
+
position: absolute;
|
|
1880
|
+
right: 35px;
|
|
1881
|
+
left: auto;
|
|
1882
|
+
top: 50%;
|
|
1883
|
+
transform: translateY(-50%);
|
|
1884
|
+
}
|
|
1885
|
+
|
|
1886
|
+
.warning-icon {
|
|
1887
|
+
color: #d72f00;
|
|
1888
|
+
width: 15px;
|
|
1889
|
+
height: 15px;
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
.warning-icon path {
|
|
1893
|
+
fill: #d8000c;
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
/* Shared checkbox group component */
|
|
1897
|
+
/* Used across: chart, data-bite, markup-include packages */
|
|
1898
|
+
.checkbox-group {
|
|
1899
|
+
padding: 16px;
|
|
1900
|
+
border: 1px solid #c4c4c4;
|
|
1901
|
+
border-radius: 8px;
|
|
1902
|
+
margin-top: 8px;
|
|
1903
|
+
margin-bottom: 24px;
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1857
1906
|
:root {
|
|
1858
1907
|
--cove-tooltip-bg: #fff;
|
|
1859
1908
|
--cove-tooltip-color: black;
|
|
@@ -4150,17 +4199,6 @@ body.post-type-cdc_visualization .cdc-editor .configure .editor-panel {
|
|
|
4150
4199
|
background-color: #00695c;
|
|
4151
4200
|
}
|
|
4152
4201
|
|
|
4153
|
-
.cove {
|
|
4154
|
-
font-size: 16px;
|
|
4155
|
-
line-height: 1.4;
|
|
4156
|
-
margin: 0;
|
|
4157
|
-
font-family: var(--app-font-main);
|
|
4158
|
-
font-size: 1em;
|
|
4159
|
-
line-height: 1.5;
|
|
4160
|
-
font-weight: 400;
|
|
4161
|
-
font-style: normal;
|
|
4162
|
-
text-rendering: optimizeLegibility;
|
|
4163
|
-
}
|
|
4164
4202
|
.cove .markup-include .theme-amber,
|
|
4165
4203
|
.cove .type-waffle-chart .theme-amber,
|
|
4166
4204
|
.cove .type-data-bite .theme-amber,
|
|
@@ -5292,6 +5330,17 @@ body.post-type-cdc_visualization .cdc-editor .configure .editor-panel {
|
|
|
5292
5330
|
color: #005eaa;
|
|
5293
5331
|
text-decoration: underline;
|
|
5294
5332
|
}
|
|
5333
|
+
.cove {
|
|
5334
|
+
font-size: 16px;
|
|
5335
|
+
line-height: 1.4;
|
|
5336
|
+
margin: 0;
|
|
5337
|
+
font-family: var(--app-font-main);
|
|
5338
|
+
font-size: 1em;
|
|
5339
|
+
line-height: 1.5;
|
|
5340
|
+
font-weight: 400;
|
|
5341
|
+
font-style: normal;
|
|
5342
|
+
text-rendering: optimizeLegibility;
|
|
5343
|
+
}
|
|
5295
5344
|
.cove strong {
|
|
5296
5345
|
font-weight: 600;
|
|
5297
5346
|
}
|