@pareto-engineering/design-system 5.0.2 → 5.0.4

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 (50) hide show
  1. package/dist/cjs/a/Charts/AreaChart/AreaChart.js +13 -3
  2. package/dist/cjs/a/Charts/BarChart/BarChart.js +4 -6
  3. package/dist/cjs/a/Charts/Common/CustomLegend/CustomLegend.js +7 -26
  4. package/dist/cjs/a/Charts/Common/CustomLegend/styles.scss +14 -41
  5. package/dist/cjs/a/Charts/Common/CustomTooltipContent/CustomTooltipContent.js +7 -18
  6. package/dist/cjs/a/Charts/Common/YLabelsDropDown/YlabelsDropDown.js +4 -3
  7. package/dist/cjs/a/Charts/Common/YLabelsDropDown/styles.scss +6 -7
  8. package/dist/cjs/a/Charts/index.js +1 -8
  9. package/dist/cjs/a/index.js +0 -6
  10. package/dist/cjs/f/fields/FileUpload/common/Preview/Preview.js +9 -2
  11. package/dist/cjs/utils/formatting.js +2 -10
  12. package/dist/cjs/utils/index.js +0 -6
  13. package/dist/es/a/Charts/AreaChart/AreaChart.js +13 -3
  14. package/dist/es/a/Charts/BarChart/BarChart.js +4 -6
  15. package/dist/es/a/Charts/Common/CustomLegend/CustomLegend.js +21 -38
  16. package/dist/es/a/Charts/Common/CustomLegend/styles.scss +14 -41
  17. package/dist/es/a/Charts/Common/CustomTooltipContent/CustomTooltipContent.js +8 -19
  18. package/dist/es/a/Charts/Common/YLabelsDropDown/YlabelsDropDown.js +5 -3
  19. package/dist/es/a/Charts/Common/YLabelsDropDown/styles.scss +6 -7
  20. package/dist/es/a/Charts/index.js +1 -2
  21. package/dist/es/a/index.js +1 -1
  22. package/dist/es/f/fields/FileUpload/common/Preview/Preview.js +9 -2
  23. package/dist/es/utils/formatting.js +0 -7
  24. package/dist/es/utils/index.js +1 -1
  25. package/package.json +2 -2
  26. package/src/stories/a/AreaChart.stories.jsx +1 -1
  27. package/src/stories/a/BarChart.stories.jsx +1 -1
  28. package/src/ui/a/Charts/AreaChart/AreaChart.jsx +14 -8
  29. package/src/ui/a/Charts/BarChart/BarChart.jsx +2 -4
  30. package/src/ui/a/Charts/Common/CustomLegend/CustomLegend.jsx +29 -54
  31. package/src/ui/a/Charts/Common/CustomLegend/styles.scss +14 -41
  32. package/src/ui/a/Charts/Common/CustomTooltipContent/CustomTooltipContent.jsx +13 -25
  33. package/src/ui/a/Charts/Common/YLabelsDropDown/YlabelsDropDown.jsx +4 -4
  34. package/src/ui/a/Charts/Common/YLabelsDropDown/styles.scss +6 -7
  35. package/src/ui/a/Charts/index.js +0 -1
  36. package/src/ui/a/index.js +1 -1
  37. package/src/ui/f/fields/FileUpload/common/Preview/Preview.jsx +26 -12
  38. package/src/ui/utils/formatting.js +0 -8
  39. package/src/ui/utils/index.js +1 -3
  40. package/tests/__snapshots__/Storyshots.test.js.snap +428 -1164
  41. package/dist/cjs/a/Charts/PieChart/PieChart.js +0 -99
  42. package/dist/cjs/a/Charts/PieChart/index.js +0 -13
  43. package/dist/cjs/a/Charts/PieChart/styles.scss +0 -48
  44. package/dist/es/a/Charts/PieChart/PieChart.js +0 -89
  45. package/dist/es/a/Charts/PieChart/index.js +0 -1
  46. package/dist/es/a/Charts/PieChart/styles.scss +0 -48
  47. package/src/stories/a/PieChart.stories.jsx +0 -53
  48. package/src/ui/a/Charts/PieChart/PieChart.jsx +0 -125
  49. package/src/ui/a/Charts/PieChart/index.js +0 -1
  50. package/src/ui/a/Charts/PieChart/styles.scss +0 -48
@@ -5,10 +5,10 @@ import PropTypes from 'prop-types'
5
5
 
6
6
  import styleNames from '@pareto-engineering/bem/exports'
7
7
 
8
- import { snakeCaseToTitleCase } from 'ui/utils'
9
-
10
8
  import './styles.scss'
11
9
 
10
+ // Local Definitions
11
+
12
12
  const baseClassName = styleNames.base
13
13
 
14
14
  const componentClassName = 'y-labels-dropdown'
