@cdc/core 4.25.3-6 → 4.25.5-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 (90) hide show
  1. package/assets/icon-close.svg +1 -1
  2. package/components/AdvancedEditor/AdvancedEditor.tsx +11 -9
  3. package/components/DataTable/DataTable.tsx +50 -31
  4. package/components/DataTable/components/CellAnchor.tsx +1 -1
  5. package/components/DataTable/components/ChartHeader.tsx +3 -2
  6. package/components/DataTable/components/MapHeader.tsx +1 -0
  7. package/components/DataTable/helpers/chartCellMatrix.tsx +2 -1
  8. package/components/DataTable/helpers/getChartCellValue.ts +11 -5
  9. package/components/DataTable/helpers/getDataSeriesColumns.ts +7 -3
  10. package/components/DataTable/helpers/mapCellMatrix.tsx +80 -39
  11. package/components/DataTable/helpers/tests/mapCellMatrix.test.ts +80 -0
  12. package/components/DownloadButton.tsx +17 -2
  13. package/components/EditorPanel/DataTableEditor.tsx +29 -19
  14. package/components/EditorPanel/Inputs.tsx +13 -4
  15. package/components/EditorPanel/VizFilterEditor/NestedDropdownEditor.tsx +2 -1
  16. package/components/EditorPanel/VizFilterEditor/VizFilterEditor.tsx +26 -1
  17. package/components/Filters/Filters.tsx +172 -421
  18. package/components/Filters/components/Dropdown.tsx +39 -0
  19. package/components/Filters/components/Tabs.tsx +82 -0
  20. package/components/Filters/helpers/getChangedFilters.ts +31 -0
  21. package/components/Filters/helpers/getNestedOptions.ts +2 -2
  22. package/components/Filters/helpers/getNewRuntime.ts +35 -0
  23. package/components/Filters/helpers/handleSorting.ts +2 -2
  24. package/components/Filters/helpers/tests/getChangedFilters.test.ts +92 -0
  25. package/components/Filters/helpers/tests/getNestedOptions.test.ts +31 -0
  26. package/components/Filters/helpers/tests/getNewRuntime.test.ts +82 -0
  27. package/components/Filters/index.ts +1 -1
  28. package/components/Layout/components/Visualization/index.tsx +3 -3
  29. package/components/Layout/components/Visualization/visualizations.scss +1 -1
  30. package/components/Legend/Legend.Gradient.tsx +66 -23
  31. package/components/MediaControls.jsx +14 -7
  32. package/components/MultiSelect/multiselect.styles.css +2 -0
  33. package/components/NestedDropdown/NestedDropdown.tsx +2 -2
  34. package/components/RichTooltip/RichTooltip.tsx +37 -0
  35. package/components/RichTooltip/richTooltip.css +16 -0
  36. package/components/Table/Table.tsx +142 -142
  37. package/components/Table/components/Row.tsx +1 -1
  38. package/components/Table/table.styles.css +10 -0
  39. package/components/_stories/DataTable.stories.tsx +9 -2
  40. package/components/_stories/Table.stories.tsx +1 -1
  41. package/components/_stories/styles.scss +0 -4
  42. package/components/elements/Button.jsx +4 -2
  43. package/components/ui/Accordion.jsx +8 -1
  44. package/components/ui/Title/index.tsx +4 -1
  45. package/components/ui/Title/{Title.scss → title.styles.css} +0 -2
  46. package/components/ui/_stories/Colors.stories.mdx +220 -0
  47. package/components/ui/_stories/IconGallery.stories.mdx +14 -0
  48. package/components/ui/_stories/Title.stories.tsx +29 -4
  49. package/components/ui/accordion.styles.css +3 -0
  50. package/data/colorPalettes.js +0 -1
  51. package/dist/cove-main.css +101 -159
  52. package/dist/cove-main.css.map +1 -1
  53. package/helpers/DataTransform.ts +2 -2
  54. package/helpers/addValuesToFilters.ts +1 -1
  55. package/helpers/constants.ts +6 -0
  56. package/helpers/cove/accessibility.ts +7 -8
  57. package/helpers/coveUpdateWorker.ts +17 -8
  58. package/helpers/filterOrderOptions.ts +17 -0
  59. package/helpers/formatConfigBeforeSave.ts +30 -8
  60. package/helpers/isNumber.ts +20 -0
  61. package/helpers/isRightAlignedTableValue.js +6 -2
  62. package/helpers/isSolr.ts +13 -0
  63. package/helpers/labelHash.ts +21 -0
  64. package/helpers/pivotData.ts +30 -18
  65. package/helpers/tests/formatConfigBeforeSave.test.ts +68 -0
  66. package/helpers/tests/pivotData.test.ts +96 -18
  67. package/helpers/ver/4.25.3.ts +43 -0
  68. package/helpers/ver/4.25.4.ts +33 -0
  69. package/helpers/ver/tests/4.25.4.test.ts +24 -0
  70. package/helpers/ver/tests/versionNeedsUpdate.test.ts +28 -0
  71. package/helpers/viewports.ts +4 -0
  72. package/package.json +2 -3
  73. package/styles/_global-variables.scss +5 -1
  74. package/styles/_global.scss +18 -9
  75. package/styles/_reset.scss +0 -6
  76. package/styles/base.scss +42 -0
  77. package/styles/filters.scss +5 -11
  78. package/styles/v2/components/button.scss +48 -12
  79. package/styles/v2/main.scss +0 -5
  80. package/styles/v2/themes/_color-definitions.scss +1 -4
  81. package/types/General.ts +1 -1
  82. package/types/Legend.ts +1 -0
  83. package/types/Table.ts +2 -0
  84. package/LICENSE +0 -201
  85. package/components/ui/_stories/Colors.stories.tsx +0 -92
  86. package/components/ui/_stories/Icon.stories.tsx +0 -29
  87. package/helpers/cove/fontSettings.ts +0 -2
  88. package/helpers/isNumber.js +0 -24
  89. package/helpers/isNumberLog.js +0 -18
  90. package/helpers/isSolr.js +0 -13
