@platformatic/ui-components 0.1.11 → 0.1.13

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 (153) hide show
  1. package/.github/workflows/ci.yml +26 -0
  2. package/dist/assets/index.133cf9fb.css +1 -0
  3. package/dist/assets/{index.03c3e650.js → index.97014e0d.js} +14 -14
  4. package/dist/index.html +2 -2
  5. package/dist/main.css +32 -11
  6. package/index.js +15 -1
  7. package/package.json +9 -2
  8. package/src/components/ApiSummary.jsx +2 -2
  9. package/src/components/Box.jsx +11 -0
  10. package/src/components/Box.module.css +3 -0
  11. package/src/components/FollowUs.jsx +35 -0
  12. package/src/components/FollowUs.module.css +11 -0
  13. package/src/components/FrontpageBackground.jsx +11 -0
  14. package/src/components/FrontpageBackground.module.css +10 -0
  15. package/src/components/List.jsx +20 -0
  16. package/src/components/List.module.css +11 -0
  17. package/src/components/ListElement.jsx +23 -0
  18. package/src/components/ListElement.module.css +23 -0
  19. package/src/components/Logo.jsx +76 -0
  20. package/src/components/PullRequest.jsx +54 -19
  21. package/src/components/PullRequest.module.css +17 -2
  22. package/src/components/Status.jsx +26 -0
  23. package/src/lib/utils.js +3 -0
  24. package/src/stories/BorderedBox.stories.jsx +11 -2
  25. package/src/stories/FollowUs.stories.jsx +14 -0
  26. package/src/stories/Frontpage.stories.jsx +42 -0
  27. package/src/stories/FrontpageBackground.stories.jsx +17 -0
  28. package/src/stories/HorizontalSeparator.stories.jsx +12 -0
  29. package/src/stories/List.stories.jsx +29 -0
  30. package/src/stories/ListElement.stories.jsx +15 -0
  31. package/src/stories/Logo.stories.jsx +14 -0
  32. package/src/stories/PullRequest.stories.jsx +31 -5
  33. package/src/stories/Status.stories.jsx +31 -0
  34. package/src/stories/{TesxtWithLabel.stories.jsx → TextWithLabel.stories.jsx} +0 -0
  35. package/vitest.config.js +1 -1
  36. package/dist/assets/index.2277ba1a.css +0 -1
  37. package/src/components/Api/Status.jsx +0 -20
  38. package/storybook-static/0.53758dff751ed2733218.manager.bundle.js +0 -2
  39. package/storybook-static/0.53758dff751ed2733218.manager.bundle.js.LICENSE.txt +0 -8
  40. package/storybook-static/1.9d13fd5be5dcb92d80a6.manager.bundle.js +0 -1
  41. package/storybook-static/5.410945cbec993452eed2.manager.bundle.js +0 -2
  42. package/storybook-static/5.410945cbec993452eed2.manager.bundle.js.LICENSE.txt +0 -31
  43. package/storybook-static/6.9ef90ca53c7deb768ec6.manager.bundle.js +0 -1
  44. package/storybook-static/7.47a294f1c5761295c4cb.manager.bundle.js +0 -1
  45. package/storybook-static/8.35b89a87599812bb0515.manager.bundle.js +0 -2
  46. package/storybook-static/8.35b89a87599812bb0515.manager.bundle.js.LICENSE.txt +0 -12
  47. package/storybook-static/9.d19ea1957ceb9893827c.manager.bundle.js +0 -1
  48. package/storybook-static/api-icon-closed.svg +0 -6
  49. package/storybook-static/api-icon.svg +0 -9
  50. package/storybook-static/assets/BorderedBox.stories.8d7654fe.css +0 -1
  51. package/storybook-static/assets/BorderedBox.stories.f9bbae3a.js +0 -26
  52. package/storybook-static/assets/BorderedBox.stories.f9bbae3a.js.map +0 -1
  53. package/storybook-static/assets/Button.7e305135.js +0 -2
  54. package/storybook-static/assets/Button.7e305135.js.map +0 -1
  55. package/storybook-static/assets/Button.bc1a867b.css +0 -1
  56. package/storybook-static/assets/Button.stories.8d745781.js +0 -42
  57. package/storybook-static/assets/Button.stories.8d745781.js.map +0 -1
  58. package/storybook-static/assets/Color-f953d088.a38b7cbd.js +0 -3
  59. package/storybook-static/assets/Color-f953d088.a38b7cbd.js.map +0 -1
  60. package/storybook-static/assets/GlobalScrollAreaStyles-8793ce4a.cf1537f5.js +0 -2
  61. package/storybook-static/assets/GlobalScrollAreaStyles-8793ce4a.cf1537f5.js.map +0 -1
  62. package/storybook-static/assets/Header.4fc7684b.css +0 -1
  63. package/storybook-static/assets/Header.cf6306b0.js +0 -2
  64. package/storybook-static/assets/Header.cf6306b0.js.map +0 -1
  65. package/storybook-static/assets/Header.stories.17ffb615.js +0 -26
  66. package/storybook-static/assets/Header.stories.17ffb615.js.map +0 -1
  67. package/storybook-static/assets/Introduction.stories.bc0afbca.js +0 -105
  68. package/storybook-static/assets/Introduction.stories.bc0afbca.js.map +0 -1
  69. package/storybook-static/assets/LoginButton.stories.10ae424d.js +0 -776
  70. package/storybook-static/assets/LoginButton.stories.10ae424d.js.map +0 -1
  71. package/storybook-static/assets/LoginButton.stories.edf744f1.css +0 -1
  72. package/storybook-static/assets/OverlayScrollbars-1355f44c.fce02603.js +0 -18
  73. package/storybook-static/assets/OverlayScrollbars-1355f44c.fce02603.js.map +0 -1
  74. package/storybook-static/assets/Page.stories.0913ba40.css +0 -1
  75. package/storybook-static/assets/Page.stories.76f6205c.js +0 -84
  76. package/storybook-static/assets/Page.stories.76f6205c.js.map +0 -1
  77. package/storybook-static/assets/Props.8d39388f.js +0 -187
  78. package/storybook-static/assets/Props.8d39388f.js.map +0 -1
  79. package/storybook-static/assets/WithTooltip-167e9982.ebb6fc8d.js +0 -11
  80. package/storybook-static/assets/WithTooltip-167e9982.ebb6fc8d.js.map +0 -1
  81. package/storybook-static/assets/client.177c4b3e.js +0 -2
  82. package/storybook-static/assets/client.177c4b3e.js.map +0 -1
  83. package/storybook-static/assets/code-brackets.9ef6443e.svg +0 -1
  84. package/storybook-static/assets/colors.ac9401f3.svg +0 -1
  85. package/storybook-static/assets/comments.f15a6837.svg +0 -1
  86. package/storybook-static/assets/config.3c15c657.js +0 -74
  87. package/storybook-static/assets/config.3c15c657.js.map +0 -1
  88. package/storybook-static/assets/config.be729574.js +0 -2
  89. package/storybook-static/assets/config.be729574.js.map +0 -1
  90. package/storybook-static/assets/direction.94a9917f.svg +0 -1
  91. package/storybook-static/assets/es.map.constructor.bc2f31bd.js +0 -2
  92. package/storybook-static/assets/es.map.constructor.bc2f31bd.js.map +0 -1
  93. package/storybook-static/assets/es.number.to-fixed.db152345.js +0 -2
  94. package/storybook-static/assets/es.number.to-fixed.db152345.js.map +0 -1
  95. package/storybook-static/assets/es.regexp.flags.ebae2243.js +0 -2
  96. package/storybook-static/assets/es.regexp.flags.ebae2243.js.map +0 -1
  97. package/storybook-static/assets/es.string.from-code-point.e6202842.js +0 -2
  98. package/storybook-static/assets/es.string.from-code-point.e6202842.js.map +0 -1
  99. package/storybook-static/assets/flow.275142c6.svg +0 -1
  100. package/storybook-static/assets/formatter-0d5cb0eb.aebafedb.js +0 -297
  101. package/storybook-static/assets/formatter-0d5cb0eb.aebafedb.js.map +0 -1
  102. package/storybook-static/assets/iframe.aab06436.js +0 -153
  103. package/storybook-static/assets/iframe.aab06436.js.map +0 -1
  104. package/storybook-static/assets/index.7df59845.js +0 -2
  105. package/storybook-static/assets/index.7df59845.js.map +0 -1
  106. package/storybook-static/assets/index.814c1dee.js +0 -9
  107. package/storybook-static/assets/index.814c1dee.js.map +0 -1
  108. package/storybook-static/assets/index.c7ae27b6.js +0 -25
  109. package/storybook-static/assets/index.c7ae27b6.js.map +0 -1
  110. package/storybook-static/assets/index.f76a1af3.js +0 -2
  111. package/storybook-static/assets/index.f76a1af3.js.map +0 -1
  112. package/storybook-static/assets/instrumenter.3eab649e.js +0 -4
  113. package/storybook-static/assets/instrumenter.3eab649e.js.map +0 -1
  114. package/storybook-static/assets/jsx-runtime.e2ea81d7.js +0 -18
  115. package/storybook-static/assets/jsx-runtime.e2ea81d7.js.map +0 -1
  116. package/storybook-static/assets/make-decorator.7fb2aeb9.js +0 -3
  117. package/storybook-static/assets/make-decorator.7fb2aeb9.js.map +0 -1
  118. package/storybook-static/assets/plugin.57148314.svg +0 -1
  119. package/storybook-static/assets/preview.0975d66e.js +0 -3
  120. package/storybook-static/assets/preview.0975d66e.js.map +0 -1
  121. package/storybook-static/assets/preview.38b4e44b.js +0 -14
  122. package/storybook-static/assets/preview.38b4e44b.js.map +0 -1
  123. package/storybook-static/assets/preview.4099ceae.js +0 -2
  124. package/storybook-static/assets/preview.4099ceae.js.map +0 -1
  125. package/storybook-static/assets/preview.43118df9.js +0 -26
  126. package/storybook-static/assets/preview.43118df9.js.map +0 -1
  127. package/storybook-static/assets/preview.4dfec941.js +0 -2
  128. package/storybook-static/assets/preview.4dfec941.js.map +0 -1
  129. package/storybook-static/assets/preview.b37e665b.js +0 -397
  130. package/storybook-static/assets/preview.b37e665b.js.map +0 -1
  131. package/storybook-static/assets/preview.b8ebcf81.css +0 -1
  132. package/storybook-static/assets/preview.cc910bd3.js +0 -2
  133. package/storybook-static/assets/preview.cc910bd3.js.map +0 -1
  134. package/storybook-static/assets/preview.f14efd1d.js +0 -3
  135. package/storybook-static/assets/preview.f14efd1d.js.map +0 -1
  136. package/storybook-static/assets/renderDocs.4312919d.js +0 -2
  137. package/storybook-static/assets/renderDocs.4312919d.js.map +0 -1
  138. package/storybook-static/assets/repo.fb4ece47.svg +0 -1
  139. package/storybook-static/assets/stackalt.2ad81543.svg +0 -1
  140. package/storybook-static/assets/string.6cc73134.js +0 -2
  141. package/storybook-static/assets/string.6cc73134.js.map +0 -1
  142. package/storybook-static/assets/syntaxhighlighter-b07b042a.04697fcf.js +0 -16
  143. package/storybook-static/assets/syntaxhighlighter-b07b042a.04697fcf.js.map +0 -1
  144. package/storybook-static/favicon.ico +0 -0
  145. package/storybook-static/iframe.html +0 -486
  146. package/storybook-static/index.html +0 -59
  147. package/storybook-static/main.1e2c996516b3b52674de.manager.bundle.js +0 -1
  148. package/storybook-static/project.json +0 -1
  149. package/storybook-static/runtime~main.904779a78e0adff8f659.manager.bundle.js +0 -1
  150. package/storybook-static/stories.json +0 -1
  151. package/storybook-static/vendors~main.ab297a8d7023057bddf0.manager.bundle.js +0 -2
  152. package/storybook-static/vendors~main.ab297a8d7023057bddf0.manager.bundle.js.LICENSE.txt +0 -107
  153. package/storybook-static/vite.svg +0 -1
