@platformatic/ui-components 0.1.18 → 0.1.21

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 (36) hide show
  1. package/.nvmrc +1 -0
  2. package/dist/assets/index.5ac5acb7.js +797 -0
  3. package/dist/assets/index.e8f4b797.css +1 -0
  4. package/dist/index.html +2 -2
  5. package/dist/main.css +13 -86
  6. package/index.js +4 -8
  7. package/package.json +2 -1
  8. package/src/components/DropDown.jsx +35 -0
  9. package/src/components/DropDown.module.css +23 -0
  10. package/src/components/ListElement.module.css +2 -2
  11. package/src/components/Loadable.jsx +34 -0
  12. package/src/components/Loadable.module.css +13 -0
  13. package/src/components/Main.jsx +0 -36
  14. package/src/components/icons/index.js +7 -0
  15. package/src/stories/DropDown.stories.jsx +43 -0
  16. package/src/stories/Loadable.stories.jsx +75 -0
  17. package/src/styles/main.css +0 -6
  18. package/dist/assets/index.d77cda9b.js +0 -797
  19. package/dist/assets/index.f6d5761c.css +0 -1
  20. package/src/components/Api/Endpoints.jsx +0 -14
  21. package/src/components/Api/Footer.jsx +0 -25
  22. package/src/components/Api/Footer.module.css +0 -3
  23. package/src/components/Api/Version.jsx +0 -8
  24. package/src/components/Api.module.css +0 -11
  25. package/src/components/ApiDetail.jsx +0 -40
  26. package/src/components/ApiDetail.module.css +0 -3
  27. package/src/components/ApiSummary.jsx +0 -77
  28. package/src/components/FrontpageBackground.jsx +0 -11
  29. package/src/components/FrontpageBackground.module.css +0 -10
  30. package/src/components/PullRequest.jsx +0 -66
  31. package/src/components/PullRequest.module.css +0 -27
  32. package/src/stories/ApiDetail.stories.jsx +0 -43
  33. package/src/stories/ApiSummary.stories.jsx +0 -43
  34. package/src/stories/Frontpage.stories.jsx +0 -42
  35. package/src/stories/FrontpageBackground.stories.jsx +0 -17
  36. package/src/stories/PullRequest.stories.jsx +0 -49