@@ -1,6 +1,7 @@
1
1
  import { describe, it, expect } from 'vitest'
2
2
 
3
3
  import { pivotData } from '../pivotData'
4
+ import _ from 'lodash'
4
5
 
5
6
  describe('pivotData', () => {
6
7
  const data = [
@@ -10,41 +11,118 @@ describe('pivotData', () => {
10
11
  { name: 'John', age: 31, city: 'San Francisco' }
11
12
  ]
12
13
  it('should pivot data correctly', () => {
13
- const result = pivotData(data, 'name', ['age'])
14
+ const result = pivotData(data, 'name', ['age'], [])
14
15
  expect(result).toEqual([
15
- { city: 'New York', John: 25, Jane: 27 },
16
- { city: 'San Francisco', Jane: 30, John: 31 }
16
+ { city: 'New York', John: 25, Jane: 27, _pivotedFrom: 'age' },
17
+ { city: 'San Francisco', Jane: 30, John: 31, _pivotedFrom: 'age' }
17
18
  ])
18
19
  })
19
20
  it('should fill in columns with no data with empty strings', () => {
20
21
  const data2 = [data[0], data[1]]
21
- const result = pivotData(data2, 'name', ['age'])
22
+ const result = pivotData(data2, 'name', ['age'], [])
22
23
 
23
24
  expect(result).toEqual([
24
- { city: 'New York', John: 25, Jane: '' },
25
- { city: 'San Francisco', Jane: 30, John: '' }
25
+ { city: 'New York', John: 25, Jane: '', _pivotedFrom: 'age' },
26
+ { city: 'San Francisco', Jane: 30, John: '', _pivotedFrom: 'age' }
26
27
  ])
27
28
 
28
29
  const data3 = [data[0], data[1], data[2]]
29
- const result2 = pivotData(data3, 'name', ['age'])
30
+ const result2 = pivotData(data3, 'name', ['age'], [])
30
31
  expect(result2).toEqual([
31
- { city: 'New York', John: 25, Jane: 27 },
32
- { city: 'San Francisco', Jane: 30, John: '' }
32
+ { city: 'New York', John: 25, Jane: 27, _pivotedFrom: 'age' },
33
+ { city: 'San Francisco', Jane: 30, John: '', _pivotedFrom: 'age' }
33
34
  ])
34
35
  })
35
36
  it('should be able to pivot more than one column', () => {
37
+ // when there are multiple pivot value columns, if any other data is present it will break the pivot.
38
+ // so we need to tell it which columns to exclude from the pivot.
39
+ // 'other' is added here as an example.
36
40
  const data = [
37
- { name: 'John', age: 25, color: 'blue', city: 'New York' },
38
- { name: 'Jane', age: 27, color: 'red', city: 'New York' },
39
- { name: 'Jane', age: 30, color: 'yellow', city: 'San Francisco' },
40
- { name: 'John', age: 31, color: 'green', city: 'San Francisco' }
41
+ { name: 'John', age: 25, color: 'blue', city: 'New York', other: 'yes' },
42
+ { name: 'Jane', age: 27, color: 'red', city: 'New York', other: 'no' },
43
+ { name: 'Jane', age: 30, color: 'yellow', city: 'San Francisco', other: 'yes' },
44
+ { name: 'John', age: 31, color: 'green', city: 'San Francisco', other: 'no' }
41
45
  ]
42
- const result = pivotData(data, 'name', ['age', 'color'])
46
+ const result = pivotData(data, 'name', ['age', 'color'], ['other'])
47
+ expect(result.map(row => _.omit(row, 'other'))).toEqual([
48
+ { city: 'New York', John: 25, Jane: 27, _pivotedFrom: 'age' },
49
+ { city: 'New York', John: 'blue', Jane: 'red', _pivotedFrom: 'color' },
50
+ { city: 'San Francisco', Jane: 30, John: 31, _pivotedFrom: 'age' },
51
+ { city: 'San Francisco', Jane: 'yellow', John: 'green', _pivotedFrom: 'color' }
52
+ ])
53
+ })
54
+ it('should allow for duplicate data when there is 1 Column Header but different columnName data', () => {
55
+ // when there are multiple pivot value columns, if any other data is present it will break the pivot.
56
+ // so we need to tell it which columns to exclude from the pivot.
57
+ // 'other' is added here as an example.
58
+ const data = [
59
+ { name: 'John', age: 27, color: 'blue', city: 'New York', other: 'yes' },
60
+ { name: 'Jane', age: 27, color: 'red', city: 'New York', other: 'no' },
61
+ { name: 'Bob', age: 31, color: 'yellow', city: 'New York', other: 'yes' },
62
+ { name: 'Betty', age: 31, color: 'green', city: 'New York', other: 'no' },
63
+ { name: 'Jane', age: 31, color: 'yellow', city: 'New York', other: 'yes' },
64
+ { name: 'John', age: 31, color: 'green', city: 'New York', other: 'no' },
65
+ { name: 'Bob', age: 27, color: 'blue', city: 'New York', other: 'yes' },
66
+ { name: 'Betty', age: 27, color: 'red', city: 'New York', other: 'no' }
67
+ ]
68
+ const result = pivotData(data, 'city', ['name'], [])
43
69
  expect(result).toEqual([
44
- { city: 'New York', John: 25, Jane: 27, pivotColumn: 'age' },
45
- { city: 'New York', John: 'blue', Jane: 'red', pivotColumn: 'color' },
46
- { city: 'San Francisco', Jane: 30, John: 31, pivotColumn: 'age' },
47
- { city: 'San Francisco', Jane: 'yellow', John: 'green', pivotColumn: 'color' }
70
+ {
71
+ 'New York': 'John',
72
+ age: 27,
73
+ color: 'blue',
74
+ other: 'yes',
75
+ _pivotedFrom: 'name'
76
+ },
77
+ {
78
+ 'New York': 'Jane',
79
+ age: 27,
80
+ color: 'red',
81
+ other: 'no',
82
+ _pivotedFrom: 'name'
83
+ },
84
+ {
85
+ 'New York': 'Bob',
86
+ age: 31,
87
+ color: 'yellow',
88
+ other: 'yes',
89
+ _pivotedFrom: 'name'
90
+ },
91
+ {
92
+ 'New York': 'Betty',
93
+ age: 31,
94
+ color: 'green',
95
+ other: 'no',
96
+ _pivotedFrom: 'name'
97
+ },
98
+ {
99
+ 'New York': 'Jane',
100
+ age: 31,
101
+ color: 'yellow',
102
+ other: 'yes',
103
+ _pivotedFrom: 'name'
104
+ },
105
+ {
106
+ 'New York': 'John',
107
+ age: 31,
108
+ color: 'green',
109
+ other: 'no',
110
+ _pivotedFrom: 'name'
111
+ },
112
+ {
113
+ 'New York': 'Bob',
114
+ age: 27,
115
+ color: 'blue',
116
+ other: 'yes',
117
+ _pivotedFrom: 'name'
118
+ },
119
+ {
120
+ 'New York': 'Betty',
121
+ age: 27,
122
+ color: 'red',
123
+ other: 'no',
124
+ _pivotedFrom: 'name'
125
+ }
48
126
  ])
49
127
  })
50
128
  })
@@ -0,0 +1,43 @@
1
+ import _ from 'lodash'
2
+
3
+ const remapTableDownloadCSV = config => {
4
+ if (config.general?.showDownloadButton !== undefined) {
5
+ let download = config.general.showDownloadButton
6
+ if (config.type === 'chart') {
7
+ download = config.table.download || config.general.showDownloadButton
8
+ }
9
+ delete config.general.showDownloadButton
10
+ config.table.download = download
11
+ }
12
+ return config
13
+ }
14
+
15
+ const handleVisualizations = newConfig => {
16
+ if (newConfig.type === 'dashboard') {
17
+ Object.keys(newConfig.visualizations).forEach(key => {
18
+ const currentViz = newConfig.visualizations[key]
19
+ remapTableDownloadCSV(currentViz)
20
+ })
21
+ }
22
+ remapTableDownloadCSV(newConfig)
23
+ }
24
+
25
+ const migrateAreaChart = config => {
26
+ // Migrate regular Area Chart to Stacked
27
+ if (config.visualizationType === 'Area Chart' && config.visualizationSubType === 'regular') {
28
+ config.visualizationSubType = 'stacked'
29
+ }
30
+ return config
31
+ }
32
+
33
+ const update_4_25_3 = config => {
34
+ const ver = '4.25.3'
35
+ const newConfig = _.cloneDeep(config)
36
+ handleVisualizations(newConfig)
37
+ remapTableDownloadCSV(newConfig)
38
+ migrateAreaChart(newConfig)
39
+ newConfig.version = ver
40
+ return newConfig
41
+ }
42
+
43
+ export default update_4_25_3
@@ -0,0 +1,33 @@
1
+ import _ from 'lodash'
2
+
3
+ export const makeChartLegendsUnified = config => {
4
+ if (config.type === 'chart') {
5
+ config.legend = config.legend || {}
6
+ config.legend.unified = true
7
+ } else if (config.type === 'dashboard') {
8
+ Object.values(config.visualizations).forEach(visualization => {
9
+ makeChartLegendsUnified(visualization)
10
+ })
11
+ }
12
+ }
13
+
14
+ const migrateTableGeneralSettings = config => {
15
+ if (config.type === 'map') {
16
+ if (config.general.showFullGeoNameInCSV) {
17
+ config.table.showFullGeoNameInCSV = config.general.showFullGeoNameInCSV
18
+ }
19
+ delete config.general.showFullGeoNameInCSV
20
+ return config
21
+ }
22
+ }
23
+
24
+ const update_4_25_4 = config => {
25
+ const ver = '4.25.4'
26
+ const newConfig = _.cloneDeep(config)
27
+ makeChartLegendsUnified(newConfig)
28
+ migrateTableGeneralSettings(newConfig)
29
+ newConfig.version = ver
30
+ return newConfig
31
+ }
32
+
33
+ export default update_4_25_4
@@ -0,0 +1,24 @@
1
+ import { expect, describe, it } from 'vitest'
2
+ import { makeChartLegendsUnified } from '../4.25.4'
3
+ import { ChartConfig } from '@cdc/chart/src/types/ChartConfig'
4
+ import { DashboardConfig } from '@cdc/dashboard/src/types/DashboardConfig'
5
+
6
+ describe('makeChartLegendsUnified(config) ', () => {
7
+ it('sets chart legends unified to true', () => {
8
+ const mockConfig = { type: 'chart', legend: { unified: false } } as Partial<ChartConfig>
9
+ makeChartLegendsUnified(mockConfig)
10
+ expect(mockConfig.legend?.unified).toBe(true)
11
+ })
12
+ it('sets dashboard nested chart legends unified to true', () => {
13
+ const mockConfig = {
14
+ type: 'dashboard',
15
+ visualizations: {
16
+ '1': { type: 'chart', legend: { unified: false } } as ChartConfig,
17
+ '2': { type: 'chart', legend: { unified: false } } as ChartConfig
18
+ }
19
+ } as Partial<DashboardConfig>
20
+ makeChartLegendsUnified(mockConfig)
21
+ expect(mockConfig.visualizations['1'].legend?.unified).toBe(true)
22
+ expect(mockConfig.visualizations['2'].legend?.unified).toBe(true)
23
+ })
24
+ })
@@ -0,0 +1,28 @@
1
+ import { describe, it, expect } from 'vitest'
2
+ import versionNeedsUpdate from '../versionNeedsUpdate'
3
+
4
+ describe('versionNeedsUpdate', () => {
5
+ it('should return true if previousVersion is empty', () => {
6
+ expect(versionNeedsUpdate('', '1.0.0')).toBe(true)
7
+ })
8
+
9
+ it('should return true if currentVersion has a higher major version', () => {
10
+ expect(versionNeedsUpdate('1.0.0', '2.0.0')).toBe(true)
11
+ })
12
+
13
+ it('should return true if currentVersion has a higher minor version', () => {
14
+ expect(versionNeedsUpdate('1.0.0', '1.1.0')).toBe(true)
15
+ })
16
+
17
+ it('should return true if currentVersion has a higher patch version', () => {
18
+ expect(versionNeedsUpdate('1.0.0', '1.0.1')).toBe(true)
19
+ })
20
+
21
+ it('should return false if currentVersion is the same as previousVersion', () => {
22
+ expect(versionNeedsUpdate('1.0.0', '1.0.0')).toBe(false)
23
+ })
24
+
25
+ it('should return false if currentVersion is an older version', () => {
26
+ expect(versionNeedsUpdate('2.0.0', '1.0.0')).toBe(false)
27
+ })
28
+ })
@@ -8,3 +8,7 @@ export const isBelowBreakpoint = (breakpoint: ViewportSize, currentViewport: Vie
8
8
  export const isLegendWrapViewport = currentViewport => isBelowBreakpoint('sm', currentViewport)
9
9
 
10
10
  export const isMobileHeightViewport = currentViewport => isBelowBreakpoint('sm', currentViewport)
11
+
12
+ export const isMobileStateLabelViewport = currentViewport => isBelowBreakpoint('md', currentViewport)
13
+
14
+ export const isMobileTerritoryViewport = currentViewport => isBelowBreakpoint('sm', currentViewport)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdc/core",
3
- "version": "4.25.3-6",
3
+ "version": "4.25.5-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",
@@ -23,7 +23,6 @@
23
23
  "dependencies": {
24
24
  "html2canvas": "^1.4.1",
25
25
  "json-edit-react": "^1.12.0",
26
- "papaparse": "^5.3.0",
27
26
  "prop-types": "^15.8.1",
28
27
  "react-accessible-accordion": "^5.0.0",
29
28
  "react-select": "^5.3.1",
@@ -34,7 +33,7 @@
34
33
  "react": "^18.2.0",
35
34
  "react-dom": "^18.2.0"
36
35
  },
37
- "gitHead": "d83d8555c1500ff0cad9d2c5c3486324afa15ec6",
36
+ "gitHead": "1d0a6e716bc113e6bea3636fcae90ebf2d19bb5c",
38
37
  "devDependencies": {
39
38
  "sass": "^1.79.4"
40
39
  }
@@ -8,6 +8,7 @@ $colors: (
8
8
  'darkGray': #333,
9
9
  'red': #d8000c,
10
10
  'white': #fff,
11
+ 'silver': #eee,
11
12
 
12
13
  'primary': #005eaa,
13
14
  'secondary': #88c3ea,
@@ -67,7 +68,8 @@ $colors: (
67
68
  'cool-gray-90': #1c1d1f,
68
69
  'cool-gray-50': #71767a,
69
70
  'cool-gray-30': #a9aeb1,
70
- 'cool-gray-10': #dfe1e2
71
+ 'cool-gray-10': #dfe1e2,
72
+ 'colors-blue-vivid-60': #005ea2
71
73
  );
72
74
 
73
75
  @mixin theme() {
@@ -105,4 +107,6 @@ $colors: (
105
107
  --filter-buttons-font-size: 0.889rem;
106
108
  --superTitle-font-size: 0.833rem;
107
109
  --title-font-size: 1.222rem;
110
+ --territory-label-font-size: 0.809rem;
111
+ --territory-label-font-size-mobile: 0.556rem;
108
112
  }
@@ -104,9 +104,6 @@ textarea {
104
104
  outline: 0;
105
105
  }
106
106
  }
107
- textarea {
108
- min-height: 140px;
109
- }
110
107
 
111
108
  .input-group-text {
112
109
  border-top-left-radius: 0;
@@ -182,10 +179,22 @@ section.footnotes {
182
179
  font-family: var(--app-font-secondary);
183
180
  font-weight: 300;
184
181
  font-size: var(--filter-select-font-size);
185
- display: block;
186
- width: 100%;
187
- padding: 0.375rem 0.75rem;
188
- border-radius: 0.25rem;
189
- border: 1px solid var(--cool-gray-10);
190
- color: var(--cool-gray-90);
182
+ line-height: normal;
183
+ padding-right: 3rem;
184
+ border-radius: 0.333rem;
185
+ border: 1px solid var(--colors-gray-cool-10);
186
+ color: var(--colors-primary-text);
187
+ // recreate caret using svg
188
+ 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
+ background-repeat: no-repeat;
190
+ background-position: right 0.5rem center;
191
+ background-size: 1em;
192
+ appearance: none;
193
+ -webkit-appearance: none;
194
+ -moz-appearance: none;
195
+ cursor: pointer;
196
+ &:focus-visible {
197
+ outline: 2px dashed var(--colors-blue-vivid-60, #005ea2) !important;
198
+ outline-offset: 2px;
199
+ }
191
200
  }
@@ -7,12 +7,6 @@
7
7
  font-style: normal;
8
8
  text-rendering: optimizeLegibility;
9
9
 
10
- // match cdc site outline
11
- :focus,
12
- [tabindex]:focus-visible {
13
- outline: 2px solid rgba(255, 102, 1, 0.9) !important;
14
- }
15
-
16
10
  .outline-none {
17
11
  outline: none !important;
18
12
  }
package/styles/base.scss CHANGED
@@ -192,4 +192,46 @@ body.post-type-cdc_visualization .cdc-editor .configure .editor-panel {
192
192
  .ms-auto {
193
193
  margin-left: auto !important;
194
194
  }
195
+ .pe-0 {
196
+ padding-right: 0 !important;
197
+ }
198
+ .pe-1 {
199
+ padding-right: 0.25rem !important;
200
+ }
201
+ .pe-2 {
202
+ padding-right: 0.5rem !important;
203
+ }
204
+ .pe-3 {
205
+ padding-right: 1rem !important;
206
+ }
207
+ .pe-4 {
208
+ padding-right: 1.5rem !important;
209
+ }
210
+ .pe-5 {
211
+ padding-right: 3rem !important;
212
+ }
213
+ .pe-auto {
214
+ padding-right: auto !important;
215
+ }
216
+ .ps-0 {
217
+ padding-left: 0 !important;
218
+ }
219
+ .ps-1 {
220
+ padding-left: 0.25rem !important;
221
+ }
222
+ .ps-2 {
223
+ padding-left: 0.5rem !important;
224
+ }
225
+ .ps-3 {
226
+ padding-left: 1rem !important;
227
+ }
228
+ .ps-4 {
229
+ padding-left: 1.5rem !important;
230
+ }
231
+ .ps-5 {
232
+ padding-left: 3rem !important;
233
+ }
234
+ .ps-auto {
235
+ padding-left: auto !important;
236
+ }
195
237
  }
@@ -2,7 +2,8 @@
2
2
  &__wrapper {
3
3
  flex-wrap: wrap;
4
4
  display: flex;
5
- gap: 18px 27px;
5
+ gap: 1rem 1.5rem;
6
+ margin-bottom: 2rem;
6
7
  label {
7
8
  display: inherit;
8
9
  margin-bottom: 5px;
@@ -19,9 +20,6 @@
19
20
  &__buttons {
20
21
  width: 100%;
21
22
  font-size: var(--filter-buttons-font-size);
22
- .apply {
23
- margin-right: 10px;
24
- }
25
23
  }
26
24
  }
27
25
 
@@ -78,6 +76,7 @@ div.single-filters {
78
76
  .tab.tab--simple {
79
77
  background: none;
80
78
  border: none;
79
+ border-bottom: 0.3rem solid transparent;
81
80
  font-family: var(--app-font-secondary);
82
81
  font-size: 1rem;
83
82
  font-weight: 300;
@@ -86,11 +85,6 @@ div.single-filters {
86
85
  cursor: pointer;
87
86
  border-radius: 6px 6px 0 0;
88
87
 
89
- @include breakpointClass(xs) {
90
- font-size: 0.778em;
91
- padding: 0.5rem 0.778em;
92
- }
93
-
94
88
  &:hover {
95
89
  color: var(--colors-blue-vivid-60, #005ea2);
96
90
  background: var(--colors-cyan-cool-10, #eff9fa);
@@ -106,7 +100,7 @@ div.single-filters {
106
100
 
107
101
  &.tab--active {
108
102
  font-weight: 500;
109
- border-bottom: 0.3rem solid var(--colors-blue-vivid-60, #005ea2);
103
+ border-bottom-color: var(--colors-blue-vivid-60, #005ea2);
110
104
  z-index: 1;
111
105
  }
112
106
  }
@@ -115,7 +109,7 @@ div.single-filters {
115
109
  @include breakpointClass(xs) {
116
110
  .single-filters--tab-simple .tab-simple-container .tab.tab--simple {
117
111
  font-size: 0.778em;
118
- padding: 0.5rem 0.778em;
112
+ padding: 0.5rem 0.73em;
119
113
  }
120
114
  }
121
115
  }
@@ -1,6 +1,23 @@
1
1
  @import '../utils/variables';
2
2
  @import '../themes/index';
3
3
 
4
+ :root {
5
+ --cove-button-primary: var(--colors-blue-vivid-60);
6
+ --cove-button-primary-font-color: #fff;
7
+ --cove-button-primary-hover: #0b4778;
8
+ --cove-button-primary-disabled: var(--cool-gray-10);
9
+ --cove-button-primary-disabled-font-color: var(--cool-gray-90);
10
+
11
+ --cove-button-secondary: #fff;
12
+ --cove-button-secondary-font-color: var(--colors-blue-vivid-60);
13
+ --cove-button-secondary-border-color: var(--colors-blue-vivid-60);
14
+ --cove-button-secondary-hover: #0b4778;
15
+ --cove-button-secondary-hover-font-color: #fff;
16
+ --cove-button-secondary-disabled: #f5f6f7;
17
+ --cove-button-secondary-disabled-font-color: var(--cool-gray-90);
18
+ --cove-button-secondary-disabled-border-color: var(--cool-gray-10);
19
+ }
20
+
4
21
  .sbdocs .cove-button {
5
22
  margin-right: 1rem;
6
23
  margin-bottom: 1rem;
@@ -11,7 +28,7 @@
11
28
  }
12
29
  }
13
30
 
14
- .cove-button {
31
+ .cdc-open-viz-module button.cove-button {
15
32
  display: inline-block;
16
33
  position: relative;
17
34
  min-height: 2.125rem;
@@ -19,12 +36,30 @@
19
36
  text-align: center;
20
37
  text-decoration: none;
21
38
  vertical-align: middle;
22
- color: #fff;
23
- background-color: $primary;
24
- border-radius: 0.1875rem;
39
+ color: var(--cove-button-primary-font-color);
40
+ background-color: var(--cove-button-primary);
41
+ border-radius: 6px;
25
42
  border: 0;
26
43
  outline: none;
27
- transition: all 500ms $transition-expo-out;
44
+ transition: background-color 500ms $transition-expo-out, color 500ms $transition-expo-out,
45
+ border-color 500ms $transition-expo-out;
46
+
47
+ &.secondary {
48
+ background-color: var(--cove-button-secondary);
49
+ color: var(--cove-button-secondary-font-color);
50
+ border: 1px solid var(--cove-button-secondary-border-color);
51
+
52
+ &:hover {
53
+ background-color: var(--cove-button-secondary-hover);
54
+ color: var(--cove-button-secondary-hover-font-color);
55
+ }
56
+
57
+ &:disabled {
58
+ background-color: var(--cove-button-secondary-disabled);
59
+ color: var(--cove-button-secondary-disabled-font-color);
60
+ border: 1px solid var(--cove-button-secondary-disabled-border-color);
61
+ }
62
+ }
28
63
 
29
64
  * {
30
65
  pointer-events: none;
@@ -32,7 +67,8 @@
32
67
  }
33
68
 
34
69
  &:disabled {
35
- background-color: #959595 !important;
70
+ background-color: var(--cove-button-primary-disabled);
71
+ color: var(--cove-button-primary-disabled-font-color);
36
72
  cursor: not-allowed;
37
73
  }
38
74
 
@@ -40,11 +76,12 @@
40
76
  cursor: pointer;
41
77
  }
42
78
 
43
- &:hover,
44
- &:active,
45
- &:focus,
46
- &.active {
47
- background-color: lighten($primary, 5%);
79
+ &:hover:not(:disabled) {
80
+ background-color: var(--cove-button-primary-hover);
81
+ }
82
+ &:focus {
83
+ outline: 2px dashed var(--colors-blue-vivid-60) !important;
84
+ outline-offset: 5px;
48
85
  }
49
86
 
50
87
  &:not(.loading) {
@@ -54,7 +91,6 @@
54
91
  content: '';
55
92
  position: absolute;
56
93
  inset: 0;
57
- outline: 2px solid rgba(161, 161, 161, 0.6);
58
94
  border-radius: 0.3125em;
59
95
  margin: -2px;
60
96
  pointer-events: none;
@@ -6,11 +6,6 @@
6
6
  font-size: 16px;
7
7
  line-height: 1.4;
8
8
 
9
- :focus,
10
- [tabindex]:focus-visible {
11
- outline: 2px solid rgba(255, 102, 1, 0.9);
12
- }
13
-
14
9
  margin: 0;
15
10
  font-family: var(--app-font-main);
16
11
  font-size: 1em;
@@ -148,9 +148,6 @@ $theme: (
148
148
  background-color: string.unquote(nth($theme-colors, 1));
149
149
  color: #fff;
150
150
  }
151
- .filters-section button.cove-button:not([disabled]) {
152
- background-color: string.unquote(nth($theme-colors, 1)) !important;
153
- }
154
151
  }
155
152
 
156
153
  .theme-#{$theme-name} {
@@ -173,7 +170,7 @@ $theme: (
173
170
  outline: 2px solid string.unquote(nth($theme-colors, 1));
174
171
  }
175
172
  .apply:not([disabled]) {
176
- background-color: string.unquote(nth($theme-colors, 1)) !important;
173
+ background-color: string.unquote(nth($theme-colors, 1));
177
174
  }
178
175
  }
179
176
  }
package/types/General.ts CHANGED
@@ -4,7 +4,6 @@ export type General = {
4
4
  boxplot: BoxPlot
5
5
  geoType: string
6
6
  type: string
7
- showDownloadButton: boolean
8
7
  allowMapZoom?: boolean
9
8
  showMissingDataLabel: boolean
10
9
  showSuppressedSymbol: boolean
@@ -12,4 +11,5 @@ export type General = {
12
11
  showAnnotationDropdown?: boolean
13
12
  hideNullValue: boolean
14
13
  title: string
14
+ annotationDropdownText?: string
15
15
  }
package/types/Legend.ts CHANGED
@@ -15,4 +15,5 @@ export type Legend = {
15
15
  singleRow: boolean
16
16
  type: string
17
17
  verticalSorted: boolean
18
+ groupBy: string
18
19
  }
package/types/Table.ts CHANGED
@@ -9,6 +9,7 @@ export type Table = {
9
9
  collapsible?: boolean
10
10
  dateDisplayFormat?: string
11
11
  download?: boolean
12
+ downloadVisibleDataOnly?: boolean
12
13
  downloadImageButton?: boolean
13
14
  downloadPdfButton?: boolean
14
15
  excludeColumns?: string[]
@@ -20,6 +21,7 @@ export type Table = {
20
21
  limitHeight?: boolean
21
22
  pivot?: Pivot
22
23
  show?: boolean
24
+ sharedFilterColumns?: string[] // added at runtime by Dashboard
23
25
  showDataTableLink?: boolean
24
26
  showDownloadImgButton?: boolean
25
27
  showDownloadLinkBelow?: boolean