@platformatic/ui-components 0.10.2 → 0.12.1
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/.nvmrc +1 -1
- package/dist/assets/{index-tWWfT-sj.js → index-DdZDgVK5.js} +1 -1
- package/dist/assets/{index-6PMGR_jN.css → index-lxtoGZUQ.css} +1 -1
- package/dist/index.html +2 -2
- package/dist/main.css +44 -0
- package/index.js +4 -2
- package/package.json +2 -2
- package/postcss.config.cjs +0 -2
- package/src/components/BorderedBox.jsx +1 -2
- package/src/components/Box.jsx +0 -2
- package/src/components/Button.jsx +0 -1
- package/src/components/ButtonFullRounded.jsx +0 -1
- package/src/components/ButtonOnlyIcon.jsx +0 -1
- package/src/components/Checkbox.jsx +0 -1
- package/src/components/CopyAndPaste.jsx +0 -1
- package/src/components/DetailedMetric.jsx +0 -2
- package/src/components/DropDown.jsx +0 -1
- package/src/components/HorizontalSeparator.jsx +0 -1
- package/src/components/InfoBox.jsx +1 -2
- package/src/components/LoadingSpinnerV2.jsx +0 -1
- package/src/components/LogoDropDown.jsx +0 -1
- package/src/components/Main.jsx +0 -2
- package/src/components/MetricValue.jsx +0 -1
- package/src/components/Modal.jsx +1 -2
- package/src/components/ModalDirectional.jsx +1 -2
- package/src/components/ModalStepsForward.jsx +0 -1
- package/src/components/PlatformaticIcon.jsx +0 -1
- package/src/components/Playground.jsx +0 -1
- package/src/components/Report.jsx +40 -0
- package/src/components/SearchBar.jsx +0 -1
- package/src/components/SearchBarV2.jsx +0 -1
- package/src/components/SimpleMetric.jsx +0 -2
- package/src/components/SplashScreen.jsx +64 -0
- package/src/components/SplashScreen.module.css +19 -0
- package/src/components/Status.jsx +0 -1
- package/src/components/TabbedWindow.jsx +0 -1
- package/src/components/Tag.jsx +0 -1
- package/src/components/TextWithLabel.jsx +1 -1
- package/src/components/Tooltip.jsx +1 -2
- package/src/components/TooltipAbsolute.jsx +1 -2
- package/src/components/Versions.jsx +0 -1
- package/src/components/VerticalSeparator.jsx +0 -1
- package/src/components/backgrounds/AppBackgroundIcon.jsx +0 -2
- package/src/components/backgrounds/LensBackgroundIcon.jsx +0 -2
- package/src/components/backgrounds/TimerBackgroundIcon.jsx +0 -2
- package/src/components/forms/Field.jsx +1 -1
- package/src/components/forms/Input.jsx +0 -1
- package/src/components/forms/InputFileUpload.jsx +0 -1
- package/src/components/forms/InputWithSeparator.jsx +0 -1
- package/src/components/forms/Password.jsx +0 -1
- package/src/components/forms/Preview.jsx +1 -1
- package/src/components/forms/RadioGroup.jsx +0 -1
- package/src/components/forms/Select.jsx +0 -1
- package/src/components/forms/SelectWithInput.jsx +0 -1
- package/src/components/forms/TextArea.jsx +0 -1
- package/src/components/forms/ToggleSwitch.jsx +0 -1
- package/src/components/layouts/Layout.jsx +0 -1
- package/src/components/layouts/TwoColumnsLayout.jsx +0 -1
- package/src/components/loaders/SpinnerCircular.jsx +0 -1
- package/src/lib/utils.js +0 -2
- package/src/stories/BorderedBox.stories.jsx +1 -1
- package/src/stories/Button.stories.jsx +0 -1
- package/src/stories/ButtonFullRounded.stories.jsx +0 -1
- package/src/stories/ButtonOnlyIcon.stories.jsx +0 -1
- package/src/stories/Checkbox.stories.jsx +0 -1
- package/src/stories/DetailedMetric.stories.jsx +0 -2
- package/src/stories/DropDown.stories.jsx +0 -1
- package/src/stories/LogoDropDown.stories.jsx +0 -1
- package/src/stories/Modal.stories.jsx +27 -22
- package/src/stories/Report.stories.jsx +24 -0
- package/src/stories/SearchBar.stories.jsx +0 -1
- package/src/stories/SearchBarV2.stories.jsx +0 -1
- package/src/stories/Sidebar.stories.jsx +0 -1
- package/src/stories/SimpleMetric.stories.jsx +0 -2
- package/src/stories/SplashScreen.stories.jsx +111 -0
- package/src/stories/Status.stories.jsx +0 -1
- package/src/stories/TabbedWindow.stories.jsx +0 -1
- package/src/stories/Tag.stories.jsx +0 -1
- package/src/stories/TextWithLabel.stories.jsx +0 -2
- package/src/stories/Tooltip.stories.jsx +0 -1
- package/src/stories/TwoColumnsLayout.stories.jsx +0 -1
- package/src/stories/backgrounds/AppBackgroundIcon.stories.jsx +0 -1
- package/src/stories/backgrounds/LensBackgroundIcon.stories.jsx +0 -1
- package/src/stories/backgrounds/TimerBackgroundIcon.stories.jsx +0 -1
- package/src/stories/forms/Field.stories.jsx +0 -1
- package/src/stories/forms/Input.stories.jsx +0 -1
- package/src/stories/forms/InputFileUpload.stories.jsx +0 -1
- package/src/stories/forms/InputWithSeparator.stories.jsx +0 -1
- package/src/stories/forms/Password.stories.jsx +0 -1
- package/src/stories/forms/Preview.stories.jsx +0 -1
- package/src/stories/forms/RadioGroup.stories.jsx +0 -1
- package/src/stories/forms/Select.stories.jsx +0 -1
- package/src/stories/forms/SelectWithInput.stories.jsx +0 -1
- package/src/stories/forms/TextArea.stories.jsx +0 -1
- package/src/stories/forms/ToggleSwitch.stories.jsx +0 -1
- package/src/stories/icons/Icons.stories.jsx +7 -2
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
'use strict'
|
|
2
1
|
import PropTypes from 'prop-types'
|
|
3
2
|
import styles from './Tooltip.module.css'
|
|
4
3
|
import { useEffect, useRef, useState } from 'react'
|
|
@@ -11,7 +10,7 @@ function Tooltip ({
|
|
|
11
10
|
activeDependsOnVisible = false,
|
|
12
11
|
content = null,
|
|
13
12
|
delay = 0,
|
|
14
|
-
children
|
|
13
|
+
children,
|
|
15
14
|
tooltipClassName = '',
|
|
16
15
|
offset = 0,
|
|
17
16
|
position = POSITION_CENTER
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
'use strict'
|
|
2
1
|
import PropTypes from 'prop-types'
|
|
3
2
|
import styles from './TooltipAbsolute.module.css'
|
|
4
3
|
import { useEffect, useState } from 'react'
|
|
@@ -8,7 +7,7 @@ const TooltipAbsolute = ({
|
|
|
8
7
|
direction = DIRECTION_TOP,
|
|
9
8
|
tooltipClassName = '',
|
|
10
9
|
delay = 0,
|
|
11
|
-
children
|
|
10
|
+
children,
|
|
12
11
|
content = null,
|
|
13
12
|
offset = 0,
|
|
14
13
|
position = POSITION_START,
|
package/src/lib/utils.js
CHANGED
|
@@ -41,35 +41,40 @@ const Template = (args) => {
|
|
|
41
41
|
const [isOpenInside, setIsOpenInside] = useState(false)
|
|
42
42
|
const { text, ...rest } = args
|
|
43
43
|
return (
|
|
44
|
-
<main style={{ height: '
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
color={MAIN_GREEN}
|
|
48
|
-
backgroundColor={MAIN_DARK_BLUE}
|
|
49
|
-
onClick={() => setIsOpen(true)}
|
|
50
|
-
label='Open Modal'
|
|
51
|
-
/>
|
|
52
|
-
{isOpen && (
|
|
53
|
-
<Modal setIsOpen={setIsOpen} {...rest}>
|
|
54
|
-
{text}
|
|
55
|
-
</Modal>
|
|
56
|
-
)}
|
|
57
|
-
|
|
58
|
-
<BorderedBox style={{ position: 'relative' }}>
|
|
59
|
-
<p>This Is another Component with Modal inside</p>
|
|
60
|
-
|
|
44
|
+
<main style={{ height: '100vh', overflow: 'scroll' }} className='flex flex-col gap-y-4'>
|
|
45
|
+
<div className='flex flex-col gap-y-4'>
|
|
46
|
+
<BorderedBox>This Is another Content</BorderedBox>
|
|
61
47
|
<Button
|
|
62
48
|
color={MAIN_GREEN}
|
|
63
49
|
backgroundColor={MAIN_DARK_BLUE}
|
|
64
|
-
onClick={() =>
|
|
65
|
-
label='Open Modal
|
|
50
|
+
onClick={() => setIsOpen(true)}
|
|
51
|
+
label='Open Modal'
|
|
66
52
|
/>
|
|
67
|
-
{
|
|
68
|
-
<Modal setIsOpen={
|
|
53
|
+
{isOpen && (
|
|
54
|
+
<Modal setIsOpen={setIsOpen} {...rest}>
|
|
69
55
|
{text}
|
|
70
56
|
</Modal>
|
|
71
57
|
)}
|
|
72
|
-
</
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<div>
|
|
61
|
+
<BorderedBox style={{ position: 'relative' }}>
|
|
62
|
+
<p>This Is another Component with Modal inside</p>
|
|
63
|
+
|
|
64
|
+
<Button
|
|
65
|
+
color={MAIN_GREEN}
|
|
66
|
+
backgroundColor={MAIN_DARK_BLUE}
|
|
67
|
+
onClick={() => setIsOpenInside(true)}
|
|
68
|
+
label='Open Modal Inside'
|
|
69
|
+
/>
|
|
70
|
+
{isOpenInside && (
|
|
71
|
+
<Modal setIsOpen={setIsOpenInside} {...rest}>
|
|
72
|
+
{text}
|
|
73
|
+
</Modal>
|
|
74
|
+
)}
|
|
75
|
+
</BorderedBox>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
73
78
|
</main>
|
|
74
79
|
)
|
|
75
80
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Report from '../components/Report'
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Platformatic/Report',
|
|
5
|
+
component: Report
|
|
6
|
+
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const Template = () => {
|
|
10
|
+
const steps = [
|
|
11
|
+
{ type: 'warning', label: 'This is a warning message' },
|
|
12
|
+
{ type: 'success', label: 'This is a success message' },
|
|
13
|
+
{ type: 'error', label: 'This is an error message' }
|
|
14
|
+
]
|
|
15
|
+
return (
|
|
16
|
+
<div className='text-white'>
|
|
17
|
+
<Report steps={steps} />
|
|
18
|
+
</div>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const Samples = {
|
|
23
|
+
render: () => <Template timeout={5000000} />
|
|
24
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import SplashScreen from '../components/SplashScreen'
|
|
3
|
+
import { ERROR_RED, MAIN_GREEN, RICH_BLACK, WHITE } from '../components/constants'
|
|
4
|
+
import Button from '../components/Button'
|
|
5
|
+
import Report from '../components/Report'
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Platformatic/Splash Screen',
|
|
8
|
+
component: SplashScreen
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const Template = (args) => {
|
|
12
|
+
const {
|
|
13
|
+
timeout = 5000
|
|
14
|
+
} = args
|
|
15
|
+
const [showSplashScreen, setShowSplashScreen] = useState(false)
|
|
16
|
+
const [splashOptions, setSplashOptions] = useState({})
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (Object.keys(splashOptions).length > 0) {
|
|
20
|
+
setShowSplashScreen(true)
|
|
21
|
+
}
|
|
22
|
+
}, [splashOptions])
|
|
23
|
+
|
|
24
|
+
function getReportSteps () {
|
|
25
|
+
const steps = [
|
|
26
|
+
{ type: 'success', label: 'Removed from Main Taxonomy' },
|
|
27
|
+
{ type: 'success', label: 'Removed from Preview Taxonomy' },
|
|
28
|
+
{ type: 'success', label: 'API Key Invalidated' },
|
|
29
|
+
{ type: 'success', label: 'Secrets removed' },
|
|
30
|
+
{ type: 'success', label: 'All pods removed' }
|
|
31
|
+
]
|
|
32
|
+
return steps
|
|
33
|
+
}
|
|
34
|
+
return (
|
|
35
|
+
<div style={{ height: '100vh' }}>
|
|
36
|
+
<div className='flex flex-col gap-y-2 w-1/4'>
|
|
37
|
+
<Button
|
|
38
|
+
color={MAIN_GREEN}
|
|
39
|
+
backgroundColor={RICH_BLACK}
|
|
40
|
+
onClick={() => {
|
|
41
|
+
setSplashOptions({
|
|
42
|
+
message: 'This is a success message',
|
|
43
|
+
success: true,
|
|
44
|
+
title: 'Operation Completed!',
|
|
45
|
+
timeout
|
|
46
|
+
})
|
|
47
|
+
}}
|
|
48
|
+
label='Success'
|
|
49
|
+
/>
|
|
50
|
+
|
|
51
|
+
<Button
|
|
52
|
+
color={ERROR_RED}
|
|
53
|
+
backgroundColor={RICH_BLACK}
|
|
54
|
+
onClick={() => {
|
|
55
|
+
setSplashOptions({
|
|
56
|
+
title: 'The application wad deleted',
|
|
57
|
+
success: false,
|
|
58
|
+
message: 'The application you are looking for was deleted on YYYY-MM-DD [HH:MM:SS]',
|
|
59
|
+
timeout
|
|
60
|
+
})
|
|
61
|
+
}}
|
|
62
|
+
label='Failure'
|
|
63
|
+
/>
|
|
64
|
+
|
|
65
|
+
<Button
|
|
66
|
+
color={WHITE}
|
|
67
|
+
backgroundColor={RICH_BLACK}
|
|
68
|
+
onClick={() => {
|
|
69
|
+
setSplashOptions({
|
|
70
|
+
title: 'The application wad deleted',
|
|
71
|
+
success: false,
|
|
72
|
+
message: 'The application you are looking for was deleted on YYYY-MM-DD [HH:MM:SS]',
|
|
73
|
+
timeout,
|
|
74
|
+
blur: true
|
|
75
|
+
})
|
|
76
|
+
}}
|
|
77
|
+
label='With Blur'
|
|
78
|
+
/>
|
|
79
|
+
|
|
80
|
+
<Button
|
|
81
|
+
color={WHITE}
|
|
82
|
+
backgroundColor={RICH_BLACK}
|
|
83
|
+
onClick={() => {
|
|
84
|
+
setSplashOptions({
|
|
85
|
+
title: 'Application deleted successfully',
|
|
86
|
+
success: true,
|
|
87
|
+
message: 'You successfully delete this application.',
|
|
88
|
+
timeout,
|
|
89
|
+
children: (
|
|
90
|
+
<Report steps={getReportSteps()} />
|
|
91
|
+
)
|
|
92
|
+
})
|
|
93
|
+
}}
|
|
94
|
+
label='With report'
|
|
95
|
+
/>
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
{showSplashScreen && (
|
|
99
|
+
<SplashScreen
|
|
100
|
+
{...splashOptions}
|
|
101
|
+
onDestroyed={() => setShowSplashScreen(false)}
|
|
102
|
+
>{splashOptions.children}
|
|
103
|
+
</SplashScreen>
|
|
104
|
+
)}
|
|
105
|
+
</div>
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export const Samples = {
|
|
110
|
+
render: () => <Template timeout={5000000} />
|
|
111
|
+
}
|
|
@@ -5,7 +5,7 @@ import CircleCloseIcon from '../../components/icons/CircleCloseIcon'
|
|
|
5
5
|
import WorkspaceStaticIcon from '../../components/icons/WorkspaceStaticIcon'
|
|
6
6
|
import UpgradeIcon from '../../components/icons/UpgradeIcon'
|
|
7
7
|
import WorkspaceDynamicIcon from '../../components/icons/WorkspaceDynamicIcon'
|
|
8
|
-
import { COLORS_ICON } from '../../components/constants'
|
|
8
|
+
import { COLORS_ICON, MAIN_GREEN, RICH_BLACK } from '../../components/constants'
|
|
9
9
|
import icons from '../../components/icons/index.js'
|
|
10
10
|
|
|
11
11
|
const divStyle = {
|
|
@@ -98,7 +98,10 @@ LargeIconsDefault.args = {}
|
|
|
98
98
|
|
|
99
99
|
const AllSizesIcons = (Icon) => () => {
|
|
100
100
|
const icons = ['small', 'medium', 'large'].map((size) => (
|
|
101
|
-
<
|
|
101
|
+
<div key={size} className='antani' style={{ backgroundColor: RICH_BLACK }}>
|
|
102
|
+
<Icon size={size} color={MAIN_GREEN} />
|
|
103
|
+
</div>
|
|
104
|
+
|
|
102
105
|
))
|
|
103
106
|
return icons
|
|
104
107
|
}
|
|
@@ -113,3 +116,5 @@ export const ExportIcons = AllSizesIcons(icons.ExportIcon).bind({})
|
|
|
113
116
|
export const InfoCircleIcons = AllSizesIcons(icons.InfoCircleIcon).bind({})
|
|
114
117
|
export const CollapseSquareIcons = AllSizesIcons(icons.CollapseSquareIcon).bind({})
|
|
115
118
|
export const ExpandSquareIcon = AllSizesIcons(icons.ExpandSquareIcon).bind({})
|
|
119
|
+
export const EntrypointIcon = AllSizesIcons(icons.EntrypointIcon).bind({})
|
|
120
|
+
export const AlertIcon = AllSizesIcons(icons.AlertIcon).bind({})
|