package/dist/index.html CHANGED
@@ -4,8 +4,8 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Platformatic UI Components</title>
7
- <script type="module" crossorigin src="/assets/index.03c3e650.js"></script>
8
- <link rel="stylesheet" href="/assets/index.2277ba1a.css">
7
+ <script type="module" crossorigin src="/assets/index.97014e0d.js"></script>
8
+ <link rel="stylesheet" href="/assets/index.133cf9fb.css">
9
9
  </head>
10
10
  <body>
11
11
  <div id="root"></div>
package/dist/main.css CHANGED
@@ -540,6 +540,10 @@ video {
540
540
  }
541
541
  }
542
542
 
543
+ .static {
544
+ position: static;
545
+ }
546
+
543
547
  .m-3 {
544
548
  margin: 0.75rem;
545
549
  }
@@ -549,6 +553,11 @@ video {
549
553
  margin-bottom: 1rem;
550
554
  }
551
555
 
556
+ .my-8 {
557
+ margin-top: 2rem;
558
+ margin-bottom: 2rem;
559
+ }
560
+
552
561
  .mx-auto {
553
562
  margin-left: auto;
554
563
  margin-right: auto;
@@ -571,8 +580,12 @@ video {
571
580
  margin-left: 1rem;
572
581
  }
573
582
 
574
- .mr-1 {
575
- margin-right: 0.25rem;
583
+ .mt-24 {
584
+ margin-top: 6rem;
585
+ }
586
+
587
+ .mb-16 {
588
+ margin-bottom: 4rem;
576
589
  }
577
590
 
578
591
  .flex {
@@ -599,6 +612,10 @@ video {
599
612
  width: 2.25rem;
600
613
  }
601
614
 
615
+ .w-80 {
616
+ width: 20rem;
617
+ }
618
+
602
619
  .grow {
603
620
  flex-grow: 1;
604
621
  }
@@ -611,6 +628,10 @@ video {
611
628
  flex-direction: column;
612
629
  }
613
630
 
631
+ .place-items-center {
632
+ place-items: center;
633
+ }
634
+
614
635
  .items-center {
615
636
  align-items: center;
616
637
  }
@@ -674,16 +695,16 @@ video {
674
695
  line-height: 1.75rem;
675
696
  }
676
697
 
677
- .text-3xl {
678
- font-size: 1.875rem;
679
- line-height: 2.25rem;
680
- }
681
-
682
698
  .text-4xl {
683
699
  font-size: 2.25rem;
684
700
  line-height: 2.5rem;
685
701
  }
686
702
 
703
+ .text-3xl {
704
+ font-size: 1.875rem;
705
+ line-height: 2.25rem;
706
+ }
707
+
687
708
  .text-6xl {
688
709
  font-size: 3.75rem;
689
710
  line-height: 1;
@@ -706,14 +727,14 @@ video {
706
727
  color: rgb(33 250 144 / var(--tw-text-opacity));
707
728
  }
708
729
 
709
- .text-dark-green {
730
+ .text-white {
710
731
  --tw-text-opacity: 1;
711
- color: rgb(2 120 63 / var(--tw-text-opacity));
732
+ color: rgb(255 255 255 / var(--tw-text-opacity));
712
733
  }
713
734
 
714
- .text-white {
735
+ .text-dark-green {
715
736
  --tw-text-opacity: 1;
716
- color: rgb(255 255 255 / var(--tw-text-opacity));
737
+ color: rgb(2 120 63 / var(--tw-text-opacity));
717
738
  }
718
739
 
719
740
  .text-error-red {
package/index.js CHANGED
@@ -12,10 +12,17 @@ import TwoColumnsLayout from './src/components/layouts/TwoColumnsLayout'
12
12
  import Playground from './src/components/Playground'
13
13
  import PullRequest from './src/components/PullRequest'
14
14
  import SearchBar from './src/components/SearchBar'
15
+ import Status from './src/components/Status'
15
16
  import TabbedWindow from './src/components/TabbedWindow'
16
17
  import TextWithLabel from './src/components/TextWithLabel'
17
18
  import Versions from './src/components/Versions'
18
19
  import VerticalSeparator from './src/components/VerticalSeparator'
20
+ import FollowUs from './src/components/FollowUs'
21
+ import List from './src/components/List'
22
+ import ListElement from './src/components/ListElement'
23
+ import Logo from './src/components/Logo'
24
+ import Box from './src/components/Box'
25
+ import FrontpageBackground from './src/components/FrontpageBackground'
19
26
  export {
20
27
  ApiSummary,
21
28
  ApiDetails,
@@ -29,8 +36,15 @@ export {
29
36
  Playground,
30
37
  PullRequest,
31
38
  SearchBar,
39
+ Status,
32
40
  TabbedWindow,
33
41
  TextWithLabel,
34
42
  Versions,
35
- VerticalSeparator
43
+ VerticalSeparator,
44
+ FollowUs,
45
+ List,
46
+ ListElement,
47
+ Logo,
48
+ Box,
49
+ FrontpageBackground
36
50
  }
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.11",
4
+ "version": "0.1.13",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
7
7
  "scripts": {
@@ -19,6 +19,7 @@
19
19
  "dependencies": {
20
20
  "@fortawesome/fontawesome-svg-core": "^6.2.0",
21
21
  "@fortawesome/free-brands-svg-icons": "^6.2.0",
22
+ "@fortawesome/free-regular-svg-icons": "^6.2.0",
22
23
  "@fortawesome/free-solid-svg-icons": "^6.2.0",
23
24
  "@fortawesome/react-fontawesome": "^0.2.0",
24
25
  "autoprefixer": "^10.4.12",
@@ -29,6 +30,7 @@
29
30
  },
30
31
  "devDependencies": {
31
32
  "@babel/core": "^7.19.3",
33
+ "@fastify/pre-commit": "^2.0.2",
32
34
  "@storybook/addon-actions": "^6.5.12",
33
35
  "@storybook/addon-essentials": "^6.5.12",
34
36
  "@storybook/addon-interactions": "^6.5.12",
@@ -42,6 +44,7 @@
42
44
  "@types/react-dom": "^18.0.6",
43
45
  "@vitejs/plugin-react": "^2.1.0",
44
46
  "babel-loader": "^8.2.5",
47
+ "happy-dom": "^7.6.6",
45
48
  "jsdom": "^20.0.1",
46
49
  "react-test-renderer": "^18.2.0",
47
50
  "snazzy": "^9.0.0",
@@ -59,5 +62,9 @@
59
62
  "ignore": [
60
63
  "/dist"
61
64
  ]
62
- }
65
+ },
66
+ "pre-commit": [
67
+ "lint",
68
+ "test"
69
+ ]
63
70
  }
@@ -8,7 +8,7 @@ import ApiIcon from './icons/ApiIcon'
8
8
  import ApiIconClosed from './icons/ApiIconClosed'
9
9
  import VerticalSeparator from './VerticalSeparator'
10
10
  import TextWithLabel from './TextWithLabel'
11
- import ApiStatus from './Api/Status'
11
+ import Status from './Status'
12
12
  import BorderedBox from './BorderedBox'
13
13
  import HorizontalSeparator from './HorizontalSeparator'
14
14
  import styles from './Api.module.css'
@@ -41,7 +41,7 @@ export default function ApiSummary (props) {
41
41
  <ApiVersion version={version} />
42
42
  </div>
43
43
  <div className={styles.status}>
44
- <ApiStatus online={online} />
44
+ <Status color={color} status={online ? 'online' : 'offline'} />
45
45
  </div>
46
46
 
47
47
  </div>
@@ -0,0 +1,11 @@
1
+ 'use strict'
2
+
3
+ import styles from './Box.module.css'
4
+ import React from 'react'
5
+ export default function Box (props) {
6
+ return (
7
+ <div className={styles.box}>
8
+ {props.children}
9
+ </div>
10
+ )
11
+ }
@@ -0,0 +1,3 @@
1
+ .box {
2
+ @apply mx-24 my-24 flex flex-col
3
+ }
@@ -0,0 +1,35 @@
1
+ import React from 'react'
2
+ import styles from './FollowUs.module.css'
3
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
4
+ import { faGithub, faTwitter, faLinkedin, faDiscord } from '@fortawesome/free-brands-svg-icons'
5
+
6
+ export default function FollowUs ({ label = 'FOLLOW US ON' }) {
7
+ return (
8
+ <div className={styles.container}>
9
+ <div className={styles.label}>
10
+ {label}
11
+ </div>
12
+ <div className={styles.icon}>
13
+ <a href='https://twitter.com/platformatic' target='_blank' rel='noopener noreferrer'>
14
+ <FontAwesomeIcon icon={faTwitter} className='mr-2 text-white' />
15
+ </a>
16
+ </div>
17
+ <div className={styles.icon}>
18
+ <a href='https://www.linkedin.com/company/platformatic/' target='_blank' rel='noopener noreferrer'>
19
+ <FontAwesomeIcon icon={faLinkedin} className='mr-2 text-white' />
20
+ </a>
21
+ </div>
22
+ <div className={styles.icon}>
23
+ <a href='https://github.com/platformatic' target='_blank' rel='noopener noreferrer'>
24
+ <FontAwesomeIcon icon={faGithub} className='mr-2 text-white' />
25
+ </a>
26
+ </div>
27
+ <div className={styles.icon}>
28
+ <a href='https://discord.gg/platformatic' target='_blank' rel='noopener noreferrer'>
29
+ <FontAwesomeIcon icon={faDiscord} className='mr-2 text-white' />
30
+ </a>
31
+ </div>
32
+
33
+ </div>
34
+ )
35
+ }
@@ -0,0 +1,11 @@
1
+ .container {
2
+ @apply flex w-96
3
+ }
4
+
5
+ .label {
6
+ @apply uppercase text-light-green
7
+ }
8
+
9
+ .icon {
10
+ @apply text-white ml-4
11
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react'
2
+ import styles from './FrontpageBackground.module.css'
3
+
4
+ export default function FrontpageBackgound ({ label = 'platformatic', ...props }) {
5
+ return (
6
+ <div className={styles.bg}>
7
+ <div className={styles.label}> {label} </div>
8
+ {props.children}
9
+ </div>
10
+ )
11
+ }
@@ -0,0 +1,10 @@
1
+ /* let's use some direct CSS here, with tailwind is quite convoluted to obtain the correct radial gradient */
2
+ .bg {
3
+ background: radial-gradient(circle at 0% 0%, rgba(33, 250, 144, 0.4) 0%, rgba(6, 31, 55, 0.4) 35%);
4
+ }
5
+
6
+ .label {
7
+ @apply text-light-green font-semibold w-full text-left uppercase px-8 py-4 text-clip
8
+ }
9
+
10
+
@@ -0,0 +1,20 @@
1
+ import React from 'react'
2
+ import styles from './List.module.css'
3
+
4
+ export default function List ({ title, ...props }) {
5
+ return (
6
+ <div className={styles.container}>
7
+ {title &&
8
+ <div
9
+ className={styles.title}
10
+ data-testid='list-title'
11
+ {...props}
12
+ >
13
+ {title}
14
+ </div>}
15
+ <div className={styles.elements}>
16
+ {props.children}
17
+ </div>
18
+ </div>
19
+ )
20
+ }
@@ -0,0 +1,11 @@
1
+ .title {
2
+ @apply text-light-green font-bold w-full text-left uppercase
3
+ }
4
+
5
+ .container {
6
+ @apply w-full
7
+ }
8
+
9
+ .elements {
10
+ @apply flex flex-col
11
+ }
@@ -0,0 +1,23 @@
1
+ import React from 'react'
2
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
3
+ import { faCircleCheck } from '@fortawesome/free-regular-svg-icons'
4
+ import styles from './ListElement.module.css'
5
+ export default function List ({ title, detail }) {
6
+ return (
7
+ <div className={styles.container}>
8
+ <div className={styles.iconCol}>
9
+ <div data-testid='list-element-title-icon' className={styles.icon}>
10
+ <FontAwesomeIcon icon={faCircleCheck} />
11
+ </div>
12
+ </div>
13
+ <div className={styles.textCol}>
14
+ <div className={styles.title} data-testid='list-element-title'>
15
+ {title}
16
+ </div>
17
+ <div data-test-id='list-element-detail'>
18
+ {detail}
19
+ </div>
20
+ </div>
21
+ </div>
22
+ )
23
+ }
@@ -0,0 +1,23 @@
1
+ .container {
2
+ @apply flex flex-row my-4
3
+ }
4
+
5
+ .iconCol {
6
+ @apply flex flex-col w-6
7
+ }
8
+
9
+ .icon {
10
+ @apply text-light-green
11
+ }
12
+
13
+ .title {
14
+ @apply flex text-light-green font-bold w-full text-left
15
+ }
16
+
17
+ .textCol {
18
+ @apply flex flex-col text-white text-justify w-96
19
+ }
20
+
21
+ .detailSpace {
22
+ @apply w-6
23
+ }
@@ -0,0 +1,76 @@
1
+ import React from 'react'
2
+ export default function Logo ({ width, heigth }) {
3
+ return (
4
+ <svg
5
+ data-name='Layer 1'
6
+ xmlns='http://www.w3.org/2000/svg'
7
+ viewBox='0 0 2000 2000'
8
+ width={width}
9
+ height={heigth}
10
+ >
11
+ <path
12
+ d='M610.13 1336.34h1012v-.29c136.31-6.16 244.94-118.58 244.94-256.4 0-141.77-114.93-256.7-256.7-256.7a255.52 255.52 0 0 0-118.5 29c-42.1-97.31-127.47-171.53-231.86-198.36m-866.79 0C243.55 692.05 133 827.87 133 989.53s110.76 297.67 260.58 336'
13
+ style={{
14
+ strokeWidth: '67.96px',
15
+ stroke: '#FFFFFF',
16
+ fill: 'none',
17
+ strokeLinecap: 'round',
18
+ strokeLinejoin: 'round'
19
+ }}
20
+ />
21
+ <path
22
+ d='M661.56 916.05a322.34 322.34 0 0 0 164.19 44.64c178.89 0 323.91-145 323.91-323.92s-145-323.91-323.91-323.91-323.92 145-323.92 323.91v483.15'
23
+ style={{
24
+ stroke: '#21fa90',
25
+ strokeWidth: '67.96px',
26
+ fill: 'none',
27
+ strokeLinecap: 'round',
28
+ strokeLinejoin: 'round'
29
+ }}
30
+ />
31
+ <path
32
+ style={{
33
+ opacity: 0.2,
34
+ stroke: '#21fa90',
35
+ strokeWidth: '67.96px',
36
+ fill: 'none',
37
+ strokeLinecap: 'round',
38
+ strokeLinejoin: 'round'
39
+ }}
40
+ d='M501.83 1630.69v56.45'
41
+ />
42
+ <path
43
+ style={{
44
+ opacity: 0.4,
45
+ stroke: '#21fa90',
46
+ strokeWidth: '67.96px',
47
+ fill: 'none',
48
+ strokeLinecap: 'round',
49
+ strokeLinejoin: 'round'
50
+ }}
51
+ d='M502.33 1453.1v89.15'
52
+ />
53
+ <path
54
+ style={{
55
+ opacity: 0.7,
56
+ stroke: '#21fa90',
57
+ strokeWidth: '67.96px',
58
+ fill: 'none',
59
+ strokeLinecap: 'round',
60
+ strokeLinejoin: 'round'
61
+ }}
62
+ d='M501.83 1211.73v149.07'
63
+ />
64
+ <path
65
+ d='m793.55 866.39-135 47.43 59.44 126'
66
+ style={{
67
+ strokeWidth: '70.05px',
68
+ stroke: '#21fa90',
69
+ fill: 'none',
70
+ strokeLinecap: 'round',
71
+ strokeLinejoin: 'round'
72
+ }}
73
+ />
74
+ </svg>
75
+ )
76
+ }
@@ -6,26 +6,61 @@ import PullRequestIcon from './icons/PullRequestIcon'
6
6
  import styles from './PullRequest.module.css'
7
7
  import TextWithLabel from './TextWithLabel'
8
8
  import VerticalSeparator from './VerticalSeparator'
9
- export default function PullRequest ({ id, title, lastCommit, url }) {
9
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
10
+ import { faStopCircle, faRotateRight } from '@fortawesome/free-solid-svg-icons'
11
+ import Status from './Status'
12
+ export default function PullRequest ({ id, title, lastCommit, url, status, onStop, onReload }) {
13
+ let prStatusColor
14
+ if (status === 'available') {
15
+ prStatusColor = 'white'
16
+ } else if (status === 'running') {
17
+ prStatusColor = 'green'
18
+ } else if (status === 'unavailable') {
19
+ prStatusColor = 'white'
20
+ }
21
+
22
+ function handleStop () {
23
+ if (onStop) {
24
+ onStop()
25
+ }
26
+ }
27
+ function handleReload () {
28
+ if (onReload) {
29
+ onReload()
30
+ }
31
+ }
10
32
  return (
11
- <BorderedBox color='green'>
12
- <div className={styles.header}>
13
- <PullRequestIcon />
14
- <span className={styles.id}>#{id}</span>
15
- <span><a href={url} target='_blank' rel='noreferrer'>{url}</a></span>
16
- </div>
17
- <div className={styles.content}>
18
- <TextWithLabel label='PR Title' text={title} />
19
- </div>
33
+ <div className={status === 'unavailable' ? styles.unavailable : null}>
34
+ <BorderedBox color={prStatusColor}>
35
+ <div className={styles.header}>
36
+ <div className={styles.title}>
37
+ <PullRequestIcon />
38
+ <span className={styles.id}>#{id}</span>
39
+ <span><a href={url} target='_blank' rel='noreferrer'>{url}</a></span>
40
+ </div>
41
+ <div className={styles.status}>
42
+ <Status color={prStatusColor} status={status} />
43
+ <VerticalSeparator />
44
+ <div className={styles.icons}>
45
+ <FontAwesomeIcon icon={faStopCircle} mask={['circle']} onClick={handleStop} />
46
+ <FontAwesomeIcon icon={faRotateRight} mask={['circle']} onClick={handleReload} />
47
+ </div>
48
+ </div>
49
+ </div>
50
+ <div className={styles.content}>
51
+ <TextWithLabel label='PR Title' text={title} />
52
+ </div>
53
+
54
+ <HorizontalSeparator />
55
+ <div className={styles.footer}>
56
+ <TextWithLabel label='Last commit by' text={lastCommit.author} />
57
+ <VerticalSeparator />
58
+ <TextWithLabel label='Commit SHA' text={lastCommit.sha} />
59
+ <VerticalSeparator />
60
+ <TextWithLabel label='Last Update' text={lastCommit.date} />
61
+ </div>
62
+ </BorderedBox>
63
+ </div>
20
64
 
21
- <HorizontalSeparator />
22
- <div className={styles.footer}>
23
- <TextWithLabel label='Last commit by' text={lastCommit.author} />
24
- <VerticalSeparator />
25
- <TextWithLabel label='Commit SHA' text={lastCommit.sha} />
26
- <VerticalSeparator />
27
- <TextWithLabel label='Last Update' text={lastCommit.date} />
28
- </div>
29
- </BorderedBox>
30
65
  )
31
66
  }
@@ -5,8 +5,23 @@
5
5
  @apply text-xl text-main-green font-semibold;
6
6
  }
7
7
  .header {
8
- @apply flex items-center gap-x-4 mb-4;
8
+ @apply flex items-center justify-between mb-4;
9
+ }
10
+ .title {
11
+ @apply flex items-center gap-x-4;
9
12
  }
10
13
  .footer {
11
- @apply flex items-center
14
+ @apply flex items-center;
15
+ }
16
+ .status {
17
+ @apply flex items-center;
18
+ }
19
+ .unavailable {
20
+ @apply opacity-30;
21
+ }
22
+ .icons {
23
+ @apply flex justify-between gap-x-2;
24
+ }
25
+ .icons > *:hover {
26
+ @apply cursor-pointer;
12
27
  }
@@ -0,0 +1,26 @@
1
+ 'use strict'
2
+ import React from 'react'
3
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
4
+ import { faCircle } from '@fortawesome/free-solid-svg-icons'
5
+ export default function Status (props) {
6
+ const { color, status } = props
7
+
8
+ function getColorClass (color) {
9
+ switch (color) {
10
+ case 'green':
11
+ return 'text-main-green'
12
+ case 'red':
13
+ return 'text-error-red'
14
+ case 'white':
15
+ default:
16
+ return 'text-white'
17
+ }
18
+ }
19
+ const colorClass = getColorClass(color)
20
+ return (
21
+ <div className={colorClass}>
22
+ <FontAwesomeIcon icon={faCircle} size='2xs' className={`text-${colorClass} mr-2`} />
23
+ {status}
24
+ </div>
25
+ )
26
+ }
package/src/lib/utils.js CHANGED
@@ -9,6 +9,9 @@ function getColor (type, color) {
9
9
  case 'red':
10
10
  convertedColor = 'error-red'
11
11
  break
12
+ case 'white':
13
+ convertedColor = 'white'
14
+ break
12
15
  default:
13
16
  convertedColor = 'main-green'
14
17
  break
@@ -5,7 +5,10 @@ export default {
5
5
  component: BorderedBox,
6
6
  // More on argTypes: https://storybook.js.org/docs/react/api/argtypes
7
7
  argTypes: {
8
- color: { control: 'color' }
8
+ color: {
9
+ options: ['green', 'red', 'white'],
10
+ control: { type: ' radio' }
11
+ }
9
12
  }
10
13
  }
11
14
 
@@ -13,7 +16,7 @@ export default {
13
16
  const Template = (args) => <BorderedBox {...args}>Hello Platformatic</BorderedBox>
14
17
 
15
18
  export const Green = Template.bind({})
16
- // More on args: https://storybook.js.org/docs/react/writing-stories/args
19
+
17
20
  Green.args = {
18
21
  color: 'green'
19
22
  }
@@ -22,3 +25,9 @@ export const Red = Template.bind({})
22
25
  Red.args = {
23
26
  color: 'red'
24
27
  }
28
+
29
+ export const White = Template.bind({})
30
+
31
+ White.args = {
32
+ color: 'white'
33
+ }
@@ -0,0 +1,14 @@
1
+ import React from 'react'
2
+ import FollowUs from '../components/FollowUs'
3
+
4
+ export default {
5
+ title: 'Platformatic/FollowUs',
6
+ component: FollowUs
7
+ }
8
+
9
+ const Template = (args) => <FollowUs {...args} />
10
+
11
+ export const FollowUsDefault = Template.bind({})
12
+ FollowUsDefault.args = {
13
+ label: 'Follow us on'
14
+ }