@platformatic/ui-components 0.1.42 → 0.1.44

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@platformatic/ui-components",
3
3
  "description": "Platformatic UI Components",
4
- "version": "0.1.42",
4
+ "version": "0.1.44",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -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,8 +1,10 @@
1
1
  .metric {
2
- @apply flex justify-center items-center;
3
- gap: 1rem;
2
+ @apply flex justify-center items-center gap-x-2;
4
3
  }
5
-
6
4
  .value {
7
- @apply text-5xl
5
+ @apply text-[32px] font-semibold;
6
+ }
7
+ .unit,
8
+ .pre {
9
+ @apply text-sm;
8
10
  }
@@ -1,8 +1,8 @@
1
1
  import React, { useState } from 'react'
2
2
  import useEscapeKey from '../hooks/useEscapeKey'
3
- import CloseModalIcon from './icons/CloseModalIcon'
4
- import RoundCloseIcon from './icons/RoundCloseIcon'
5
- import RoundCloseHoverIcon from './icons/RoundCloseHoverIcon'
3
+ import CloseIcon from './icons/CloseIcon'
4
+ import CircleCloseIcon from './icons/CircleCloseIcon'
5
+ import CircleCloseHoverIcon from './icons/CircleCloseHoverIcon'
6
6
  import Logo from './Logo'
7
7
  import HorizontalSeparator from './HorizontalSeparator'
8
8
  import styles from './Modal.module.css'
@@ -25,7 +25,7 @@ export default function Modal (props) {
25
25
  <div className={styles.header}>
26
26
  <div className={styles.title}>{title}</div>
27
27
  <div className={styles.close} onClick={() => setIsOpen(false)}>
28
- <CloseModalIcon />
28
+ <CloseIcon />
29
29
  </div>
30
30
  </div>
31
31
  <div>
@@ -50,7 +50,7 @@ export default function Modal (props) {
50
50
  onMouseEnter={() => setIsHoverCloseModal(true)}
51
51
  onMouseLeave={() => setIsHoverCloseModal(false)}
52
52
  >
53
- {isHoverCloseModal ? <RoundCloseHoverIcon /> : <RoundCloseIcon />}
53
+ {isHoverCloseModal ? <CircleCloseHoverIcon /> : <CircleCloseIcon />}
54
54
  </div>
55
55
  </div>
56
56
  <p className={styles.titleInvite}>{title}</p>
@@ -73,7 +73,7 @@ export default function Modal (props) {
73
73
  onMouseEnter={() => setIsHoverCloseModal(true)}
74
74
  onMouseLeave={() => setIsHoverCloseModal(false)}
75
75
  >
76
- {isHoverCloseModal ? <RoundCloseHoverIcon color='main-dark-blue' /> : <RoundCloseIcon color='main-dark-blue' />}
76
+ {isHoverCloseModal ? <CircleCloseHoverIcon color='main-dark-blue' /> : <CircleCloseIcon color='main-dark-blue' />}
77
77
  </div>
78
78
  </div>
79
79
  <div className={classNameFullScreen}>
@@ -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
- <FontAwesomeIcon
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} />
@@ -3,5 +3,5 @@
3
3
  }
4
4
 
5
5
  .title {
6
- @apply text-xl;
6
+ @apply text-base font-semibold;
7
7
  }
@@ -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
+ }
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import styles from './Icons.module.css'
3
3
 
