@cdc/core 4.22.10 → 4.23.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 (75) hide show
  1. package/README.md +1 -1
  2. package/components/AdvancedEditor.js +52 -67
  3. package/components/ErrorBoundary.jsx +10 -11
  4. package/components/GlobalContext.jsx +2 -6
  5. package/components/LegendCircle.jsx +3 -4
  6. package/components/Loading.jsx +14 -12
  7. package/components/Waiting.jsx +14 -5
  8. package/components/elements/Button.jsx +34 -45
  9. package/components/elements/Card.jsx +1 -1
  10. package/components/inputs/InputCheckbox.jsx +32 -35
  11. package/components/inputs/InputGroup.jsx +38 -17
  12. package/components/inputs/InputSelect.jsx +27 -23
  13. package/components/inputs/InputText.jsx +9 -25
  14. package/components/inputs/InputToggle.jsx +29 -33
  15. package/components/managers/DataDesigner.jsx +87 -64
  16. package/components/ui/Accordion.jsx +18 -30
  17. package/components/ui/Icon.jsx +34 -35
  18. package/components/ui/LoadSpin.jsx +6 -11
  19. package/components/ui/Modal.jsx +40 -44
  20. package/components/ui/Overlay.jsx +12 -23
  21. package/components/ui/OverlayFrame.jsx +1 -5
  22. package/components/ui/Tooltip.jsx +8 -28
  23. package/data/colorPalettes.js +29 -266
  24. package/data/dataDesignerTables.js +107 -107
  25. package/data/themes.js +13 -13
  26. package/helpers/CoveMediaControls.js +139 -0
  27. package/helpers/DataTransform.js +92 -92
  28. package/helpers/cacheBustingString.js +3 -3
  29. package/helpers/events.js +5 -6
  30. package/helpers/fetchRemoteData.js +33 -33
  31. package/helpers/getViewport.js +15 -15
  32. package/helpers/numberFromString.js +7 -7
  33. package/helpers/updatePaletteNames.js +15 -17
  34. package/helpers/useDataVizClasses.js +38 -35
  35. package/helpers/validateFipsCodeLength.js +41 -56
  36. package/package.json +4 -2
  37. package/styles/_button-section.scss +35 -0
  38. package/styles/_data-table.scss +39 -27
  39. package/styles/_global.scss +29 -24
  40. package/styles/_mixins.scss +12 -12
  41. package/styles/_reset.scss +85 -16
  42. package/styles/_variables.scss +5 -5
  43. package/styles/base.scss +100 -48
  44. package/styles/heading-colors.scss +6 -2
  45. package/styles/loading.scss +62 -60
  46. package/styles/v2/base/_file-selector.scss +2 -2
  47. package/styles/v2/base/_general.scss +1 -1
  48. package/styles/v2/base/_reset.scss +2 -2
  49. package/styles/v2/base/index.scss +4 -4
  50. package/styles/v2/components/accordion.scss +13 -13
  51. package/styles/v2/components/button.scss +3 -3
  52. package/styles/v2/components/card.scss +1 -1
  53. package/styles/v2/components/data-designer.scss +7 -6
  54. package/styles/v2/components/editor.scss +52 -51
  55. package/styles/v2/components/guidance-block.scss +6 -6
  56. package/styles/v2/components/input/_input-check-radio.scss +7 -7
  57. package/styles/v2/components/input/_input-group.scss +2 -2
  58. package/styles/v2/components/input/_input-slider.scss +2 -3
  59. package/styles/v2/components/input/index.scss +6 -6
  60. package/styles/v2/components/loadspin.scss +1 -1
  61. package/styles/v2/components/modal.scss +2 -2
  62. package/styles/v2/components/overlay.scss +4 -4
  63. package/styles/v2/layout/_alert.scss +8 -8
  64. package/styles/v2/layout/_component.scss +1 -1
  65. package/styles/v2/layout/_data-table.scss +12 -11
  66. package/styles/v2/layout/_progression.scss +8 -6
  67. package/styles/v2/layout/index.scss +5 -5
  68. package/styles/v2/main.scss +7 -7
  69. package/styles/v2/themes/_color-definitions.scss +77 -24
  70. package/styles/v2/themes/index.scss +1 -1
  71. package/styles/v2/utils/_animations.scss +2 -2
  72. package/styles/v2/utils/_breakpoints.scss +53 -12
  73. package/styles/v2/utils/_variables.scss +5 -5
  74. package/styles/v2/utils/index.scss +8 -8
  75. package/styles/waiting.scss +22 -23
