@platformatic/ui-components 0.4.0 → 0.5.0
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/dist/assets/index-BHLxMHb5.js +40 -0
- package/dist/assets/{index-K_bDNror.css → index-Of0we_2v.css} +1 -1
- package/dist/index.html +2 -2
- package/index.js +0 -2
- package/package.json +3 -3
- package/setupTests.js +1 -0
- package/src/components/BorderedBox.jsx +9 -20
- package/src/components/Button.jsx +14 -30
- package/src/components/ButtonFullRounded.jsx +13 -31
- package/src/components/ButtonOnlyIcon.jsx +13 -36
- package/src/components/Checkbox.jsx +5 -6
- package/src/components/CopyAndPaste.jsx +8 -19
- package/src/components/HorizontalSeparator.jsx +6 -8
- package/src/components/LoadingSpinnerV2.jsx +4 -11
- package/src/components/LoginButton.test.jsx +0 -1
- package/src/components/Modal.jsx +11 -25
- package/src/components/PlatformaticIcon.jsx +9 -21
- package/src/components/TabbedWindow.jsx +11 -10
- package/src/components/TabbedWindow.module.css +4 -4
- package/src/components/Tag.jsx +9 -11
- package/src/components/VerticalSeparator.jsx +6 -4
- package/src/components/icons/APIDocsIcon.jsx +6 -7
- package/src/components/icons/AddIcon.jsx +6 -7
- package/src/components/icons/AlertIcon.jsx +6 -7
- package/src/components/icons/AllAppsIcon.jsx +6 -7
- package/src/components/icons/AllInOneIcon.jsx +6 -7
- package/src/components/icons/ApiCloudIcon.jsx +6 -7
- package/src/components/icons/ApiEmptyIcon.jsx +6 -7
- package/src/components/icons/ApiIcon.jsx +6 -7
- package/src/components/icons/ApiIconClosed.jsx +10 -6
- package/src/components/icons/ApiPerformanceIcon.jsx +6 -7
- package/src/components/icons/AppConfigurationIcon.jsx +6 -7
- package/src/components/icons/AppDetailsIcon.jsx +6 -7
- package/src/components/icons/AppEditIcon.jsx +6 -7
- package/src/components/icons/AppEmptyIcon.jsx +6 -7
- package/src/components/icons/AppIcon.jsx +6 -7
- package/src/components/icons/AppListIcon.jsx +6 -7
- package/src/components/icons/AppSettingsIcon.jsx +6 -7
- package/src/components/icons/AppWorkspace.jsx +10 -7
- package/src/components/icons/ApplicationTypeIcon.jsx +6 -7
- package/src/components/icons/ArrowDownFullIcon.jsx +6 -7
- package/src/components/icons/ArrowDownIcon.jsx +6 -7
- package/src/components/icons/ArrowLeftIcon.jsx +6 -7
- package/src/components/icons/ArrowLongLeftIcon.jsx +6 -7
- package/src/components/icons/ArrowLongRightIcon.jsx +6 -7
- package/src/components/icons/ArrowRightIcon.jsx +6 -7
- package/src/components/icons/ArrowUpIcon.jsx +6 -7
- package/src/components/icons/BellIcon.jsx +6 -7
- package/src/components/icons/BillingIcon.jsx +6 -7
- package/src/components/icons/BuiltInLoggingIcon.jsx +6 -7
- package/src/components/icons/CLIIcon.jsx +6 -7
- package/src/components/icons/Calendar1DayIcon.jsx +6 -7
- package/src/components/icons/Calendar7DaysIcon.jsx +6 -7
- package/src/components/icons/CalendarIcon.jsx +6 -7
- package/src/components/icons/CheckListIcon.jsx +6 -7
- package/src/components/icons/CircleAddIcon.jsx +6 -7
- package/src/components/icons/CircleArrowLeftIcon.jsx +6 -7
- package/src/components/icons/CircleArrowRightIcon.jsx +6 -7
- package/src/components/icons/CircleCheckMarkButtonIcon.jsx +6 -8
- package/src/components/icons/CircleCheckMarkFullIcon.jsx +6 -7
- package/src/components/icons/CircleCheckMarkIcon.jsx +7 -6
- package/src/components/icons/CircleCloseHoverIcon.jsx +6 -7
- package/src/components/icons/CircleCloseIcon.jsx +6 -7
- package/src/components/icons/CircleCopyPasteIcon.jsx +6 -7
- package/src/components/icons/CircleDownloadIcon.jsx +6 -7
- package/src/components/icons/CircleEditIcon.jsx +6 -7
- package/src/components/icons/CircleExclamationIcon.jsx +7 -7
- package/src/components/icons/CircleFullIcon.jsx +6 -7
- package/src/components/icons/CircleGearIcon.jsx +6 -7
- package/src/components/icons/CirclePlayIcon.jsx +6 -7
- package/src/components/icons/CircleRestartIcon.jsx +6 -7
- package/src/components/icons/CircleStopIcon.jsx +6 -7
- package/src/components/icons/CircleSubtractIcon.jsx +6 -7
- package/src/components/icons/CircleTwoArrowsDownIcon.jsx +6 -7
- package/src/components/icons/CircleTwoArrowsUpIcon.jsx +6 -7
- package/src/components/icons/CloseIcon.jsx +6 -7
- package/src/components/icons/CloudIcon.jsx +6 -7
- package/src/components/icons/CodeTestingIcon.jsx +6 -7
- package/src/components/icons/ComputerIcon.jsx +6 -7
- package/src/components/icons/ConfigureDatabaseIcon.jsx +6 -7
- package/src/components/icons/CopyPasteIcon.jsx +6 -7
- package/src/components/icons/CreateAppIcon.jsx +6 -7
- package/src/components/icons/CreditCardIcon.jsx +6 -7
- package/src/components/icons/DatabaseIcon.jsx +6 -7
- package/src/components/icons/DatabaseMigrationIcon.jsx +6 -7
- package/src/components/icons/DepencenciesReloadIcon.jsx +6 -7
- package/src/components/icons/EditDocumentIcon.jsx +6 -7
- package/src/components/icons/EditIcon.jsx +6 -7
- package/src/components/icons/EnlargeIcon.jsx +6 -7
- package/src/components/icons/EntryIcon.jsx +6 -7
- package/src/components/icons/EntrypointIcon.jsx +6 -7
- package/src/components/icons/ExpandIcon.jsx +6 -7
- package/src/components/icons/ExploreDocIcon.jsx +6 -7
- package/src/components/icons/EyeClosedIcon.jsx +6 -7
- package/src/components/icons/EyeOpenedIcon.jsx +6 -7
- package/src/components/icons/FolderIcon.jsx +6 -7
- package/src/components/icons/FoldersIcon.jsx +6 -7
- package/src/components/icons/GearIcon.jsx +6 -7
- package/src/components/icons/GenerationLoadingIcon.jsx +6 -7
- package/src/components/icons/GitHubRepo2Icon.jsx +6 -7
- package/src/components/icons/GitHubRepoIcon.jsx +6 -7
- package/src/components/icons/GiveOwnershipIcon.jsx +6 -7
- package/src/components/icons/GraphQLIcon.jsx +6 -7
- package/src/components/icons/ImportAppIcon.jsx +6 -7
- package/src/components/icons/KeyIcon.jsx +6 -7
- package/src/components/icons/LabelIcon.jsx +6 -7
- package/src/components/icons/LayersIcon.jsx +6 -7
- package/src/components/icons/LensIcon.jsx +6 -7
- package/src/components/icons/LiveIcon.jsx +6 -7
- package/src/components/icons/LoadingAppIcon.jsx +6 -7
- package/src/components/icons/LogOutIcon.jsx +7 -7
- package/src/components/icons/LogsRiskIcon.jsx +6 -7
- package/src/components/icons/MetricsIcon.jsx +6 -7
- package/src/components/icons/MetricsLoadingIcon.jsx +6 -7
- package/src/components/icons/MissingTemplateIcon.jsx +6 -7
- package/src/components/icons/NameAppIcon.jsx +6 -7
- package/src/components/icons/NoMetricsIcon.jsx +6 -7
- package/src/components/icons/OrganizationIcon.jsx +6 -7
- package/src/components/icons/OutOfBoxGraphQLIcon.jsx +6 -7
- package/src/components/icons/PlatformaticComposerIcon.jsx +6 -7
- package/src/components/icons/PlatformaticDBIcon.jsx +6 -7
- package/src/components/icons/PlatformaticRuntimeIcon.jsx +6 -7
- package/src/components/icons/PlatformaticServiceIcon.jsx +6 -7
- package/src/components/icons/PlayIcon.jsx +6 -7
- package/src/components/icons/PreviewPRIcon.jsx +6 -7
- package/src/components/icons/PullRequestIcon.jsx +6 -7
- package/src/components/icons/PullRequestLoadingIcon.jsx +6 -7
- package/src/components/icons/RecentAppsIcon.jsx +6 -7
- package/src/components/icons/RequestOwnershipIcon.jsx +6 -7
- package/src/components/icons/RestartIcon.jsx +6 -7
- package/src/components/icons/RocketIcon.jsx +6 -7
- package/src/components/icons/RunningAppIcon.jsx +6 -7
- package/src/components/icons/RunningIcon.jsx +6 -7
- package/src/components/icons/SendIcon.jsx +6 -7
- package/src/components/icons/ServiceIcon.jsx +6 -7
- package/src/components/icons/SlotIcon.jsx +6 -7
- package/src/components/icons/SocialDiscordIcon.jsx +6 -7
- package/src/components/icons/SocialGitHubIcon.jsx +6 -7
- package/src/components/icons/SocialGitLabIcon.jsx +6 -7
- package/src/components/icons/SocialLinkedInIcon.jsx +6 -7
- package/src/components/icons/SocialNPMIcon.jsx +6 -7
- package/src/components/icons/SocialXIcon.jsx +6 -7
- package/src/components/icons/SortDownIcon.jsx +6 -7
- package/src/components/icons/SortIcon.jsx +6 -7
- package/src/components/icons/SortUpIcon.jsx +6 -7
- package/src/components/icons/SortableIcon.jsx +6 -7
- package/src/components/icons/StackablesIcon.jsx +6 -7
- package/src/components/icons/StackablesPluginIcon.jsx +6 -7
- package/src/components/icons/StackablesTemplateIcon.jsx +6 -7
- package/src/components/icons/StopIcon.jsx +6 -7
- package/src/components/icons/StoppedAppIcon.jsx +6 -7
- package/src/components/icons/SwitchIcon.jsx +6 -7
- package/src/components/icons/TeamsIcon.jsx +6 -7
- package/src/components/icons/TerminalIcon.jsx +6 -7
- package/src/components/icons/TrashIcon.jsx +6 -8
- package/src/components/icons/TwoUsersIcon.jsx +6 -7
- package/src/components/icons/UpgradeIcon.jsx +6 -7
- package/src/components/icons/UserComputerIcon.jsx +6 -7
- package/src/components/icons/UserIcon.jsx +6 -7
- package/src/components/icons/UserRemoveIcon.jsx +7 -7
- package/src/components/icons/UserRoleIcon.jsx +7 -7
- package/src/components/icons/WorkspaceDynamicIcon.jsx +6 -7
- package/src/components/icons/WorkspaceEmptyIcon.jsx +6 -7
- package/src/components/icons/WorkspaceFailIcon.jsx +6 -7
- package/src/components/icons/WorkspaceGitHubIcon.jsx +6 -7
- package/src/components/icons/WorkspaceLoadingIcon.jsx +6 -7
- package/src/components/icons/WorkspaceReadyIcon.jsx +6 -7
- package/src/components/icons/WorkspaceStaticIcon.jsx +6 -7
- package/src/components/layouts/Layout.jsx +4 -6
- package/src/components/logos/AdvancedLogo.jsx +5 -7
- package/src/components/logos/BasicLogo.jsx +5 -7
- package/src/components/logos/FreeLogo.jsx +5 -7
- package/src/components/logos/ProLogo.jsx +5 -7
- package/vitest.config.js +2 -1
- package/dist/assets/index-DxEcxprd.js +0 -40
- package/src/components/TabbedWindowV2.jsx +0 -82
- package/src/components/TabbedWindowV2.module.css +0 -17
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
import React, { useEffect, useState } from 'react'
|
|
3
|
-
import PropTypes from 'prop-types'
|
|
4
|
-
import styles from './TabbedWindowV2.module.css'
|
|
5
|
-
import commonStyles from './Common.module.css'
|
|
6
|
-
import { MAIN_DARK_BLUE, OPACITY_30, TRANSPARENT, WHITE } from './constants'
|
|
7
|
-
import VerticalSeparator from './VerticalSeparator'
|
|
8
|
-
|
|
9
|
-
function TabbedWindowV2 ({ tabs, keySelected, backgroundColor }) {
|
|
10
|
-
const headers = []
|
|
11
|
-
const keys = []
|
|
12
|
-
const components = []
|
|
13
|
-
tabs.forEach((tab) => {
|
|
14
|
-
headers.push(tab.headerComponent)
|
|
15
|
-
keys.push(tab.key)
|
|
16
|
-
components.push(tab.component)
|
|
17
|
-
})
|
|
18
|
-
const [currentComponent, setCurrentComponent] = useState(components[0])
|
|
19
|
-
const className = commonStyles.fullWidth + ' ' + commonStyles[`background-color-${backgroundColor}`] + ' '
|
|
20
|
-
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
if (keySelected) {
|
|
23
|
-
const indexKey = keys.findIndex(key => key === keySelected)
|
|
24
|
-
setCurrentComponent(components[indexKey])
|
|
25
|
-
}
|
|
26
|
-
}, [keySelected])
|
|
27
|
-
|
|
28
|
-
function renderHeaders () {
|
|
29
|
-
const cmps = []
|
|
30
|
-
headers.forEach((header, index) => {
|
|
31
|
-
if (index > 0) {
|
|
32
|
-
cmps.push(<VerticalSeparator color={WHITE} backgroundColorOpacity={OPACITY_30} key={`vs${index}`} />)
|
|
33
|
-
}
|
|
34
|
-
cmps.push(header())
|
|
35
|
-
/* const element = header()
|
|
36
|
-
cmps.push(
|
|
37
|
-
React.cloneElement(element, {
|
|
38
|
-
key: element.key,
|
|
39
|
-
onClick: () => {setCurrentTab(index)},
|
|
40
|
-
})
|
|
41
|
-
) */
|
|
42
|
-
})
|
|
43
|
-
return cmps
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<div className={`${styles.container} ${className}`}>
|
|
48
|
-
<div className={styles['tabs-header']}>
|
|
49
|
-
{renderHeaders()}
|
|
50
|
-
</div>
|
|
51
|
-
<div className={styles['tabs-content']}>{currentComponent}</div>
|
|
52
|
-
</div>
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
TabbedWindowV2.propTypes = {
|
|
57
|
-
/**
|
|
58
|
-
* tabs
|
|
59
|
-
*/
|
|
60
|
-
tabs: PropTypes.array,
|
|
61
|
-
/**
|
|
62
|
-
* keySelected
|
|
63
|
-
*/
|
|
64
|
-
keySelected: PropTypes.string,
|
|
65
|
-
/**
|
|
66
|
-
* callbackSelected
|
|
67
|
-
*/
|
|
68
|
-
callbackSelected: PropTypes.func,
|
|
69
|
-
/**
|
|
70
|
-
* backgroundColor
|
|
71
|
-
*/
|
|
72
|
-
backgroundColor: PropTypes.oneOf([WHITE, MAIN_DARK_BLUE, TRANSPARENT])
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
TabbedWindowV2.defaultProps = {
|
|
76
|
-
tabs: [],
|
|
77
|
-
keySelected: '',
|
|
78
|
-
callbackSelected: () => {},
|
|
79
|
-
backgroundColor: MAIN_DARK_BLUE
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export default TabbedWindowV2
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
@apply flex flex-col gap-y-10
|
|
3
|
-
}
|
|
4
|
-
.tabs-header {
|
|
5
|
-
@apply flex justify-start items-center gap-x-0;
|
|
6
|
-
}
|
|
7
|
-
.tabs-content {
|
|
8
|
-
@apply min-h-screen
|
|
9
|
-
}
|
|
10
|
-
.tab::before {
|
|
11
|
-
display: block;
|
|
12
|
-
content: attr(title);
|
|
13
|
-
font-weight: bold;
|
|
14
|
-
height: 0;
|
|
15
|
-
overflow: hidden;
|
|
16
|
-
visibility: hidden;
|
|
17
|
-
}
|