4
- const RoundCloseHoverIcon = ({ color = 'green' }) => {
4
+ const CircleCloseHoverIcon = ({ color = 'green' }) => {
5
5
  const className = styles[`${color}`] + ' ' + styles[`fill-circle-${color}`]
6
6
  return (
7
7
  <svg
@@ -39,4 +39,4 @@ const RoundCloseHoverIcon = ({ color = 'green' }) => {
39
39
  )
40
40
  }
41
41
 
42
- export default RoundCloseHoverIcon
42
+ export default CircleCloseHoverIcon
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import styles from './Icons.module.css'
3
3
 
4
- const RoundCloseIcon = ({ color = 'green' }) => {
4
+ const CircleCloseIcon = ({ color = 'green' }) => {
5
5
  const className = styles[`${color}`]
6
6
  return (
7
7
  <svg
@@ -29,4 +29,4 @@ const RoundCloseIcon = ({ color = 'green' }) => {
29
29
  )
30
30
  }
31
31
 
32
- export default RoundCloseIcon
32
+ export default CircleCloseIcon
@@ -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
@@ -0,0 +1,31 @@
1
+ import * as React from 'react'
2
+ import styles from './Icons.module.css'
3
+
4
+ const CloseIcon = ({ color = 'main-dark-blue' }) => {
5
+ const className = styles[`${color}`]
6
+ return (
7
+ <svg
8
+ width={16}
9
+ height={16}
10
+ viewBox='0 0 16 16'
11
+ fill='none'
12
+ xmlns='http://www.w3.org/2000/svg'
13
+ className={className}
14
+ >
15
+ <path
16
+ d='M2 2L14 14'
17
+ stroke='none'
18
+ strokeLinecap='round'
19
+ strokeLinejoin='round'
20
+ />
21
+ <path
22
+ d='M2 14L14 2'
23
+ stroke='none'
24
+ strokeLinecap='round'
25
+ strokeLinejoin='round'
26
+ />
27
+ </svg>
28
+ )
29
+ }
30
+
31
+ export default CloseIcon
@@ -0,0 +1,26 @@
1
+ import * as React from 'react'
2
+ import styles from './Icons.module.css'
3
+ const TriangleExclamationIcon = ({ color = 'red' }) => {
4
+ const className = styles[`${color}`]
5
+ return (
6
+ <svg
7
+ width={16}
8
+ height={16}
9
+ viewBox='0 0 16 16'
10
+ fill='none'
11
+ xmlns='http://www.w3.org/2000/svg'
12
+ className={className}
13
+ >
14
+ <path d='M14 14H2L8 2L14 14Z' stroke='none' strokeLinejoin='round' />
15
+ <path
16
+ d='M8 6V10.5'
17
+ stroke='none'
18
+ strokeLinecap='round'
19
+ strokeLinejoin='round'
20
+ />
21
+ <circle cx={8} cy={12} r={0.5} fill='none' />
22
+ </svg>
23
+ )
24
+ }
25
+
26
+ export default TriangleExclamationIcon
@@ -2,28 +2,34 @@ 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'
6
- import CloseModalIcon from './CloseModalIcon'
7
+ import CircleExclamationIcon from './CircleExclamationIcon'
8
+ import CircleCloseIcon from './CircleCloseIcon'
9
+ import CircleCloseHoverIcon from './CircleCloseHoverIcon'
10
+ import CloseIcon from './CloseIcon'
7
11
  import GearIcon from './GearIcon'
8
- import RoundCloseIcon from './RoundCloseIcon'
9
- import RoundCloseHoverIcon from './RoundCloseHoverIcon'
10
12
  import MetricsIcon from './MetricsIcon'
11
13
  import PuzzleDynamicIcon from './PuzzleDynamicIcon'
12
14
  import PuzzleIcon from './PuzzleIcon'
13
15
  import PullRequestIcon from './PullRequestIcon'
16
+ import TriangleExclamationIcon from './TriangleExclamationIcon'
14
17
 
15
18
  export default {
16
19
  ApiIcon,
17
20
  ApiIconClosed,
18
21
  ApiEmptyIcon,
19
22
  AppIcon,
23
+ AppListIcon,
20
24
  AppEmptyIcon,
21
- CloseModalIcon,
25
+ CircleExclamationIcon,
26
+ CircleCloseIcon,
27
+ CircleCloseHoverIcon,
28
+ CloseIcon,
22
29
  GearIcon,
23
- RoundCloseIcon,
24
- RoundCloseHoverIcon,
25
30
  MetricsIcon,
26
31
  PuzzleDynamicIcon,
27
32
  PuzzleIcon,
28
- PullRequestIcon
33
+ PullRequestIcon,
34
+ TriangleExclamationIcon
29
35
  }
@@ -3,7 +3,7 @@
3
3
  import DetailedMetric from '../components/DetailedMetric'
4
4
 
5
5
  export default {
6
- title: 'Platformatic/DetailedMetric',
6
+ title: 'Platformatic/Metrics/DetailedMetric',
7
7
  component: DetailedMetric
8
8
  }
9
9
 
@@ -3,7 +3,7 @@
3
3
  import SimpleMetric from '../components/SimpleMetric'
4
4
 
5
5
  export default {
6
- title: 'Platformatic/SimpleMetric',
6
+ title: 'Platformatic/Metrics/SimpleMetric',
7
7
  component: SimpleMetric
8
8
  }
9
9
 
@@ -0,0 +1,35 @@
1
+ import React from 'react'
2
+ import PullRequestIcon from '../../components/icons/PullRequestIcon'
3
+ import CloseIcon from '../../components/icons/CloseIcon'
4
+ import CircleCloseIcon from '../../components/icons/CircleCloseIcon'
5
+ import TriangleExclamationIcon from '../../components/icons/TriangleExclamationIcon'
6
+
7
+ export default {
8
+ title: 'Platformatic/Icons',
9
+ component: PullRequestIcon,
10
+ argTypes: {
11
+ color: {
12
+ type: 'string',
13
+ control: {
14
+ type: 'radio',
15
+ options: ['green', 'white', 'red']
16
+ }
17
+ }
18
+ }
19
+ }
20
+
21
+ const PullRequestIconTemplate = (args) => <PullRequestIcon {...args} />
22
+ export const PullRequestIconDefault = PullRequestIconTemplate.bind({})
23
+ PullRequestIconDefault.args = {}
24
+
25
+ const CloseIconTemplate = (args) => <CloseIcon {...args} />
26
+ export const CloseIconDefault = CloseIconTemplate.bind({})
27
+ CloseIconDefault.args = {}
28
+
29
+ const CircleCloseIconTemplate = (args) => <CircleCloseIcon {...args} />
30
+ export const CircleCloseIconDefault = CircleCloseIconTemplate.bind({})
31
+ CircleCloseIconDefault.args = {}
32
+
33
+ const TriangleExclamationIconTemplate = (args) => <TriangleExclamationIcon {...args} />
34
+ export const TriangleExclamationIconDefault = TriangleExclamationIconTemplate.bind({})
35
+ TriangleExclamationIconDefault.args = {}
@@ -1,26 +0,0 @@
1
- import * as React from 'react'
2
-
3
- const CloseModalIcon = () => (
4
- <svg
5
- width={16}
6
- height={16}
7
- viewBox='0 0 16 16'
8
- fill='none'
9
- xmlns='http://www.w3.org/2000/svg'
10
- >
11
- <path
12
- d='M2 2L14 14'
13
- stroke='#00283D'
14
- strokeLinecap='round'
15
- strokeLinejoin='round'
16
- />
17
- <path
18
- d='M2 14L14 2'
19
- stroke='#00283D'
20
- strokeLinecap='round'
21
- strokeLinejoin='round'
22
- />
23
- </svg>
24
- )
25
-
26
- export default CloseModalIcon
@@ -1,20 +0,0 @@
1
- import React from 'react'
2
- import PullRequestIcon from '../../components/icons/PullRequestIcon'
3
-
4
- export default {
5
- title: 'Platformatic/Icons',
6
- component: PullRequestIcon,
7
- argTypes: {
8
- color: {
9
- type: 'string',
10
- control: {
11
- type: 'radio',
12
- options: ['green', 'white', 'red']
13
- }
14
- }
15
- }
16
- }
17
-
18
- const Template = (args) => <PullRequestIcon {...args} />
19
- export const PullRequestIconDefault = Template.bind({})
20
- PullRequestIconDefault.args = {}