@platformatic/ui-components 0.1.9 → 0.1.11

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 (140) hide show
  1. package/dist/assets/index.03c3e650.js +797 -0
  2. package/dist/assets/index.2277ba1a.css +1 -0
  3. package/dist/index.html +2 -2
  4. package/dist/main.css +27 -16
  5. package/index.js +9 -7
  6. package/package.json +17 -4
  7. package/src/components/ApiDetail.jsx +14 -10
  8. package/src/components/ApiDetail.module.css +3 -0
  9. package/src/components/ApiSummary.jsx +6 -5
  10. package/src/components/GHLoginButton.jsx +0 -1
  11. package/src/components/LoginButton.jsx +2 -2
  12. package/src/components/LoginButton.test.jsx +25 -0
  13. package/src/components/Main.jsx +2 -2
  14. package/src/components/PullRequest.jsx +6 -11
  15. package/src/components/PullRequest.module.css +2 -8
  16. package/src/components/TextWithLabel.jsx +11 -0
  17. package/src/components/TextWithLabel.module.css +9 -0
  18. package/src/stories/Button.jsx +11 -11
  19. package/src/stories/Button.stories.jsx +5 -5
  20. package/src/stories/SearchBar.stories.jsx +2 -1
  21. package/src/stories/TesxtWithLabel.stories.jsx +25 -0
  22. package/storybook-static/0.53758dff751ed2733218.manager.bundle.js +2 -0
  23. package/storybook-static/0.53758dff751ed2733218.manager.bundle.js.LICENSE.txt +8 -0
  24. package/storybook-static/1.9d13fd5be5dcb92d80a6.manager.bundle.js +1 -0
  25. package/storybook-static/5.410945cbec993452eed2.manager.bundle.js +2 -0
  26. package/storybook-static/5.410945cbec993452eed2.manager.bundle.js.LICENSE.txt +31 -0
  27. package/storybook-static/6.9ef90ca53c7deb768ec6.manager.bundle.js +1 -0
  28. package/storybook-static/7.47a294f1c5761295c4cb.manager.bundle.js +1 -0
  29. package/storybook-static/8.35b89a87599812bb0515.manager.bundle.js +2 -0
  30. package/storybook-static/8.35b89a87599812bb0515.manager.bundle.js.LICENSE.txt +12 -0
  31. package/storybook-static/9.d19ea1957ceb9893827c.manager.bundle.js +1 -0
  32. package/storybook-static/api-icon-closed.svg +6 -0
  33. package/storybook-static/api-icon.svg +9 -0
  34. package/storybook-static/assets/BorderedBox.stories.8d7654fe.css +1 -0
  35. package/storybook-static/assets/BorderedBox.stories.f9bbae3a.js +26 -0
  36. package/storybook-static/assets/BorderedBox.stories.f9bbae3a.js.map +1 -0
  37. package/storybook-static/assets/Button.7e305135.js +2 -0
  38. package/storybook-static/assets/Button.7e305135.js.map +1 -0
  39. package/storybook-static/assets/Button.bc1a867b.css +1 -0
  40. package/storybook-static/assets/Button.stories.8d745781.js +42 -0
  41. package/storybook-static/assets/Button.stories.8d745781.js.map +1 -0
  42. package/storybook-static/assets/Color-f953d088.a38b7cbd.js +3 -0
  43. package/storybook-static/assets/Color-f953d088.a38b7cbd.js.map +1 -0
  44. package/storybook-static/assets/GlobalScrollAreaStyles-8793ce4a.cf1537f5.js +2 -0
  45. package/storybook-static/assets/GlobalScrollAreaStyles-8793ce4a.cf1537f5.js.map +1 -0
  46. package/storybook-static/assets/Header.4fc7684b.css +1 -0
  47. package/storybook-static/assets/Header.cf6306b0.js +2 -0
  48. package/storybook-static/assets/Header.cf6306b0.js.map +1 -0
  49. package/storybook-static/assets/Header.stories.17ffb615.js +26 -0
  50. package/storybook-static/assets/Header.stories.17ffb615.js.map +1 -0
  51. package/storybook-static/assets/Introduction.stories.bc0afbca.js +105 -0
  52. package/storybook-static/assets/Introduction.stories.bc0afbca.js.map +1 -0
  53. package/storybook-static/assets/LoginButton.stories.10ae424d.js +776 -0
  54. package/storybook-static/assets/LoginButton.stories.10ae424d.js.map +1 -0
  55. package/storybook-static/assets/LoginButton.stories.edf744f1.css +1 -0
  56. package/storybook-static/assets/OverlayScrollbars-1355f44c.fce02603.js +18 -0
  57. package/storybook-static/assets/OverlayScrollbars-1355f44c.fce02603.js.map +1 -0
  58. package/storybook-static/assets/Page.stories.0913ba40.css +1 -0
  59. package/storybook-static/assets/Page.stories.76f6205c.js +84 -0
  60. package/storybook-static/assets/Page.stories.76f6205c.js.map +1 -0
  61. package/storybook-static/assets/Props.8d39388f.js +187 -0
  62. package/storybook-static/assets/Props.8d39388f.js.map +1 -0
  63. package/storybook-static/assets/WithTooltip-167e9982.ebb6fc8d.js +11 -0
  64. package/storybook-static/assets/WithTooltip-167e9982.ebb6fc8d.js.map +1 -0
  65. package/storybook-static/assets/client.177c4b3e.js +2 -0
  66. package/storybook-static/assets/client.177c4b3e.js.map +1 -0
  67. package/storybook-static/assets/code-brackets.9ef6443e.svg +1 -0
  68. package/storybook-static/assets/colors.ac9401f3.svg +1 -0
  69. package/storybook-static/assets/comments.f15a6837.svg +1 -0
  70. package/storybook-static/assets/config.3c15c657.js +74 -0
  71. package/storybook-static/assets/config.3c15c657.js.map +1 -0
  72. package/storybook-static/assets/config.be729574.js +2 -0
  73. package/storybook-static/assets/config.be729574.js.map +1 -0
  74. package/storybook-static/assets/direction.94a9917f.svg +1 -0
  75. package/storybook-static/assets/es.map.constructor.bc2f31bd.js +2 -0
  76. package/storybook-static/assets/es.map.constructor.bc2f31bd.js.map +1 -0
  77. package/storybook-static/assets/es.number.to-fixed.db152345.js +2 -0
  78. package/storybook-static/assets/es.number.to-fixed.db152345.js.map +1 -0
  79. package/storybook-static/assets/es.regexp.flags.ebae2243.js +2 -0
  80. package/storybook-static/assets/es.regexp.flags.ebae2243.js.map +1 -0
  81. package/storybook-static/assets/es.string.from-code-point.e6202842.js +2 -0
  82. package/storybook-static/assets/es.string.from-code-point.e6202842.js.map +1 -0
  83. package/storybook-static/assets/flow.275142c6.svg +1 -0
  84. package/storybook-static/assets/formatter-0d5cb0eb.aebafedb.js +297 -0
  85. package/storybook-static/assets/formatter-0d5cb0eb.aebafedb.js.map +1 -0
  86. package/storybook-static/assets/iframe.aab06436.js +153 -0
  87. package/storybook-static/assets/iframe.aab06436.js.map +1 -0
  88. package/storybook-static/assets/index.7df59845.js +2 -0
  89. package/storybook-static/assets/index.7df59845.js.map +1 -0
  90. package/storybook-static/assets/index.814c1dee.js +9 -0
  91. package/storybook-static/assets/index.814c1dee.js.map +1 -0
  92. package/storybook-static/assets/index.c7ae27b6.js +25 -0
  93. package/storybook-static/assets/index.c7ae27b6.js.map +1 -0
  94. package/storybook-static/assets/index.f76a1af3.js +2 -0
  95. package/storybook-static/assets/index.f76a1af3.js.map +1 -0
  96. package/storybook-static/assets/instrumenter.3eab649e.js +4 -0
  97. package/storybook-static/assets/instrumenter.3eab649e.js.map +1 -0
  98. package/storybook-static/assets/jsx-runtime.e2ea81d7.js +18 -0
  99. package/storybook-static/assets/jsx-runtime.e2ea81d7.js.map +1 -0
  100. package/storybook-static/assets/make-decorator.7fb2aeb9.js +3 -0
  101. package/storybook-static/assets/make-decorator.7fb2aeb9.js.map +1 -0
  102. package/storybook-static/assets/plugin.57148314.svg +1 -0
  103. package/storybook-static/assets/preview.0975d66e.js +3 -0
  104. package/storybook-static/assets/preview.0975d66e.js.map +1 -0
  105. package/storybook-static/assets/preview.38b4e44b.js +14 -0
  106. package/storybook-static/assets/preview.38b4e44b.js.map +1 -0
  107. package/storybook-static/assets/preview.4099ceae.js +2 -0
  108. package/storybook-static/assets/preview.4099ceae.js.map +1 -0
  109. package/storybook-static/assets/preview.43118df9.js +26 -0
  110. package/storybook-static/assets/preview.43118df9.js.map +1 -0
  111. package/storybook-static/assets/preview.4dfec941.js +2 -0
  112. package/storybook-static/assets/preview.4dfec941.js.map +1 -0
  113. package/storybook-static/assets/preview.b37e665b.js +397 -0
  114. package/storybook-static/assets/preview.b37e665b.js.map +1 -0
  115. package/storybook-static/assets/preview.b8ebcf81.css +1 -0
  116. package/storybook-static/assets/preview.cc910bd3.js +2 -0
  117. package/storybook-static/assets/preview.cc910bd3.js.map +1 -0
  118. package/storybook-static/assets/preview.f14efd1d.js +3 -0
  119. package/storybook-static/assets/preview.f14efd1d.js.map +1 -0
  120. package/storybook-static/assets/renderDocs.4312919d.js +2 -0
  121. package/storybook-static/assets/renderDocs.4312919d.js.map +1 -0
  122. package/storybook-static/assets/repo.fb4ece47.svg +1 -0
  123. package/storybook-static/assets/stackalt.2ad81543.svg +1 -0
  124. package/storybook-static/assets/string.6cc73134.js +2 -0
  125. package/storybook-static/assets/string.6cc73134.js.map +1 -0
  126. package/storybook-static/assets/syntaxhighlighter-b07b042a.04697fcf.js +16 -0
  127. package/storybook-static/assets/syntaxhighlighter-b07b042a.04697fcf.js.map +1 -0
  128. package/storybook-static/favicon.ico +0 -0
  129. package/storybook-static/iframe.html +486 -0
  130. package/storybook-static/index.html +59 -0
  131. package/storybook-static/main.1e2c996516b3b52674de.manager.bundle.js +1 -0
  132. package/storybook-static/project.json +1 -0
  133. package/storybook-static/runtime~main.904779a78e0adff8f659.manager.bundle.js +1 -0
  134. package/storybook-static/stories.json +1 -0
  135. package/storybook-static/vendors~main.ab297a8d7023057bddf0.manager.bundle.js +2 -0
  136. package/storybook-static/vendors~main.ab297a8d7023057bddf0.manager.bundle.js.LICENSE.txt +107 -0
  137. package/storybook-static/vite.svg +1 -0
  138. package/vitest.config.js +14 -0
  139. package/dist/assets/index.fcbe6de7.js +0 -797
  140. package/dist/platformatic-ui.css +0 -1
