@platformatic/ui-components 0.1.48 → 0.1.50
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/.github/workflows/ci.yml +26 -26
- package/.nvmrc +1 -1
- package/LICENSE +201 -201
- package/README.md +30 -30
- package/fonts/Montserrat/README.txt +81 -81
- package/index.html +12 -12
- package/index.js +71 -71
- package/package.json +76 -76
- package/postcss.config.cjs +8 -8
- package/public/api-icon-closed.svg +6 -6
- package/public/api-icon.svg +9 -9
- package/src/App.jsx +12 -12
- package/src/components/BorderedBox.jsx +18 -18
- package/src/components/BorderedBox.module.css +8 -8
- package/src/components/BorderedText.jsx +8 -8
- package/src/components/BorderedText.module.css +2 -2
- package/src/components/Box.jsx +14 -14
- package/src/components/Box.module.css +7 -7
- package/src/components/Button.jsx +95 -95
- package/src/components/Button.module.css +127 -127
- package/src/components/ButtonFullRounded.jsx +17 -17
- package/src/components/ButtonFullRounded.module.css +28 -28
- package/src/components/Checkbox.jsx +11 -11
- package/src/components/Checkbox.module.css +18 -18
- package/src/components/Common.module.css +28 -28
- package/src/components/DetailedMetric.jsx +32 -32
- package/src/components/DetailedMetric.module.css +2 -2
- package/src/components/DropDown.jsx +36 -36
- package/src/components/DropDown.module.css +27 -27
- package/src/components/FollowUs.jsx +35 -35
- package/src/components/FollowUs.module.css +11 -11
- package/src/components/GHLoginButton.jsx +14 -14
- package/src/components/HorizontalSeparator.jsx +15 -15
- package/src/components/HorizontalSeparator.module.css +26 -26
- package/src/components/InfoBox.jsx +50 -50
- package/src/components/InfoBox.module.css +5 -5
- package/src/components/List.jsx +20 -20
- package/src/components/List.module.css +11 -11
- package/src/components/ListElement.jsx +23 -23
- package/src/components/ListElement.module.css +23 -23
- package/src/components/Loadable.jsx +34 -34
- package/src/components/Loadable.module.css +13 -13
- package/src/components/Loader.jsx +22 -22
- package/src/components/Loader.module.css +13 -13
- package/src/components/LoginButton.jsx +17 -17
- package/src/components/LoginButton.module.css +7 -7
- package/src/components/LoginButton.test.jsx +25 -25
- package/src/components/Logo.jsx +62 -62
- package/src/components/Logo.module.css +5 -5
- package/src/components/Main.jsx +33 -33
- package/src/components/MetricValue.jsx +15 -15
- package/src/components/MetricValue.module.css +9 -9
- package/src/components/Modal.jsx +93 -93
- package/src/components/Modal.module.css +50 -50
- package/src/components/PlatformaticIcon.jsx +57 -57
- package/src/components/PlatformaticIcon.module.css +2 -2
- package/src/components/Playground.jsx +9 -9
- package/src/components/SearchBar.jsx +63 -63
- package/src/components/SearchBar.module.css +20 -20
- package/src/components/Sidebar.jsx +153 -153
- package/src/components/Sidebar.module.css +66 -66
- package/src/components/SimpleMetric.jsx +28 -28
- package/src/components/SimpleMetric.module.css +6 -6
- package/src/components/Status.jsx +26 -26
- package/src/components/TabbedWindow.jsx +39 -39
- package/src/components/TabbedWindow.module.css +16 -16
- package/src/components/TextWithLabel.jsx +11 -11
- package/src/components/TextWithLabel.module.css +8 -8
- package/src/components/Versions.jsx +9 -9
- package/src/components/VerticalSeparator.jsx +5 -5
- package/src/components/forms/Field.jsx +53 -20
- package/src/components/forms/Field.module.css +23 -17
- package/src/components/forms/Input.jsx +80 -87
- package/src/components/forms/Input.module.css +28 -28
- package/src/components/forms/Preview.jsx +75 -77
- package/src/components/forms/Preview.module.css +14 -14
- package/src/components/forms/ToggleSwitch.jsx +18 -18
- package/src/components/forms/ToggleSwitch.module.css +42 -42
- package/src/components/forms/index.js +8 -8
- package/src/components/icons/ApiEmptyIcon.jsx +107 -107
- package/src/components/icons/ApiIcon.jsx +29 -29
- package/src/components/icons/ApiIconClosed.jsx +19 -19
- package/src/components/icons/AppEmptyIcon.jsx +94 -94
- package/src/components/icons/AppIcon.jsx +38 -38
- package/src/components/icons/AppListIcon.jsx +73 -73
- package/src/components/icons/Calendar1Icon.jsx +54 -54
- package/src/components/icons/Calendar7Icon.jsx +55 -55
- package/src/components/icons/CalendarIcon.jsx +56 -56
- package/src/components/icons/CircleAddIcon.jsx +40 -40
- package/src/components/icons/CircleBackIcon.jsx +51 -51
- package/src/components/icons/CircleCheckMarkIcon.jsx +66 -0
- package/src/components/icons/CircleCloseHoverIcon.jsx +42 -42
- package/src/components/icons/CircleCloseIcon.jsx +32 -32
- package/src/components/icons/CircleExclamationIcon.jsx +29 -29
- package/src/components/icons/CloseIcon.jsx +31 -31
- package/src/components/icons/CopyIcon.jsx +75 -46
- package/src/components/icons/CreatedWorkspaceIcon.jsx +70 -70
- package/src/components/icons/DynamicWorkspaceIcon.jsx +125 -125
- package/src/components/icons/EditIcon.jsx +38 -0
- package/src/components/icons/GearIcon.jsx +40 -40
- package/src/components/icons/Icons.module.css +29 -29
- package/src/components/icons/LiveIcon.jsx +43 -43
- package/src/components/icons/MetricsIcon.jsx +52 -52
- package/src/components/icons/PlayIcon.jsx +20 -20
- package/src/components/icons/PullRequestIcon.jsx +35 -35
- package/src/components/icons/StaticWorkspaceIcon.jsx +119 -119
- package/src/components/icons/StopIcon.jsx +21 -21
- package/src/components/icons/TerminalIcon.jsx +22 -22
- package/src/components/icons/TriangleExclamationIcon.jsx +26 -26
- package/src/components/icons/UpgradeIcon.jsx +48 -48
- package/src/components/icons/index.js +63 -59
- package/src/components/layouts/Layout.jsx +11 -11
- package/src/components/layouts/TwoColumnsLayout.jsx +12 -12
- package/src/components/layouts/TwoColumnsLayout.module.css +9 -9
- package/src/hooks/useEscapeKey.js +20 -20
- package/src/lib/utils.js +23 -23
- package/src/main.jsx +9 -9
- package/src/stories/BorderedBox.stories.jsx +33 -33
- package/src/stories/BorderedText.stories.jsx +24 -24
- package/src/stories/Button.stories.jsx +114 -114
- package/src/stories/ButtonFullRounded.stories.jsx +61 -61
- package/src/stories/Checkbox.stories.jsx +27 -27
- package/src/stories/DetailedMetric.stories.jsx +33 -33
- package/src/stories/DropDown.stories.jsx +62 -62
- package/src/stories/FollowUs.stories.jsx +14 -14
- package/src/stories/GHLoginButton.stories.jsx +14 -14
- package/src/stories/HorizontalSeparator.stories.jsx +12 -12
- package/src/stories/InfoBox.stories.jsx +46 -46
- package/src/stories/Introduction.stories.mdx +211 -211
- package/src/stories/List.stories.jsx +29 -29
- package/src/stories/ListElement.stories.jsx +15 -15
- package/src/stories/Loadable.stories.jsx +75 -75
- package/src/stories/Loader.stories.jsx +44 -44
- package/src/stories/LoginButton.stories.jsx +15 -15
- package/src/stories/Logo.stories.jsx +17 -17
- package/src/stories/Modal.stories.jsx +100 -100
- package/src/stories/PlatformaticIcon.stories.jsx +51 -35
- package/src/stories/SearchBar.stories.jsx +28 -28
- package/src/stories/Sidebar.stories.jsx +61 -61
- package/src/stories/SimpleMetric.stories.jsx +41 -41
- package/src/stories/Status.stories.jsx +31 -31
- package/src/stories/TextWithLabel.stories.jsx +25 -25
- package/src/stories/TwoColumnsLayout.stories.jsx +42 -42
- package/src/stories/forms/Field.stories.jsx +89 -81
- package/src/stories/forms/Input.stories.jsx +89 -69
- package/src/stories/forms/Preview.stories.jsx +57 -57
- package/src/stories/forms/ToggleSwitch.stories.jsx +15 -15
- package/src/stories/icons/Icons.stories.jsx +74 -74
- package/src/styles/main.css +15 -15
- package/tailwind.config.cjs +60 -60
- package/vite.config.js +6 -6
- package/vitest.config.js +14 -14
|
@@ -1,23 +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
|
-
}
|
|
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
|
+
}
|
|
@@ -1,23 +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
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.textCol {
|
|
18
|
-
@apply flex flex-col text-white text-justify w-full
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.detailSpace {
|
|
22
|
-
@apply w-6
|
|
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
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.textCol {
|
|
18
|
+
@apply flex flex-col text-white text-justify w-full
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.detailSpace {
|
|
22
|
+
@apply w-6
|
|
23
|
+
}
|
|
@@ -1,34 +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 Loadable ({ ...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
|
-
}
|
|
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 Loadable ({ ...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
|
+
}
|
|
@@ -1,13 +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
|
+
|
|
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,22 +1,22 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import styles from './Loader.module.css'
|
|
3
|
-
import { SpinnerCircular } from 'spinners-react'
|
|
4
|
-
|
|
5
|
-
export default function Loader ({ loading, children }) {
|
|
6
|
-
return (
|
|
7
|
-
<>
|
|
8
|
-
{
|
|
9
|
-
loading
|
|
10
|
-
? (
|
|
11
|
-
<div className={styles.container} data-testid='loading'>
|
|
12
|
-
<div data-testid='loading-content' className={styles.content}>
|
|
13
|
-
<SpinnerCircular className={styles.spinner} thickness={180} size={60} />
|
|
14
|
-
<div className={styles.blurred}>{children}</div>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
)
|
|
18
|
-
: children
|
|
19
|
-
}
|
|
20
|
-
</>
|
|
21
|
-
)
|
|
22
|
-
}
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import styles from './Loader.module.css'
|
|
3
|
+
import { SpinnerCircular } from 'spinners-react'
|
|
4
|
+
|
|
5
|
+
export default function Loader ({ loading, children }) {
|
|
6
|
+
return (
|
|
7
|
+
<>
|
|
8
|
+
{
|
|
9
|
+
loading
|
|
10
|
+
? (
|
|
11
|
+
<div className={styles.container} data-testid='loading'>
|
|
12
|
+
<div data-testid='loading-content' className={styles.content}>
|
|
13
|
+
<SpinnerCircular className={styles.spinner} thickness={180} size={60} />
|
|
14
|
+
<div className={styles.blurred}>{children}</div>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
)
|
|
18
|
+
: children
|
|
19
|
+
}
|
|
20
|
+
</>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
@apply fixed top-0 left-0 h-full w-full z-40;
|
|
3
|
-
}
|
|
4
|
-
.content {
|
|
5
|
-
@apply h-full w-full;
|
|
6
|
-
}
|
|
7
|
-
.spinner {
|
|
8
|
-
@apply absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-50;
|
|
9
|
-
}
|
|
10
|
-
.blurred {
|
|
11
|
-
@apply blur-sm;
|
|
12
|
-
}
|
|
13
|
-
|
|
1
|
+
.container {
|
|
2
|
+
@apply fixed top-0 left-0 h-full w-full z-40;
|
|
3
|
+
}
|
|
4
|
+
.content {
|
|
5
|
+
@apply h-full w-full;
|
|
6
|
+
}
|
|
7
|
+
.spinner {
|
|
8
|
+
@apply absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-50;
|
|
9
|
+
}
|
|
10
|
+
.blurred {
|
|
11
|
+
@apply blur-sm;
|
|
12
|
+
}
|
|
13
|
+
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
3
|
-
import styles from './LoginButton.module.css'
|
|
4
|
-
|
|
5
|
-
export default function LoginButton ({ icon, label, onClick, ...props }) {
|
|
6
|
-
return (
|
|
7
|
-
<div className={styles.container} onClick={onClick}>
|
|
8
|
-
<div
|
|
9
|
-
className={styles.button}
|
|
10
|
-
data-testid='login-button'
|
|
11
|
-
{...props}
|
|
12
|
-
>
|
|
13
|
-
{icon ? <FontAwesomeIcon icon={icon} className='mr-2' data-testid='login-button-icon' /> : null} {label}
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
)
|
|
17
|
-
}
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
3
|
+
import styles from './LoginButton.module.css'
|
|
4
|
+
|
|
5
|
+
export default function LoginButton ({ icon, label, onClick, ...props }) {
|
|
6
|
+
return (
|
|
7
|
+
<div className={styles.container} onClick={onClick}>
|
|
8
|
+
<div
|
|
9
|
+
className={styles.button}
|
|
10
|
+
data-testid='login-button'
|
|
11
|
+
{...props}
|
|
12
|
+
>
|
|
13
|
+
{icon ? <FontAwesomeIcon icon={icon} className='mr-2' data-testid='login-button-icon' /> : null} {label}
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
)
|
|
17
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
.button {
|
|
2
|
-
@apply bg-light-green text-main-dark-blue font-bold py-2 px-4 rounded w-full text-center cursor-pointer
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.container {
|
|
6
|
-
@apply w-64
|
|
7
|
-
}
|
|
1
|
+
.button {
|
|
2
|
+
@apply bg-light-green text-main-dark-blue font-bold py-2 px-4 rounded w-full text-center cursor-pointer
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.container {
|
|
6
|
+
@apply w-64
|
|
7
|
+
}
|
|
@@ -1,25 +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
|
+
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
|
+
})
|
package/src/components/Logo.jsx
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import styles from './Logo.module.css'
|
|
3
|
-
export default function Logo ({ width = 107, heigth = 86, color = 'white' }) {
|
|
4
|
-
const className = styles[`${color}`]
|
|
5
|
-
return (
|
|
6
|
-
<svg
|
|
7
|
-
width={width}
|
|
8
|
-
height={heigth}
|
|
9
|
-
viewBox='0 0 107 86'
|
|
10
|
-
fill='none'
|
|
11
|
-
xmlns='http://www.w3.org/2000/svg'
|
|
12
|
-
className={className}
|
|
13
|
-
>
|
|
14
|
-
<path
|
|
15
|
-
id='platformatic-cloud'
|
|
16
|
-
d='M30.8197 62.5803H89.7919V62.5614C92.0266 62.4574 94.2096 61.8539 96.1799 60.7954C98.1502 59.7369 99.8577 58.2503 101.177 56.4452C102.496 54.6401 103.392 52.5624 103.801 50.3652C104.21 48.168 104.12 45.9072 103.538 43.7493C102.956 41.5915 101.897 39.5915 100.438 37.8967C98.9799 36.202 97.1596 34.8556 95.1114 33.9567C93.0632 33.0579 90.8392 32.6294 88.6032 32.703C86.3673 32.7765 84.1763 33.3502 82.1917 34.3817C80.9669 31.5572 79.1131 29.0491 76.7716 27.0482C74.43 25.0473 71.6623 23.6064 68.6792 22.8352M18.1691 22.8352C13.8266 23.9537 9.97973 26.4828 7.23367 30.0244C4.48761 33.566 2.99827 37.9192 3 42.399C3.00173 46.8787 4.49443 51.2307 7.24322 54.7702C9.992 58.3098 13.8409 60.8359 18.1841 61.951'
|
|
17
|
-
stroke='none'
|
|
18
|
-
strokeWidth={4.21053}
|
|
19
|
-
strokeLinecap='round'
|
|
20
|
-
strokeLinejoin='round'
|
|
21
|
-
/>
|
|
22
|
-
<path
|
|
23
|
-
d='M41.4979 35.2219L33.6299 37.9838L37.0924 45.3197'
|
|
24
|
-
stroke='#21FA90'
|
|
25
|
-
strokeWidth={4.21053}
|
|
26
|
-
strokeLinecap='round'
|
|
27
|
-
strokeLinejoin='round'
|
|
28
|
-
/>
|
|
29
|
-
<path
|
|
30
|
-
d='M33.8069 38.1138C37.3946 40.2213 41.5789 41.0853 45.709 40.5715C49.8391 40.0577 53.6834 38.1948 56.6441 35.2727C59.6047 32.3505 61.5157 28.5329 62.0797 24.4136C62.6437 20.2943 61.8292 16.1043 59.7628 12.4953C57.6964 8.88629 54.494 6.0606 50.6537 4.45774C46.8135 2.85489 42.5506 2.56474 38.5281 3.63241C34.5057 4.70009 30.9492 7.06574 28.4119 10.3614C25.8745 13.6571 24.4986 17.698 24.498 21.8556V49.9806'
|
|
31
|
-
stroke='#21FA90'
|
|
32
|
-
strokeWidth={4.21053}
|
|
33
|
-
strokeLinecap='round'
|
|
34
|
-
strokeLinejoin='round'
|
|
35
|
-
/>
|
|
36
|
-
<path
|
|
37
|
-
opacity='0.2'
|
|
38
|
-
d='M24.498 79.7146V83.0001'
|
|
39
|
-
stroke='#21FA90'
|
|
40
|
-
strokeWidth={4.21053}
|
|
41
|
-
strokeLinecap='round'
|
|
42
|
-
strokeLinejoin='round'
|
|
43
|
-
/>
|
|
44
|
-
<path
|
|
45
|
-
opacity='0.4'
|
|
46
|
-
d='M24.5283 69.3757V74.5658'
|
|
47
|
-
stroke='#21FA90'
|
|
48
|
-
strokeWidth={4.21053}
|
|
49
|
-
strokeLinecap='round'
|
|
50
|
-
strokeLinejoin='round'
|
|
51
|
-
/>
|
|
52
|
-
<path
|
|
53
|
-
opacity='0.7'
|
|
54
|
-
d='M24.498 55.3254V64.0028'
|
|
55
|
-
stroke='#21FA90'
|
|
56
|
-
strokeWidth={4.21053}
|
|
57
|
-
strokeLinecap='round'
|
|
58
|
-
strokeLinejoin='round'
|
|
59
|
-
/>
|
|
60
|
-
</svg>
|
|
61
|
-
)
|
|
62
|
-
}
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import styles from './Logo.module.css'
|
|
3
|
+
export default function Logo ({ width = 107, heigth = 86, color = 'white' }) {
|
|
4
|
+
const className = styles[`${color}`]
|
|
5
|
+
return (
|
|
6
|
+
<svg
|
|
7
|
+
width={width}
|
|
8
|
+
height={heigth}
|
|
9
|
+
viewBox='0 0 107 86'
|
|
10
|
+
fill='none'
|
|
11
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
12
|
+
className={className}
|
|
13
|
+
>
|
|
14
|
+
<path
|
|
15
|
+
id='platformatic-cloud'
|
|
16
|
+
d='M30.8197 62.5803H89.7919V62.5614C92.0266 62.4574 94.2096 61.8539 96.1799 60.7954C98.1502 59.7369 99.8577 58.2503 101.177 56.4452C102.496 54.6401 103.392 52.5624 103.801 50.3652C104.21 48.168 104.12 45.9072 103.538 43.7493C102.956 41.5915 101.897 39.5915 100.438 37.8967C98.9799 36.202 97.1596 34.8556 95.1114 33.9567C93.0632 33.0579 90.8392 32.6294 88.6032 32.703C86.3673 32.7765 84.1763 33.3502 82.1917 34.3817C80.9669 31.5572 79.1131 29.0491 76.7716 27.0482C74.43 25.0473 71.6623 23.6064 68.6792 22.8352M18.1691 22.8352C13.8266 23.9537 9.97973 26.4828 7.23367 30.0244C4.48761 33.566 2.99827 37.9192 3 42.399C3.00173 46.8787 4.49443 51.2307 7.24322 54.7702C9.992 58.3098 13.8409 60.8359 18.1841 61.951'
|
|
17
|
+
stroke='none'
|
|
18
|
+
strokeWidth={4.21053}
|
|
19
|
+
strokeLinecap='round'
|
|
20
|
+
strokeLinejoin='round'
|
|
21
|
+
/>
|
|
22
|
+
<path
|
|
23
|
+
d='M41.4979 35.2219L33.6299 37.9838L37.0924 45.3197'
|
|
24
|
+
stroke='#21FA90'
|
|
25
|
+
strokeWidth={4.21053}
|
|
26
|
+
strokeLinecap='round'
|
|
27
|
+
strokeLinejoin='round'
|
|
28
|
+
/>
|
|
29
|
+
<path
|
|
30
|
+
d='M33.8069 38.1138C37.3946 40.2213 41.5789 41.0853 45.709 40.5715C49.8391 40.0577 53.6834 38.1948 56.6441 35.2727C59.6047 32.3505 61.5157 28.5329 62.0797 24.4136C62.6437 20.2943 61.8292 16.1043 59.7628 12.4953C57.6964 8.88629 54.494 6.0606 50.6537 4.45774C46.8135 2.85489 42.5506 2.56474 38.5281 3.63241C34.5057 4.70009 30.9492 7.06574 28.4119 10.3614C25.8745 13.6571 24.4986 17.698 24.498 21.8556V49.9806'
|
|
31
|
+
stroke='#21FA90'
|
|
32
|
+
strokeWidth={4.21053}
|
|
33
|
+
strokeLinecap='round'
|
|
34
|
+
strokeLinejoin='round'
|
|
35
|
+
/>
|
|
36
|
+
<path
|
|
37
|
+
opacity='0.2'
|
|
38
|
+
d='M24.498 79.7146V83.0001'
|
|
39
|
+
stroke='#21FA90'
|
|
40
|
+
strokeWidth={4.21053}
|
|
41
|
+
strokeLinecap='round'
|
|
42
|
+
strokeLinejoin='round'
|
|
43
|
+
/>
|
|
44
|
+
<path
|
|
45
|
+
opacity='0.4'
|
|
46
|
+
d='M24.5283 69.3757V74.5658'
|
|
47
|
+
stroke='#21FA90'
|
|
48
|
+
strokeWidth={4.21053}
|
|
49
|
+
strokeLinecap='round'
|
|
50
|
+
strokeLinejoin='round'
|
|
51
|
+
/>
|
|
52
|
+
<path
|
|
53
|
+
opacity='0.7'
|
|
54
|
+
d='M24.498 55.3254V64.0028'
|
|
55
|
+
stroke='#21FA90'
|
|
56
|
+
strokeWidth={4.21053}
|
|
57
|
+
strokeLinecap='round'
|
|
58
|
+
strokeLinejoin='round'
|
|
59
|
+
/>
|
|
60
|
+
</svg>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
.white > path[id='platformatic-cloud']{
|
|
2
|
-
@apply stroke-white
|
|
3
|
-
}
|
|
4
|
-
.main-dark-blue > path[id='platformatic-cloud']{
|
|
5
|
-
@apply stroke-main-dark-blue
|
|
1
|
+
.white > path[id='platformatic-cloud']{
|
|
2
|
+
@apply stroke-white
|
|
3
|
+
}
|
|
4
|
+
.main-dark-blue > path[id='platformatic-cloud']{
|
|
5
|
+
@apply stroke-main-dark-blue
|
|
6
6
|
}
|
package/src/components/Main.jsx
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import SearchBar from './SearchBar'
|
|
4
|
-
import TabbedWindow from './TabbedWindow'
|
|
5
|
-
import Playground from './Playground'
|
|
6
|
-
import Versions from './Versions'
|
|
7
|
-
import React, { useState } from 'react'
|
|
8
|
-
export default function Main () {
|
|
9
|
-
const [currentSearch, setCurrentSearch] = useState('')
|
|
10
|
-
const tabs = [
|
|
11
|
-
{
|
|
12
|
-
label: 'Playground',
|
|
13
|
-
component: () => <Playground />
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
label: 'Versions',
|
|
17
|
-
component: () => <Versions />
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
]
|
|
21
|
-
return (
|
|
22
|
-
<>
|
|
23
|
-
<h1 className='text-white text-2xl font-bold'>My APIs</h1>
|
|
24
|
-
<SearchBar action={(value) => setCurrentSearch(value)} />
|
|
25
|
-
{currentSearch !== '' && (
|
|
26
|
-
<span className='text-main-green'>You searched for {currentSearch}</span>
|
|
27
|
-
)}
|
|
28
|
-
<TabbedWindow
|
|
29
|
-
tabs={tabs}
|
|
30
|
-
/>
|
|
31
|
-
</>
|
|
32
|
-
)
|
|
33
|
-
}
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import SearchBar from './SearchBar'
|
|
4
|
+
import TabbedWindow from './TabbedWindow'
|
|
5
|
+
import Playground from './Playground'
|
|
6
|
+
import Versions from './Versions'
|
|
7
|
+
import React, { useState } from 'react'
|
|
8
|
+
export default function Main () {
|
|
9
|
+
const [currentSearch, setCurrentSearch] = useState('')
|
|
10
|
+
const tabs = [
|
|
11
|
+
{
|
|
12
|
+
label: 'Playground',
|
|
13
|
+
component: () => <Playground />
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
label: 'Versions',
|
|
17
|
+
component: () => <Versions />
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
]
|
|
21
|
+
return (
|
|
22
|
+
<>
|
|
23
|
+
<h1 className='text-white text-2xl font-bold'>My APIs</h1>
|
|
24
|
+
<SearchBar action={(value) => setCurrentSearch(value)} />
|
|
25
|
+
{currentSearch !== '' && (
|
|
26
|
+
<span className='text-main-green'>You searched for {currentSearch}</span>
|
|
27
|
+
)}
|
|
28
|
+
<TabbedWindow
|
|
29
|
+
tabs={tabs}
|
|
30
|
+
/>
|
|
31
|
+
</>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import styles from './MetricValue.module.css'
|
|
4
|
-
import { getColor } from '../lib/utils'
|
|
5
|
-
export default function MetricValue ({ pre, color, value, unit }) {
|
|
6
|
-
return (
|
|
7
|
-
<div className={styles.metric}>
|
|
8
|
-
{pre && <span className={styles.pre}>{pre}</span>}
|
|
9
|
-
<span className={`${styles.value} ${getColor('text', color)}`}>
|
|
10
|
-
{value}
|
|
11
|
-
</span>
|
|
12
|
-
<span className={styles.unit}>{unit}</span>
|
|
13
|
-
</div>
|
|
14
|
-
)
|
|
15
|
-
}
|
|
1
|
+
'use strict'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import styles from './MetricValue.module.css'
|
|
4
|
+
import { getColor } from '../lib/utils'
|
|
5
|
+
export default function MetricValue ({ pre, color, value, unit }) {
|
|
6
|
+
return (
|
|
7
|
+
<div className={styles.metric}>
|
|
8
|
+
{pre && <span className={styles.pre}>{pre}</span>}
|
|
9
|
+
<span className={`${styles.value} ${getColor('text', color)}`}>
|
|
10
|
+
{value}
|
|
11
|
+
</span>
|
|
12
|
+
<span className={styles.unit}>{unit}</span>
|
|
13
|
+
</div>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
.metric {
|
|
2
|
-
@apply flex justify-center items-center gap-x-2;
|
|
3
|
-
}
|
|
4
|
-
.value {
|
|
5
|
-
@apply text-sm lg:text-base;
|
|
6
|
-
}
|
|
7
|
-
.unit,
|
|
8
|
-
.pre {
|
|
9
|
-
@apply text-sm;
|
|
1
|
+
.metric {
|
|
2
|
+
@apply flex justify-center items-center gap-x-2;
|
|
3
|
+
}
|
|
4
|
+
.value {
|
|
5
|
+
@apply text-sm lg:text-base;
|
|
6
|
+
}
|
|
7
|
+
.unit,
|
|
8
|
+
.pre {
|
|
9
|
+
@apply text-sm;
|
|
10
10
|
}
|