@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.
Files changed (73) hide show
  1. package/_stories/StoryRenderingTests.stories.tsx +164 -0
  2. package/components/AdvancedEditor/AdvancedEditor.tsx +3 -1
  3. package/components/CustomColorsEditor/CustomColorsEditor.css +299 -0
  4. package/components/CustomColorsEditor/CustomColorsEditor.tsx +209 -0
  5. package/components/CustomColorsEditor/index.ts +1 -0
  6. package/components/DataTable/DataTableStandAlone.tsx +8 -3
  7. package/components/DataTable/components/DataTableEditorPanel.tsx +12 -2
  8. package/components/DataTable/data-table.css +6 -0
  9. package/components/DataTable/helpers/mapCellMatrix.tsx +14 -3
  10. package/components/DataTable/helpers/standardizeState.js +2 -2
  11. package/components/DataTable/helpers/tests/standardizeState.test.js +54 -0
  12. package/components/EditorPanel/DataTableEditor.tsx +3 -3
  13. package/components/EditorPanel/EditorPanel.styles.css +423 -0
  14. package/components/EditorPanel/FootnotesEditor.tsx +44 -37
  15. package/components/EditorPanel/Inputs.tsx +12 -2
  16. package/components/EditorPanel/VizFilterEditor/NestedDropdownEditor.tsx +35 -62
  17. package/components/EditorPanel/VizFilterEditor/VizFilterEditor.tsx +12 -2
  18. package/components/EditorPanel/components/MarkupVariablesEditor.tsx +61 -22
  19. package/components/Filters/Filters.tsx +26 -5
  20. package/components/Filters/components/Dropdown.tsx +6 -1
  21. package/components/Footnotes/Footnotes.tsx +35 -25
  22. package/components/Footnotes/FootnotesStandAlone.tsx +42 -6
  23. package/components/HeaderThemeSelector/HeaderThemeSelector.css +43 -0
  24. package/components/HeaderThemeSelector/HeaderThemeSelector.stories.tsx +74 -0
  25. package/components/HeaderThemeSelector/HeaderThemeSelector.tsx +61 -0
  26. package/components/HeaderThemeSelector/index.ts +2 -0
  27. package/components/Layout/styles/editor.scss +2 -1
  28. package/components/Loader/Loader.tsx +1 -1
  29. package/components/MediaControls.tsx +21 -18
  30. package/components/PaletteConversionModal.tsx +7 -4
  31. package/components/PaletteSelector/PaletteSelector.css +49 -6
  32. package/components/Table/components/Cell.tsx +23 -2
  33. package/components/Table/components/Row.tsx +5 -3
  34. package/components/_stories/Filters.stories.tsx +20 -1
  35. package/components/_stories/Footnotes.CSV.stories.tsx +247 -0
  36. package/components/_stories/Footnotes.stories.tsx +768 -3
  37. package/components/_stories/Inputs.stories.tsx +2 -2
  38. package/components/_stories/styles.scss +0 -1
  39. package/components/ui/Accordion.jsx +1 -1
  40. package/components/ui/accordion.styles.css +57 -0
  41. package/data/chartColorPalettes.ts +1 -1
  42. package/dist/cove-main.css +49 -3
  43. package/dist/cove-main.css.map +1 -1
  44. package/helpers/addValuesToFilters.ts +5 -0
  45. package/helpers/constants.ts +37 -0
  46. package/helpers/cove/number.ts +33 -12
  47. package/helpers/coveUpdateWorker.ts +3 -1
  48. package/helpers/fetchRemoteData.ts +3 -15
  49. package/helpers/markupProcessor.ts +27 -12
  50. package/helpers/mergeCustomOrderValues.ts +37 -0
  51. package/helpers/parseCsvWithQuotes.ts +65 -0
  52. package/helpers/testing.ts +17 -4
  53. package/helpers/ver/4.25.11.ts +13 -0
  54. package/helpers/viewports.ts +2 -0
  55. package/package.json +4 -3
  56. package/styles/_common-components.css +73 -0
  57. package/styles/_global.scss +25 -5
  58. package/styles/base.scss +0 -50
  59. package/styles/cove-main.scss +3 -1
  60. package/styles/filters.scss +10 -3
  61. package/styles/v2/base/index.scss +0 -1
  62. package/styles/v2/components/editor.scss +14 -6
  63. package/styles/v2/utils/_breakpoints.scss +1 -1
  64. package/styles/v2/utils/index.scss +0 -1
  65. package/styles/waiting.scss +1 -1
  66. package/types/MarkupInclude.ts +4 -3
  67. package/types/MarkupVariable.ts +1 -1
  68. package/types/VizFilter.ts +1 -0
  69. package/styles/_mixins.scss +0 -13
  70. package/styles/_typography.scss +0 -0
  71. package/styles/v2/base/_typography.scss +0 -0
  72. package/styles/v2/components/guidance-block.scss +0 -74
  73. package/styles/v2/utils/_functions.scss +0 -0