@@ -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}._bordered_1ece3_1{border-radius:.375rem;border-width:1px;border-style:solid;--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity));padding:.25rem .5rem;letter-spacing:.25rem;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}._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))}._stats-header_w45a1_1{display:flex;align-items:center;justify-content:space-between;font-weight:700}._stats-main-stat_w45a1_4{display:flex;align-items:center;justify-content:center;gap:1rem}._container_pqngl_1{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}._label_pqngl_4{margin-right:.5rem;font-weight:100}._text_pqngl_7{font-weight:600}._main_172rv_1{display:flex;flex-direction:column;row-gap:1rem}._footer_kawbk_1{margin-left:2.25rem;display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.5rem .5rem .5rem 1.25rem;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}._main_1uwu5_1{display:flex;align-items:center;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}._data_1uwu5_5{display:flex;width:100%;flex-direction:column}._status_1uwu5_9{justify-self:end}._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}._container_s2cim_1{display:flex;flex-direction:column}._id_s2cim_4{font-size:1.25rem;line-height:1.75rem;font-weight:600;--tw-text-opacity: 1;color:rgb(33 250 144 / var(--tw-text-opacity))}._header_s2cim_7{margin-bottom:1rem;display:flex;align-items:center;-moz-column-gap:1rem;column-gap:1rem}._footer_s2cim_10{display:flex;align-items:center}*,: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}}.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}.mr-5{margin-right:1.25rem}.ml-4{margin-left:1rem}.mr-1{margin-right:.25rem}.flex{display:flex}.grid{display:grid}.contents{display:contents}.h-screen{height:100vh}.w-full{width:100%}.w-9{width:2.25rem}.grow{flex-grow:1}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-around{justify-content:space-around}.gap-2{gap:.5rem}.gap-4{gap:1rem}.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}.text-xl{font-size:1.25rem;line-height:1.75rem}.font-semibold{font-weight:600}.font-bold{font-weight:700}.font-light{font-weight:300}.text-main-green{--tw-text-opacity: 1;color:rgb(33 250 144 / var(--tw-text-opacity))}.text-dark-green{--tw-text-opacity: 1;color:rgb(2 120 63 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-error-red{--tw-text-opacity: 1;color:rgb(250 33 33 / var(--tw-text-opacity))}@font-face{font-family:Montserrat;src:local("Montserrat"),url(./fonts/Montserrat/Montserrat-VariableFont_wght.ttf) format("truetype");font-weight:100 900}: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}.hover\:cursor-pointer:hover{cursor:pointer}
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.fcbe6de7.js"></script>
8
- <link rel="stylesheet" href="/platformatic-ui.css">
7
+ <script type="module" crossorigin src="/assets/index.03c3e650.js"></script>
8
+ <link rel="stylesheet" href="/assets/index.2277ba1a.css">
9
9
  </head>
10
10
  <body>
11
11
  <div id="root"></div>
package/dist/main.css CHANGED
@@ -559,6 +559,10 @@ video {
559
559
  margin-bottom: 1.25rem;
560
560
  }
561
561
 
562
+ .mr-2 {
563
+ margin-right: 0.5rem;
564
+ }
565
+
562
566
  .mr-5 {
563
567
  margin-right: 1.25rem;
564
568
  }
@@ -567,10 +571,6 @@ video {
567
571
  margin-left: 1rem;
568
572
  }
569
573
 
570
- .mr-2 {
571
- margin-right: 0.5rem;
572
- }
573
-
574
574
  .mr-1 {
575
575
  margin-right: 0.25rem;
576
576
  }
@@ -587,6 +587,10 @@ video {
587
587
  display: contents;
588
588
  }
589
589
 
590
+ .h-screen {
591
+ height: 100vh;
592
+ }
593
+
590
594
  .w-full {
591
595
  width: 100%;
592
596
  }
@@ -619,14 +623,14 @@ video {
619
623
  justify-content: space-around;
620
624
  }
621
625
 
622
- .gap-4 {
623
- gap: 1rem;
624
- }
625
-
626
626
  .gap-2 {
627
627
  gap: 0.5rem;
628
628
  }
629
629
 
630
+ .gap-4 {
631
+ gap: 1rem;
632
+ }
633
+
630
634
  .gap-10 {
631
635
  gap: 2.5rem;
632
636
  }
@@ -636,10 +640,6 @@ video {
636
640
  column-gap: 1rem;
637
641
  }
638
642
 
639
- .rounded-full {
640
- border-radius: 9999px;
641
- }
642
-
643
643
  .border {
644
644
  border-width: 1px;
645
645
  }
@@ -654,10 +654,6 @@ video {
654
654
  border-color: rgb(33 250 144 / var(--tw-border-opacity));
655
655
  }
656
656
 
657
- .p-2 {
658
- padding: 0.5rem;
659
- }
660
-
661
657
  .px-4 {
662
658
  padding-left: 1rem;
663
659
  padding-right: 1rem;
@@ -678,6 +674,21 @@ video {
678
674
  line-height: 1.75rem;
679
675
  }
680
676
 
677
+ .text-3xl {
678
+ font-size: 1.875rem;
679
+ line-height: 2.25rem;
680
+ }
681
+
682
+ .text-4xl {
683
+ font-size: 2.25rem;
684
+ line-height: 2.5rem;
685
+ }
686
+
687
+ .text-6xl {
688
+ font-size: 3.75rem;
689
+ line-height: 1;
690
+ }
691
+
681
692
  .font-semibold {
682
693
  font-weight: 600;
683
694
  }
package/index.js CHANGED
@@ -5,30 +5,32 @@ import ApiDetails from './src/components/ApiDetail'
5
5
  import BorderedBox from './src/components/BorderedBox'
6
6
  import BorderedText from './src/components/BorderedText'
7
7
  import HorizontalSeparator from './src/components/HorizontalSeparator'
8
+ import GHLoginButton from './src/components/GHLoginButton'
8
9
  import Layout from './src/components/layouts/Layout'
10
+ import LoginButton from './src/components/LoginButton'
9
11
  import TwoColumnsLayout from './src/components/layouts/TwoColumnsLayout'
10
12
  import Playground from './src/components/Playground'
11
- import Prs from './src/components/Pr'
13
+ import PullRequest from './src/components/PullRequest'
12
14
  import SearchBar from './src/components/SearchBar'
13
15
  import TabbedWindow from './src/components/TabbedWindow'
16
+ import TextWithLabel from './src/components/TextWithLabel'
14
17
  import Versions from './src/components/Versions'
15
18
  import VerticalSeparator from './src/components/VerticalSeparator'
16
- import LoginButton from './src/components/LoginButton'
17
- import GHLoginButton from './src/components/GHLoginButton'
18
19
  export {
19
20
  ApiSummary,
20
21
  ApiDetails,
21
22
  BorderedBox,
22
23
  BorderedText,
24
+ GHLoginButton,
23
25
  HorizontalSeparator,
24
26
  Layout,
27
+ LoginButton,
25
28
  TwoColumnsLayout,
26
29
  Playground,
27
- Prs,
30
+ PullRequest,
28
31
  SearchBar,
29
32
  TabbedWindow,
33
+ TextWithLabel,
30
34
  Versions,
31
- VerticalSeparator,
32
- LoginButton,
33
- GHLoginButton
35
+ VerticalSeparator
34
36
  }
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.9",
4
+ "version": "0.1.11",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
7
7
  "scripts": {
@@ -12,7 +12,9 @@
12
12
  "build-storybook": "NODE_OPTIONS='--openssl-legacy-provider' build-storybook",
13
13
  "tailwind:watch": "tailwindcss -i ./src/styles/main.css -o ./dist/main.css --watch",
14
14
  "tailwind": "tailwindcss -i ./src/styles/main.css -o ./dist/main.css",
15
- "lint": "standard --fix"
15
+ "lint": "standard src | snazzy",
16
+ "lint:fix": "standard src --fix",
17
+ "test": "vitest run"
16
18
  },
17
19
  "dependencies": {
18
20
  "@fortawesome/fontawesome-svg-core": "^6.2.0",
@@ -34,17 +36,28 @@
34
36
  "@storybook/builder-vite": "^0.2.4",
35
37
  "@storybook/react": "^6.5.12",
36
38
  "@storybook/testing-library": "^0.0.13",
39
+ "@testing-library/jest-dom": "^5.16.5",
40
+ "@testing-library/react": "^13.4.0",
37
41
  "@types/react": "^18.0.17",
38
42
  "@types/react-dom": "^18.0.6",
39
43
  "@vitejs/plugin-react": "^2.1.0",
40
44
  "babel-loader": "^8.2.5",
45
+ "jsdom": "^20.0.1",
46
+ "react-test-renderer": "^18.2.0",
47
+ "snazzy": "^9.0.0",
41
48
  "standard": "^17.0.0",
42
49
  "tailwindcss": "^3.1.8",
43
- "vite": "^3.1.0"
50
+ "vite": "^3.1.0",
51
+ "vitest": "^0.24.3"
44
52
  },
45
53
  "standard": {
46
- "global": [
54
+ "globals": [
55
+ "expect",
56
+ "test",
47
57
  "alert"
58
+ ],
59
+ "ignore": [
60
+ "/dist"
48
61
  ]
49
62
  }
50
63
  }
@@ -6,8 +6,10 @@ import BorderedText from './BorderedText'
6
6
  import HorizontalSeparator from './HorizontalSeparator'
7
7
  import TwoColumnsLayout from './layouts/TwoColumnsLayout'
8
8
  import StatsView from './StatsView'
9
+ import TextWithLabel from './TextWithLabel'
9
10
  import VerticalSeparator from './VerticalSeparator'
10
11
  import React from 'react'
12
+ import styles from './ApiDetail.module.css'
11
13
  export default function ApiDetails (props) {
12
14
  const { url, repository, version, openapi, graphql, source, lastDeploy } = props
13
15
  const requestStats = {
@@ -55,20 +57,22 @@ export default function ApiDetails (props) {
55
57
  return (
56
58
  <>
57
59
  <BorderedBox classes='api-data'>
58
- <div>
59
- Preview/Staging URL: <a href={url}>{url}</a>
60
- </div>
61
- <div>
62
- Repository: <a href={`https://github.com/${repository}`}>{repository}</a>
63
- </div>
64
- <div>
65
- Version: <BorderedText text={`v${version}`} />
60
+ <div className={styles.main}>
61
+ <div>
62
+ Preview/Staging URL: <a href={url}>{url}</a>
63
+ </div>
64
+ <div>
65
+ Repository: <a href={`https://github.com/${repository}`}>{repository}</a>
66
+ </div>
67
+ <div>
68
+ Version: <BorderedText text={`v${version}`} />
69
+ </div>
66
70
  </div>
67
71
  <HorizontalSeparator />
68
72
  <div className='flex gap-2 items-center'>
69
- <span>Generated with: {source}</span>
73
+ <TextWithLabel label='Generated With' text={source} />
70
74
  <VerticalSeparator />
71
- <span>Last deployed: {lastDeploy}</span>
75
+ <TextWithLabel label='Last deployed' text={lastDeploy} />
72
76
  </div>
73
77
  <div className='flex items-center'>
74
78
  <span className='mr-2'>Endpoints: </span><Endpoints graphql={graphql} openapi={openapi} />
@@ -0,0 +1,3 @@
1
+ .main {
2
+ @apply flex flex-col gap-y-4;
3
+ }
@@ -5,8 +5,9 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
5
5
  import { faLink } from '@fortawesome/free-solid-svg-icons'
6
6
  import ApiVersion from './Api/Version'
7
7
  import ApiIcon from './icons/ApiIcon'
8
- import ApiIconClosed from './Api/ApiIconClosed'
9
- import Separator from './VerticalSeparator'
8
+ import ApiIconClosed from './icons/ApiIconClosed'
9
+ import VerticalSeparator from './VerticalSeparator'
10
+ import TextWithLabel from './TextWithLabel'
10
11
  import ApiStatus from './Api/Status'
11
12
  import BorderedBox from './BorderedBox'
12
13
  import HorizontalSeparator from './HorizontalSeparator'
@@ -46,9 +47,9 @@ export default function ApiSummary (props) {
46
47
  </div>
47
48
 
48
49
  <div className='flex gap-2 items-center'>
49
- <span>Generated with: {source}</span>
50
- <Separator />
51
- <span>Last deployed: {lastDeploy}</span>
50
+ <TextWithLabel label='Generated With' text={source} />
51
+ <VerticalSeparator />
52
+ <TextWithLabel label='Last deployed' text={lastDeploy} />
52
53
  </div>
53
54
  </div>
54
55
 
@@ -1,5 +1,4 @@
1
1
  import React from 'react'
2
- import PropTypes from 'prop-types'
3
2
  import LoginButton from './LoginButton'
4
3
  import { faGithub } from '@fortawesome/free-brands-svg-icons'
5
4
 
@@ -1,5 +1,4 @@
1
1
  import React from 'react'
2
- import PropTypes from 'prop-types'
3
2
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
4
3
  import styles from './LoginButton.module.css'
5
4
 
@@ -8,9 +7,10 @@ export default function LoginButton ({ icon, label, onClick, ...props }) {
8
7
  <div className={styles.container} onClick={onClick}>
9
8
  <div
10
9
  className={styles.button}
10
+ data-testid='login-button'
11
11
  {...props}
12
12
  >
13
- {icon ? <FontAwesomeIcon icon={icon} className='mr-2' /> : null} {label}
13
+ {icon ? <FontAwesomeIcon icon={icon} className='mr-2' data-testid='login-button-icon' /> : null} {label}
14
14
  </div>
15
15
  </div>
16
16
  )
@@ -0,0 +1,25 @@
1
+ import React from 'react'
2
+ import { render, screen } from '@testing-library/react'
3
+ import '@testing-library/jest-dom/extend-expect'
4
+ import LoginButton from './LoginButton'
5
+ import { faTwitter } from '@fortawesome/free-brands-svg-icons'
6
+
7
+ test('<LoginButton /> with label', () => {
8
+ const label = 'My Button'
9
+ render(
10
+ <LoginButton label={label} />
11
+ )
12
+ expect(screen.getByTestId('login-button')).toHaveTextContent(label)
13
+ const icon = screen.queryByTestId('login-button-icon')
14
+ expect(icon).not.toBeInTheDocument()
15
+ })
16
+
17
+ test('<LoginButton /> with label and twitter icon', () => {
18
+ const label = 'My Twitter Button'
19
+ render(
20
+ <LoginButton label={label} icon={faTwitter} />
21
+ )
22
+ expect(screen.getByTestId('login-button')).toHaveTextContent(label)
23
+ const icon = screen.queryByTestId('login-button-icon')
24
+ expect(icon).toBeInTheDocument()
25
+ })
@@ -1,8 +1,8 @@
1
1
  'use strict'
2
2
 
3
3
  import SearchBar from './SearchBar'
4
- import Api from './Api'
5
4
  import ApiDetails from './ApiDetail'
5
+ import ApiSummary from './ApiSummary'
6
6
  import TabbedWindow from './TabbedWindow'
7
7
  import Prs from './PullRequest'
8
8
  import Playground from './Playground'
@@ -63,7 +63,7 @@ export default function Main () {
63
63
  <TabbedWindow
64
64
  tabs={tabs}
65
65
  />
66
- {apis.map((api) => { return (<Api key={api.id} data={api} />) })}
66
+ {apis.map((api) => { return (<ApiSummary key={api.id} data={api} />) })}
67
67
  </>
68
68
  )
69
69
  }
@@ -4,6 +4,7 @@ import BorderedBox from './BorderedBox'
4
4
  import HorizontalSeparator from './HorizontalSeparator'
5
5
  import PullRequestIcon from './icons/PullRequestIcon'
6
6
  import styles from './PullRequest.module.css'
7
+ import TextWithLabel from './TextWithLabel'
7
8
  import VerticalSeparator from './VerticalSeparator'
8
9
  export default function PullRequest ({ id, title, lastCommit, url }) {
9
10
  return (
@@ -14,22 +15,16 @@ export default function PullRequest ({ id, title, lastCommit, url }) {
14
15
  <span><a href={url} target='_blank' rel='noreferrer'>{url}</a></span>
15
16
  </div>
16
17
  <div className={styles.content}>
17
- <div>
18
- <span className={styles.label}>PR Title: </span>
19
- <span className={styles.value}>{title}</span>
20
- </div>
18
+ <TextWithLabel label='PR Title' text={title} />
21
19
  </div>
22
20
 
23
21
  <HorizontalSeparator />
24
- <div>
25
- <span className={styles.label}>Last commit by: </span>
26
- <span className={styles.value}>{lastCommit.author}</span>
22
+ <div className={styles.footer}>
23
+ <TextWithLabel label='Last commit by' text={lastCommit.author} />
27
24
  <VerticalSeparator />
28
- <span className={styles.label}>Commit SHA: </span>
29
- <span className={styles.value}>{lastCommit.sha}</span>
25
+ <TextWithLabel label='Commit SHA' text={lastCommit.sha} />
30
26
  <VerticalSeparator />
31
- <span className={styles.label}>Last Update: </span>
32
- <span className={styles.value}>{lastCommit.date}</span>
27
+ <TextWithLabel label='Last Update' text={lastCommit.date} />
33
28
  </div>
34
29
  </BorderedBox>
35
30
  )
@@ -7,12 +7,6 @@
7
7
  .header {
8
8
  @apply flex items-center gap-x-4 mb-4;
9
9
  }
10
- .label {
11
- @apply font-thin;
12
- }
13
- .value {
14
- @apply font-semibold;
15
- }
16
- .content {
17
-
10
+ .footer {
11
+ @apply flex items-center
18
12
  }
@@ -0,0 +1,11 @@
1
+ import React from 'react'
2
+ import styles from './TextWithLabel.module.css'
3
+ export default function TextWithLabel ({ label, text, children }) {
4
+ return (
5
+ <div className={styles.container}>
6
+ <span className={styles.label}>{label}:</span>
7
+ {text && <span className={styles.text}>{text}</span>}
8
+ {children && <span>{children}</span>}
9
+ </div>
10
+ )
11
+ }
@@ -0,0 +1,9 @@
1
+ .container {
2
+ @apply text-white
3
+ }
4
+ .label {
5
+ @apply font-thin mr-2;
6
+ }
7
+ .text {
8
+ @apply font-semibold;
9
+ }
@@ -1,23 +1,23 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import './button.css';
1
+ import React from 'react'
2
+ import PropTypes from 'prop-types'
3
+ import './button.css'
4
4
 
5
5
  /**
6
6
  * Primary UI component for user interaction
7
7
  */
8
8
  export const Button = ({ primary, backgroundColor, size, label, ...props }) => {
9
- const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
9
+ const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary'
10
10
  return (
11
11
  <button
12
- type="button"
12
+ type='button'
13
13
  className={['storybook-button', `storybook-button--${size}`, mode].join(' ')}
14
14
  style={backgroundColor && { backgroundColor }}
15
15
  {...props}
16
16
  >
17
17
  {label}
18
18
  </button>
19
- );
20
- };
19
+ )
20
+ }
21
21
 
22
22
  Button.propTypes = {
23
23
  /**
@@ -39,12 +39,12 @@ Button.propTypes = {
39
39
  /**
40
40
  * Optional click handler
41
41
  */
42
- onClick: PropTypes.func,
43
- };
42
+ onClick: PropTypes.func
43
+ }
44
44
 
45
45
  Button.defaultProps = {
46
46
  backgroundColor: null,
47
47
  primary: false,
48
48
  size: 'medium',
49
- onClick: undefined,
50
- };
49
+ onClick: undefined
50
+ }
@@ -9,7 +9,7 @@ export default {
9
9
  // More on argTypes: https://storybook.js.org/docs/react/api/argtypes
10
10
  argTypes: {
11
11
  backgroundColor: { control: 'color' }
12
- },
12
+ }
13
13
  }
14
14
 
15
15
  // More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
@@ -20,21 +20,21 @@ export const Primary = Template.bind({})
20
20
  Primary.args = {
21
21
  primary: true,
22
22
  label: 'Button'
23
- };
23
+ }
24
24
 
25
25
  export const Secondary = Template.bind({})
26
26
  Secondary.args = {
27
27
  label: 'Button'
28
- };
28
+ }
29
29
 
30
30
  export const Large = Template.bind({})
31
31
  Large.args = {
32
32
  size: 'large',
33
33
  label: 'Button'
34
- };
34
+ }
35
35
 
36
36
  export const Small = Template.bind({})
37
37
  Small.args = {
38
38
  size: 'small',
39
39
  label: 'Button'
40
- };
40
+ }
@@ -4,7 +4,8 @@ export default {
4
4
  title: 'Platformatic/SearchBar',
5
5
  component: SearchBar,
6
6
  argTypes: {
7
- color: { control: 'color' }
7
+ onChange: { control: 'function' },
8
+ onSubmit: { control: 'function' }
8
9
  }
9
10
  }
10
11
  const Template = (args) => {
@@ -0,0 +1,25 @@
1
+ 'use strict'
2
+
3
+ import TextWithLabel from '../components/TextWithLabel'
4
+ export default {
5
+ title: 'Platformatic/TextWithLabel',
6
+ component: TextWithLabel,
7
+ argTypes: {
8
+ label: { control: 'text' },
9
+ text: { control: 'text' }
10
+ }
11
+ }
12
+ const Template = (args) => <TextWithLabel {...args} />
13
+
14
+ export const Standard = Template.bind({})
15
+
16
+ Standard.args = {
17
+ label: 'Created By',
18
+ text: 'Platformatic Team'
19
+ }
20
+
21
+ export const WithLink = (args) => <TextWithLabel {...args}><a href='https://example.com'>Standard Link</a></TextWithLabel>
22
+
23
+ WithLink.args = {
24
+ label: 'External Link'
25
+ }