@platformatic/ui-components 0.1.124 → 0.1.125
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-78f54889.js +206 -0
- package/dist/assets/index-89e9ad97.css +1 -0
- package/dist/index.html +2 -2
- package/dist/main.css +0 -10
- package/fonts/Inter/Inter-VariableFont_slnt,wght.ttf +0 -0
- package/fonts/Inter/OFL.txt +93 -0
- package/fonts/Inter/README.txt +72 -0
- package/fonts/Inter/static/Inter-Black.ttf +0 -0
- package/fonts/Inter/static/Inter-Bold.ttf +0 -0
- package/fonts/Inter/static/Inter-ExtraBold.ttf +0 -0
- package/fonts/Inter/static/Inter-ExtraLight.ttf +0 -0
- package/fonts/Inter/static/Inter-Light.ttf +0 -0
- package/fonts/Inter/static/Inter-Medium.ttf +0 -0
- package/fonts/Inter/static/Inter-Regular.ttf +0 -0
- package/fonts/Inter/static/Inter-SemiBold.ttf +0 -0
- package/fonts/Inter/static/Inter-Thin.ttf +0 -0
- package/fonts/{Montserrat/fonts.css → fonts.css} +7 -0
- package/index.js +8 -0
- package/package.json +1 -1
- package/src/components/BorderedBox.jsx +25 -6
- package/src/components/BorderedBox.module.css +3 -0
- package/src/components/Common.module.css +34 -3
- package/src/components/HorizontalSeparator.jsx +2 -1
- package/src/components/HorizontalSeparator.module.css +19 -0
- package/src/components/LoadingSpinnerV2.jsx +45 -0
- package/src/components/LoadingSpinnerV2.module.css +8 -0
- package/src/components/Modal.jsx +36 -3
- package/src/components/Modal.module.css +9 -1
- package/src/components/ModalDirectional.jsx +83 -0
- package/src/components/ModalDirectional.module.css +38 -0
- package/src/components/PlatformaticIcon.jsx +20 -5
- package/src/components/SearchBarV2.jsx +120 -0
- package/src/components/SearchBarV2.module.css +28 -0
- package/src/components/TabbedWindowV2.jsx +82 -0
- package/src/components/TabbedWindowV2.module.css +17 -0
- package/src/components/VerticalSeparator.jsx +18 -6
- package/src/components/VerticalSeparator.module.css +3 -0
- package/src/components/constants.js +10 -2
- package/src/components/forms/Field.jsx +29 -8
- package/src/components/forms/Field.module.css +7 -1
- package/src/components/forms/Input.jsx +73 -8
- package/src/components/forms/Input.module.css +8 -3
- package/src/components/forms/Select.jsx +98 -20
- package/src/components/forms/Select.module.css +17 -6
- package/src/components/forms/ToggleSwitch.jsx +11 -5
- package/src/components/forms/ToggleSwitch.module.css +2 -2
- package/src/components/icons/AddIcon.jsx +12 -5
- package/src/components/icons/AlertIcon.jsx +12 -5
- package/src/components/icons/AllInOneIcon.jsx +12 -5
- package/src/components/icons/ApiCloudIcon.jsx +12 -5
- package/src/components/icons/ApiEmptyIcon.jsx +12 -5
- package/src/components/icons/ApiIcon.jsx +12 -5
- package/src/components/icons/ApiIconClosed.jsx +10 -4
- package/src/components/icons/ApiPerformanceIcon.jsx +12 -5
- package/src/components/icons/AppEmptyIcon.jsx +12 -5
- package/src/components/icons/AppIcon.jsx +12 -5
- package/src/components/icons/AppListIcon.jsx +12 -5
- package/src/components/icons/AppWorkspace.jsx +5 -2
- package/src/components/icons/ApplicationTypeIcon.jsx +12 -5
- package/src/components/icons/ArrowDownFullIcon.jsx +12 -5
- package/src/components/icons/ArrowDownIcon.jsx +12 -5
- package/src/components/icons/ArrowLeftIcon.jsx +12 -5
- package/src/components/icons/ArrowLongLeftIcon.jsx +84 -0
- package/src/components/icons/ArrowLongRightIcon.jsx +12 -5
- package/src/components/icons/ArrowRightIcon.jsx +12 -5
- package/src/components/icons/ArrowUpIcon.jsx +12 -5
- package/src/components/icons/BellIcon.jsx +12 -5
- package/src/components/icons/BillingIcon.jsx +12 -5
- package/src/components/icons/Calendar1DayIcon.jsx +12 -5
- package/src/components/icons/Calendar7DaysIcon.jsx +12 -5
- package/src/components/icons/CalendarIcon.jsx +12 -5
- package/src/components/icons/CheckListIcon.jsx +12 -5
- package/src/components/icons/CircleAddIcon.jsx +12 -5
- package/src/components/icons/CircleArrowLeftIcon.jsx +12 -5
- package/src/components/icons/CircleArrowRightIcon.jsx +12 -5
- package/src/components/icons/CircleCheckMarkButtonIcon.jsx +7 -3
- package/src/components/icons/CircleCheckMarkFullIcon.jsx +12 -5
- package/src/components/icons/CircleCheckMarkIcon.jsx +10 -4
- package/src/components/icons/CircleCloseHoverIcon.jsx +12 -5
- package/src/components/icons/CircleCloseIcon.jsx +12 -5
- package/src/components/icons/CircleCopyPasteIcon.jsx +12 -5
- package/src/components/icons/CircleDownloadIcon.jsx +12 -5
- package/src/components/icons/CircleEditIcon.jsx +12 -5
- package/src/components/icons/CircleExclamationIcon.jsx +5 -2
- package/src/components/icons/CircleFullIcon.jsx +12 -5
- package/src/components/icons/CircleGearIcon.jsx +12 -5
- package/src/components/icons/CircleRestartIcon.jsx +12 -5
- package/src/components/icons/CircleSubtractIcon.jsx +12 -5
- package/src/components/icons/CircleTwoArrowsDownIcon.jsx +12 -5
- package/src/components/icons/CircleTwoArrowsUpIcon.jsx +12 -5
- package/src/components/icons/CloseIcon.jsx +12 -5
- package/src/components/icons/CloudIcon.jsx +12 -5
- package/src/components/icons/ConfigureDatabaseIcon.jsx +12 -5
- package/src/components/icons/CopyPasteIcon.jsx +12 -5
- package/src/components/icons/CreatingAppIcon.jsx +12 -5
- package/src/components/icons/CreditCardIcon.jsx +12 -5
- package/src/components/icons/DatabaseIcon.jsx +12 -5
- package/src/components/icons/DatabaseMigrationIcon.jsx +12 -5
- package/src/components/icons/DepencenciesReloadIcon.jsx +12 -5
- package/src/components/icons/EditDocumentIcon.jsx +12 -5
- package/src/components/icons/EditIcon.jsx +12 -5
- package/src/components/icons/EnlargeIcon.jsx +12 -5
- package/src/components/icons/EntryIcon.jsx +12 -5
- package/src/components/icons/ExpandIcon.jsx +92 -0
- package/src/components/icons/ExploreDocIcon.jsx +12 -5
- package/src/components/icons/EyeClosedIcon.jsx +12 -5
- package/src/components/icons/EyeOpenedIcon.jsx +12 -5
- package/src/components/icons/FolderIcon.jsx +83 -0
- package/src/components/icons/FoldersIcon.jsx +86 -0
- package/src/components/icons/GearIcon.jsx +12 -5
- package/src/components/icons/GenerationLoadingIcon.jsx +12 -5
- package/src/components/icons/GitHubRepo2Icon.jsx +12 -5
- package/src/components/icons/GitHubRepoIcon.jsx +12 -5
- package/src/components/icons/GiveOwnershipIcon.jsx +12 -5
- package/src/components/icons/GraphQLIcon.jsx +12 -5
- package/src/components/icons/Icons.module.css +7 -2
- package/src/components/icons/ImportApplicationIcon.jsx +12 -5
- package/src/components/icons/KeyIcon.jsx +12 -5
- package/src/components/icons/LabelIcon.jsx +12 -5
- package/src/components/icons/LayersIcon.jsx +12 -5
- package/src/components/icons/LensIcon.jsx +12 -5
- package/src/components/icons/LiveIcon.jsx +12 -5
- package/src/components/icons/LoadingAppIcon.jsx +12 -5
- package/src/components/icons/LogOutIcon.jsx +5 -2
- package/src/components/icons/MetricsIcon.jsx +12 -5
- package/src/components/icons/MetricsLoadingIcon.jsx +12 -5
- package/src/components/icons/NameAppIcon.jsx +12 -5
- package/src/components/icons/OrganizationIcon.jsx +12 -5
- package/src/components/icons/OutOfBoxGraphQLIcon.jsx +12 -5
- package/src/components/icons/PlatformaticComposerIcon.jsx +12 -5
- package/src/components/icons/PlatformaticDBIcon.jsx +12 -5
- package/src/components/icons/PlatformaticRuntimeIcon.jsx +12 -5
- package/src/components/icons/PlatformaticServiceIcon.jsx +12 -5
- package/src/components/icons/PlayIcon.jsx +12 -5
- package/src/components/icons/PreviewPRIcon.jsx +12 -5
- package/src/components/icons/PullRequestIcon.jsx +12 -5
- package/src/components/icons/PullRequestLoadingIcon.jsx +12 -5
- package/src/components/icons/RequestOwnershipIcon.jsx +12 -5
- package/src/components/icons/RestartIcon.jsx +12 -5
- package/src/components/icons/RocketIcon.jsx +12 -5
- package/src/components/icons/RunningIcon.jsx +12 -5
- package/src/components/icons/SendIcon.jsx +12 -5
- package/src/components/icons/ServiceIcon.jsx +12 -5
- package/src/components/icons/SlotIcon.jsx +12 -5
- package/src/components/icons/SocialDiscordIcon.jsx +12 -5
- package/src/components/icons/SocialGitHubIcon.jsx +12 -5
- package/src/components/icons/SocialGitLabIcon.jsx +12 -5
- package/src/components/icons/SocialLinkedInIcon.jsx +12 -5
- package/src/components/icons/SocialNPMIcon.jsx +12 -5
- package/src/components/icons/SocialXIcon.jsx +12 -5
- package/src/components/icons/SortableIcon.jsx +93 -0
- package/src/components/icons/StackablesPluginIcon.jsx +134 -0
- package/src/components/icons/StackablesTemplateIcon.jsx +133 -0
- package/src/components/icons/StopIcon.jsx +12 -5
- package/src/components/icons/SwitchIcon.jsx +12 -5
- package/src/components/icons/TeamsIcon.jsx +12 -5
- package/src/components/icons/TerminalIcon.jsx +12 -5
- package/src/components/icons/TrashIcon.jsx +95 -0
- package/src/components/icons/TwoUsersIcon.jsx +12 -5
- package/src/components/icons/UpgradeIcon.jsx +12 -5
- package/src/components/icons/UserIcon.jsx +12 -5
- package/src/components/icons/UserRemoveIcon.jsx +5 -2
- package/src/components/icons/UserRoleIcon.jsx +5 -2
- package/src/components/icons/WorkspaceDynamicIcon.jsx +12 -5
- package/src/components/icons/WorkspaceEmptyIcon.jsx +12 -5
- package/src/components/icons/WorkspaceFailIcon.jsx +12 -5
- package/src/components/icons/WorkspaceGitHubIcon.jsx +12 -5
- package/src/components/icons/WorkspaceLoadingIcon.jsx +12 -5
- package/src/components/icons/WorkspaceReadyIcon.jsx +12 -5
- package/src/components/icons/WorkspaceStaticIcon.jsx +12 -5
- package/src/components/icons/index.js +23 -7
- package/src/stories/ModalDirectional.stories.jsx +45 -0
- package/src/stories/forms/Select.stories.jsx +33 -1
- package/tailwind.config.cjs +5 -2
- package/dist/assets/index-3a61658e.css +0 -1
- package/dist/assets/index-8f6ac36c.js +0 -206
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
import React, { useState, useEffect } from 'react'
|
|
3
|
+
import PropTypes from 'prop-types'
|
|
4
|
+
import useEscapeKey from '../hooks/useEscapeKey'
|
|
5
|
+
import styles from './ModalDirectional.module.css'
|
|
6
|
+
import {
|
|
7
|
+
SMALL,
|
|
8
|
+
WHITE
|
|
9
|
+
} from './constants'
|
|
10
|
+
import PlatformaticIcon from './PlatformaticIcon'
|
|
11
|
+
|
|
12
|
+
function ModalDirectional ({
|
|
13
|
+
setIsOpen,
|
|
14
|
+
title,
|
|
15
|
+
titleClassName,
|
|
16
|
+
children,
|
|
17
|
+
smallLayout
|
|
18
|
+
}) {
|
|
19
|
+
const className = `${styles.container} ${styles.modalLeftCover} ${smallLayout ? styles.smallLayout : styles.normalLayout}`
|
|
20
|
+
const [modalClassName] = useState(className)
|
|
21
|
+
const [variantModalClassName, setVariantModalClassName] = useState(`${styles.container} ${styles.modalLeftCover}`)
|
|
22
|
+
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
setVariantModalClassName(`${modalClassName} ${styles.modalLeftCoverEntering}`)
|
|
25
|
+
}, [])
|
|
26
|
+
|
|
27
|
+
useEscapeKey(() => closeModal())
|
|
28
|
+
|
|
29
|
+
function closeModal () {
|
|
30
|
+
setVariantModalClassName(`${modalClassName} ${styles.modalLeftCoverLeaving}`)
|
|
31
|
+
setTimeout(() => {
|
|
32
|
+
setIsOpen(false)
|
|
33
|
+
}, 300)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<>
|
|
38
|
+
<div className={styles.blur} onClick={() => closeModal()} />
|
|
39
|
+
<div className={variantModalClassName}>
|
|
40
|
+
<div className={styles.modalLefty}>
|
|
41
|
+
<div className={styles.headerClassName}>
|
|
42
|
+
<PlatformaticIcon iconName='ArrowLongLeftIcon' color={WHITE} size={SMALL} onClick={() => closeModal()} />
|
|
43
|
+
<span className={titleClassName}>{title}</span>
|
|
44
|
+
</div>
|
|
45
|
+
{children}
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
ModalDirectional.propTypes = {
|
|
53
|
+
/**
|
|
54
|
+
* children
|
|
55
|
+
*/
|
|
56
|
+
children: PropTypes.node,
|
|
57
|
+
/**
|
|
58
|
+
* setIsOpen
|
|
59
|
+
*/
|
|
60
|
+
setIsOpen: PropTypes.func,
|
|
61
|
+
/**
|
|
62
|
+
* title
|
|
63
|
+
*/
|
|
64
|
+
title: PropTypes.string,
|
|
65
|
+
/**
|
|
66
|
+
* title
|
|
67
|
+
*/
|
|
68
|
+
titleClassName: PropTypes.string,
|
|
69
|
+
/**
|
|
70
|
+
* smallLayout
|
|
71
|
+
*/
|
|
72
|
+
smallLayout: PropTypes.bool
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
ModalDirectional.defaultProps = {
|
|
76
|
+
children: null,
|
|
77
|
+
setIsOpen: () => {},
|
|
78
|
+
title: '',
|
|
79
|
+
titleClassName: '',
|
|
80
|
+
smallLayout: false
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export default ModalDirectional
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.blur {
|
|
2
|
+
@apply absolute top-0 left-0 w-full h-full z-10 bg-rich-black/75;
|
|
3
|
+
}
|
|
4
|
+
.container {
|
|
5
|
+
@apply z-20 fixed top-0 -right-[100%] min-h-full h-full bg-rich-black border-solid border-white border-l;
|
|
6
|
+
}
|
|
7
|
+
.normalLayout {
|
|
8
|
+
@apply max-w-[75%] min-w-[75%];
|
|
9
|
+
}
|
|
10
|
+
.smallLayout {
|
|
11
|
+
@apply max-w-[34%] min-w-[34%];
|
|
12
|
+
}
|
|
13
|
+
.modalLeftCover {
|
|
14
|
+
@apply overflow-y-auto w-full ;
|
|
15
|
+
}
|
|
16
|
+
.modalLeftCoverEntering {
|
|
17
|
+
animation: come-in 400ms forwards;
|
|
18
|
+
}
|
|
19
|
+
.modalLeftCoverLeaving {
|
|
20
|
+
animation: come-out 200ms forwards;
|
|
21
|
+
}
|
|
22
|
+
.headerClassName {
|
|
23
|
+
@apply flex items-center gap-x-2 pb-4;
|
|
24
|
+
}
|
|
25
|
+
.modalLefty {
|
|
26
|
+
@apply py-20 px-[7.5rem];
|
|
27
|
+
height: calc(100% - 10rem);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@keyframes come-in {
|
|
31
|
+
from {right: -100%}
|
|
32
|
+
to {right: 0%}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@keyframes come-out {
|
|
36
|
+
from {right: 0%}
|
|
37
|
+
to {right: -100%}
|
|
38
|
+
}
|
|
@@ -6,19 +6,29 @@ import Icons from './icons'
|
|
|
6
6
|
import styles from './PlatformaticIcon.module.css'
|
|
7
7
|
import { COLORS_ICON, MAIN_GREEN, SIZES, SMALL } from './constants'
|
|
8
8
|
|
|
9
|
-
function PlatformaticIcon ({
|
|
9
|
+
function PlatformaticIcon ({
|
|
10
|
+
iconName,
|
|
11
|
+
color,
|
|
12
|
+
onClick,
|
|
13
|
+
size,
|
|
14
|
+
classes,
|
|
15
|
+
tip,
|
|
16
|
+
disabled,
|
|
17
|
+
...rest
|
|
18
|
+
}) {
|
|
10
19
|
let icon = <></>
|
|
11
20
|
if (iconName) {
|
|
12
21
|
icon = React.createElement(Icons[`${iconName}`], {
|
|
13
22
|
color,
|
|
14
23
|
size,
|
|
15
24
|
tip,
|
|
25
|
+
disabled,
|
|
16
26
|
...rest
|
|
17
27
|
})
|
|
18
|
-
if (onClick) {
|
|
28
|
+
if (onClick && !disabled) {
|
|
19
29
|
let className = styles.cursorPointer
|
|
20
30
|
if (classes) className += ` ${classes}`
|
|
21
|
-
icon = (<
|
|
31
|
+
icon = (<div className={className} onClick={onClick}>{icon}</div>)
|
|
22
32
|
}
|
|
23
33
|
}
|
|
24
34
|
return (
|
|
@@ -53,7 +63,11 @@ PlatformaticIcon.propTypes = {
|
|
|
53
63
|
/**
|
|
54
64
|
* tip
|
|
55
65
|
*/
|
|
56
|
-
tip: PropTypes.string
|
|
66
|
+
tip: PropTypes.string,
|
|
67
|
+
/**
|
|
68
|
+
* disabled
|
|
69
|
+
*/
|
|
70
|
+
disabled: PropTypes.bool
|
|
57
71
|
}
|
|
58
72
|
|
|
59
73
|
PlatformaticIcon.defaultProps = {
|
|
@@ -62,7 +76,8 @@ PlatformaticIcon.defaultProps = {
|
|
|
62
76
|
size: SMALL,
|
|
63
77
|
onClick: () => {},
|
|
64
78
|
classes: '',
|
|
65
|
-
tip: ''
|
|
79
|
+
tip: '',
|
|
80
|
+
disabled: false
|
|
66
81
|
}
|
|
67
82
|
|
|
68
83
|
export default PlatformaticIcon
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
import React, { useRef, useState } from 'react'
|
|
3
|
+
import PropTypes from 'prop-types'
|
|
4
|
+
import styles from './SearchBarV2.module.css'
|
|
5
|
+
import PlatformaticIcon from './PlatformaticIcon'
|
|
6
|
+
import { MEDIUM, WHITE } from './constants'
|
|
7
|
+
function SearchBarV2 ({
|
|
8
|
+
onSubmit,
|
|
9
|
+
onChange,
|
|
10
|
+
onClear,
|
|
11
|
+
color,
|
|
12
|
+
onFocusColor,
|
|
13
|
+
placeholder,
|
|
14
|
+
dataAttrName,
|
|
15
|
+
dataAttrValue
|
|
16
|
+
}) {
|
|
17
|
+
const inputRef = useRef()
|
|
18
|
+
const [wrapperClassName, setWrapperClassName] = useState(normalClassName())
|
|
19
|
+
const [isOnFocus, setIsOnFocus] = useState(false)
|
|
20
|
+
const dataProps = {}
|
|
21
|
+
if (dataAttrName && dataAttrValue) {
|
|
22
|
+
dataProps[`data-${dataAttrName}`] = dataAttrValue
|
|
23
|
+
}
|
|
24
|
+
function handleSearch () {
|
|
25
|
+
if (onSubmit) {
|
|
26
|
+
const value = inputRef.current.value
|
|
27
|
+
return onSubmit(value)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function handleChange () {
|
|
32
|
+
if (onChange) {
|
|
33
|
+
const value = inputRef.current.value
|
|
34
|
+
return onChange(value)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function handleClear () {
|
|
39
|
+
inputRef.current.value = ''
|
|
40
|
+
return onClear()
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function onFocus () {
|
|
44
|
+
if (!isOnFocus) {
|
|
45
|
+
setIsOnFocus(true)
|
|
46
|
+
setWrapperClassName(onFocusClassName())
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function onBlur () {
|
|
51
|
+
setIsOnFocus(false)
|
|
52
|
+
setWrapperClassName(normalClassName())
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function onFocusClassName () {
|
|
56
|
+
return `${styles.container} ${styles.wrapperPadding} ${styles.onFocus}`
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function normalClassName () {
|
|
60
|
+
return `${styles.container} ${styles.wrapperPadding} ${styles.onBlur}`
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<div className={wrapperClassName} {...dataProps}>
|
|
65
|
+
<PlatformaticIcon iconName='LensIcon' color={isOnFocus ? onFocusColor : color} size={MEDIUM} onClick={handleSearch} />
|
|
66
|
+
<input type='text' placeholder={placeholder} className={styles.input} ref={inputRef} onChange={handleChange} onFocus={onFocus} onBlur={onBlur} />
|
|
67
|
+
<div className={styles.clearContainer}>
|
|
68
|
+
<PlatformaticIcon iconName='CircleCloseIcon' color={isOnFocus ? onFocusColor : color} size={MEDIUM} onClick={handleClear} />
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
SearchBarV2.propTypes = {
|
|
75
|
+
/**
|
|
76
|
+
* onSubmit
|
|
77
|
+
*/
|
|
78
|
+
onSubmit: PropTypes.func,
|
|
79
|
+
/**
|
|
80
|
+
* onSubmit
|
|
81
|
+
*/
|
|
82
|
+
onChange: PropTypes.func,
|
|
83
|
+
/**
|
|
84
|
+
* onSubmit
|
|
85
|
+
*/
|
|
86
|
+
onClear: PropTypes.func,
|
|
87
|
+
/**
|
|
88
|
+
* color
|
|
89
|
+
*/
|
|
90
|
+
color: PropTypes.string,
|
|
91
|
+
/**
|
|
92
|
+
* onFocusColor
|
|
93
|
+
*/
|
|
94
|
+
onFocusColor: PropTypes.string,
|
|
95
|
+
/**
|
|
96
|
+
* placeholder
|
|
97
|
+
*/
|
|
98
|
+
placeholder: PropTypes.string,
|
|
99
|
+
/**
|
|
100
|
+
* dataAttrName
|
|
101
|
+
*/
|
|
102
|
+
dataAttrName: PropTypes.string,
|
|
103
|
+
/**
|
|
104
|
+
* dataAttrValue
|
|
105
|
+
*/
|
|
106
|
+
dataAttrValue: PropTypes.string
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
SearchBarV2.defaultProps = {
|
|
110
|
+
color: WHITE,
|
|
111
|
+
onFocusColor: WHITE,
|
|
112
|
+
onSubmit: () => {},
|
|
113
|
+
onChange: () => {},
|
|
114
|
+
onClear: () => {},
|
|
115
|
+
placeholder: 'Search',
|
|
116
|
+
dataAttrName: '',
|
|
117
|
+
dataAttrValue: ''
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export default SearchBarV2
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
@apply relative flex gap-x-2 w-full h-auto border border-solid box-border rounded-md;
|
|
3
|
+
}
|
|
4
|
+
.input {
|
|
5
|
+
@apply w-full p-0 bg-transparent border-none text-white ;
|
|
6
|
+
}
|
|
7
|
+
.onFocus {
|
|
8
|
+
@apply border-white;
|
|
9
|
+
}
|
|
10
|
+
.onBlur {
|
|
11
|
+
@apply border-white/15;
|
|
12
|
+
}
|
|
13
|
+
.fillWhite {
|
|
14
|
+
@apply fill-white;
|
|
15
|
+
}
|
|
16
|
+
.container > input:focus {
|
|
17
|
+
@apply outline-none;
|
|
18
|
+
}
|
|
19
|
+
.title {
|
|
20
|
+
@apply font-semibold text-white text-3xl pb-4;
|
|
21
|
+
}
|
|
22
|
+
.clearContainer {
|
|
23
|
+
@apply absolute right-[1rem] translate-y-[-50%];
|
|
24
|
+
}
|
|
25
|
+
.wrapperPadding {
|
|
26
|
+
@apply px-2 py-1.5;
|
|
27
|
+
}
|
|
28
|
+
|
|
@@ -0,0 +1,82 @@
|
|
|
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
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
}
|
|
@@ -1,23 +1,35 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
import React from 'react'
|
|
3
3
|
import PropTypes from 'prop-types'
|
|
4
|
-
import { DARK_GREEN, MAIN_DARK_BLUE } from './constants'
|
|
4
|
+
import { DARK_GREEN, MAIN_DARK_BLUE, OPACITY_10, OPACITY_20, OPACITY_30, OPACITY_60, OPACITY_100, WHITE } from './constants'
|
|
5
5
|
import commonStyles from './Common.module.css'
|
|
6
|
+
import styles from './VerticalSeparator.module.css'
|
|
6
7
|
|
|
7
|
-
function VerticalSeparator ({ color }) {
|
|
8
|
-
const
|
|
9
|
-
|
|
8
|
+
function VerticalSeparator ({ color, backgroundColorOpacity }) {
|
|
9
|
+
const backgroundColor = commonStyles[`background-color-${color}`]
|
|
10
|
+
const backgroundOpacity = commonStyles[`background-color-opaque-${backgroundColorOpacity}`]
|
|
11
|
+
const className = `${backgroundColor} ${backgroundOpacity} ${styles.fullHeight}`
|
|
12
|
+
return <div className={className} />
|
|
10
13
|
}
|
|
11
14
|
|
|
12
15
|
VerticalSeparator.propTypes = {
|
|
13
16
|
/**
|
|
14
17
|
* color
|
|
15
18
|
*/
|
|
16
|
-
color: PropTypes.oneOf([DARK_GREEN, MAIN_DARK_BLUE])
|
|
19
|
+
color: PropTypes.oneOf([DARK_GREEN, MAIN_DARK_BLUE, WHITE]),
|
|
20
|
+
/**
|
|
21
|
+
* backgroundColorOpacity
|
|
22
|
+
*/
|
|
23
|
+
backgroundColorOpacity: PropTypes.oneOf([OPACITY_10,
|
|
24
|
+
OPACITY_20,
|
|
25
|
+
OPACITY_30,
|
|
26
|
+
OPACITY_60,
|
|
27
|
+
OPACITY_100])
|
|
17
28
|
}
|
|
18
29
|
|
|
19
30
|
VerticalSeparator.defaultProps = {
|
|
20
|
-
color: DARK_GREEN
|
|
31
|
+
color: DARK_GREEN,
|
|
32
|
+
backgroundColorOpacity: 100
|
|
21
33
|
}
|
|
22
34
|
|
|
23
35
|
export default VerticalSeparator
|
|
@@ -9,6 +9,8 @@ export const TRANSPARENT = 'transparent'
|
|
|
9
9
|
export const TERTIARY_BLUE = 'tertiary-blue'
|
|
10
10
|
export const ERROR_RED = 'error-red'
|
|
11
11
|
export const WARNING_YELLOW = 'warning-yellow'
|
|
12
|
+
export const RICH_BLACK = 'rich-black'
|
|
13
|
+
|
|
12
14
|
export const NONE = 'none'
|
|
13
15
|
export const EXTRA_SMALL = 'extra-small'
|
|
14
16
|
export const SMALL = 'small'
|
|
@@ -26,14 +28,15 @@ export const HOVER_EFFECTS_BUTTONS = [BOX_SHADOW, BACKGROUND_COLOR_OPAQUE, UNDER
|
|
|
26
28
|
export const MODAL_SIZES = [SMALL, MEDIUM, FULL_WIDTH]
|
|
27
29
|
|
|
28
30
|
export const COLORS_ICON = [MAIN_GREEN, WHITE, MAIN_DARK_BLUE, ERROR_RED, WARNING_YELLOW, TERTIARY_BLUE]
|
|
29
|
-
export const COLORS_BUTTON = [MAIN_GREEN, DARK_GREEN, LIGHT_GREEN, MAIN_DARK_BLUE, DARK_BLUE, LIGHT_BLUE, WHITE, ERROR_RED, TERTIARY_BLUE, TRANSPARENT]
|
|
31
|
+
export const COLORS_BUTTON = [MAIN_GREEN, DARK_GREEN, LIGHT_GREEN, MAIN_DARK_BLUE, DARK_BLUE, LIGHT_BLUE, WHITE, ERROR_RED, TERTIARY_BLUE, TRANSPARENT, RICH_BLACK]
|
|
30
32
|
export const COLORS_BORDERED_BOX = [MAIN_GREEN, ERROR_RED, WHITE, DARK_BLUE, MAIN_DARK_BLUE, WARNING_YELLOW, TRANSPARENT, LIGHT_BLUE, TERTIARY_BLUE]
|
|
31
33
|
|
|
32
34
|
export const MODAL_POPUP = 'popup'
|
|
35
|
+
export const MODAL_POPUP_V2 = 'popup-v2'
|
|
33
36
|
export const MODAL_COVER = 'cover'
|
|
34
37
|
export const MODAL_FULL_DARK = 'full-dark'
|
|
35
38
|
export const MODAL_FULL_LIGHT = 'full-light'
|
|
36
|
-
export const MODAL_LAYOUTS = [MODAL_POPUP, MODAL_COVER, MODAL_FULL_DARK, MODAL_FULL_LIGHT]
|
|
39
|
+
export const MODAL_LAYOUTS = [MODAL_POPUP_V2, MODAL_POPUP, MODAL_COVER, MODAL_FULL_DARK, MODAL_FULL_LIGHT]
|
|
37
40
|
|
|
38
41
|
export const FREE = 'free'
|
|
39
42
|
export const BASIC = 'basic'
|
|
@@ -49,6 +52,11 @@ export const ROLE_USER = 'user'
|
|
|
49
52
|
export const ROLE_OWNER = 'owner'
|
|
50
53
|
|
|
51
54
|
export const MARGIN_10 = 10
|
|
55
|
+
export const MARGIN_8 = 8
|
|
52
56
|
export const MARGIN_0 = 0
|
|
53
57
|
|
|
58
|
+
export const OPACITY_10 = 10
|
|
54
59
|
export const OPACITY_20 = 20
|
|
60
|
+
export const OPACITY_30 = 30
|
|
61
|
+
export const OPACITY_60 = 60
|
|
62
|
+
export const OPACITY_100 = 100
|
|
@@ -1,19 +1,30 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import styles from './Field.module.css'
|
|
4
|
+
import { ERROR_RED, MAIN_DARK_BLUE, WHITE } from '../constants'
|
|
4
5
|
|
|
5
|
-
function Field ({
|
|
6
|
+
function Field ({
|
|
7
|
+
title,
|
|
8
|
+
titleColor,
|
|
9
|
+
helper,
|
|
10
|
+
children,
|
|
11
|
+
disabled,
|
|
12
|
+
required,
|
|
13
|
+
titleClassName,
|
|
14
|
+
helperClassName
|
|
15
|
+
}) {
|
|
6
16
|
let className = `${styles.container}`
|
|
7
17
|
if (disabled) className += ` ${styles.disabled}`
|
|
8
|
-
|
|
9
|
-
|
|
18
|
+
const styledTitle = titleClassName || (`${styles.title} ` + styles[`text-color-${titleColor}`])
|
|
19
|
+
let styledHelper = helperClassName || styles.helper
|
|
20
|
+
styledHelper += ` ${styles.helperPadding}`
|
|
10
21
|
let titleTmp = title
|
|
11
22
|
if (required) { titleTmp += ' *' }
|
|
12
23
|
|
|
13
24
|
return (
|
|
14
25
|
<div className={className}>
|
|
15
|
-
<p className={
|
|
16
|
-
{helper && <p className={
|
|
26
|
+
<p className={styledTitle}>{titleTmp}</p>
|
|
27
|
+
{helper && <p className={styledHelper}>{helper}</p>}
|
|
17
28
|
<div className={styles.content}>
|
|
18
29
|
{children}
|
|
19
30
|
</div>
|
|
@@ -29,7 +40,7 @@ Field.propTypes = {
|
|
|
29
40
|
/**
|
|
30
41
|
* titleColor
|
|
31
42
|
*/
|
|
32
|
-
titleColor: PropTypes.oneOf([
|
|
43
|
+
titleColor: PropTypes.oneOf([ERROR_RED, MAIN_DARK_BLUE, WHITE]),
|
|
33
44
|
/**
|
|
34
45
|
* helper
|
|
35
46
|
*/
|
|
@@ -45,7 +56,15 @@ Field.propTypes = {
|
|
|
45
56
|
/**
|
|
46
57
|
* required
|
|
47
58
|
*/
|
|
48
|
-
required: PropTypes.bool
|
|
59
|
+
required: PropTypes.bool,
|
|
60
|
+
/**
|
|
61
|
+
* titleClassName
|
|
62
|
+
*/
|
|
63
|
+
titleClassName: PropTypes.string,
|
|
64
|
+
/**
|
|
65
|
+
* titleClassName
|
|
66
|
+
*/
|
|
67
|
+
helperClassName: PropTypes.string
|
|
49
68
|
}
|
|
50
69
|
|
|
51
70
|
Field.defaultProps = {
|
|
@@ -54,7 +73,9 @@ Field.defaultProps = {
|
|
|
54
73
|
helper: '',
|
|
55
74
|
children: null,
|
|
56
75
|
disabled: false,
|
|
57
|
-
required: false
|
|
76
|
+
required: false,
|
|
77
|
+
titleClassName: '',
|
|
78
|
+
helperClassName: ''
|
|
58
79
|
}
|
|
59
80
|
|
|
60
81
|
export default Field
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.container {
|
|
2
|
-
@apply flex flex-col w-full;
|
|
2
|
+
@apply flex flex-col w-full gap-y-1;
|
|
3
3
|
}
|
|
4
4
|
.title {
|
|
5
5
|
@apply font-semibold pb-2;
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
.text-color-error-red {
|
|
11
11
|
@apply text-error-red;
|
|
12
12
|
}
|
|
13
|
+
.text-color-white {
|
|
14
|
+
@apply text-white;
|
|
15
|
+
}
|
|
13
16
|
.helper{
|
|
14
17
|
@apply text-sm pb-4;
|
|
15
18
|
}
|
|
@@ -21,4 +24,7 @@
|
|
|
21
24
|
}
|
|
22
25
|
.disabled {
|
|
23
26
|
@apply opacity-20;
|
|
27
|
+
}
|
|
28
|
+
.helperPadding {
|
|
29
|
+
@apply pb-3
|
|
24
30
|
}
|