@platformatic/ui-components 0.1.49 → 0.1.51
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/dist/api-icon-closed.svg +6 -0
- package/dist/api-icon.svg +9 -0
- package/dist/assets/Montserrat-Regular.dcfe8df2.ttf +0 -0
- package/dist/assets/index.691ca940.css +1 -0
- package/dist/assets/index.ff0dadfc.js +797 -0
- package/dist/index.html +14 -0
- package/dist/stats.html +6177 -0
- package/dist/vite.svg +1 -0
- 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 +35 -36
- package/src/components/DropDown.module.css +25 -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 +151 -153
- package/src/components/Sidebar.module.css +70 -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 -80
- 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/AddIcon.jsx +78 -0
- package/src/components/icons/AlertIcon.jsx +81 -0
- package/src/components/icons/AllInOneIcon.jsx +111 -0
- package/src/components/icons/ApiCloudIcon.jsx +93 -0
- package/src/components/icons/ApiEmptyIcon.jsx +107 -107
- package/src/components/icons/ApiIcon.jsx +84 -29
- package/src/components/icons/ApiIconClosed.jsx +19 -19
- package/src/components/icons/AppEmptyIcon.jsx +94 -94
- package/src/components/icons/AppIcon.jsx +85 -38
- package/src/components/icons/AppListIcon.jsx +73 -73
- package/src/components/icons/ArrowDownFullIcon.jsx +76 -0
- package/src/components/icons/ArrowDownIcon.jsx +75 -0
- package/src/components/icons/ArrowLeftIcon.jsx +75 -0
- package/src/components/icons/ArrowRightIcon.jsx +75 -0
- package/src/components/icons/ArrowUpIcon.jsx +75 -0
- package/src/components/icons/Calendar1DayIcon.jsx +90 -0
- package/src/components/icons/Calendar7DaysIcon.jsx +88 -0
- package/src/components/icons/CalendarIcon.jsx +102 -56
- package/src/components/icons/CircleAddIcon.jsx +81 -40
- package/src/components/icons/CircleBackIcon.jsx +51 -51
- package/src/components/icons/{Calendar1Icon.jsx → CircleCheckMarkIcon.jsx} +66 -54
- 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 +79 -31
- package/src/components/icons/CopyPasteIcon.jsx +81 -0
- package/src/components/icons/DatabaseIcon.jsx +81 -0
- package/src/components/icons/EditIcon.jsx +81 -38
- package/src/components/icons/GearIcon.jsx +78 -40
- package/src/components/icons/Icons.module.css +46 -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/StopIcon.jsx +21 -21
- package/src/components/icons/TerminalIcon.jsx +22 -22
- package/src/components/icons/UpgradeIcon.jsx +48 -48
- package/src/components/icons/Users2Icon.jsx +84 -0
- package/src/components/icons/WorkspaceDynamicIcon.jsx +87 -0
- package/src/components/icons/WorkspaceReadyIcon.jsx +144 -0
- package/src/components/icons/WorkspaceStaticIcon.jsx +84 -0
- package/src/components/icons/index.js +83 -61
- 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 +57 -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 -89
- 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 +68 -74
- package/src/styles/main.css +22 -15
- package/tailwind.config.cjs +60 -60
- package/vite.config.js +6 -6
- package/vitest.config.js +14 -14
- package/dist/main.css +0 -704
- package/src/components/icons/Calendar7Icon.jsx +0 -55
- package/src/components/icons/CopyIcon.jsx +0 -75
- package/src/components/icons/CreatedWorkspaceIcon.jsx +0 -70
- package/src/components/icons/DynamicWorkspaceIcon.jsx +0 -125
- package/src/components/icons/StaticWorkspaceIcon.jsx +0 -119
- package/src/components/icons/TriangleExclamationIcon.jsx +0 -26
|
@@ -1,61 +1,83 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
1
|
+
import AddIcon from './AddIcon'
|
|
2
|
+
import AlertIcon from './AlertIcon'
|
|
3
|
+
import AllInOneIcon from './AllInOneIcon'
|
|
4
|
+
import ApiCloudIcon from './ApiCloudIcon'
|
|
5
|
+
import ApiIcon from './ApiIcon'
|
|
6
|
+
import ApiIconClosed from './ApiIconClosed'
|
|
7
|
+
import ApiEmptyIcon from './ApiEmptyIcon'
|
|
8
|
+
import AppIcon from './AppIcon'
|
|
9
|
+
import AppListIcon from './AppListIcon'
|
|
10
|
+
import AppEmptyIcon from './AppEmptyIcon'
|
|
11
|
+
import ArrowDownFullIcon from './ArrowDownFullIcon'
|
|
12
|
+
import ArrowDownIcon from './ArrowDownIcon'
|
|
13
|
+
import ArrowLeftIcon from './ArrowLeftIcon'
|
|
14
|
+
import ArrowRightIcon from './ArrowRightIcon'
|
|
15
|
+
import ArrowUpIcon from './ArrowUpIcon'
|
|
16
|
+
import CalendarIcon from './CalendarIcon'
|
|
17
|
+
import Calendar1DayIcon from './Calendar1DayIcon'
|
|
18
|
+
import Calendar7DaysIcon from './Calendar7DaysIcon'
|
|
19
|
+
import CircleAddIcon from './CircleAddIcon'
|
|
20
|
+
import CircleBackIcon from './CircleBackIcon'
|
|
21
|
+
import CircleExclamationIcon from './CircleExclamationIcon'
|
|
22
|
+
import CircleCheckMarkIcon from './CircleCheckMarkIcon'
|
|
23
|
+
import CircleCloseIcon from './CircleCloseIcon'
|
|
24
|
+
import CircleCloseHoverIcon from './CircleCloseHoverIcon'
|
|
25
|
+
import CloseIcon from './CloseIcon'
|
|
26
|
+
import CopyPasteIcon from './CopyPasteIcon'
|
|
27
|
+
import DatabaseIcon from './DatabaseIcon'
|
|
28
|
+
import EditIcon from './EditIcon'
|
|
29
|
+
import GearIcon from './GearIcon'
|
|
30
|
+
import LiveIcon from './LiveIcon'
|
|
31
|
+
import MetricsIcon from './MetricsIcon'
|
|
32
|
+
import PlayIcon from './PlayIcon'
|
|
33
|
+
import PullRequestIcon from './PullRequestIcon'
|
|
34
|
+
import StopIcon from './StopIcon'
|
|
35
|
+
import TerminalIcon from './TerminalIcon'
|
|
36
|
+
import Users2Icon from './Users2Icon'
|
|
37
|
+
import UpgradeIcon from './UpgradeIcon'
|
|
38
|
+
import WorkspaceDynamicIcon from './WorkspaceDynamicIcon'
|
|
39
|
+
import WorkspaceReadyIcon from './WorkspaceReadyIcon'
|
|
40
|
+
import WorkspaceStaticIcon from './WorkspaceStaticIcon'
|
|
41
|
+
|
|
42
|
+
export default {
|
|
43
|
+
AddIcon,
|
|
44
|
+
AlertIcon,
|
|
45
|
+
AllInOneIcon,
|
|
46
|
+
ApiCloudIcon,
|
|
47
|
+
ApiIcon,
|
|
48
|
+
ApiIconClosed,
|
|
49
|
+
ApiEmptyIcon,
|
|
50
|
+
AppIcon,
|
|
51
|
+
AppListIcon,
|
|
52
|
+
AppEmptyIcon,
|
|
53
|
+
ArrowDownFullIcon,
|
|
54
|
+
ArrowDownIcon,
|
|
55
|
+
ArrowLeftIcon,
|
|
56
|
+
ArrowRightIcon,
|
|
57
|
+
ArrowUpIcon,
|
|
58
|
+
CalendarIcon,
|
|
59
|
+
Calendar1DayIcon,
|
|
60
|
+
Calendar7DaysIcon,
|
|
61
|
+
CircleAddIcon,
|
|
62
|
+
CircleBackIcon,
|
|
63
|
+
CircleCheckMarkIcon,
|
|
64
|
+
CircleExclamationIcon,
|
|
65
|
+
CircleCloseIcon,
|
|
66
|
+
CircleCloseHoverIcon,
|
|
67
|
+
CloseIcon,
|
|
68
|
+
CopyPasteIcon,
|
|
69
|
+
DatabaseIcon,
|
|
70
|
+
GearIcon,
|
|
71
|
+
EditIcon,
|
|
72
|
+
LiveIcon,
|
|
73
|
+
MetricsIcon,
|
|
74
|
+
PlayIcon,
|
|
75
|
+
PullRequestIcon,
|
|
76
|
+
StopIcon,
|
|
77
|
+
TerminalIcon,
|
|
78
|
+
UpgradeIcon,
|
|
79
|
+
Users2Icon,
|
|
80
|
+
WorkspaceDynamicIcon,
|
|
81
|
+
WorkspaceReadyIcon,
|
|
82
|
+
WorkspaceStaticIcon
|
|
83
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
|
|
4
|
-
export default function Layout (props) {
|
|
5
|
-
return (
|
|
6
|
-
<div className='container mx-auto px-5 my-5 flex flex-col gap-10 h-screen'>
|
|
7
|
-
{props.children}
|
|
8
|
-
</div>
|
|
9
|
-
|
|
10
|
-
)
|
|
11
|
-
}
|
|
1
|
+
'use strict'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
export default function Layout (props) {
|
|
5
|
+
return (
|
|
6
|
+
<div className='container mx-auto px-5 my-5 flex flex-col gap-10 h-screen'>
|
|
7
|
+
{props.children}
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
)
|
|
11
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import styles from './TwoColumnsLayout.module.css'
|
|
4
|
-
|
|
5
|
-
export default function TwoColumnsLayout ({ children, gridTemplate = 'columns' }) {
|
|
6
|
-
const className = styles[`${gridTemplate}`]
|
|
7
|
-
return (
|
|
8
|
-
<div className={className}>
|
|
9
|
-
{children}
|
|
10
|
-
</div>
|
|
11
|
-
)
|
|
12
|
-
}
|
|
1
|
+
'use strict'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import styles from './TwoColumnsLayout.module.css'
|
|
4
|
+
|
|
5
|
+
export default function TwoColumnsLayout ({ children, gridTemplate = 'columns' }) {
|
|
6
|
+
const className = styles[`${gridTemplate}`]
|
|
7
|
+
return (
|
|
8
|
+
<div className={className}>
|
|
9
|
+
{children}
|
|
10
|
+
</div>
|
|
11
|
+
)
|
|
12
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
.columns {
|
|
3
|
-
@apply grid grid-cols-2 gap-x-4;
|
|
4
|
-
}
|
|
5
|
-
.rows {
|
|
6
|
-
@apply grid grid-rows-2 gap-y-4;
|
|
7
|
-
}
|
|
8
|
-
.responsive {
|
|
9
|
-
@apply grid grid-rows-2 gap-y-4 md:grid-rows-none md:gap-y-0 md:grid-cols-2 md:gap-x-4;
|
|
1
|
+
|
|
2
|
+
.columns {
|
|
3
|
+
@apply grid grid-cols-2 gap-x-4;
|
|
4
|
+
}
|
|
5
|
+
.rows {
|
|
6
|
+
@apply grid grid-rows-2 gap-y-4;
|
|
7
|
+
}
|
|
8
|
+
.responsive {
|
|
9
|
+
@apply grid grid-rows-2 gap-y-4 md:grid-rows-none md:gap-y-0 md:grid-cols-2 md:gap-x-4;
|
|
10
10
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { useCallback, useEffect } from 'react'
|
|
2
|
-
const KEY_NAME_ESC = 'Escape'
|
|
3
|
-
const KEY_EVENT_TYPE = 'keyup'
|
|
4
|
-
function useEscapeKey (handleClose) {
|
|
5
|
-
const handleEscKey = useCallback((event) => {
|
|
6
|
-
if (event.key === KEY_NAME_ESC) {
|
|
7
|
-
handleClose()
|
|
8
|
-
}
|
|
9
|
-
}, [handleClose])
|
|
10
|
-
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
document.addEventListener(KEY_EVENT_TYPE, handleEscKey, false)
|
|
13
|
-
|
|
14
|
-
return () => {
|
|
15
|
-
document.removeEventListener(KEY_EVENT_TYPE, handleEscKey, false)
|
|
16
|
-
}
|
|
17
|
-
}, [handleEscKey])
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export default useEscapeKey
|
|
1
|
+
import { useCallback, useEffect } from 'react'
|
|
2
|
+
const KEY_NAME_ESC = 'Escape'
|
|
3
|
+
const KEY_EVENT_TYPE = 'keyup'
|
|
4
|
+
function useEscapeKey (handleClose) {
|
|
5
|
+
const handleEscKey = useCallback((event) => {
|
|
6
|
+
if (event.key === KEY_NAME_ESC) {
|
|
7
|
+
handleClose()
|
|
8
|
+
}
|
|
9
|
+
}, [handleClose])
|
|
10
|
+
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
document.addEventListener(KEY_EVENT_TYPE, handleEscKey, false)
|
|
13
|
+
|
|
14
|
+
return () => {
|
|
15
|
+
document.removeEventListener(KEY_EVENT_TYPE, handleEscKey, false)
|
|
16
|
+
}
|
|
17
|
+
}, [handleEscKey])
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default useEscapeKey
|
package/src/lib/utils.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
function getColor (type, color) {
|
|
4
|
-
let convertedColor
|
|
5
|
-
switch (color) {
|
|
6
|
-
case 'green':
|
|
7
|
-
convertedColor = 'main-green'
|
|
8
|
-
break
|
|
9
|
-
case 'red':
|
|
10
|
-
convertedColor = 'error-red'
|
|
11
|
-
break
|
|
12
|
-
case 'white':
|
|
13
|
-
convertedColor = 'white'
|
|
14
|
-
break
|
|
15
|
-
default:
|
|
16
|
-
convertedColor = 'main-green'
|
|
17
|
-
break
|
|
18
|
-
}
|
|
19
|
-
return `${type}-${convertedColor}`
|
|
20
|
-
}
|
|
21
|
-
export {
|
|
22
|
-
getColor
|
|
23
|
-
}
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
function getColor (type, color) {
|
|
4
|
+
let convertedColor
|
|
5
|
+
switch (color) {
|
|
6
|
+
case 'green':
|
|
7
|
+
convertedColor = 'main-green'
|
|
8
|
+
break
|
|
9
|
+
case 'red':
|
|
10
|
+
convertedColor = 'error-red'
|
|
11
|
+
break
|
|
12
|
+
case 'white':
|
|
13
|
+
convertedColor = 'white'
|
|
14
|
+
break
|
|
15
|
+
default:
|
|
16
|
+
convertedColor = 'main-green'
|
|
17
|
+
break
|
|
18
|
+
}
|
|
19
|
+
return `${type}-${convertedColor}`
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
getColor
|
|
23
|
+
}
|
package/src/main.jsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import ReactDOM from 'react-dom/client'
|
|
3
|
-
import App from './App'
|
|
4
|
-
import './styles/main.css'
|
|
5
|
-
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
6
|
-
<React.StrictMode>
|
|
7
|
-
<App />
|
|
8
|
-
</React.StrictMode>
|
|
9
|
-
)
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import ReactDOM from 'react-dom/client'
|
|
3
|
+
import App from './App'
|
|
4
|
+
import './styles/main.css'
|
|
5
|
+
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
6
|
+
<React.StrictMode>
|
|
7
|
+
<App />
|
|
8
|
+
</React.StrictMode>
|
|
9
|
+
)
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
import BorderedBox from '../components/BorderedBox'
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Platformatic/BorderedBox',
|
|
5
|
-
component: BorderedBox,
|
|
6
|
-
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
7
|
-
argTypes: {
|
|
8
|
-
color: {
|
|
9
|
-
options: ['green', 'red', 'white'],
|
|
10
|
-
control: { type: ' radio' }
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
|
|
16
|
-
const Template = (args) => <BorderedBox {...args}>Hello Platformatic</BorderedBox>
|
|
17
|
-
|
|
18
|
-
export const Green = Template.bind({})
|
|
19
|
-
|
|
20
|
-
Green.args = {
|
|
21
|
-
color: 'green'
|
|
22
|
-
}
|
|
23
|
-
export const Red = Template.bind({})
|
|
24
|
-
|
|
25
|
-
Red.args = {
|
|
26
|
-
color: 'red'
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const White = Template.bind({})
|
|
30
|
-
|
|
31
|
-
White.args = {
|
|
32
|
-
color: 'white'
|
|
33
|
-
}
|
|
1
|
+
'use strict'
|
|
2
|
+
import BorderedBox from '../components/BorderedBox'
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Platformatic/BorderedBox',
|
|
5
|
+
component: BorderedBox,
|
|
6
|
+
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
7
|
+
argTypes: {
|
|
8
|
+
color: {
|
|
9
|
+
options: ['green', 'red', 'white'],
|
|
10
|
+
control: { type: ' radio' }
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
|
|
16
|
+
const Template = (args) => <BorderedBox {...args}>Hello Platformatic</BorderedBox>
|
|
17
|
+
|
|
18
|
+
export const Green = Template.bind({})
|
|
19
|
+
|
|
20
|
+
Green.args = {
|
|
21
|
+
color: 'green'
|
|
22
|
+
}
|
|
23
|
+
export const Red = Template.bind({})
|
|
24
|
+
|
|
25
|
+
Red.args = {
|
|
26
|
+
color: 'red'
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const White = Template.bind({})
|
|
30
|
+
|
|
31
|
+
White.args = {
|
|
32
|
+
color: 'white'
|
|
33
|
+
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
import BorderedText from '../components/BorderedText'
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Platformatic/BorderedText',
|
|
5
|
-
component: BorderedText,
|
|
6
|
-
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
7
|
-
argTypes: {
|
|
8
|
-
text: { control: 'string' }
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
|
|
13
|
-
const Template = (args) => <BorderedText {...args} />
|
|
14
|
-
|
|
15
|
-
export const Sample = Template.bind({})
|
|
16
|
-
// More on args: https://storybook.js.org/docs/react/writing-stories/args
|
|
17
|
-
Sample.args = {
|
|
18
|
-
text: 'Hello Platformatic!'
|
|
19
|
-
}
|
|
20
|
-
export const Version = Template.bind({})
|
|
21
|
-
|
|
22
|
-
Version.args = {
|
|
23
|
-
text: 'v1.2.3'
|
|
24
|
-
}
|
|
1
|
+
'use strict'
|
|
2
|
+
import BorderedText from '../components/BorderedText'
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Platformatic/BorderedText',
|
|
5
|
+
component: BorderedText,
|
|
6
|
+
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
7
|
+
argTypes: {
|
|
8
|
+
text: { control: 'string' }
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
|
|
13
|
+
const Template = (args) => <BorderedText {...args} />
|
|
14
|
+
|
|
15
|
+
export const Sample = Template.bind({})
|
|
16
|
+
// More on args: https://storybook.js.org/docs/react/writing-stories/args
|
|
17
|
+
Sample.args = {
|
|
18
|
+
text: 'Hello Platformatic!'
|
|
19
|
+
}
|
|
20
|
+
export const Version = Template.bind({})
|
|
21
|
+
|
|
22
|
+
Version.args = {
|
|
23
|
+
text: 'v1.2.3'
|
|
24
|
+
}
|
|
@@ -1,114 +1,114 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
import { faCheck } from '@fortawesome/free-solid-svg-icons'
|
|
3
|
-
import { useState } from 'react'
|
|
4
|
-
import Button from '../components/Button'
|
|
5
|
-
|
|
6
|
-
const colors = ['main-green', 'dark-green', 'light-green', 'main-dark-blue', 'dark-blue', 'light-blue', 'white', 'error-red', 'tertiary-blue', 'transparent']
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
title: 'Platformatic/Button',
|
|
10
|
-
component: Button,
|
|
11
|
-
argTypes: {
|
|
12
|
-
label: {
|
|
13
|
-
type: 'string',
|
|
14
|
-
control: 'text'
|
|
15
|
-
},
|
|
16
|
-
bold: {
|
|
17
|
-
type: 'boolean'
|
|
18
|
-
},
|
|
19
|
-
backgroundColor: {
|
|
20
|
-
type: 'string',
|
|
21
|
-
control: {
|
|
22
|
-
type: 'radio',
|
|
23
|
-
options: colors
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
color: {
|
|
27
|
-
type: 'string',
|
|
28
|
-
control: {
|
|
29
|
-
type: 'radio',
|
|
30
|
-
options: colors
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
disabled: {
|
|
34
|
-
type: 'boolean'
|
|
35
|
-
},
|
|
36
|
-
size: {
|
|
37
|
-
type: 'string',
|
|
38
|
-
control: {
|
|
39
|
-
type: 'radio',
|
|
40
|
-
options: ['small', 'medium', 'large', 'extra-large']
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
hoverEffect: {
|
|
44
|
-
type: 'radio',
|
|
45
|
-
options: ['hover', 'underline']
|
|
46
|
-
},
|
|
47
|
-
bordered: {
|
|
48
|
-
type: 'boolean'
|
|
49
|
-
},
|
|
50
|
-
fullWidth: {
|
|
51
|
-
type: 'boolean'
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const Template = (args) => <Button {...args} />
|
|
57
|
-
|
|
58
|
-
export const OnlyLabel = Template.bind({})
|
|
59
|
-
// More on args: https://storybook.js.org/docs/react/writing-stories/args
|
|
60
|
-
OnlyLabel.args = {
|
|
61
|
-
label: 'Sample label',
|
|
62
|
-
backgroundColor: 'main-green'
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export const BorderedRed = Template.bind({})
|
|
66
|
-
BorderedRed.args = {
|
|
67
|
-
label: 'Borderer Red',
|
|
68
|
-
color: 'error-red'
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export const TransparentWhite = Template.bind({})
|
|
72
|
-
TransparentWhite.args = {
|
|
73
|
-
label: 'White',
|
|
74
|
-
color: 'white',
|
|
75
|
-
icon: faCheck
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const DisabledTemplate = (args) => {
|
|
79
|
-
const [enabled, setEnabled] = useState(false)
|
|
80
|
-
return (
|
|
81
|
-
<div className='flex flex-col gap-y-6 text-white'>
|
|
82
|
-
<div>
|
|
83
|
-
<Button {...args} disabled={!enabled} onClick={() => alert('clicked')} />
|
|
84
|
-
<span className='ml-4 text-xl'>👈 This button is {enabled ? 'enabled' : 'disabled'}</span>
|
|
85
|
-
</div>
|
|
86
|
-
<div>
|
|
87
|
-
<Button label='Toggle Disabled' backgroundColor='main-green' onClick={() => setEnabled(!enabled)} />
|
|
88
|
-
</div>
|
|
89
|
-
</div>
|
|
90
|
-
)
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export const DisabledGreen = DisabledTemplate.bind({})
|
|
94
|
-
|
|
95
|
-
DisabledGreen.args = {
|
|
96
|
-
backgroundColor: 'main-green',
|
|
97
|
-
label: 'A simple button',
|
|
98
|
-
color: 'main-dark-blue',
|
|
99
|
-
disabled: true
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export const DisabledRed = DisabledTemplate.bind({})
|
|
103
|
-
DisabledRed.args = {
|
|
104
|
-
label: 'A simple button',
|
|
105
|
-
color: 'error-red',
|
|
106
|
-
disabled: true
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export const UsingPlatformaticIcon = Template.bind({})
|
|
110
|
-
UsingPlatformaticIcon.args = {
|
|
111
|
-
label: 'White',
|
|
112
|
-
color: 'white',
|
|
113
|
-
platformaticIcon: { iconName: 'GearIcon', color: 'white' }
|
|
114
|
-
}
|
|
1
|
+
'use strict'
|
|
2
|
+
import { faCheck } from '@fortawesome/free-solid-svg-icons'
|
|
3
|
+
import { useState } from 'react'
|
|
4
|
+
import Button from '../components/Button'
|
|
5
|
+
|
|
6
|
+
const colors = ['main-green', 'dark-green', 'light-green', 'main-dark-blue', 'dark-blue', 'light-blue', 'white', 'error-red', 'tertiary-blue', 'transparent']
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Platformatic/Button',
|
|
10
|
+
component: Button,
|
|
11
|
+
argTypes: {
|
|
12
|
+
label: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
control: 'text'
|
|
15
|
+
},
|
|
16
|
+
bold: {
|
|
17
|
+
type: 'boolean'
|
|
18
|
+
},
|
|
19
|
+
backgroundColor: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
control: {
|
|
22
|
+
type: 'radio',
|
|
23
|
+
options: colors
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
color: {
|
|
27
|
+
type: 'string',
|
|
28
|
+
control: {
|
|
29
|
+
type: 'radio',
|
|
30
|
+
options: colors
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
disabled: {
|
|
34
|
+
type: 'boolean'
|
|
35
|
+
},
|
|
36
|
+
size: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
control: {
|
|
39
|
+
type: 'radio',
|
|
40
|
+
options: ['small', 'medium', 'large', 'extra-large']
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
hoverEffect: {
|
|
44
|
+
type: 'radio',
|
|
45
|
+
options: ['hover', 'underline']
|
|
46
|
+
},
|
|
47
|
+
bordered: {
|
|
48
|
+
type: 'boolean'
|
|
49
|
+
},
|
|
50
|
+
fullWidth: {
|
|
51
|
+
type: 'boolean'
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const Template = (args) => <Button {...args} />
|
|
57
|
+
|
|
58
|
+
export const OnlyLabel = Template.bind({})
|
|
59
|
+
// More on args: https://storybook.js.org/docs/react/writing-stories/args
|
|
60
|
+
OnlyLabel.args = {
|
|
61
|
+
label: 'Sample label',
|
|
62
|
+
backgroundColor: 'main-green'
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const BorderedRed = Template.bind({})
|
|
66
|
+
BorderedRed.args = {
|
|
67
|
+
label: 'Borderer Red',
|
|
68
|
+
color: 'error-red'
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const TransparentWhite = Template.bind({})
|
|
72
|
+
TransparentWhite.args = {
|
|
73
|
+
label: 'White',
|
|
74
|
+
color: 'white',
|
|
75
|
+
icon: faCheck
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const DisabledTemplate = (args) => {
|
|
79
|
+
const [enabled, setEnabled] = useState(false)
|
|
80
|
+
return (
|
|
81
|
+
<div className='flex flex-col gap-y-6 text-white'>
|
|
82
|
+
<div>
|
|
83
|
+
<Button {...args} disabled={!enabled} onClick={() => alert('clicked')} />
|
|
84
|
+
<span className='ml-4 text-xl'>👈 This button is {enabled ? 'enabled' : 'disabled'}</span>
|
|
85
|
+
</div>
|
|
86
|
+
<div>
|
|
87
|
+
<Button label='Toggle Disabled' backgroundColor='main-green' onClick={() => setEnabled(!enabled)} />
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export const DisabledGreen = DisabledTemplate.bind({})
|
|
94
|
+
|
|
95
|
+
DisabledGreen.args = {
|
|
96
|
+
backgroundColor: 'main-green',
|
|
97
|
+
label: 'A simple button',
|
|
98
|
+
color: 'main-dark-blue',
|
|
99
|
+
disabled: true
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export const DisabledRed = DisabledTemplate.bind({})
|
|
103
|
+
DisabledRed.args = {
|
|
104
|
+
label: 'A simple button',
|
|
105
|
+
color: 'error-red',
|
|
106
|
+
disabled: true
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export const UsingPlatformaticIcon = Template.bind({})
|
|
110
|
+
UsingPlatformaticIcon.args = {
|
|
111
|
+
label: 'White',
|
|
112
|
+
color: 'white',
|
|
113
|
+
platformaticIcon: { iconName: 'GearIcon', color: 'white' }
|
|
114
|
+
}
|