@cdc/core 4.25.10 → 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 +3 -1
- package/components/CustomColorsEditor/CustomColorsEditor.css +299 -0
- package/components/CustomColorsEditor/CustomColorsEditor.tsx +209 -0
- package/components/CustomColorsEditor/index.ts +1 -0
- package/components/DataTable/DataTableStandAlone.tsx +8 -3
- package/components/DataTable/components/DataTableEditorPanel.tsx +12 -2
- package/components/DataTable/data-table.css +6 -0
- package/components/DataTable/helpers/mapCellMatrix.tsx +14 -3
- package/components/DataTable/helpers/standardizeState.js +2 -2
- package/components/DataTable/helpers/tests/standardizeState.test.js +54 -0
- 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/MarkupVariablesEditor.tsx +61 -22
- package/components/Filters/Filters.tsx +26 -5
- package/components/Filters/components/Dropdown.tsx +6 -1
- 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/Loader/Loader.tsx +1 -1
- package/components/MediaControls.tsx +21 -18
- package/components/PaletteConversionModal.tsx +7 -4
- package/components/PaletteSelector/PaletteSelector.css +49 -6
- package/components/Table/components/Cell.tsx +23 -2
- package/components/Table/components/Row.tsx +5 -3
- package/components/_stories/Filters.stories.tsx +20 -1
- package/components/_stories/Footnotes.CSV.stories.tsx +247 -0
- package/components/_stories/Footnotes.stories.tsx +768 -3
- package/components/_stories/Inputs.stories.tsx +2 -2
- package/components/_stories/styles.scss +0 -1
- package/components/ui/Accordion.jsx +1 -1
- package/components/ui/accordion.styles.css +57 -0
- package/data/chartColorPalettes.ts +1 -1
- package/dist/cove-main.css +49 -3
- package/dist/cove-main.css.map +1 -1
- package/helpers/addValuesToFilters.ts +5 -0
- package/helpers/constants.ts +37 -0
- package/helpers/cove/number.ts +33 -12
- package/helpers/coveUpdateWorker.ts +3 -1
- package/helpers/fetchRemoteData.ts +3 -15
- package/helpers/markupProcessor.ts +27 -12
- package/helpers/mergeCustomOrderValues.ts +37 -0
- package/helpers/parseCsvWithQuotes.ts +65 -0
- package/helpers/testing.ts +17 -4
- package/helpers/ver/4.25.11.ts +13 -0
- package/helpers/viewports.ts +2 -0
- package/package.json +4 -3
- package/styles/_common-components.css +73 -0
- package/styles/_global.scss +25 -5
- package/styles/base.scss +0 -50
- 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/editor.scss +14 -6
- package/styles/v2/utils/_breakpoints.scss +1 -1
- package/styles/v2/utils/index.scss +0 -1
- package/styles/waiting.scss +1 -1
- package/types/MarkupInclude.ts +4 -3
- package/types/MarkupVariable.ts +1 -1
- package/types/VizFilter.ts +1 -0
- package/styles/_mixins.scss +0 -13
- package/styles/_typography.scss +0 -0
- 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
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import Papa from 'papaparse'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Parses CSV text while preserving newlines and commas within quoted fields.
|
|
5
|
+
*
|
|
6
|
+
* @param responseText - The raw CSV text to parse
|
|
7
|
+
* @param options - Parsing options
|
|
8
|
+
* @param options.delimiter - The delimiter to use after processing (default: '|')
|
|
9
|
+
* @param options.dynamicTyping - Whether to automatically convert types (default: false)
|
|
10
|
+
* @returns Parsed CSV data as an array of objects
|
|
11
|
+
*/
|
|
12
|
+
export function parseCsvWithQuotes(
|
|
13
|
+
responseText: string,
|
|
14
|
+
options: {
|
|
15
|
+
delimiter?: string
|
|
16
|
+
dynamicTyping?: boolean
|
|
17
|
+
} = {}
|
|
18
|
+
): any[] {
|
|
19
|
+
const { delimiter = '|', dynamicTyping = false } = options
|
|
20
|
+
|
|
21
|
+
const NEWLINE_PLACEHOLDER = '__COVE_NEWLINE__'
|
|
22
|
+
|
|
23
|
+
// Preserve newlines in quoted fields by replacing with placeholder
|
|
24
|
+
const quotedFields: string[] = []
|
|
25
|
+
let placeholderIndex = 0
|
|
26
|
+
let sanitizedText = responseText.replace(/("(?:[^"\\]|\\.|[\s\S])*?")/g, (match) => {
|
|
27
|
+
const preserved = match.replace(/\n/g, NEWLINE_PLACEHOLDER)
|
|
28
|
+
quotedFields.push(preserved)
|
|
29
|
+
return `__QUOTED_FIELD_${placeholderIndex++}__`
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
// Replace commas outside quoted fields with pipe delimiter
|
|
33
|
+
sanitizedText = sanitizedText.replace(/(__QUOTED_FIELD_\d+__)|,/g, (...m) => m[1] || delimiter)
|
|
34
|
+
|
|
35
|
+
// Restore quoted fields without outer quotes
|
|
36
|
+
quotedFields.forEach((field, index) => {
|
|
37
|
+
const unquoted = field.slice(1, -1).replace(new RegExp(NEWLINE_PLACEHOLDER, 'g'), '\n')
|
|
38
|
+
sanitizedText = sanitizedText.replace(`__QUOTED_FIELD_${index}__`, unquoted)
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
// Parse with Papa.parse
|
|
42
|
+
const parsedCsv = Papa.parse(sanitizedText, {
|
|
43
|
+
header: true,
|
|
44
|
+
skipEmptyLines: true,
|
|
45
|
+
delimiter,
|
|
46
|
+
dynamicTyping
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
// Restore newlines in parsed data
|
|
50
|
+
const restoredData = parsedCsv.data.map((row: any) => {
|
|
51
|
+
const restoredRow: any = {}
|
|
52
|
+
Object.keys(row).forEach(key => {
|
|
53
|
+
const value = row[key]
|
|
54
|
+
if (typeof value === 'string') {
|
|
55
|
+
restoredRow[key] = value.replace(new RegExp(NEWLINE_PLACEHOLDER, 'g'), '\n')
|
|
56
|
+
} else {
|
|
57
|
+
restoredRow[key] = value
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
return restoredRow
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
return restoredData
|
|
64
|
+
}
|
|
65
|
+
|
package/helpers/testing.ts
CHANGED
|
@@ -39,7 +39,7 @@ export const MIN_ANIMATION_DELAY_MS = (() => {
|
|
|
39
39
|
return 500
|
|
40
40
|
})()
|
|
41
41
|
|
|
42
|
-
const WAIT_FOR_TIMEOUT_MS =
|
|
42
|
+
const WAIT_FOR_TIMEOUT_MS = 10000
|
|
43
43
|
|
|
44
44
|
// ============================================================================
|
|
45
45
|
// CORE POLLING UTILITIES
|
|
@@ -177,8 +177,11 @@ export const waitForTextContent = async (el: HTMLElement | null, expected: strin
|
|
|
177
177
|
*/
|
|
178
178
|
export const waitForEditor = async (canvas: any) => {
|
|
179
179
|
await waitForWithDelay(() => {
|
|
180
|
-
const
|
|
181
|
-
expect(
|
|
180
|
+
const accordionButtons = canvas.getAllByRole('button', { name: /general|data|visual/i })
|
|
181
|
+
expect(accordionButtons.length).toBeGreaterThan(0)
|
|
182
|
+
for (const button of accordionButtons) {
|
|
183
|
+
expect(button).toBeVisible()
|
|
184
|
+
}
|
|
182
185
|
})
|
|
183
186
|
}
|
|
184
187
|
|
|
@@ -189,7 +192,17 @@ export const waitForEditor = async (canvas: any) => {
|
|
|
189
192
|
* @param sectionName Name of the accordion section (case-insensitive)
|
|
190
193
|
*/
|
|
191
194
|
export const openAccordion = async (canvas: any, sectionName: string) => {
|
|
192
|
-
|
|
195
|
+
// Get all buttons with matching name and filter to only accordion buttons
|
|
196
|
+
const allButtons = canvas.getAllByRole('button', { name: new RegExp(sectionName, 'i') })
|
|
197
|
+
const accordion = allButtons.find(
|
|
198
|
+
(button: HTMLElement) =>
|
|
199
|
+
button.classList.contains('accordion__button') || button.closest('.editor-panel, .accordion')
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
if (!accordion) {
|
|
203
|
+
throw new Error(`Could not find accordion button for "${sectionName}"`)
|
|
204
|
+
}
|
|
205
|
+
|
|
193
206
|
await userEvent.click(accordion)
|
|
194
207
|
await waitForWithDelay(() => {
|
|
195
208
|
const accordionContent = accordion.closest('.accordion-item, .accordion-section, [class*="accordion"]')
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import cloneConfig from '../cloneConfig'
|
|
2
|
+
|
|
3
|
+
const update_4_25_11 = config => {
|
|
4
|
+
const ver = '4.25.11'
|
|
5
|
+
const newConfig = cloneConfig(config)
|
|
6
|
+
// No config transformations needed - this is a runtime behavior fix
|
|
7
|
+
newConfig.version = ver
|
|
8
|
+
return newConfig
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default update_4_25_11
|
|
12
|
+
|
|
13
|
+
|
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)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"chroma-js": "3.1.2",
|
|
26
26
|
"dompurify": "^3.2.4",
|
|
27
|
+
"html-react-parser": "5.2.3",
|
|
27
28
|
"html2canvas": "^1.4.1",
|
|
28
29
|
"json-edit-react": "^1.27.0",
|
|
29
30
|
"papaparse": "5.5.2",
|
|
@@ -40,12 +41,12 @@
|
|
|
40
41
|
"react": "^18.2.0",
|
|
41
42
|
"react-dom": "^18.2.0"
|
|
42
43
|
},
|
|
43
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "5f09a137c22f454111ab5f4cd7fdf1d2d58e31bd",
|
|
44
45
|
"devDependencies": {
|
|
45
46
|
"@rollup/plugin-dsv": "^3.0.2",
|
|
46
47
|
"@vitejs/plugin-react": "^4.3.4",
|
|
47
48
|
"sass": "^1.89.2",
|
|
48
|
-
"vite": "^
|
|
49
|
+
"vite": "^5.4.21",
|
|
49
50
|
"vite-plugin-css-injected-by-js": "^2.4.0",
|
|
50
51
|
"vite-plugin-svgr": "^2.4.0"
|
|
51
52
|
}
|
|
@@ -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
|
@@ -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
|
-
|
|
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(--
|
|
188
|
-
color: var(--
|
|
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;
|
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,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
|
-
>
|
|
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
|
-
+
|
|
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
|
-
>
|
|
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
|
|
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
|
-
>
|
|
260
|
+
>li {
|
|
258
261
|
margin-right: 0.3em;
|
|
259
262
|
margin-bottom: 0.3em;
|
|
260
263
|
}
|
|
261
264
|
|
|
262
|
-
li
|
|
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
|
+
}
|
package/styles/waiting.scss
CHANGED
package/types/MarkupInclude.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Runtime } from '@cdc/core/types/Runtime'
|
|
2
|
-
import {
|
|
2
|
+
import { MarkupVariable } from './MarkupVariable'
|
|
3
3
|
import { Visualization } from './Visualization'
|
|
4
4
|
import { VizFilter } from './VizFilter'
|
|
5
5
|
|
|
@@ -8,7 +8,7 @@ export type MarkupIncludeConfig = Visualization & {
|
|
|
8
8
|
// Changing the base config object creates an infinite loop, nesting it is a workaround
|
|
9
9
|
allowHideSection?: boolean
|
|
10
10
|
inlineHTML: string
|
|
11
|
-
markupVariables?:
|
|
11
|
+
markupVariables?: MarkupVariable[]
|
|
12
12
|
showHeader: boolean
|
|
13
13
|
showNoDataMessage?: boolean
|
|
14
14
|
noDataMessageText?: string
|
|
@@ -17,9 +17,10 @@ export type MarkupIncludeConfig = Visualization & {
|
|
|
17
17
|
useInlineHTML: boolean
|
|
18
18
|
}
|
|
19
19
|
data?: Object[]
|
|
20
|
+
enableMarkupVariables?: boolean
|
|
20
21
|
filters?: VizFilter[]
|
|
21
22
|
formattedData: {}
|
|
22
|
-
markupVariables?:
|
|
23
|
+
markupVariables?: MarkupVariable[] // Support markupVariables at root level for backwards compatibility
|
|
23
24
|
newViz?: boolean
|
|
24
25
|
runtime?: Runtime
|
|
25
26
|
visual: {
|
package/types/MarkupVariable.ts
CHANGED
package/types/VizFilter.ts
CHANGED
|
@@ -23,6 +23,7 @@ export type GeneralFilter = FilterBase & {
|
|
|
23
23
|
queuedActive: string | string[]
|
|
24
24
|
filterStyle: VizFilterStyle
|
|
25
25
|
label: string
|
|
26
|
+
labels?: Record<string, string>
|
|
26
27
|
order: OrderBy
|
|
27
28
|
orderColumn?: string
|
|
28
29
|
orderedValues?: string[] // should only exist if the order is 'cust'
|
package/styles/_mixins.scss
DELETED
package/styles/_typography.scss
DELETED
|
File without changes
|
|
File without changes
|