@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.
- package/dist/cjs/a/Charts/AreaChart/AreaChart.js +13 -3
- package/dist/cjs/a/Charts/BarChart/BarChart.js +4 -6
- package/dist/cjs/a/Charts/Common/CustomLegend/CustomLegend.js +7 -26
- package/dist/cjs/a/Charts/Common/CustomLegend/styles.scss +14 -41
- package/dist/cjs/a/Charts/Common/CustomTooltipContent/CustomTooltipContent.js +7 -18
- package/dist/cjs/a/Charts/Common/YLabelsDropDown/YlabelsDropDown.js +4 -3
- package/dist/cjs/a/Charts/Common/YLabelsDropDown/styles.scss +6 -7
- package/dist/cjs/a/Charts/index.js +1 -8
- package/dist/cjs/a/index.js +0 -6
- package/dist/cjs/f/fields/FileUpload/common/Preview/Preview.js +9 -2
- package/dist/cjs/utils/formatting.js +2 -10
- package/dist/cjs/utils/index.js +0 -6
- package/dist/es/a/Charts/AreaChart/AreaChart.js +13 -3
- package/dist/es/a/Charts/BarChart/BarChart.js +4 -6
- package/dist/es/a/Charts/Common/CustomLegend/CustomLegend.js +21 -38
- package/dist/es/a/Charts/Common/CustomLegend/styles.scss +14 -41
- package/dist/es/a/Charts/Common/CustomTooltipContent/CustomTooltipContent.js +8 -19
- package/dist/es/a/Charts/Common/YLabelsDropDown/YlabelsDropDown.js +5 -3
- package/dist/es/a/Charts/Common/YLabelsDropDown/styles.scss +6 -7
- package/dist/es/a/Charts/index.js +1 -2
- package/dist/es/a/index.js +1 -1
- package/dist/es/f/fields/FileUpload/common/Preview/Preview.js +9 -2
- package/dist/es/utils/formatting.js +0 -7
- package/dist/es/utils/index.js +1 -1
- package/package.json +2 -2
- package/src/stories/a/AreaChart.stories.jsx +1 -1
- package/src/stories/a/BarChart.stories.jsx +1 -1
- package/src/ui/a/Charts/AreaChart/AreaChart.jsx +14 -8
- package/src/ui/a/Charts/BarChart/BarChart.jsx +2 -4
- package/src/ui/a/Charts/Common/CustomLegend/CustomLegend.jsx +29 -54
- package/src/ui/a/Charts/Common/CustomLegend/styles.scss +14 -41
- package/src/ui/a/Charts/Common/CustomTooltipContent/CustomTooltipContent.jsx +13 -25
- package/src/ui/a/Charts/Common/YLabelsDropDown/YlabelsDropDown.jsx +4 -4
- package/src/ui/a/Charts/Common/YLabelsDropDown/styles.scss +6 -7
- package/src/ui/a/Charts/index.js +0 -1
- package/src/ui/a/index.js +1 -1
- package/src/ui/f/fields/FileUpload/common/Preview/Preview.jsx +26 -12
- package/src/ui/utils/formatting.js +0 -8
- package/src/ui/utils/index.js +1 -3
- package/tests/__snapshots__/Storyshots.test.js.snap +428 -1164
- package/dist/cjs/a/Charts/PieChart/PieChart.js +0 -99
- package/dist/cjs/a/Charts/PieChart/index.js +0 -13
- package/dist/cjs/a/Charts/PieChart/styles.scss +0 -48
- package/dist/es/a/Charts/PieChart/PieChart.js +0 -89
- package/dist/es/a/Charts/PieChart/index.js +0 -1
- package/dist/es/a/Charts/PieChart/styles.scss +0 -48
- package/src/stories/a/PieChart.stories.jsx +0 -53
- package/src/ui/a/Charts/PieChart/PieChart.jsx +0 -125
- package/src/ui/a/Charts/PieChart/index.js +0 -1
- 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
|
-
{
|
|
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:'
|
|
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:
|
|
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-
|
|
21
|
-
border:
|
|
22
|
-
border-radius:
|
|
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:
|
|
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);
|
package/src/ui/a/Charts/index.js
CHANGED
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
|
|
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
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
94
|
+
<>
|
|
95
|
+
<Tooltip
|
|
96
|
+
description="bulk-updates-text"
|
|
97
|
+
content={(
|
|
98
|
+
<p>
|
|
99
|
+
This file doesn'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
|
-
}
|
package/src/ui/utils/index.js
CHANGED