@@ -0,0 +1 @@
1
+ ._input_1v03r_1{box-sizing:border-box;display:flex;height:2.5rem;width:100%;justify-content:space-between;border-radius:.375rem;border-width:1px;border-style:solid;--tw-border-opacity: 1;border-color:rgb(33 250 144 / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}._input_1v03r_1>input:focus{outline:2px solid transparent;outline-offset:2px}._padded_650jz_1{padding:.625rem .5rem}._bordered_650jz_5{box-sizing:border-box;border-radius:.375rem;border-width:1px;border-style:solid}._tabbed-container_1r9tv_1{--tw-bg-opacity: 1;background-color:rgb(0 40 61 / var(--tw-bg-opacity))}._tabs-header_1r9tv_5{margin-bottom:1rem;display:flex;height:2rem;justify-content:flex-start;text-transform:uppercase;letter-spacing:.25rem;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}._tabs-header_1r9tv_5:hover{cursor:pointer}._tab_1r9tv_1{margin-right:1rem;min-width:105px;text-align:center}._selected-tab_1r9tv_11{font-weight:700;--tw-text-opacity: 1;color:rgb(33 250 144 / var(--tw-text-opacity));text-decoration-line:underline;text-underline-offset:8px}._tabs-content_1r9tv_15{height:100vh}._borderedBox_1fd0d_1{margin-bottom:1rem;flex:1 1 0%;row-gap:1rem;border-radius:.375rem;--tw-bg-opacity: 1;background-color:rgb(0 52 79 / var(--tw-bg-opacity));padding:1.25rem;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Montserrat}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%;margin-right:auto;margin-left:auto}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.relative{position:relative}.m-3{margin:.75rem}.my-4{margin-top:1rem;margin-bottom:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.mr-2{margin-right:.5rem}.flex{display:flex}.grid{display:grid}.h-screen{height:100vh}.grow{flex-grow:1}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.gap-10{gap:2.5rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.border{border-width:1px}.border-error-red{--tw-border-opacity: 1;border-color:rgb(250 33 33 / var(--tw-border-opacity))}.border-main-green{--tw-border-opacity: 1;border-color:rgb(33 250 144 / var(--tw-border-opacity))}.px-4{padding-left:1rem;padding-right:1rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-6xl{font-size:3.75rem;line-height:1}.text-2xl{font-size:1.5rem;line-height:2rem}.font-bold{font-weight:700}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-dark-green{--tw-text-opacity: 1;color:rgb(2 120 63 / var(--tw-text-opacity))}.text-main-green{--tw-text-opacity: 1;color:rgb(33 250 144 / var(--tw-text-opacity))}.text-error-red{--tw-text-opacity: 1;color:rgb(250 33 33 / var(--tw-text-opacity))}:root{--tw-bg-opacity: 1;background-color:rgb(0 40 61 / var(--tw-bg-opacity));font-family:Montserrat}a{--tw-text-opacity: 1;color:rgb(37 136 228 / var(--tw-text-opacity))}input{background-color:transparent}
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.d77cda9b.js"></script>
8
- <link rel="stylesheet" href="/assets/index.f6d5761c.css">
7
+ <script type="module" crossorigin src="/assets/index.5ac5acb7.js"></script>
8
+ <link rel="stylesheet" href="/assets/index.e8f4b797.css">
9
9
  </head>
10
10
  <body>
11
11
  <div id="root"></div>
package/dist/main.css CHANGED
@@ -540,8 +540,8 @@ video {
540
540
  }
541
541
  }
542
542
 
543
- .static {
544
- position: static;
543
+ .relative {
544
+ position: relative;
545
545
  }
546
546
 
547
547
  .m-3 {
@@ -553,11 +553,6 @@ video {
553
553
  margin-bottom: 1rem;
554
554
  }
555
555
 
556
- .my-8 {
557
- margin-top: 2rem;
558
- margin-bottom: 2rem;
559
- }
560
-
561
556
  .mx-auto {
562
557
  margin-left: auto;
563
558
  margin-right: auto;
@@ -572,22 +567,6 @@ video {
572
567
  margin-right: 0.5rem;
573
568
  }
574
569
 
575
- .mr-5 {
576
- margin-right: 1.25rem;
577
- }
578
-
579
- .ml-4 {
580
- margin-left: 1rem;
581
- }
582
-
583
- .mt-24 {
584
- margin-top: 6rem;
585
- }
586
-
587
- .mb-16 {
588
- margin-bottom: 4rem;
589
- }
590
-
591
570
  .flex {
592
571
  display: flex;
593
572
  }
@@ -600,18 +579,6 @@ video {
600
579
  height: 100vh;
601
580
  }
602
581
 
603
- .w-full {
604
- width: 100%;
605
- }
606
-
607
- .w-9 {
608
- width: 2.25rem;
609
- }
610
-
611
- .w-80 {
612
- width: 20rem;
613
- }
614
-
615
582
  .grow {
616
583
  flex-grow: 1;
617
584
  }
@@ -624,26 +591,6 @@ video {
624
591
  flex-direction: column;
625
592
  }
626
593
 
627
- .place-items-center {
628
- place-items: center;
629
- }
630
-
631
- .items-center {
632
- align-items: center;
633
- }
634
-
635
- .justify-between {
636
- justify-content: space-between;
637
- }
638
-
639
- .gap-2 {
640
- gap: 0.5rem;
641
- }
642
-
643
- .gap-4 {
644
- gap: 1rem;
645
- }
646
-
647
594
  .gap-10 {
648
595
  gap: 2.5rem;
649
596
  }
@@ -677,9 +624,9 @@ video {
677
624
  line-height: 2rem;
678
625
  }
679
626
 
680
- .text-5xl {
681
- font-size: 3rem;
682
- line-height: 1;
627
+ .text-3xl {
628
+ font-size: 1.875rem;
629
+ line-height: 2.25rem;
683
630
  }
684
631
 
685
632
  .text-4xl {
@@ -687,9 +634,9 @@ video {
687
634
  line-height: 2.5rem;
688
635
  }
689
636
 
690
- .text-3xl {
691
- font-size: 1.875rem;
692
- line-height: 2.25rem;
637
+ .text-5xl {
638
+ font-size: 3rem;
639
+ line-height: 1;
693
640
  }
694
641
 
695
642
  .text-6xl {
@@ -697,23 +644,10 @@ video {
697
644
  line-height: 1;
698
645
  }
699
646
 
700
- .font-semibold {
701
- font-weight: 600;
702
- }
703
-
704
647
  .font-bold {
705
648
  font-weight: 700;
706
649
  }
707
650
 
708
- .font-light {
709
- font-weight: 300;
710
- }
711
-
712
- .text-main-green {
713
- --tw-text-opacity: 1;
714
- color: rgb(33 250 144 / var(--tw-text-opacity));
715
- }
716
-
717
651
  .text-white {
718
652
  --tw-text-opacity: 1;
719
653
  color: rgb(255 255 255 / var(--tw-text-opacity));
@@ -724,17 +658,14 @@ video {
724
658
  color: rgb(2 120 63 / var(--tw-text-opacity));
725
659
  }
726
660
 
727
- .text-error-red {
661
+ .text-main-green {
728
662
  --tw-text-opacity: 1;
729
- color: rgb(250 33 33 / var(--tw-text-opacity));
663
+ color: rgb(33 250 144 / var(--tw-text-opacity));
730
664
  }
731
665
 
732
- @font-face {
733
- font-family: 'Montserrat';
734
-
735
- src: local('Montserrat'), url(./fonts/Montserrat/Montserrat-VariableFont_wght.ttf) format('truetype');
736
-
737
- font-weight: 100 900;
666
+ .text-error-red {
667
+ --tw-text-opacity: 1;
668
+ color: rgb(250 33 33 / var(--tw-text-opacity));
738
669
  }
739
670
 
740
671
  :root {
@@ -750,8 +681,4 @@ a {
750
681
 
751
682
  input {
752
683
  background-color: transparent;
753
- }
754
-
755
- .hover\:cursor-pointer:hover {
756
- cursor: pointer;
757
684
  }
package/index.js CHANGED
@@ -1,16 +1,15 @@
1
1
  'use strict'
2
2
 
3
- import ApiSummary from './src/components/ApiSummary'
4
- import ApiDetails from './src/components/ApiDetail'
5
3
  import BorderedBox from './src/components/BorderedBox'
6
4
  import BorderedText from './src/components/BorderedText'
7
5
  import Box from './src/components/Box'
8
6
  import Button from './src/components/Button'
9
7
  import DetailedMetric from './src/components/DetailedMetric'
8
+ import DropDown from './src/components/DropDown'
10
9
  import FollowUs from './src/components/FollowUs'
11
- import FrontpageBackground from './src/components/FrontpageBackground'
12
10
  import GHLoginButton from './src/components/GHLoginButton'
13
11
  import HorizontalSeparator from './src/components/HorizontalSeparator'
12
+ import Icons from './src/components/icons'
14
13
  import Input from './src/components/Input'
15
14
  import Layout from './src/components/layouts/Layout'
16
15
  import List from './src/components/List'
@@ -18,7 +17,6 @@ import ListElement from './src/components/ListElement'
18
17
  import LoginButton from './src/components/LoginButton'
19
18
  import Logo from './src/components/Logo'
20
19
  import Playground from './src/components/Playground'
21
- import PullRequest from './src/components/PullRequest'
22
20
  import SearchBar from './src/components/SearchBar'
23
21
  import SimpleMetric from './src/components/SimpleMetric'
24
22
  import Status from './src/components/Status'
@@ -28,17 +26,16 @@ import TwoColumnsLayout from './src/components/layouts/TwoColumnsLayout'
28
26
  import Versions from './src/components/Versions'
29
27
  import VerticalSeparator from './src/components/VerticalSeparator'
30
28
  export {
31
- ApiSummary,
32
- ApiDetails,
33
29
  BorderedBox,
34
30
  BorderedText,
35
31
  Box,
36
32
  Button,
37
33
  DetailedMetric,
34
+ DropDown,
38
35
  FollowUs,
39
- FrontpageBackground,
40
36
  HorizontalSeparator,
41
37
  GHLoginButton,
38
+ Icons,
42
39
  Input,
43
40
  Layout,
44
41
  List,
@@ -46,7 +43,6 @@ export {
46
43
  LoginButton,
47
44
  Logo,
48
45
  Playground,
49
- PullRequest,
50
46
  SearchBar,
51
47
  SimpleMetric,
52
48
  Status,
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.18",
4
+ "version": "0.1.21",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
7
7
  "scripts": {
@@ -27,6 +27,7 @@
27
27
  "react": "^18.2.0",
28
28
  "react-dom": "^18.2.0",
29
29
  "react-tooltip": "^4.4.3",
30
+ "spinners-react": "^1.0.7",
30
31
  "storybook-tailwind-foundations": "^1.1.2"
31
32
  },
32
33
  "devDependencies": {
@@ -0,0 +1,35 @@
1
+ 'use strict'
2
+
3
+ import React, { useState } from 'react'
4
+ import styles from './DropDown.module.css'
5
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
6
+ import { faChevronLeft, faChevronDown } from '@fortawesome/free-solid-svg-icons'
7
+ export default function DropDown (props) {
8
+ const { header, items, align = 'left' } = props
9
+ const [open, setOpen] = useState(false)
10
+ function handleOpen () {
11
+ setOpen(!open)
12
+ }
13
+ return (
14
+ <div className={`${styles.dropDown} ${styles[align]}`}>
15
+ <span className={styles.header} onClick={handleOpen}>
16
+ {header}
17
+ {!open && <FontAwesomeIcon className={styles.arrow} icon={faChevronLeft} />}
18
+ {open && <FontAwesomeIcon className={styles.arrow} icon={faChevronDown} />}
19
+ </span>
20
+ {open && (
21
+ <div className={styles.menu}>
22
+ {items.map((item, index) => {
23
+ return (
24
+ <div className={styles.item} key={index}>
25
+ {item}
26
+ </div>
27
+ )
28
+ })}
29
+ </div>
30
+ )}
31
+
32
+ </div>
33
+
34
+ )
35
+ }
@@ -0,0 +1,23 @@
1
+ .dropDown {
2
+ @apply mx-4 relative flex flex-col;
3
+ }
4
+
5
+ .right {
6
+ @apply items-end;
7
+ }
8
+
9
+ .left {
10
+ @apply items-start;
11
+ }
12
+ .arrow {
13
+ @apply ml-2;
14
+ }
15
+ .header {
16
+ @apply hover:cursor-pointer
17
+ }
18
+ .menu {
19
+ @apply absolute border-solid border border-main-green p-4 bg-dark-blue mt-8 rounded-md;
20
+ }
21
+ .item {
22
+ @apply mb-2
23
+ }
@@ -11,11 +11,11 @@
11
11
  }
12
12
 
13
13
  .title {
14
- @apply flex text-light-green font-bold w-full text-left
14
+ @apply flex text-light-green font-bold w-full
15
15
  }
16
16
 
17
17
  .textCol {
18
- @apply flex flex-col text-white text-justify w-96
18
+ @apply flex flex-col text-white text-justify w-full
19
19
  }
20
20
 
21
21
  .detailSpace {
@@ -0,0 +1,34 @@
1
+ import React, { useState, cloneElement, Children } from 'react'
2
+ import styles from './Loadable.module.css'
3
+ import { SpinnerCircular } from 'spinners-react'
4
+
5
+ export default function List ({ ...props }) {
6
+ // If null then loading not started, if true then loading, if false then done loading
7
+ const [loading, setLoading] = useState(null)
8
+ const startLoading = (reset = false) => {
9
+ // We can start only once (unless we reset)
10
+ if (loading === null || reset) {
11
+ setLoading(true)
12
+ }
13
+ }
14
+ const stopLoading = () => setLoading(false)
15
+
16
+ const children = Children.map(props.children, child => cloneElement(child, { startLoading, stopLoading }))
17
+
18
+ return (
19
+ <div className={styles.container} data-testid='loadable'>
20
+ {
21
+ loading
22
+ ? (
23
+ <>
24
+ <div data-testid='loadable-content' className={styles.relative}>
25
+ <SpinnerCircular className={styles.spinner} thickness={180} size={60} />
26
+ <div className={styles.blurred}>{children}</div>
27
+ </div>
28
+ </>
29
+ )
30
+ : <>{children}</>
31
+ }
32
+ </div>
33
+ )
34
+ }
@@ -0,0 +1,13 @@
1
+
2
+ .container {
3
+ @apply relative
4
+ }
5
+
6
+ .spinner {
7
+ @apply z-50 absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2
8
+ }
9
+
10
+ .blurred {
11
+ @apply blur-sm
12
+ }
13
+
@@ -1,48 +1,13 @@
1
1
  'use strict'
2
2
 
3
3
  import SearchBar from './SearchBar'
4
- import ApiDetails from './ApiDetail'
5
- import ApiSummary from './ApiSummary'
6
4
  import TabbedWindow from './TabbedWindow'
7
- import Prs from './PullRequest'
8
5
  import Playground from './Playground'
9
6
  import Versions from './Versions'
10
7
  import React, { useState } from 'react'
11
8
  export default function Main () {
12
9
  const [currentSearch, setCurrentSearch] = useState('')
13
- const apis = [
14
- {
15
- id: 1,
16
- name: 'api-online',
17
- version: '1.2.3',
18
- source: 'Platformatic DB',
19
- lastDeploy: '2022-10-10',
20
- graphql: true,
21
- openapi: true,
22
- online: true,
23
- url: 'https://example.com',
24
- repository: 'platformatic/example'
25
- },
26
- {
27
- id: 2,
28
- name: 'api-offline',
29
- version: '1.2.3',
30
- source: 'Platformatic DB',
31
- lastDeploy: '2022-10-10',
32
- graphql: true,
33
- openapi: true,
34
- online: false
35
- }
36
- ]
37
10
  const tabs = [
38
- {
39
- label: 'Overview',
40
- component: () => <ApiDetails data={apis[0]} />
41
- },
42
- {
43
- label: 'PRs',
44
- component: () => <Prs />
45
- },
46
11
  {
47
12
  label: 'Playground',
48
13
  component: () => <Playground />
@@ -63,7 +28,6 @@ export default function Main () {
63
28
  <TabbedWindow
64
29
  tabs={tabs}
65
30
  />
66
- {apis.map((api) => { return (<ApiSummary key={api.id} data={api} />) })}
67
31
  </>
68
32
  )
69
33
  }
@@ -0,0 +1,7 @@
1
+ import ApiIcon from './ApiIcon'
2
+ import ApiIconClosed from './ApiIconClosed'
3
+ import PullRequestIcon from './PullRequestIcon'
4
+
5
+ export default {
6
+ ApiIcon, ApiIconClosed, PullRequestIcon
7
+ }
@@ -0,0 +1,43 @@
1
+ 'use strict'
2
+ import DropDown from '../components/DropDown'
3
+ export default {
4
+ title: 'Platformatic/DropDown',
5
+ component: DropDown,
6
+ decorators: [dd => <div className='text-white'>{dd()}</div>]
7
+ }
8
+
9
+ const Template = (args) => <DropDown {...args} />
10
+ export const DefaultAlignment = Template.bind({})
11
+
12
+ DefaultAlignment.args = {
13
+ header: 'My Menu',
14
+ items: [
15
+ <span key='1'>Menu 1</span>,
16
+ <span key='2'>Menu 2</span>,
17
+ <span key='3'>This is a very long menu item</span>
18
+ ]
19
+ }
20
+
21
+ export const AlignRight = Template.bind({})
22
+
23
+ AlignRight.args = {
24
+ header: 'My Menu',
25
+ align: 'right',
26
+ items: [
27
+ <span key='1'>Menu 1</span>,
28
+ <span key='2'>Menu 2</span>,
29
+ <span key='3'>This is a very long menu item</span>
30
+ ]
31
+ }
32
+
33
+ export const AlignLeft = Template.bind({})
34
+
35
+ AlignLeft.args = {
36
+ header: 'My Menu',
37
+ align: 'left',
38
+ items: [
39
+ <span key='1'>Menu 1</span>,
40
+ <span key='2'>Menu 2</span>,
41
+ <span key='3'>This is a very long menu item</span>
42
+ ]
43
+ }
@@ -0,0 +1,75 @@
1
+ import React, { useEffect } from 'react'
2
+ import Loadable from '../components/Loadable'
3
+ import BorderedBox from '../components/BorderedBox'
4
+
5
+ const loremIpsum = `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus est nisl, maximus aliquet urna eu, consequat semper nisi. Nam vel elit feugiat dui congue elementum. Sed turpis urna, egestas at pharetra et, lacinia ac mauris. Pellentesque cursus, ipsum nec malesuada ornare, dui purus ultrices elit, non blandit nisi quam non nisi. Suspendisse sapien leo, ultricies pretium vulputate sed, malesuada sed justo. Suspendisse euismod erat ut lacus feugiat malesuada. In tempor a eros et egestas. Nam pretium dolor sollicitudin, cursus sem vitae, elementum enim. Nam in nisi ipsum.
6
+ `
7
+
8
+ export default {
9
+ title: 'Platformatic/Loadable',
10
+ component: Loadable
11
+ }
12
+
13
+ const ContentThatLoads = ({ startLoading }) => {
14
+ startLoading()
15
+ return <BorderedBox>{loremIpsum}</BorderedBox>
16
+ }
17
+
18
+ export const Loading = args =>
19
+ <Loadable {...args}>
20
+ <ContentThatLoads />
21
+ </Loadable>
22
+ Loading.args = {}
23
+
24
+ const ContentThatLoadsAndStops = ({ startLoading, stopLoading }) => {
25
+ useEffect(() => {
26
+ startLoading()
27
+ const timer = setTimeout(() => {
28
+ stopLoading()
29
+ }, 2000)
30
+ return () => clearTimeout(timer)
31
+ }, [])
32
+ return <BorderedBox>{loremIpsum}</BorderedBox>
33
+ }
34
+
35
+ export const LoadsAndStops = args => {
36
+ return (
37
+ <Loadable {...args}>
38
+ <ContentThatLoadsAndStops />
39
+ </Loadable>
40
+ )
41
+ }
42
+ LoadsAndStops.args = {}
43
+
44
+ export const LoadsAndStops2 = args => {
45
+ return (
46
+ <Loadable {...args}>
47
+ <ContentThatLoadsAndStops />
48
+ <ContentThatLoadsAndStops />
49
+ </Loadable>
50
+ )
51
+ }
52
+ LoadsAndStops2.args = {}
53
+
54
+ const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
55
+ const ContentThatToggle = ({ startLoading, stopLoading }) => {
56
+ useEffect(() => {
57
+ startLoading()
58
+ const toggle = async () => {
59
+ await sleep(1000)
60
+ stopLoading()
61
+ await sleep(1000)
62
+ startLoading(true)
63
+ }
64
+ toggle()
65
+ }, [])
66
+ return <BorderedBox>{loremIpsum}</BorderedBox>
67
+ }
68
+ export const Toggle = args => {
69
+ return (
70
+ <Loadable {...args}>
71
+ <ContentThatToggle />
72
+ </Loadable>
73
+ )
74
+ }
75
+ Toggle.args = {}
@@ -2,12 +2,6 @@
2
2
  @tailwind components;
3
3
  @tailwind utilities;
4
4
 
5
- @font-face {
6
- font-family: 'Montserrat';
7
- src: local('Montserrat'), url(./fonts/Montserrat/Montserrat-VariableFont_wght.ttf) format('truetype');
8
- font-weight: 100 900;
9
- }
10
-
11
5
  :root {
12
6
  @apply bg-main-dark-blue;
13
7
  font-family: 'Montserrat';