@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
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { changeSingleStateMapNoDataMessage } from '../4.25.9'
|
|
2
|
+
import { expect, describe, it } from 'vitest'
|
|
3
|
+
|
|
4
|
+
describe('changeSingleStateMapNoDataMessage', () => {
|
|
5
|
+
it('should set noDataMessage to "No State Selected" if the message is default', () => {
|
|
6
|
+
const config: any = {
|
|
7
|
+
type: 'map',
|
|
8
|
+
general: { noStateFoundMessage: 'Map Unavailable' },
|
|
9
|
+
runtime: {}
|
|
10
|
+
}
|
|
11
|
+
changeSingleStateMapNoDataMessage(config)
|
|
12
|
+
expect(config.general.noDataMessage).toBe('No State Selected')
|
|
13
|
+
expect(config.general.noStateFoundMessage).toBeUndefined()
|
|
14
|
+
expect(config.runtime.noStateFoundMessage).toBeUndefined()
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
it('should preserve custom noStateFoundMessage', () => {
|
|
18
|
+
const config: any = {
|
|
19
|
+
type: 'map',
|
|
20
|
+
general: { noStateFoundMessage: 'Custom Message' },
|
|
21
|
+
runtime: {}
|
|
22
|
+
}
|
|
23
|
+
changeSingleStateMapNoDataMessage(config)
|
|
24
|
+
expect(config.general.noDataMessage).toBe('Custom Message')
|
|
25
|
+
expect(config.general.noStateFoundMessage).toBeUndefined()
|
|
26
|
+
expect(config.runtime.noStateFoundMessage).toBeUndefined()
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
it('should work for dashboard configs with map visualizations', () => {
|
|
30
|
+
const dashboardConfig: any = {
|
|
31
|
+
type: 'dashboard',
|
|
32
|
+
visualizations: {
|
|
33
|
+
map1: {
|
|
34
|
+
type: 'map',
|
|
35
|
+
general: { noStateFoundMessage: 'Map Unavailable' },
|
|
36
|
+
runtime: {}
|
|
37
|
+
},
|
|
38
|
+
chart1: {
|
|
39
|
+
type: 'chart',
|
|
40
|
+
general: {},
|
|
41
|
+
runtime: {}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
changeSingleStateMapNoDataMessage(dashboardConfig)
|
|
46
|
+
expect(dashboardConfig.visualizations.map1.general.noDataMessage).toBe('No State Selected')
|
|
47
|
+
expect(dashboardConfig.visualizations.map1.general.noStateFoundMessage).toBeUndefined()
|
|
48
|
+
expect(dashboardConfig.visualizations.map1.runtime.noStateFoundMessage).toBeUndefined()
|
|
49
|
+
expect(dashboardConfig.visualizations.chart1.general.noDataMessage).toBeUndefined()
|
|
50
|
+
})
|
|
51
|
+
})
|
package/helpers/viewports.ts
CHANGED
|
@@ -14,3 +14,5 @@ export const isMobileStateLabelViewport = currentViewport => isBelowBreakpoint('
|
|
|
14
14
|
export const isMobileTerritoryViewport = currentViewport => isBelowBreakpoint('sm', currentViewport)
|
|
15
15
|
|
|
16
16
|
export const isMobileFontViewport = currentViewport => isBelowBreakpoint('sm', currentViewport)
|
|
17
|
+
|
|
18
|
+
export const isMobileSmallMultiplesViewport = currentViewport => isBelowBreakpoint('md', currentViewport)
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { useEffect, useMemo } from 'react'
|
|
2
|
+
import { filterColorPalettes } from '../helpers/filterColorPalettes'
|
|
3
|
+
import { twoColorPalette, chartColorPalettes } from '../data/colorPalettes'
|
|
4
|
+
|
|
5
|
+
export interface UseColorPaletteResult {
|
|
6
|
+
sequential: string[]
|
|
7
|
+
nonSequential: string[]
|
|
8
|
+
accessibleColors: string[]
|
|
9
|
+
twoColorPalettes: string[]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* React hook for filtering color palettes based on config and visualization type
|
|
14
|
+
* Provides filtered palettes for chart visualization components
|
|
15
|
+
*/
|
|
16
|
+
export const useColorPalette = (config: any, updateConfig?: (newConfig: any) => void): UseColorPaletteResult => {
|
|
17
|
+
// Get filtered palettes using the core filtering logic
|
|
18
|
+
const filteredPalettes = useMemo(() => {
|
|
19
|
+
const isReversed = config.general?.palette?.isReversed
|
|
20
|
+
const visualizationType = config.visualizationType
|
|
21
|
+
|
|
22
|
+
const result = filterColorPalettes({
|
|
23
|
+
config,
|
|
24
|
+
isReversed,
|
|
25
|
+
colorPalettes: chartColorPalettes,
|
|
26
|
+
visualizationType
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
// Handle two-color palettes specially for chart components
|
|
30
|
+
let twoColorPalettes: string[] = []
|
|
31
|
+
if (visualizationType === 'Paired Bar' || visualizationType === 'Deviation Bar') {
|
|
32
|
+
const isTwoColorReversed = config.twoColor?.isPaletteReversed
|
|
33
|
+
twoColorPalettes = Object.keys(twoColorPalette).filter(name =>
|
|
34
|
+
isTwoColorReversed ? name.endsWith('reverse') : !name.endsWith('reverse')
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
sequential: result.sequential,
|
|
40
|
+
nonSequential: result.nonSequential,
|
|
41
|
+
accessibleColors: result.accessibleColors,
|
|
42
|
+
twoColorPalettes: result.twoColorPalettes || twoColorPalettes
|
|
43
|
+
}
|
|
44
|
+
}, [
|
|
45
|
+
config.visualizationType,
|
|
46
|
+
config.general?.palette?.isReversed,
|
|
47
|
+
config.general?.palette?.version,
|
|
48
|
+
config.twoColor?.isPaletteReversed
|
|
49
|
+
])
|
|
50
|
+
|
|
51
|
+
// Update twoColor palette based on isPaletteReversed
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (!updateConfig || !config.twoColor) return
|
|
54
|
+
|
|
55
|
+
const { isPaletteReversed, palette } = config.twoColor
|
|
56
|
+
let newPalette = ''
|
|
57
|
+
|
|
58
|
+
if (isPaletteReversed && !palette.endsWith('reverse')) {
|
|
59
|
+
newPalette = palette + 'reverse'
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (!isPaletteReversed && palette.endsWith('reverse')) {
|
|
63
|
+
newPalette = palette.slice(0, -7)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (newPalette && newPalette !== palette) {
|
|
67
|
+
updateConfig({
|
|
68
|
+
...config,
|
|
69
|
+
twoColor: {
|
|
70
|
+
...config.twoColor,
|
|
71
|
+
palette: newPalette
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
}
|
|
75
|
+
}, [config.twoColor?.isPaletteReversed, updateConfig])
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
return filteredPalettes
|
|
79
|
+
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdc/core",
|
|
3
|
-
"version": "4.25.
|
|
3
|
+
"version": "4.25.11",
|
|
4
4
|
"description": "Core components, styles, hooks, and helpers, for the CDC Open Visualization project",
|
|
5
5
|
"moduleName": "CdcCore",
|
|
6
6
|
"main": "dist/cdccore",
|
|
7
|
+
"type": "module",
|
|
7
8
|
"scripts": {
|
|
8
9
|
"test": "vitest run --environment jsdom --reporter verbose",
|
|
9
10
|
"test-watch": "vitest watch --reporter verbose",
|
|
@@ -21,14 +22,17 @@
|
|
|
21
22
|
},
|
|
22
23
|
"license": "Apache-2.0",
|
|
23
24
|
"dependencies": {
|
|
25
|
+
"chroma-js": "3.1.2",
|
|
24
26
|
"dompurify": "^3.2.4",
|
|
27
|
+
"html-react-parser": "5.2.3",
|
|
25
28
|
"html2canvas": "^1.4.1",
|
|
26
29
|
"json-edit-react": "^1.27.0",
|
|
30
|
+
"papaparse": "5.5.2",
|
|
27
31
|
"prop-types": "^15.8.1",
|
|
28
32
|
"react-accessible-accordion": "^5.0.1",
|
|
29
33
|
"react-select": "^5.3.1",
|
|
30
34
|
"react-tooltip": "5.8.2-beta.3",
|
|
31
|
-
"
|
|
35
|
+
"resize-observer-polyfill": "^1.5.1",
|
|
32
36
|
"use-debounce": "^10.0.5",
|
|
33
37
|
"vega": "^6.1.0",
|
|
34
38
|
"vega-lite": "^6.1.0"
|
|
@@ -37,8 +41,13 @@
|
|
|
37
41
|
"react": "^18.2.0",
|
|
38
42
|
"react-dom": "^18.2.0"
|
|
39
43
|
},
|
|
40
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "5f09a137c22f454111ab5f4cd7fdf1d2d58e31bd",
|
|
41
45
|
"devDependencies": {
|
|
42
|
-
"
|
|
46
|
+
"@rollup/plugin-dsv": "^3.0.2",
|
|
47
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
48
|
+
"sass": "^1.89.2",
|
|
49
|
+
"vite": "^5.4.21",
|
|
50
|
+
"vite-plugin-css-injected-by-js": "^2.4.0",
|
|
51
|
+
"vite-plugin-svgr": "^2.4.0"
|
|
43
52
|
}
|
|
44
53
|
}
|
|
@@ -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
|
+
}
|
package/styles/_global.scss
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use 'sass:color';
|
|
2
|
+
|
|
1
3
|
strong {
|
|
2
4
|
font-weight: 600;
|
|
3
5
|
}
|
|
@@ -8,12 +10,15 @@ strong {
|
|
|
8
10
|
justify-content: space-between;
|
|
9
11
|
padding: 0.3rem 1rem;
|
|
10
12
|
font-size: 0.9rem;
|
|
13
|
+
|
|
11
14
|
strong {
|
|
12
15
|
font-weight: 600;
|
|
13
16
|
}
|
|
17
|
+
|
|
14
18
|
p {
|
|
15
19
|
margin: 0;
|
|
16
20
|
}
|
|
21
|
+
|
|
17
22
|
.dismiss-error {
|
|
18
23
|
flex-shrink: 0;
|
|
19
24
|
font-size: 0.8rem;
|
|
@@ -34,19 +39,23 @@ strong {
|
|
|
34
39
|
border: 0 !important;
|
|
35
40
|
display: flex;
|
|
36
41
|
}
|
|
42
|
+
|
|
37
43
|
.cdcdataviz-sr-only-focusable:focus {
|
|
38
44
|
width: fit-content;
|
|
39
45
|
margin-bottom: 0.5em;
|
|
40
46
|
margin-left: 1em;
|
|
41
47
|
}
|
|
48
|
+
|
|
42
49
|
.inline-icon {
|
|
43
50
|
width: 1em !important;
|
|
44
51
|
height: auto !important;
|
|
52
|
+
font-size: 1rem;
|
|
53
|
+
color: inherit;
|
|
54
|
+
|
|
45
55
|
@media all and (-ms-high-contrast: none) {
|
|
46
56
|
height: 30px !important;
|
|
47
57
|
}
|
|
48
|
-
|
|
49
|
-
color: inherit;
|
|
58
|
+
|
|
50
59
|
path {
|
|
51
60
|
fill: currentColor;
|
|
52
61
|
}
|
|
@@ -56,27 +65,32 @@ strong {
|
|
|
56
65
|
&.full-width {
|
|
57
66
|
width: 100%;
|
|
58
67
|
}
|
|
68
|
+
|
|
59
69
|
&:hover {
|
|
60
70
|
transition: 0.1s background-color;
|
|
61
71
|
}
|
|
72
|
+
|
|
62
73
|
&.secondary {
|
|
63
74
|
font-size: 0.8em;
|
|
64
75
|
padding: 0.3em 1em;
|
|
65
76
|
background: rgba(0, 0, 0, 0.3);
|
|
66
77
|
display: inline-block;
|
|
67
78
|
margin-bottom: 1em;
|
|
79
|
+
|
|
68
80
|
&:hover {
|
|
69
81
|
background: rgba(0, 0, 0, 0.5);
|
|
70
82
|
}
|
|
71
83
|
}
|
|
84
|
+
|
|
72
85
|
&.danger {
|
|
73
86
|
background-color: $red;
|
|
74
87
|
padding: 0em 0.6em 0em;
|
|
75
88
|
height: 1.6em;
|
|
76
89
|
font-size: 0.8 em;
|
|
77
90
|
color: #fff;
|
|
91
|
+
|
|
78
92
|
&:hover {
|
|
79
|
-
background-color:
|
|
93
|
+
background-color: color.adjust($red, $lightness: -5%);
|
|
80
94
|
}
|
|
81
95
|
}
|
|
82
96
|
|
|
@@ -99,6 +113,7 @@ textarea {
|
|
|
99
113
|
font-weight: normal;
|
|
100
114
|
font-family: sans-serif;
|
|
101
115
|
border: rgba(0, 0, 0, 0.3) 1px solid !important;
|
|
116
|
+
|
|
102
117
|
&:focus {
|
|
103
118
|
border: rgba(0, 0, 0, 0.7) 1px solid !important;
|
|
104
119
|
outline: 0;
|
|
@@ -120,6 +135,7 @@ textarea {
|
|
|
120
135
|
position: relative;
|
|
121
136
|
transition: 0.2s all;
|
|
122
137
|
font-size: 1em;
|
|
138
|
+
|
|
123
139
|
&:before {
|
|
124
140
|
content: ' ';
|
|
125
141
|
width: 5px;
|
|
@@ -129,22 +145,27 @@ textarea {
|
|
|
129
145
|
bottom: -1px;
|
|
130
146
|
position: absolute;
|
|
131
147
|
}
|
|
148
|
+
|
|
132
149
|
&:hover {
|
|
133
150
|
background: $lightestGray;
|
|
134
151
|
transition: 0.2s all;
|
|
135
152
|
color: #444;
|
|
136
153
|
}
|
|
137
|
-
|
|
154
|
+
|
|
155
|
+
>div {
|
|
138
156
|
font-size: 0.9em;
|
|
139
157
|
}
|
|
158
|
+
|
|
140
159
|
svg {
|
|
141
160
|
width: 60px;
|
|
142
161
|
color: $blue;
|
|
143
162
|
margin-right: 1rem;
|
|
163
|
+
|
|
144
164
|
path {
|
|
145
165
|
fill: currentColor;
|
|
146
166
|
}
|
|
147
167
|
}
|
|
168
|
+
|
|
148
169
|
h3 {
|
|
149
170
|
font-weight: 600;
|
|
150
171
|
font-size: 1.2rem;
|
|
@@ -167,23 +188,24 @@ section.footnotes {
|
|
|
167
188
|
.btn.btn-primary:not([disabled]) {
|
|
168
189
|
background-color: $blue;
|
|
169
190
|
border-color: $blue;
|
|
191
|
+
|
|
170
192
|
&:hover:not([disabled]) {
|
|
171
|
-
background-color:
|
|
172
|
-
border-color:
|
|
193
|
+
background-color: color.adjust($blue, $lightness: -5%);
|
|
194
|
+
border-color: color.adjust($blue, $lightness: -5%);
|
|
173
195
|
}
|
|
174
196
|
}
|
|
175
197
|
|
|
176
198
|
// after migration to TP5 this declaration should be removed and all references
|
|
177
199
|
// to it should be replaced with .form-select
|
|
178
|
-
.cove-form-select {
|
|
200
|
+
select.cove-form-select {
|
|
179
201
|
font-family: var(--app-font-secondary);
|
|
180
202
|
font-weight: 300;
|
|
181
203
|
font-size: var(--filter-select-font-size);
|
|
182
204
|
line-height: normal;
|
|
183
205
|
padding-right: 3rem;
|
|
184
206
|
border-radius: 0.333rem;
|
|
185
|
-
border: 1px solid var(--
|
|
186
|
-
color: var(--
|
|
207
|
+
border: 1px solid var(--cool-gray-10) !important;
|
|
208
|
+
color: var(--cool-gray-90);
|
|
187
209
|
// recreate caret using svg
|
|
188
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>');
|
|
189
211
|
background-repeat: no-repeat;
|
|
@@ -193,4 +215,4 @@ section.footnotes {
|
|
|
193
215
|
-webkit-appearance: none;
|
|
194
216
|
-moz-appearance: none;
|
|
195
217
|
cursor: pointer;
|
|
196
|
-
}
|
|
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 {
|
|
@@ -66,20 +17,19 @@ body.post-type-cdc_visualization .cdc-editor .configure .editor-panel {
|
|
|
66
17
|
.cdc-open-viz-module {
|
|
67
18
|
position: relative;
|
|
68
19
|
line-height: 1.4;
|
|
20
|
+
// Force printing chart images
|
|
21
|
+
-webkit-print-color-adjust: exact !important; /* Chrome, Safari 6 – 15.3, Edge */
|
|
22
|
+
color-adjust: exact !important; /* Firefox 48 – 96 */
|
|
23
|
+
print-color-adjust: exact !important; /* Firefox 97+, Safari 15.4+ */
|
|
24
|
+
|
|
69
25
|
@import 'global';
|
|
70
26
|
@import 'button-section';
|
|
71
27
|
@import 'series-list';
|
|
72
|
-
@import 'typography';
|
|
73
28
|
|
|
74
29
|
input[type='range'] {
|
|
75
30
|
appearance: auto !important;
|
|
76
31
|
}
|
|
77
32
|
|
|
78
|
-
// Force printing chart images
|
|
79
|
-
-webkit-print-color-adjust: exact !important; /* Chrome, Safari 6 – 15.3, Edge */
|
|
80
|
-
color-adjust: exact !important; /* Firefox 48 – 96 */
|
|
81
|
-
print-color-adjust: exact !important; /* Firefox 97+, Safari 15.4+ */
|
|
82
|
-
|
|
83
33
|
$theme: (
|
|
84
34
|
'amber': (
|
|
85
35
|
'#fbab18',
|
|
@@ -234,4 +184,7 @@ body.post-type-cdc_visualization .cdc-editor .configure .editor-panel {
|
|
|
234
184
|
.ps-auto {
|
|
235
185
|
padding-left: auto !important;
|
|
236
186
|
}
|
|
187
|
+
.fw-bold {
|
|
188
|
+
font-weight: 700 !important;
|
|
189
|
+
}
|
|
237
190
|
}
|
package/styles/cove-main.scss
CHANGED
package/styles/filters.scss
CHANGED
|
@@ -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
|
-
|
|
39
|
-
|
|
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,3 +1,4 @@
|
|
|
1
|
+
@use 'sass:color';
|
|
1
2
|
@import '../utils/variables';
|
|
2
3
|
@import '../themes/index';
|
|
3
4
|
|
|
@@ -110,7 +111,7 @@
|
|
|
110
111
|
background-color: #44aa41;
|
|
111
112
|
|
|
112
113
|
&:hover {
|
|
113
|
-
background-color:
|
|
114
|
+
background-color: color.adjust(#44aa41, $lightness: 5%);
|
|
114
115
|
}
|
|
115
116
|
}
|
|
116
117
|
|
|
@@ -118,7 +119,7 @@
|
|
|
118
119
|
background-color: #d73636;
|
|
119
120
|
|
|
120
121
|
&:hover {
|
|
121
|
-
background-color:
|
|
122
|
+
background-color: color.adjust(#d73636, $lightness: -5%);
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
|
|
@@ -126,7 +127,7 @@
|
|
|
126
127
|
background-color: #a0a0a0;
|
|
127
128
|
|
|
128
129
|
&:hover {
|
|
129
|
-
background-color:
|
|
130
|
+
background-color: color.adjust(#a0a0a0, $lightness: -5%);
|
|
130
131
|
}
|
|
131
132
|
}
|
|
132
133
|
|
|
@@ -1,13 +1,16 @@
|
|
|
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
|
-
@import './../base/reset';
|
|
6
7
|
display: grid;
|
|
7
8
|
grid-template-columns: auto 1fr;
|
|
8
9
|
grid-template-areas: 'panel content';
|
|
9
10
|
height: 100vh;
|
|
10
11
|
|
|
12
|
+
@import './../base/reset';
|
|
13
|
+
|
|
11
14
|
.cove-editor__panel {
|
|
12
15
|
grid-area: panel;
|
|
13
16
|
width: $editorWidth;
|
|
@@ -90,7 +93,7 @@
|
|
|
90
93
|
margin-top: 1em;
|
|
91
94
|
justify-content: space-between;
|
|
92
95
|
|
|
93
|
-
>
|
|
96
|
+
>label {
|
|
94
97
|
width: 48%;
|
|
95
98
|
margin-top: 0 !important;
|
|
96
99
|
}
|
|
@@ -127,7 +130,7 @@
|
|
|
127
130
|
cursor: pointer;
|
|
128
131
|
}
|
|
129
132
|
|
|
130
|
-
+
|
|
133
|
+
+li {
|
|
131
134
|
border-top: $lightGray 1px solid;
|
|
132
135
|
}
|
|
133
136
|
}
|
|
@@ -147,6 +150,7 @@
|
|
|
147
150
|
color: $blue;
|
|
148
151
|
margin-right: 1rem;
|
|
149
152
|
height: 60px; // IE11
|
|
153
|
+
|
|
150
154
|
path {
|
|
151
155
|
fill: currentColor;
|
|
152
156
|
}
|
|
@@ -185,7 +189,7 @@
|
|
|
185
189
|
display: flex;
|
|
186
190
|
justify-content: space-between;
|
|
187
191
|
|
|
188
|
-
>
|
|
192
|
+
>label {
|
|
189
193
|
margin-top: 0;
|
|
190
194
|
width: 30%;
|
|
191
195
|
display: inline-block;
|
|
@@ -233,7 +237,7 @@
|
|
|
233
237
|
margin-top: 0;
|
|
234
238
|
}
|
|
235
239
|
|
|
236
|
-
label
|
|
240
|
+
label+label {
|
|
237
241
|
margin-top: 1em;
|
|
238
242
|
}
|
|
239
243
|
|
|
@@ -253,12 +257,12 @@
|
|
|
253
257
|
.sort-list {
|
|
254
258
|
list-style: none;
|
|
255
259
|
|
|
256
|
-
>
|
|
260
|
+
>li {
|
|
257
261
|
margin-right: 0.3em;
|
|
258
262
|
margin-bottom: 0.3em;
|
|
259
263
|
}
|
|
260
264
|
|
|
261
|
-
li
|
|
265
|
+
li>div {
|
|
262
266
|
display: block;
|
|
263
267
|
box-sizing: border-box;
|
|
264
268
|
border: 1px solid #d1d1d1;
|
|
@@ -483,3 +487,8 @@ ul.color-palette {
|
|
|
483
487
|
}
|
|
484
488
|
}
|
|
485
489
|
}
|
|
490
|
+
|
|
491
|
+
// CheckBox component styling for EditorPanel/Inputs
|
|
492
|
+
.edit-checkbox {
|
|
493
|
+
margin-right: 8px;
|
|
494
|
+
}
|