@@ -65,7 +65,7 @@ const YLabelsDropDown = ({
65
65
  className="status-dot"
66
66
  style={{ backgroundColor: item.color }}
67
67
  />
68
- {snakeCaseToTitleCase(item.label)}
68
+ {item.label}
69
69
  {selectedYLabels.some((label) => label.label === item.label) && (
70
70
  <span className="icon checkmark">I</span>
71
71
  )}
@@ -115,7 +115,7 @@ YLabelsDropDown.propTypes = {
115
115
  }
116
116
 
117
117
  YLabelsDropDown.defaultProps = {
118
- placeholder:'Select Item',
118
+ placeholder:'Submission status',
119
119
  }
120
120
 
121
121
  export default YLabelsDropDown
@@ -1,8 +1,7 @@
1
1
  @use "@pareto-engineering/bem";
2
2
 
3
3
  $default-margin: 1rem;
4
- $default-border: var(--theme-default-input-border);
5
- $default-border-radius: var(--theme-default-input-border-radius);
4
+ $default-border-radius: .25rem;
6
5
  $default-padding: 1rem;
7
6
  $default-width: 15rem;
8
7
  $default-box-shadow: 0 .25rem .75rem var(--ui-lines);
@@ -17,9 +16,9 @@ $default-checkmark-font-size: calc(var(--s-1) * .75rem);
17
16
 
18
17
  .dropdown-button {
19
18
  align-items: center;
20
- background-color: var(--background-far);
21
- border: $default-border;
22
- border-radius: calc($default-border-radius / 2);
19
+ background-color: var(--soft-background-inputs);
20
+ border: none;
21
+ border-radius: $default-border-radius;
23
22
  color: var(--hard-paragraph);
24
23
  cursor: pointer;
25
24
  display: flex;
@@ -54,8 +53,8 @@ $default-checkmark-font-size: calc(var(--s-1) * .75rem);
54
53
 
55
54
  .dropdown-item {
56
55
  align-items: center;
57
- border-radius: calc($default-border-radius / 2);
58
- color: var(--paragraph);
56
+ border-radius: $default-border-radius;
57
+ color: var(--hard-paragraph);
59
58
  cursor: pointer;
60
59
  display: flex;
61
60
  margin: calc($default-margin * .125);
@@ -1,3 +1,2 @@
1
1
  export { AreaChart } from './AreaChart'
2
2
  export { BarChart } from './BarChart'
3
- export { PieChart } from './PieChart'
package/src/ui/a/index.js CHANGED
@@ -30,4 +30,4 @@ export { ToggleSwitch } from './ToggleSwitch'
30
30
  export { XMLEditor } from './XMLEditor'
31
31
  export { DatePicker } from './DatePicker'
32
32
  export { Tooltip } from './Tooltip'
33
- export { AreaChart, BarChart, PieChart } from './Charts'
33
+ export { AreaChart, BarChart } from './Charts'
@@ -91,18 +91,32 @@ const Preview = ({
91
91
  <span title={file.name} className="name">{file.name}</span>
92
92
  {isFileBroken
93
93
  ? (
94
- <Tooltip
95
- description="bulk-updates-text"
96
- content={(
97
- <p>
98
- This file doesn&apos;t have a link or the link is invalid.
99
- </p>
100
- )}
101
- >
102
- <span className="icon x-ui-icons c-x">
103
- h
104
- </span>
105
- </Tooltip>
94
+ <>
95
+ <Tooltip
96
+ description="bulk-updates-text"
97
+ content={(
98
+ <p>
99
+ This file doesn&apos;t have a link or the link is invalid.
100
+ </p>
101
+ )}
102
+ >
103
+ <span className="icon x-ui-icons c-x">
104
+ h
105
+ </span>
106
+ </Tooltip>
107
+ {
108
+ writeOnly && (
109
+ <Button
110
+ color="ui-icons"
111
+ isCompact
112
+ isSimple
113
+ onClick={() => handleDelete()}
114
+ >
115
+ <span className="icon">{canDelete ? 'Y' : '9'}</span>
116
+ </Button>
117
+ )
118
+ }
119
+ </>
106
120
  )
107
121
  : (
108
122
  <Button
@@ -46,9 +46,6 @@ export const formatTime = (seconds) => {
46
46
  if (minutes > 0 || (hours > 0 && remainingSeconds > 0)) parts.push(`${minutes}m`)
47
47
  if (remainingSeconds > 0) parts.push(`${remainingSeconds}s`)
48
48
 
49
- // Cater for decimal seconds
50
- if (parts.length === 0) return '0s'
51
-
52
49
  return parts.join(' ')
53
50
  }
54
51
 
@@ -126,8 +123,3 @@ export const formatDate = (input, format = DATE_FORMATS.HUMAN_READABLE) => {
126
123
  return 'Invalid Date'
127
124
  }
128
125
  }
129
-
130
- export const snakeCaseToTitleCase = (word) => {
131
- const result = word.replace(/([A-Z])/g, ' $1')
132
- return result.charAt(0).toUpperCase() + result.slice(1)
133
- }
@@ -1,4 +1,2 @@
1
1
  export { useWindowSize, useDynamicPosition, useOutsideClick } from './hooks'
2
- export {
3
- formatTime, formatDate, DATE_FORMATS, snakeCaseToTitleCase,
4
- } from './formatting'
2
+ export { formatTime, formatDate, DATE_FORMATS } from './formatting'