@cdc/map 4.25.6 → 4.25.7-2

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.
@@ -135,6 +135,7 @@ const Legend = forwardRef<HTMLDivElement, LegendProps>((props, ref) => {
135
135
  }
136
136
  }}
137
137
  tabIndex={0}
138
+ role='button'
138
139
  >
139
140
  <LegendShape shape={config.legend.style === 'boxes' ? 'square' : 'circle'} fill={item.color} />
140
141
  <span>{item.label}</span>
@@ -313,41 +314,41 @@ const Legend = forwardRef<HTMLDivElement, LegendProps>((props, ref) => {
313
314
 
314
315
  {((config.visual.additionalCityStyles && config.visual.additionalCityStyles.some(c => c.label)) ||
315
316
  config.visual.cityStyleLabel) && (
316
- <>
317
- <hr />
318
- <div className={legendClasses.div.join(' ') || ''}>
319
- {config.visual.cityStyleLabel && (
320
- <div>
321
- <svg>
322
- <Group
323
- top={
324
- config.visual.cityStyle === 'pin' ? 19 : config.visual.cityStyle === 'triangle' ? 13 : 11
325
- }
326
- left={10}
327
- >
328
- {cityStyleShapes[config.visual.cityStyle.toLowerCase()]}
329
- </Group>
330
- </svg>
331
- <p>{config.visual.cityStyleLabel}</p>
332
- </div>
333
- )}
334
-
335
- {config.visual.additionalCityStyles.map(
336
- ({ shape, label }) =>
337
- label && (
338
- <div>
339
- <svg>
340
- <Group top={shape === 'Pin' ? 19 : shape === 'Triangle' ? 13 : 11} left={10}>
341
- {cityStyleShapes[shape.toLowerCase()]}
342
- </Group>
343
- </svg>
344
- <p>{label}</p>
345
- </div>
346
- )
347
- )}
348
- </div>
349
- </>
350
- )}
317
+ <>
318
+ <hr />
319
+ <div className={legendClasses.div.join(' ') || ''}>
320
+ {config.visual.cityStyleLabel && (
321
+ <div>
322
+ <svg>
323
+ <Group
324
+ top={
325
+ config.visual.cityStyle === 'pin' ? 19 : config.visual.cityStyle === 'triangle' ? 13 : 11
326
+ }
327
+ left={10}
328
+ >
329
+ {cityStyleShapes[config.visual.cityStyle.toLowerCase()]}
330
+ </Group>
331
+ </svg>
332
+ <p>{config.visual.cityStyleLabel}</p>
333
+ </div>
334
+ )}
335
+
336
+ {config.visual.additionalCityStyles.map(
337
+ ({ shape, label }) =>
338
+ label && (
339
+ <div>
340
+ <svg>
341
+ <Group top={shape === 'Pin' ? 19 : shape === 'Triangle' ? 13 : 11} left={10}>
342
+ {cityStyleShapes[shape.toLowerCase()]}
343
+ </Group>
344
+ </svg>
345
+ <p>{label}</p>
346
+ </div>
347
+ )
348
+ )}
349
+ </div>
350
+ </>
351
+ )}
351
352
  {runtimeLegend.disabledAmt > 0 && (
352
353
  <Button className={legendClasses.showAllButton.join(' ')} onClick={handleReset}>
353
354
  Show All
@@ -462,7 +462,7 @@ export const generateRuntimeLegend = (
462
462
  if (!assigned) {
463
463
  console.warn('Value not assigned to any range:', number, 'assigning to closest range')
464
464
  let closestIndex = 0
465
- let minDistance = Math.abs(number - ((result.items[0].min + result.items[0].max) / 2))
465
+ let minDistance = Math.abs(number - (result.items[0].min + result.items[0].max) / 2)
466
466
 
467
467
  for (let i = 1; i < result.items.length; i++) {
468
468
  const midpoint = (result.items[i].min + result.items[i].max) / 2
@@ -1,8 +1,8 @@
1
1
  @import 'mixins';
2
2
  @import 'editor-panel';
3
+ @import '@cdc/core/styles/accessibility';
3
4
 
4
5
  .type-map--has-error {
5
-
6
6
  .waiting {
7
7
  display: flex;
8
8
  overflow: hidden !important;