@platformatic/ui-components 0.1.42 → 0.1.43
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/package.json +1 -1
- package/src/components/MetricValue.jsx +2 -2
- package/src/components/MetricValue.module.css +6 -4
- package/src/components/SimpleMetric.jsx +2 -6
- package/src/components/SimpleMetric.module.css +1 -1
- package/src/components/icons/AppListIcon.jsx +73 -0
- package/src/components/icons/CircleExclamationIcon.jsx +29 -0
- package/src/components/icons/index.js +4 -0
- package/src/stories/DetailedMetric.stories.jsx +1 -1
- package/src/stories/SimpleMetric.stories.jsx +1 -1
package/package.json
CHANGED
|
@@ -5,11 +5,11 @@ import { getColor } from '../lib/utils'
|
|
|
5
5
|
export default function MetricValue ({ pre, color, value, unit }) {
|
|
6
6
|
return (
|
|
7
7
|
<div className={styles.metric}>
|
|
8
|
-
{pre && <span>{pre}</span>}
|
|
8
|
+
{pre && <span className={styles.pre}>{pre}</span>}
|
|
9
9
|
<span className={`${styles.value} ${getColor('text', color)}`}>
|
|
10
10
|
{value}
|
|
11
11
|
</span>
|
|
12
|
-
<span>{unit}</span>
|
|
12
|
+
<span className={styles.unit}>{unit}</span>
|
|
13
13
|
</div>
|
|
14
14
|
)
|
|
15
15
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
import React from 'react'
|
|
4
|
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
5
4
|
// The icon that is in design is not in the free version of fontawesome
|
|
6
5
|
// Temporary using this one
|
|
7
|
-
import { faCircleExclamation } from '@fortawesome/free-solid-svg-icons'
|
|
8
6
|
import ReactTooltip from 'react-tooltip'
|
|
9
7
|
import BorderedBox from './BorderedBox'
|
|
10
8
|
import styles from './SimpleMetric.module.css'
|
|
11
9
|
import MetricValue from './MetricValue'
|
|
10
|
+
import Icons from './icons'
|
|
12
11
|
|
|
13
12
|
export default function SimpleMetric ({ title, pre, color, unit, value, tooltip, children }) {
|
|
14
13
|
return (
|
|
@@ -16,10 +15,7 @@ export default function SimpleMetric ({ title, pre, color, unit, value, tooltip,
|
|
|
16
15
|
<BorderedBox>
|
|
17
16
|
<div className={styles.header}>
|
|
18
17
|
<span className={styles.title}>{title}</span>
|
|
19
|
-
<
|
|
20
|
-
icon={faCircleExclamation}
|
|
21
|
-
data-tip={tooltip}
|
|
22
|
-
/>
|
|
18
|
+
<Icons.CircleExclamationIcon tip={tooltip} />
|
|
23
19
|
</div>
|
|
24
20
|
<div>
|
|
25
21
|
<MetricValue pre={pre} color={color} unit={unit} value={value} />
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import styles from './Icons.module.css'
|
|
3
|
+
export default function AppListIcon ({ color = 'white' }) {
|
|
4
|
+
const className = styles[`${color}`]
|
|
5
|
+
return (
|
|
6
|
+
<svg
|
|
7
|
+
width={49}
|
|
8
|
+
height={67}
|
|
9
|
+
viewBox='0 0 49 67'
|
|
10
|
+
fill='none'
|
|
11
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
12
|
+
className={className}
|
|
13
|
+
>
|
|
14
|
+
<path
|
|
15
|
+
d='M19.6628 38.0801H11.9961C11.4438 38.0801 10.9961 38.5278 10.9961 39.0801V53.7201C10.9961 54.2724 11.4438 54.7201 11.9961 54.7201H35.9961C36.5484 54.7201 36.9961 54.2724 36.9961 53.7201V39.0801C36.9961 38.5278 36.5484 38.0801 35.9961 38.0801H28.3294'
|
|
16
|
+
stroke='none'
|
|
17
|
+
strokeWidth={2}
|
|
18
|
+
strokeLinecap='round'
|
|
19
|
+
/>
|
|
20
|
+
<rect
|
|
21
|
+
x={19.6631}
|
|
22
|
+
y={54.72}
|
|
23
|
+
width={8.66667}
|
|
24
|
+
height={4.16}
|
|
25
|
+
stroke='white'
|
|
26
|
+
strokeWidth={2}
|
|
27
|
+
/>
|
|
28
|
+
<path
|
|
29
|
+
d='M15.3291 59.8799C15.3291 59.3276 15.7768 58.8799 16.3291 58.8799H31.6624C32.2147 58.8799 32.6624 59.3276 32.6624 59.8799V61.9999H15.3291V59.8799Z'
|
|
30
|
+
stroke='white'
|
|
31
|
+
strokeWidth={2}
|
|
32
|
+
/>
|
|
33
|
+
<path
|
|
34
|
+
d='M23.9958 36L25.9416 41.749H32.2383L27.1441 45.302L29.0899 51.051L23.9958 47.498L18.9016 51.051L20.8474 45.302L15.7533 41.749H22.05L23.9958 36Z'
|
|
35
|
+
stroke='white'
|
|
36
|
+
strokeWidth={2}
|
|
37
|
+
strokeLinejoin='round'
|
|
38
|
+
/>
|
|
39
|
+
<path
|
|
40
|
+
d='M20.9961 34H15.9961V25H13.9961'
|
|
41
|
+
stroke='white'
|
|
42
|
+
strokeWidth={2}
|
|
43
|
+
strokeLinecap='round'
|
|
44
|
+
strokeLinejoin='round'
|
|
45
|
+
/>
|
|
46
|
+
<path
|
|
47
|
+
d='M19.9961 29.5V9'
|
|
48
|
+
stroke='white'
|
|
49
|
+
strokeWidth={2}
|
|
50
|
+
strokeLinecap='round'
|
|
51
|
+
strokeLinejoin='round'
|
|
52
|
+
/>
|
|
53
|
+
<path
|
|
54
|
+
d='M27.9961 35H32V27H38.9961V19'
|
|
55
|
+
stroke='white'
|
|
56
|
+
strokeWidth={2}
|
|
57
|
+
strokeLinecap='round'
|
|
58
|
+
strokeLinejoin='round'
|
|
59
|
+
/>
|
|
60
|
+
<path
|
|
61
|
+
d='M26 31.5V22H30.9961V14.5'
|
|
62
|
+
stroke='white'
|
|
63
|
+
strokeWidth={2}
|
|
64
|
+
strokeLinecap='round'
|
|
65
|
+
strokeLinejoin='round'
|
|
66
|
+
/>
|
|
67
|
+
<circle cx={11.9961} cy={25} r={2} stroke='white' strokeWidth={2} />
|
|
68
|
+
<circle cx={19.9961} cy={7} r={2} stroke='white' strokeWidth={2} />
|
|
69
|
+
<circle cx={30.9961} cy={12} r={2} stroke='white' strokeWidth={2} />
|
|
70
|
+
<circle cx={38.9961} cy={17} r={2} stroke='white' strokeWidth={2} />
|
|
71
|
+
</svg>
|
|
72
|
+
)
|
|
73
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import styles from './Icons.module.css'
|
|
3
|
+
const CircleExclamationIcon = ({ color = 'white', tip = '' }) => {
|
|
4
|
+
const className = styles[`${color}`]
|
|
5
|
+
|
|
6
|
+
return (
|
|
7
|
+
<svg
|
|
8
|
+
width={24}
|
|
9
|
+
height={24}
|
|
10
|
+
viewBox='0 0 24 24'
|
|
11
|
+
fill='none'
|
|
12
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
13
|
+
className={className}
|
|
14
|
+
data-tip={tip}
|
|
15
|
+
>
|
|
16
|
+
<circle cx={12} cy={12} r={9} stroke='none' strokeWidth={1.5} />
|
|
17
|
+
<path
|
|
18
|
+
d='M12 8.25V13.5'
|
|
19
|
+
stroke='none'
|
|
20
|
+
strokeWidth={1.5}
|
|
21
|
+
strokeLinecap='round'
|
|
22
|
+
strokeLinejoin='round'
|
|
23
|
+
/>
|
|
24
|
+
<circle cx={12} cy={15.75} r={0.75} fill='none' />
|
|
25
|
+
</svg>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default CircleExclamationIcon
|
|
@@ -2,7 +2,9 @@ import ApiIcon from './ApiIcon'
|
|
|
2
2
|
import ApiIconClosed from './ApiIconClosed'
|
|
3
3
|
import ApiEmptyIcon from './ApiEmptyIcon'
|
|
4
4
|
import AppIcon from './AppIcon'
|
|
5
|
+
import AppListIcon from './AppListIcon'
|
|
5
6
|
import AppEmptyIcon from './AppEmptyIcon'
|
|
7
|
+
import CircleExclamationIcon from './CircleExclamationIcon'
|
|
6
8
|
import CloseModalIcon from './CloseModalIcon'
|
|
7
9
|
import GearIcon from './GearIcon'
|
|
8
10
|
import RoundCloseIcon from './RoundCloseIcon'
|
|
@@ -17,7 +19,9 @@ export default {
|
|
|
17
19
|
ApiIconClosed,
|
|
18
20
|
ApiEmptyIcon,
|
|
19
21
|
AppIcon,
|
|
22
|
+
AppListIcon,
|
|
20
23
|
AppEmptyIcon,
|
|
24
|
+
CircleExclamationIcon,
|
|
21
25
|
CloseModalIcon,
|
|
22
26
|
GearIcon,
|
|
23
27
|
RoundCloseIcon,
|