@@ -0,0 +1,247 @@
1
+ import { Meta, StoryObj } from '@storybook/react-vite'
2
+ import FootnotesStandAlone from '../Footnotes/FootnotesStandAlone'
3
+ import FootnotesConfig from '../../types/Footnotes'
4
+
5
+ const meta: Meta<typeof FootnotesStandAlone> = {
6
+ title: 'Components/Organisms/Footnotes/CSV Features',
7
+ component: FootnotesStandAlone,
8
+ parameters: {
9
+ docs: {
10
+ description: {
11
+ component: 'Demonstrates CSV parsing fixes: newlines and commas in quoted fields are preserved, and HTML tags render correctly.'
12
+ }
13
+ }
14
+ }
15
+ }
16
+
17
+ export default meta
18
+
19
+ type Story = StoryObj<typeof FootnotesStandAlone>
20
+
21
+ const csvDataWithNewlines = [
22
+ {
23
+ symbol: '*',
24
+ text: 'This footnote has a newline\nbetween these two lines',
25
+ order: 1
26
+ },
27
+ {
28
+ symbol: '†',
29
+ text: 'This footnote has multiple\nnewlines\ncreating three lines',
30
+ order: 2
31
+ },
32
+ {
33
+ symbol: '**',
34
+ text: 'This footnote has a newline\nand continues on the next line',
35
+ order: 3
36
+ }
37
+ ]
38
+
39
+ const csvDataWithCommas = [
40
+ {
41
+ symbol: '*',
42
+ text: 'This footnote contains commas, which should be preserved, in the text',
43
+ order: 1
44
+ },
45
+ {
46
+ symbol: '†',
47
+ text: 'Price: $1,234.56, which includes, all commas',
48
+ order: 2
49
+ },
50
+ {
51
+ symbol: '**',
52
+ text: 'Multiple, commas, in, one, sentence',
53
+ order: 3
54
+ }
55
+ ]
56
+
57
+ const csvDataWithBoth = [
58
+ {
59
+ symbol: '*',
60
+ text: 'Line 1, with comma\nLine 2, also with comma',
61
+ order: 1
62
+ },
63
+ {
64
+ symbol: '†',
65
+ text: 'First line, comma here\nSecond line, another comma\nThird line, final comma',
66
+ order: 2
67
+ },
68
+ {
69
+ symbol: '**',
70
+ text: 'Start, comma\nMiddle, comma\nEnd, comma',
71
+ order: 3
72
+ }
73
+ ]
74
+
75
+ const csvDataWithHTML = [
76
+ {
77
+ symbol: '*',
78
+ text: 'This footnote has a <br> tag for line break',
79
+ order: 1
80
+ },
81
+ {
82
+ symbol: '†',
83
+ text: 'This has <strong>bold text</strong> and <em>italic text</em>',
84
+ order: 2
85
+ },
86
+ {
87
+ symbol: '**',
88
+ text: 'Multiple tags: <strong>bold</strong>, <em>italic</em>, and <br>line break',
89
+ order: 3
90
+ }
91
+ ]
92
+
93
+ const csvDataWithNewlinesAndHTML = [
94
+ {
95
+ symbol: '*',
96
+ text: 'Line 1, with comma\nLine 2 with <strong>bold</strong> text',
97
+ order: 1
98
+ },
99
+ {
100
+ symbol: '†',
101
+ text: 'First line\nSecond line with <em>italic</em>\nThird line with <br>HTML tag',
102
+ order: 2
103
+ },
104
+ {
105
+ symbol: '**',
106
+ text: 'Start, comma\nMiddle with <strong>bold, comma</strong>\nEnd',
107
+ order: 3
108
+ }
109
+ ]
110
+
111
+ const csvDataComplex = [
112
+ {
113
+ symbol: '*',
114
+ text: 'Complex footnote:\n- Line 1, with comma\n- Line 2 with <strong>bold</strong>\n- Line 3, final',
115
+ order: 1
116
+ },
117
+ {
118
+ symbol: '†',
119
+ text: 'This demonstrates:\n1. Newlines (\\n) from CSV\n2. Commas, preserved\n3. HTML tags like <br> work\n4. All together, in one footnote',
120
+ order: 2
121
+ }
122
+ ]
123
+
124
+ export const WithNewlines: Story = {
125
+ args: {
126
+ config: {
127
+ dataKey: 'footnote-data-newlines',
128
+ data: csvDataWithNewlines,
129
+ dynamicFootnotes: {
130
+ symbolColumn: 'symbol',
131
+ textColumn: 'text',
132
+ orderColumn: 'order'
133
+ }
134
+ }
135
+ }
136
+ }
137
+
138
+ export const WithCommas: Story = {
139
+ args: {
140
+ config: {
141
+ dataKey: 'footnote-data-commas',
142
+ data: csvDataWithCommas,
143
+ dynamicFootnotes: {
144
+ symbolColumn: 'symbol',
145
+ textColumn: 'text',
146
+ orderColumn: 'order'
147
+ }
148
+ }
149
+ }
150
+ }
151
+
152
+ export const WithNewlinesAndCommas: Story = {
153
+ args: {
154
+ config: {
155
+ dataKey: 'footnote-data-both',
156
+ data: csvDataWithBoth,
157
+ dynamicFootnotes: {
158
+ symbolColumn: 'symbol',
159
+ textColumn: 'text',
160
+ orderColumn: 'order'
161
+ }
162
+ }
163
+ }
164
+ }
165
+
166
+ export const WithHTMLTags: Story = {
167
+ args: {
168
+ config: {
169
+ dataKey: 'footnote-data-html',
170
+ data: csvDataWithHTML,
171
+ dynamicFootnotes: {
172
+ symbolColumn: 'symbol',
173
+ textColumn: 'text',
174
+ orderColumn: 'order'
175
+ }
176
+ }
177
+ }
178
+ }
179
+
180
+ export const WithNewlinesCommasAndHTML: Story = {
181
+ args: {
182
+ config: {
183
+ dataKey: 'footnote-data-complex',
184
+ data: csvDataWithNewlinesAndHTML,
185
+ dynamicFootnotes: {
186
+ symbolColumn: 'symbol',
187
+ textColumn: 'text',
188
+ orderColumn: 'order'
189
+ }
190
+ }
191
+ }
192
+ }
193
+
194
+ export const ComplexExample: Story = {
195
+ args: {
196
+ config: {
197
+ dataKey: 'footnote-data-complex-example',
198
+ data: csvDataComplex,
199
+ dynamicFootnotes: {
200
+ symbolColumn: 'symbol',
201
+ textColumn: 'text',
202
+ orderColumn: 'order'
203
+ }
204
+ }
205
+ }
206
+ }
207
+
208
+ export const StaticFootnotesWithHTML: Story = {
209
+ args: {
210
+ config: {
211
+ staticFootnotes: [
212
+ {
213
+ symbol: '*',
214
+ text: 'Static footnote with newline\nand HTML <strong>bold</strong> text'
215
+ },
216
+ {
217
+ symbol: '†',
218
+ text: 'Another static footnote with <em>italic</em> and <br>line break'
219
+ },
220
+ {
221
+ text: 'Static footnote without symbol, with comma, and newline\nSecond line'
222
+ }
223
+ ]
224
+ }
225
+ }
226
+ }
227
+
228
+ export const MixedDynamicAndStatic: Story = {
229
+ args: {
230
+ config: {
231
+ dataKey: 'footnote-data-mixed',
232
+ data: csvDataWithNewlines.slice(0, 2),
233
+ dynamicFootnotes: {
234
+ symbolColumn: 'symbol',
235
+ textColumn: 'text',
236
+ orderColumn: 'order'
237
+ },
238
+ staticFootnotes: [
239
+ {
240
+ symbol: '**',
241
+ text: 'Static footnote with <strong>HTML</strong> and newline\nSecond line'
242
+ }
243
+ ]
244
+ }
245
+ }
246
+ }
247
+