@@ -3,38 +3,23 @@ import { useDebounce } from 'use-debounce'
3
3
 
4
4
  import '../../styles/v2/components/input/index.scss'
5
5
 
6
- const InputText = memo((
7
- {
8
- label,
9
- section = null,
10
- subsection = null,
11
- fieldName,
12
- updateField,
13
- value: stateValue,
14
- type = 'input',
15
- tooltip,
16
- placeholder,
17
- i = null, min = null, max = null,
18
- className, ...attributes
19
- }
20
- ) => {
21
-
22
- const [ value, setValue ] = useState(stateValue)
23
- const [ debouncedValue ] = useDebounce(value, 500)
6
+ const InputText = memo(({ label, section = null, subsection = null, fieldName, updateField, value: stateValue, type = 'input', tooltip, placeholder, i = null, min = null, max = null, className, ...attributes }) => {
7
+ const [value, setValue] = useState(stateValue)
8
+ const [debouncedValue] = useDebounce(value, 500)
24
9
 
25
10
  useEffect(() => {
26
11
  if ('string' === typeof debouncedValue && stateValue !== debouncedValue && updateField) {
27
12
  updateField(section, subsection, fieldName, debouncedValue, i)
28
13
  }
29
- }, [ debouncedValue, section, subsection, fieldName, i, stateValue, updateField ])
14
+ }, [debouncedValue, section, subsection, fieldName, i, stateValue, updateField])
30
15
 
31
16
  let name = subsection ? `${section}-${subsection}-${fieldName}` : `${section}-${subsection}-${fieldName}`
32
17
 
33
- const onChange = (e) => {
18
+ const onChange = e => {
34
19
  if ('number' !== type || min === null) {
35
20
  setValue(e.target.value)
36
21
  } else {
37
- if (!e.target.value || (parseFloat(min) <= parseFloat(e.target.value) & parseFloat(max) >= parseFloat(e.target.value))) {
22
+ if (!e.target.value || (parseFloat(min) <= parseFloat(e.target.value)) & (parseFloat(max) >= parseFloat(e.target.value))) {
38
23
  setValue(e.target.value)
39
24
  } else {
40
25
  setValue(min.toString())
@@ -52,13 +37,12 @@ const InputText = memo((
52
37
  ...attributes
53
38
  }
54
39
 
55
- let formElement = 'textarea' === type
56
- ? (<textarea {...inputAttrs}/>)
57
- : (<input {...inputAttrs}/>)
40
+ let formElement = 'textarea' === type ? <textarea {...inputAttrs} /> : <input {...inputAttrs} />
58
41
 
59
42
  return (
60
43
  <>
61
- {label && <label className="cove-input__label">{label}</label>}{tooltip}
44
+ {label && <label className='cove-input__label'>{label}</label>}
45
+ {tooltip}
62
46
  {formElement}
63
47
  </>
64
48
  )
@@ -3,41 +3,37 @@ import PropTypes from 'prop-types'
3
3
 
4
4
  import '../../styles/v2/components/input/index.scss'
5
5
 
6
- const InputSlider = (
7
- {
8
- label,
9
- sliderType = 'flat',
10
- size = 'medium',
11
- activeColor = null,
12
- section = null,
13
- subsection = null,
14
- fieldName,
15
- updateField,
16
- value: stateValue,
6
+ const InputSlider = ({
7
+ label,
8
+ sliderType = 'flat',
9
+ size = 'medium',
10
+ activeColor = null,
11
+ section = null,
12
+ subsection = null,
13
+ fieldName,
14
+ updateField,
15
+ value: stateValue,
17
16
 
18
- i = null, min = null, max = null,
19
- ...attributes
20
- }
21
- ) => {
22
-
23
- const [ value, setValue ] = useState(stateValue)
17
+ i = null,
18
+ min = null,
19
+ max = null,
20
+ ...attributes
21
+ }) => {
22
+ const [value, setValue] = useState(stateValue)
24
23
 
25
24
  let name = () => {
26
25
  let str = ''
27
- if (section)
28
- str += section + '-'
29
- if (subsection)
30
- str += subsection + '-'
31
- if (fieldName)
32
- str += fieldName
26
+ if (section) str += section + '-'
27
+ if (subsection) str += subsection + '-'
28
+ if (fieldName) str += fieldName
33
29
  return str
34
30
  }
35
31
 
36
32
  const sliderTypeClass = () => {
37
33
  const typeArr = {
38
- 'flat': ' slider--flat',
39
- 'block': ' slider--block',
40
- 'pill': ' slider--pill',
34
+ flat: ' slider--flat',
35
+ block: ' slider--block',
36
+ pill: ' slider--pill',
41
37
  '3d': ' slider--3d'
42
38
  }
43
39
  return typeArr[sliderType] || ''
@@ -47,21 +43,21 @@ const InputSlider = (
47
43
  if (stateValue !== undefined && stateValue !== value) {
48
44
  setValue(stateValue)
49
45
  }
50
- }, [ stateValue ])
46
+ }, [stateValue])
51
47
 
52
48
  useEffect(() => {
53
49
  if (stateValue !== undefined && stateValue !== value && updateField) {
54
50
  updateField(section, subsection, fieldName, value, i)
55
51
  }
56
- }, [ value ])
52
+ }, [value])
57
53
 
58
54
  return (
59
- <div className="input-group">
55
+ <div className='input-group'>
60
56
  {label && <label>{label}</label>}
61
- <div className={'cove-input__slider' + (size === 'small' ? '--small' : size === 'large' ? '--large' : '') + (sliderTypeClass()) + (value ? ' active' : '')} onClick={() => setValue(!value)}>
62
- <div className="cove-input__slider-button"/>
63
- <div className="cove-input__slider-track" style={value && activeColor ? { backgroundColor: activeColor } : null }/>
64
- <input className="cove-input--hidden" type="checkbox" name={name()} checked={value || false} readOnly/>
57
+ <div className={'cove-input__slider' + (size === 'small' ? '--small' : size === 'large' ? '--large' : '') + sliderTypeClass() + (value ? ' active' : '')} onClick={() => setValue(!value)}>
58
+ <div className='cove-input__slider-button' />
59
+ <div className='cove-input__slider-track' style={value && activeColor ? { backgroundColor: activeColor } : null} />
60
+ <input className='cove-input--hidden' type='checkbox' name={name()} checked={value || false} readOnly />
65
61
  </div>
66
62
  </div>
67
63
  )
@@ -6,39 +6,42 @@ import Card from '../elements/Card'
6
6
  import { DATA_TABLE_VERTICAL, DATA_TABLE_HORIZONTAL, DATA_TABLE_SINGLE_ROW, DATA_TABLE_MULTI_ROW } from '../../data/dataDesignerTables'
7
7
  import '../../styles/v2/components/data-designer.scss'
8
8
 
9
- const DataDesigner = (props) => {
10
- const { configureData, updateDescriptionProp, visualizationKey, dataKey } = props;
9
+ const DataDesigner = props => {
10
+ const { configureData, updateDescriptionProp, visualizationKey, dataKey } = props
11
11
 
12
12
  return (
13
- <div className="cove-data-designer__container">
14
- <div className="mb-2">
15
- <div className="cove-heading--3 fw-bold mb-1">Describe Data</div>
16
- <div className="cove-heading--3 fw-normal mb-1">Data Orientation</div>
17
- <div className="grid grid-gap-2 mb-4">
18
- <div className="column">
13
+ <div className='cove-data-designer__container'>
14
+ <div className='mb-2'>
15
+ <div className='cove-heading--3 fw-bold mb-1'>Describe Data</div>
16
+ <div className='cove-heading--3 fw-normal mb-1'>Data Orientation</div>
17
+ <div className='grid grid-gap-2 mb-4'>
18
+ <div className='column'>
19
19
  <button
20
20
  className={'cove-data-designer__button' + (configureData.dataDescription && configureData.dataDescription.horizontal === false ? ' active' : '')}
21
21
  onClick={() => {
22
22
  updateDescriptionProp(visualizationKey, dataKey, 'horizontal', false)
23
- }}>
23
+ }}
24
+ >
24
25
  <Card>
25
- <strong className="cove-heading--3">Vertical</strong>
26
- <p className="mb-1">Values for map geography or chart date/category axis are contained in a
27
- single <em>column</em>.
26
+ <strong className='cove-heading--3'>Vertical</strong>
27
+ <p className='mb-1'>
28
+ Values for map geography or chart date/category axis are contained in a single <em>column</em>.
28
29
  </p>
29
30
  {DATA_TABLE_VERTICAL}
30
31
  </Card>
31
32
  </button>
32
33
  </div>
33
- <div className="column">
34
+ <div className='column'>
34
35
  <button
35
36
  className={'cove-data-designer__button' + (configureData.dataDescription && configureData.dataDescription.horizontal === true ? ' active' : '')}
36
37
  onClick={() => {
37
38
  updateDescriptionProp(visualizationKey, dataKey, 'horizontal', true)
38
- }}>
39
+ }}
40
+ >
39
41
  <Card>
40
- <strong className="cove-heading--3">Horizontal</strong>
41
- <p className="mb-1">Values for map geography or chart date/category axis are contained in a single <em>row</em>
42
+ <strong className='cove-heading--3'>Horizontal</strong>
43
+ <p className='mb-1'>
44
+ Values for map geography or chart date/category axis are contained in a single <em>row</em>
42
45
  </p>
43
46
  {DATA_TABLE_HORIZONTAL}
44
47
  </Card>
@@ -48,13 +51,13 @@ const DataDesigner = (props) => {
48
51
  </div>
49
52
  {configureData.dataDescription && (
50
53
  <>
51
- <div className="mb-2">
52
- <div className="mb-1">Are there multiple series represented in your data?</div>
54
+ <div className='mb-2'>
55
+ <div className='mb-1'>Are there multiple series represented in your data?</div>
53
56
  <div>
54
57
  <Button
55
58
  style={{ backgroundColor: '#00345d' }}
56
59
  hoverStyle={{ backgroundColor: '#015daa' }}
57
- className="mr-1"
60
+ className='mr-1'
58
61
  onClick={() => {
59
62
  updateDescriptionProp(visualizationKey, dataKey, 'series', true)
60
63
  }}
@@ -75,45 +78,52 @@ const DataDesigner = (props) => {
75
78
  </div>
76
79
  </div>
77
80
  {configureData.dataDescription.horizontal === true && configureData.dataDescription.series === true && (
78
- <div className="mb-2">
79
- <div className="mb-1">Which property in the dataset represents which series the row is describing?</div>
80
- <select onChange={(e) => {
81
- updateDescriptionProp(visualizationKey, dataKey, 'seriesKey', e.target.value)
82
- }} defaultValue={configureData.dataDescription.seriesKey}>
83
- <option value="">Choose an option</option>
84
- {Object.keys(configureData.data[0]).map((value, index) => <option value={value} key={index}>{value}</option>)}
81
+ <div className='mb-2'>
82
+ <div className='mb-1'>Which property in the dataset represents which series the row is describing?</div>
83
+ <select
84
+ onChange={e => {
85
+ updateDescriptionProp(visualizationKey, dataKey, 'seriesKey', e.target.value)
86
+ }}
87
+ defaultValue={configureData.dataDescription.seriesKey}
88
+ >
89
+ <option value=''>Choose an option</option>
90
+ {Object.keys(configureData.data[0]).map((value, index) => (
91
+ <option value={value} key={index}>
92
+ {value}
93
+ </option>
94
+ ))}
85
95
  </select>
86
96
  </div>
87
97
  )}
88
98
  {configureData.dataDescription.horizontal === false && configureData.dataDescription.series === true && (
89
99
  <>
90
- <div className="mb-2">
91
- <div className="mb-1">Are the series values in your data represented in a
92
- single row, or across multiple rows?
93
- </div>
94
- <div className="grid grid-gap-2 mb-4">
95
- <div className="column">
100
+ <div className='mb-2'>
101
+ <div className='mb-1'>Are the series values in your data represented in a single row, or across multiple rows?</div>
102
+ <div className='grid grid-gap-2 mb-4'>
103
+ <div className='column'>
96
104
  <button
97
105
  className={'cove-data-designer__button' + (configureData.dataDescription.singleRow === true ? ' active' : '')}
98
106
  onClick={() => {
99
- updateDescriptionProp(visualizationKey, dataKey, 'singleRow', true)
100
- }}>
107
+ updateDescriptionProp(visualizationKey, dataKey, 'singleRow', true)
108
+ }}
109
+ >
101
110
  <Card>
102
- <strong className="cove-heading--3">Single Row</strong>
103
- <p className="mb-1">Each row contains the data for an individual series in itself.</p>
111
+ <strong className='cove-heading--3'>Single Row</strong>
112
+ <p className='mb-1'>Each row contains the data for an individual series in itself.</p>
104
113
  {DATA_TABLE_SINGLE_ROW}
105
114
  </Card>
106
115
  </button>
107
116
  </div>
108
- <div className="column">
117
+ <div className='column'>
109
118
  <button
110
119
  className={'cove-data-designer__button' + (configureData.dataDescription.singleRow === false ? ' active' : '')}
111
120
  onClick={() => {
112
121
  updateDescriptionProp(visualizationKey, dataKey, 'singleRow', false)
113
- }}>
122
+ }}
123
+ >
114
124
  <Card>
115
- <strong className="cove-heading--3">Multiple Rows</strong>
116
- <p className="mb-1">Each series data is broken out into multiple rows.</p>
125
+ <strong className='cove-heading--3'>Multiple Rows</strong>
126
+ <p className='mb-1'>Each series data is broken out into multiple rows.</p>
117
127
  {DATA_TABLE_MULTI_ROW}
118
128
  </Card>
119
129
  </button>
@@ -122,36 +132,51 @@ const DataDesigner = (props) => {
122
132
  </div>
123
133
  {configureData.dataDescription.singleRow === false && (
124
134
  <>
125
- <div className="mb-2">
126
- <div className="mb-1">Which property in the dataset represents which series the row is describing?</div>
127
- <select onChange={(e) => {
128
- updateDescriptionProp(visualizationKey, dataKey, 'seriesKey', e.target.value)
129
- }} defaultValue={configureData.dataDescription.seriesKey}>
130
- <option value="">Choose an option</option>
135
+ <div className='mb-2'>
136
+ <div className='mb-1'>Which property in the dataset represents which series the row is describing?</div>
137
+ <select
138
+ onChange={e => {
139
+ updateDescriptionProp(visualizationKey, dataKey, 'seriesKey', e.target.value)
140
+ }}
141
+ defaultValue={configureData.dataDescription.seriesKey}
142
+ >
143
+ <option value=''>Choose an option</option>
131
144
  {Object.keys(configureData.data[0]).map((value, index) => (
132
- <option value={value} key={index}>{value}</option>
145
+ <option value={value} key={index}>
146
+ {value}
147
+ </option>
133
148
  ))}
134
149
  </select>
135
150
  </div>
136
- <div className="mb-2">
137
- <div className="mb-1">Which property in the dataset represents the values for the category/date axis or map geography?</div>
138
- <select onChange={(e) => {
139
- updateDescriptionProp(visualizationKey, dataKey, 'xKey', e.target.value)
140
- }} defaultValue={configureData.dataDescription.xKey}>
141
- <option value="">Choose an option</option>
151
+ <div className='mb-2'>
152
+ <div className='mb-1'>Which property in the dataset represents the values for the category/date axis or map geography?</div>
153
+ <select
154
+ onChange={e => {
155
+ updateDescriptionProp(visualizationKey, dataKey, 'xKey', e.target.value)
156
+ }}
157
+ defaultValue={configureData.dataDescription.xKey}
158
+ >
159
+ <option value=''>Choose an option</option>
142
160
  {Object.keys(configureData.data[0]).map((value, index) => (
143
- <option value={value} key={index}>{value}</option>
161
+ <option value={value} key={index}>
162
+ {value}
163
+ </option>
144
164
  ))}
145
165
  </select>
146
166
  </div>
147
- <div className="mb-2">
148
- <div className="mb-1">Which property in the dataset represents the numeric value?</div>
149
- <select onChange={(e) => {
150
- updateDescriptionProp(visualizationKey, dataKey, 'valueKey', e.target.value)
151
- }} defaultValue={configureData.dataDescription.valueKey}>
152
- <option value="">Choose an option</option>
167
+ <div className='mb-2'>
168
+ <div className='mb-1'>Which property in the dataset represents the numeric value?</div>
169
+ <select
170
+ onChange={e => {
171
+ updateDescriptionProp(visualizationKey, dataKey, 'valueKey', e.target.value)
172
+ }}
173
+ defaultValue={configureData.dataDescription.valueKey}
174
+ >
175
+ <option value=''>Choose an option</option>
153
176
  {Object.keys(configureData.data[0]).map((value, index) => (
154
- <option value={value} key={index}>{value}</option>
177
+ <option value={value} key={index}>
178
+ {value}
179
+ </option>
155
180
  ))}
156
181
  </select>
157
182
  </div>
@@ -161,9 +186,7 @@ const DataDesigner = (props) => {
161
186
  )}
162
187
  </>
163
188
  )}
164
- {configureData.dataDescription && configureData.formattedData && (
165
- <div>Data configured successfully</div>
166
- )}
189
+ {configureData.dataDescription && configureData.formattedData && <div>Data configured successfully</div>}
167
190
  </div>
168
191
  )
169
192
  }
@@ -1,11 +1,5 @@
1
1
  import React, { Children } from 'react'
2
- import {
3
- Accordion as AccordionComponent,
4
- AccordionItem,
5
- AccordionItemHeading,
6
- AccordionItemPanel,
7
- AccordionItemButton,
8
- } from 'react-accessible-accordion'
2
+ import { Accordion as AccordionComponent, AccordionItem, AccordionItemHeading, AccordionItemPanel, AccordionItemButton } from 'react-accessible-accordion'
9
3
  import PropTypes from 'prop-types'
10
4
 
11
5
  import Icon from './Icon'
@@ -16,37 +10,31 @@ import '../../styles/v2/components/accordion.scss'
16
10
  //Define the "slots" to be populated by subcomponents
17
11
  const AccordionSection = () => null
18
12
 
19
- const Accordion = ({children}) => {
13
+ const Accordion = ({ children }) => {
20
14
  const childNodes = Children.toArray(children)
21
15
  const accordionSections = childNodes.filter(child => child?.type === AccordionSection)
22
16
 
23
17
  return (
24
18
  <AccordionComponent allowZeroExpanded={true}>
25
- {accordionSections && accordionSections.map((section, index) => (
26
- <AccordionItem className="cove-accordion__item" key={index}>
27
- <AccordionItemHeading className="cove-accordion__heading">
28
- <AccordionItemButton className="cove-accordion__button">
29
- {section.props.title}
30
- {section.props.tooltipText
31
- ? (
32
- <Tooltip position="bottom">
19
+ {accordionSections &&
20
+ accordionSections.map((section, index) => (
21
+ <AccordionItem className='cove-accordion__item' key={index}>
22
+ <AccordionItemHeading className='cove-accordion__heading'>
23
+ <AccordionItemButton className='cove-accordion__button'>
24
+ {section.props.title}
25
+ {section.props.tooltipText ? (
26
+ <Tooltip position='bottom'>
33
27
  <Tooltip.Target>
34
- <Icon display="question" size={14}/>
28
+ <Icon display='question' size={14} />
35
29
  </Tooltip.Target>
36
- <Tooltip.Content>
37
- {section.props.tooltipText}
38
- </Tooltip.Content>
30
+ <Tooltip.Content>{section.props.tooltipText}</Tooltip.Content>
39
31
  </Tooltip>
40
- )
41
- : null
42
- }
43
- </AccordionItemButton>
44
- </AccordionItemHeading>
45
- <AccordionItemPanel className="cove-accordion__panel">
46
- {section.props.children}
47
- </AccordionItemPanel>
48
- </AccordionItem>
49
- ))}
32
+ ) : null}
33
+ </AccordionItemButton>
34
+ </AccordionItemHeading>
35
+ <AccordionItemPanel className='cove-accordion__panel'>{section.props.children}</AccordionItemPanel>
36
+ </AccordionItem>
37
+ ))}
50
38
  </AccordionComponent>
51
39
  )
52
40
  }
@@ -32,33 +32,33 @@ import iconText from '../../assets/filtered-text.svg'
32
32
  import '../../styles/v2/components/icon.scss'
33
33
 
34
34
  const iconHash = {
35
- 'caretUp': iconCaretUp,
36
- 'caretDown': iconCaretDown,
37
- 'caretFilledUp': iconCaretFilledUp,
38
- 'caretFilledDown': iconCaretFilledDown,
39
- 'chartBar': iconChartBar,
40
- 'chartLine': iconChartLine,
41
- 'chartPie': iconChartPie,
42
- 'close': iconClose,
43
- 'code': iconCode,
44
- 'databite': iconDataBite,
45
- 'edit': iconEdit,
46
- 'fileUpload': iconFileUpload,
47
- 'filterBars': iconFilterBars,
48
- 'grid': iconGrid,
49
- 'info': iconInfo,
50
- 'link': iconLink,
51
- 'mapAl': iconMapAl,
52
- 'mapUsa': iconMapUsa,
53
- 'mapWorld': iconMapWorld,
54
- 'move': iconMove,
55
- 'question': iconQuestion,
56
- 'upload': iconUpload,
57
- 'warningCircle': iconWarningCircle,
58
- 'warningTriangle': iconWarningTriangle,
59
- 'gear': iconGear,
60
- 'tools': iconTools,
61
- 'filtered-text':iconText
35
+ caretUp: iconCaretUp,
36
+ caretDown: iconCaretDown,
37
+ caretFilledUp: iconCaretFilledUp,
38
+ caretFilledDown: iconCaretFilledDown,
39
+ chartBar: iconChartBar,
40
+ chartLine: iconChartLine,
41
+ chartPie: iconChartPie,
42
+ close: iconClose,
43
+ code: iconCode,
44
+ databite: iconDataBite,
45
+ edit: iconEdit,
46
+ fileUpload: iconFileUpload,
47
+ filterBars: iconFilterBars,
48
+ grid: iconGrid,
49
+ info: iconInfo,
50
+ link: iconLink,
51
+ mapAl: iconMapAl,
52
+ mapUsa: iconMapUsa,
53
+ mapWorld: iconMapWorld,
54
+ move: iconMove,
55
+ question: iconQuestion,
56
+ upload: iconUpload,
57
+ warningCircle: iconWarningCircle,
58
+ warningTriangle: iconWarningTriangle,
59
+ gear: iconGear,
60
+ tools: iconTools,
61
+ 'filtered-text': iconText
62
62
  }
63
63
 
64
64
  const Icon = ({ display = null, base, alt = '', size, color, style, ...attributes }) => {
@@ -75,14 +75,13 @@ const Icon = ({ display = null, base, alt = '', size, color, style, ...attribute
75
75
 
76
76
  return (
77
77
  <>
78
- {base
79
- ? <IconObj title={alt}/>
80
- : (
81
- <span className={`cove-icon${attributes.className ? ' ' + attributes.className : ''}`} style={styles} {...filteredAttrs}>
82
- <IconObj title={alt}/>
83
- </span>
84
- )
85
- }
78
+ {base ? (
79
+ <IconObj title={alt} />
80
+ ) : (
81
+ <span className={`cove-icon${attributes.className ? ' ' + attributes.className : ''}`} style={styles} {...filteredAttrs}>
82
+ <IconObj title={alt} />
83
+ </span>
84
+ )}
86
85
  </>
87
86
  )
88
87
  }
@@ -1,20 +1,15 @@
1
1
  import React from 'react'
2
2
  import '../../styles/v2/components/loadspin.scss'
3
3
 
4
- const LoadSpin = ({
5
- color = '#fff',
6
- opacity = 100,
7
- size = 100,
8
- className
9
- }) => {
4
+ const LoadSpin = ({ color = '#fff', opacity = 100, size = 100, className }) => {
10
5
  const n = 8
11
6
  return (
12
7
  <>
13
- <div className={`cove-loadspin${className ? ' ' + className : ''}`} style={{width: size, height: size}}>
14
- <div className="cove-loadspin__roller" style={{opacity: opacity / 100, transform: `scale(${size/80})`}}>
15
- {
16
- [...Array(n)].map((elem, index) => <div key={index} style={{backgroundColor: color}}/>)
17
- }
8
+ <div className={`cove-loadspin${className ? ' ' + className : ''}`} style={{ width: size, height: size }}>
9
+ <div className='cove-loadspin__roller' style={{ opacity: opacity / 100, transform: `scale(${size / 80})` }}>
10
+ {[...Array(n)].map((elem, index) => (
11
+ <div key={index} style={{ backgroundColor: color }} />
12
+ ))}
18
13
  </div>
19
14
  </div>
20
15
  </>