@platformatic/ui-components 0.4.0 → 0.5.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.
Files changed (214) hide show
  1. package/dist/assets/{index-K_bDNror.css → index-Of0we_2v.css} +1 -1
  2. package/dist/assets/index-hLMQmMDJ.js +40 -0
  3. package/dist/index.html +2 -2
  4. package/index.js +0 -2
  5. package/package.json +3 -3
  6. package/setupTests.js +1 -0
  7. package/src/components/BorderedBox.jsx +9 -20
  8. package/src/components/Button.jsx +14 -30
  9. package/src/components/ButtonFullRounded.jsx +13 -31
  10. package/src/components/ButtonOnlyIcon.jsx +13 -36
  11. package/src/components/Checkbox.jsx +5 -6
  12. package/src/components/CopyAndPaste.jsx +8 -19
  13. package/src/components/DropDown.jsx +10 -26
  14. package/src/components/FollowUs.jsx +18 -27
  15. package/src/components/HorizontalSeparator.jsx +6 -8
  16. package/src/components/InfoBox.jsx +8 -10
  17. package/src/components/ListElement.jsx +9 -11
  18. package/src/components/LoadingSpinner.jsx +1 -5
  19. package/src/components/LoadingSpinnerV2.jsx +4 -11
  20. package/src/components/LoginButton.test.jsx +0 -1
  21. package/src/components/LogoDropDown.jsx +7 -8
  22. package/src/components/Modal.jsx +11 -25
  23. package/src/components/ModalDirectional.jsx +9 -19
  24. package/src/components/ModalStepsForward.jsx +12 -24
  25. package/src/components/PlatformaticIcon.jsx +9 -21
  26. package/src/components/SearchBarV2.jsx +9 -22
  27. package/src/components/Sidebar.jsx +12 -26
  28. package/src/components/Status.jsx +5 -7
  29. package/src/components/TabbedWindow.jsx +11 -10
  30. package/src/components/TabbedWindow.module.css +4 -4
  31. package/src/components/Tag.jsx +9 -11
  32. package/src/components/TextWithLabel.jsx +7 -9
  33. package/src/components/Tooltip.jsx +8 -19
  34. package/src/components/TooltipAbsolute.jsx +10 -22
  35. package/src/components/VerticalSeparator.jsx +5 -7
  36. package/src/components/forms/Field.jsx +8 -19
  37. package/src/components/forms/Input.jsx +17 -37
  38. package/src/components/forms/InputWithSeparator.jsx +14 -31
  39. package/src/components/forms/Password.jsx +10 -18
  40. package/src/components/forms/Preview.jsx +10 -12
  41. package/src/components/forms/RadioGroup.jsx +9 -17
  42. package/src/components/forms/Select.jsx +19 -40
  43. package/src/components/forms/SelectWithInput.jsx +22 -46
  44. package/src/components/forms/TextArea.jsx +11 -25
  45. package/src/components/forms/ToggleSwitch.jsx +8 -19
  46. package/src/components/icons/APIDocsIcon.jsx +6 -7
  47. package/src/components/icons/AddIcon.jsx +6 -7
  48. package/src/components/icons/AlertIcon.jsx +6 -7
  49. package/src/components/icons/AllAppsIcon.jsx +6 -7
  50. package/src/components/icons/AllInOneIcon.jsx +6 -7
  51. package/src/components/icons/ApiCloudIcon.jsx +6 -7
  52. package/src/components/icons/ApiEmptyIcon.jsx +6 -7
  53. package/src/components/icons/ApiIcon.jsx +6 -7
  54. package/src/components/icons/ApiIconClosed.jsx +10 -6
  55. package/src/components/icons/ApiPerformanceIcon.jsx +6 -7
  56. package/src/components/icons/AppConfigurationIcon.jsx +6 -7
  57. package/src/components/icons/AppDetailsIcon.jsx +6 -7
  58. package/src/components/icons/AppEditIcon.jsx +6 -7
  59. package/src/components/icons/AppEmptyIcon.jsx +6 -7
  60. package/src/components/icons/AppIcon.jsx +6 -7
  61. package/src/components/icons/AppListIcon.jsx +6 -7
  62. package/src/components/icons/AppSettingsIcon.jsx +6 -7
  63. package/src/components/icons/AppWorkspace.jsx +10 -7
  64. package/src/components/icons/ApplicationTypeIcon.jsx +6 -7
  65. package/src/components/icons/ArrowDownFullIcon.jsx +6 -7
  66. package/src/components/icons/ArrowDownIcon.jsx +6 -7
  67. package/src/components/icons/ArrowLeftIcon.jsx +6 -7
  68. package/src/components/icons/ArrowLongLeftIcon.jsx +6 -7
  69. package/src/components/icons/ArrowLongRightIcon.jsx +6 -7
  70. package/src/components/icons/ArrowRightIcon.jsx +6 -7
  71. package/src/components/icons/ArrowUpIcon.jsx +6 -7
  72. package/src/components/icons/BellIcon.jsx +6 -7
  73. package/src/components/icons/BillingIcon.jsx +6 -7
  74. package/src/components/icons/BranchIcon.jsx +102 -0
  75. package/src/components/icons/BuiltInLoggingIcon.jsx +6 -7
  76. package/src/components/icons/CLIIcon.jsx +6 -7
  77. package/src/components/icons/Calendar1DayIcon.jsx +6 -7
  78. package/src/components/icons/Calendar7DaysIcon.jsx +6 -7
  79. package/src/components/icons/CalendarIcon.jsx +6 -7
  80. package/src/components/icons/CheckListIcon.jsx +6 -7
  81. package/src/components/icons/CircleAddIcon.jsx +6 -7
  82. package/src/components/icons/CircleArrowLeftIcon.jsx +6 -7
  83. package/src/components/icons/CircleArrowRightIcon.jsx +6 -7
  84. package/src/components/icons/CircleCheckMarkButtonIcon.jsx +6 -8
  85. package/src/components/icons/CircleCheckMarkFullIcon.jsx +6 -7
  86. package/src/components/icons/CircleCheckMarkIcon.jsx +7 -6
  87. package/src/components/icons/CircleCloseHoverIcon.jsx +6 -7
  88. package/src/components/icons/CircleCloseIcon.jsx +6 -7
  89. package/src/components/icons/CircleCopyPasteIcon.jsx +6 -7
  90. package/src/components/icons/CircleDownloadIcon.jsx +6 -7
  91. package/src/components/icons/CircleEditIcon.jsx +6 -7
  92. package/src/components/icons/CircleExclamationIcon.jsx +7 -7
  93. package/src/components/icons/CircleFullIcon.jsx +6 -7
  94. package/src/components/icons/CircleGearIcon.jsx +6 -7
  95. package/src/components/icons/CirclePlayIcon.jsx +6 -7
  96. package/src/components/icons/CircleRestartIcon.jsx +6 -7
  97. package/src/components/icons/CircleStopIcon.jsx +6 -7
  98. package/src/components/icons/CircleSubtractIcon.jsx +6 -7
  99. package/src/components/icons/CircleTwoArrowsDownIcon.jsx +6 -7
  100. package/src/components/icons/CircleTwoArrowsUpIcon.jsx +6 -7
  101. package/src/components/icons/CloseIcon.jsx +6 -7
  102. package/src/components/icons/CloudIcon.jsx +6 -7
  103. package/src/components/icons/CodeTestingIcon.jsx +6 -7
  104. package/src/components/icons/ComputerIcon.jsx +6 -7
  105. package/src/components/icons/ConfigureDatabaseIcon.jsx +6 -7
  106. package/src/components/icons/CopyPasteIcon.jsx +6 -7
  107. package/src/components/icons/CreateAppIcon.jsx +6 -7
  108. package/src/components/icons/CreditCardIcon.jsx +6 -7
  109. package/src/components/icons/DatabaseIcon.jsx +6 -7
  110. package/src/components/icons/DatabaseMigrationIcon.jsx +6 -7
  111. package/src/components/icons/DepencenciesReloadIcon.jsx +6 -7
  112. package/src/components/icons/DeploymentHistoryIcon.jsx +118 -0
  113. package/src/components/icons/EditDocumentIcon.jsx +6 -7
  114. package/src/components/icons/EditIcon.jsx +6 -7
  115. package/src/components/icons/EnlargeIcon.jsx +6 -7
  116. package/src/components/icons/EntryIcon.jsx +6 -7
  117. package/src/components/icons/EntrypointIcon.jsx +6 -7
  118. package/src/components/icons/ExpandIcon.jsx +6 -7
  119. package/src/components/icons/ExploreDocIcon.jsx +6 -7
  120. package/src/components/icons/EyeClosedIcon.jsx +6 -7
  121. package/src/components/icons/EyeOpenedIcon.jsx +6 -7
  122. package/src/components/icons/FailureRateIcon.jsx +104 -0
  123. package/src/components/icons/FolderIcon.jsx +6 -7
  124. package/src/components/icons/FoldersIcon.jsx +6 -7
  125. package/src/components/icons/GearIcon.jsx +6 -7
  126. package/src/components/icons/GenerationLoadingIcon.jsx +6 -7
  127. package/src/components/icons/GitHubRepo2Icon.jsx +6 -7
  128. package/src/components/icons/GitHubRepoIcon.jsx +6 -7
  129. package/src/components/icons/GiveOwnershipIcon.jsx +6 -7
  130. package/src/components/icons/GraphQLIcon.jsx +6 -7
  131. package/src/components/icons/ImportAppIcon.jsx +6 -7
  132. package/src/components/icons/K8SMetricsIcon.jsx +106 -0
  133. package/src/components/icons/KeyIcon.jsx +6 -7
  134. package/src/components/icons/LabelIcon.jsx +6 -7
  135. package/src/components/icons/LayersIcon.jsx +6 -7
  136. package/src/components/icons/LensIcon.jsx +6 -7
  137. package/src/components/icons/LiveIcon.jsx +6 -7
  138. package/src/components/icons/LoadingAppIcon.jsx +6 -7
  139. package/src/components/icons/LogOutIcon.jsx +7 -7
  140. package/src/components/icons/LogsRiskIcon.jsx +6 -7
  141. package/src/components/icons/MetricsIcon.jsx +6 -7
  142. package/src/components/icons/MetricsLoadingIcon.jsx +6 -7
  143. package/src/components/icons/MetricsLogsIcon.jsx +124 -0
  144. package/src/components/icons/MissingTemplateIcon.jsx +6 -7
  145. package/src/components/icons/NameAppIcon.jsx +6 -7
  146. package/src/components/icons/NoMetricsIcon.jsx +6 -7
  147. package/src/components/icons/NodeJSMetricsIcon.jsx +106 -0
  148. package/src/components/icons/NotCompliantServiceIcon.jsx +103 -0
  149. package/src/components/icons/OrganizationIcon.jsx +6 -7
  150. package/src/components/icons/OtherLogosGoogleIcon.jsx +69 -0
  151. package/src/components/icons/OutOfBoxGraphQLIcon.jsx +6 -7
  152. package/src/components/icons/OutdatedServiceIcon.jsx +105 -0
  153. package/src/components/icons/PlatformaticComposerIcon.jsx +6 -7
  154. package/src/components/icons/PlatformaticDBIcon.jsx +6 -7
  155. package/src/components/icons/PlatformaticRuntimeIcon.jsx +6 -7
  156. package/src/components/icons/PlatformaticServiceIcon.jsx +6 -7
  157. package/src/components/icons/PlayIcon.jsx +6 -7
  158. package/src/components/icons/PreviewPRIcon.jsx +6 -7
  159. package/src/components/icons/PullRequestIcon.jsx +6 -7
  160. package/src/components/icons/PullRequestLoadingIcon.jsx +6 -7
  161. package/src/components/icons/RecentAppsIcon.jsx +6 -7
  162. package/src/components/icons/RequestOwnershipIcon.jsx +6 -7
  163. package/src/components/icons/ResourceIcon.jsx +111 -0
  164. package/src/components/icons/RestartIcon.jsx +6 -7
  165. package/src/components/icons/RocketIcon.jsx +6 -7
  166. package/src/components/icons/RunningAppIcon.jsx +6 -7
  167. package/src/components/icons/RunningIcon.jsx +6 -7
  168. package/src/components/icons/SendIcon.jsx +6 -7
  169. package/src/components/icons/ServiceIcon.jsx +6 -7
  170. package/src/components/icons/SlotIcon.jsx +6 -7
  171. package/src/components/icons/SocialDiscordIcon.jsx +6 -7
  172. package/src/components/icons/SocialGitHubIcon.jsx +6 -7
  173. package/src/components/icons/SocialGitLabIcon.jsx +6 -7
  174. package/src/components/icons/SocialLinkedInIcon.jsx +6 -7
  175. package/src/components/icons/SocialNPMIcon.jsx +6 -7
  176. package/src/components/icons/SocialXIcon.jsx +6 -7
  177. package/src/components/icons/SortDownIcon.jsx +6 -7
  178. package/src/components/icons/SortIcon.jsx +6 -7
  179. package/src/components/icons/SortUpIcon.jsx +6 -7
  180. package/src/components/icons/SortableIcon.jsx +6 -7
  181. package/src/components/icons/StackablesIcon.jsx +6 -7
  182. package/src/components/icons/StackablesPluginIcon.jsx +6 -7
  183. package/src/components/icons/StackablesTemplateIcon.jsx +6 -7
  184. package/src/components/icons/StopIcon.jsx +6 -7
  185. package/src/components/icons/StoppedAppIcon.jsx +6 -7
  186. package/src/components/icons/SwitchIcon.jsx +6 -7
  187. package/src/components/icons/TeamsIcon.jsx +6 -7
  188. package/src/components/icons/TerminalIcon.jsx +6 -7
  189. package/src/components/icons/TrashIcon.jsx +6 -8
  190. package/src/components/icons/TwoUsersIcon.jsx +6 -7
  191. package/src/components/icons/UpgradeIcon.jsx +6 -7
  192. package/src/components/icons/UserComputerIcon.jsx +6 -7
  193. package/src/components/icons/UserIcon.jsx +6 -7
  194. package/src/components/icons/UserRemoveIcon.jsx +7 -7
  195. package/src/components/icons/UserRoleIcon.jsx +7 -7
  196. package/src/components/icons/WorkspaceDynamicIcon.jsx +6 -7
  197. package/src/components/icons/WorkspaceEmptyIcon.jsx +6 -7
  198. package/src/components/icons/WorkspaceFailIcon.jsx +6 -7
  199. package/src/components/icons/WorkspaceGitHubIcon.jsx +6 -7
  200. package/src/components/icons/WorkspaceLoadingIcon.jsx +6 -7
  201. package/src/components/icons/WorkspaceReadyIcon.jsx +6 -7
  202. package/src/components/icons/WorkspaceStaticIcon.jsx +6 -7
  203. package/src/components/icons/ZoomInIcon.jsx +99 -0
  204. package/src/components/icons/ZoomOutIcon.jsx +96 -0
  205. package/src/components/icons/index.js +25 -2
  206. package/src/components/layouts/Layout.jsx +4 -6
  207. package/src/components/logos/AdvancedLogo.jsx +5 -7
  208. package/src/components/logos/BasicLogo.jsx +5 -7
  209. package/src/components/logos/FreeLogo.jsx +5 -7
  210. package/src/components/logos/ProLogo.jsx +5 -7
  211. package/vitest.config.js +2 -1
  212. package/dist/assets/index-DxEcxprd.js +0 -40
  213. package/src/components/TabbedWindowV2.jsx +0 -82
  214. package/src/components/TabbedWindowV2.module.css +0 -17
@@ -12,13 +12,13 @@ import {
12
12
  import Button from './Button'
13
13
 
14
14
  function ModalDirectional ({
15
- setIsOpen,
16
- title,
17
- titleClassName,
18
- children,
19
- smallLayout,
20
- classNameModalLefty,
21
- permanent
15
+ children = null,
16
+ setIsOpen = () => {},
17
+ title = '',
18
+ titleClassName = '',
19
+ smallLayout = false,
20
+ classNameModalLefty = '',
21
+ permanent = false
22
22
  }) {
23
23
  const className = `${styles.container} ${styles.modalLeftCover} ${smallLayout ? styles.smallLayout : styles.normalLayout}`
24
24
  const [modalClassName] = useState(className)
@@ -88,23 +88,13 @@ ModalDirectional.propTypes = {
88
88
  */
89
89
  smallLayout: PropTypes.bool,
90
90
  /**
91
- * classNameLefty
91
+ * classNameModalLefty
92
92
  */
93
- classNameLefty: PropTypes.string,
93
+ classNameModalLefty: PropTypes.string,
94
94
  /**
95
95
  * permanent: modal could be closed only with Esc, X or Cancel
96
96
  */
97
97
  permanent: PropTypes.bool
98
98
  }
99
99
 
100
- ModalDirectional.defaultProps = {
101
- children: null,
102
- setIsOpen: () => {},
103
- title: '',
104
- titleClassName: '',
105
- smallLayout: false,
106
- classNameLefty: '',
107
- permanent: false
108
- }
109
-
110
100
  export default ModalDirectional
@@ -8,19 +8,19 @@ import HorizontalSeparator from './HorizontalSeparator'
8
8
  import styles from './ModalStepsForward.module.css'
9
9
  import commonStyles from './Common.module.css'
10
10
  import {
11
- MODAL_SIZES,
12
- SMALL,
13
- MODAL_LAYOUTS,
14
- MODAL_POPUP,
15
11
  MAIN_DARK_BLUE,
16
12
  DULLS_BACKGROUND_COLOR,
17
13
  LARGE,
18
- PROFILES,
19
14
  MARGIN_0,
20
15
  OPACITY_20
21
16
  } from './constants'
22
17
 
23
- function ModalStepsForward ({ setIsOpen, right, stepper, left }) {
18
+ function ModalStepsForward ({
19
+ setIsOpen = () => {},
20
+ right = null,
21
+ stepper = null,
22
+ left = null
23
+ }) {
24
24
  const buttonFullRoundedClassName = commonStyles['background-color-white']
25
25
  let modalCoverClassName = `${styles.container} ${styles.fullscreen} `
26
26
  modalCoverClassName += commonStyles['background-color-light-blue']
@@ -62,29 +62,17 @@ ModalStepsForward.propTypes = {
62
62
  */
63
63
  setIsOpen: PropTypes.func,
64
64
  /**
65
- * layout
65
+ * right
66
66
  */
67
- layout: PropTypes.oneOf(MODAL_LAYOUTS),
67
+ right: PropTypes.node,
68
68
  /**
69
- * Size
69
+ * stepper
70
70
  */
71
- size: PropTypes.oneOf(MODAL_SIZES),
71
+ stepper: PropTypes.node,
72
72
  /**
73
- * profile
73
+ * left
74
74
  */
75
- profile: PropTypes.oneOf(PROFILES),
76
- /**
77
- * backgroundClassName
78
- */
79
- backgroundClassName: PropTypes.string
80
- }
81
-
82
- ModalStepsForward.defaultProps = {
83
- setIsOpen: () => {},
84
- layout: MODAL_POPUP,
85
- size: SMALL,
86
- profile: '',
87
- backgroundClassName: ''
75
+ left: PropTypes.node
88
76
  }
89
77
 
90
78
  export default ModalStepsForward
@@ -6,15 +6,15 @@ import styles from './PlatformaticIcon.module.css'
6
6
  import { COLORS_ICON, MAIN_GREEN, SIZES, SMALL } from './constants'
7
7
 
8
8
  function PlatformaticIcon ({
9
- iconName,
10
- color,
11
- onClick,
12
- size,
13
- classes,
14
- tip,
15
- disabled,
16
- inactive,
17
- internalOverHandling,
9
+ iconName = '',
10
+ color = MAIN_GREEN,
11
+ onClick = () => {},
12
+ size = SMALL,
13
+ classes = '',
14
+ tip = '',
15
+ disabled = false,
16
+ inactive = false,
17
+ internalOverHandling = false,
18
18
  ...rest
19
19
  }) {
20
20
  const [hover, setHover] = useState(false)
@@ -90,16 +90,4 @@ PlatformaticIcon.propTypes = {
90
90
  internalOverHandling: PropTypes.bool
91
91
  }
92
92
 
93
- PlatformaticIcon.defaultProps = {
94
- iconName: '',
95
- color: MAIN_GREEN,
96
- size: SMALL,
97
- onClick: () => {},
98
- classes: '',
99
- tip: '',
100
- disabled: false,
101
- inactive: false,
102
- internalOverHandling: false
103
- }
104
-
105
93
  export default PlatformaticIcon
@@ -6,15 +6,15 @@ import styles from './SearchBarV2.module.css'
6
6
  import PlatformaticIcon from './PlatformaticIcon'
7
7
  import { RICH_BLACK, SMALL, TRANSPARENT, WHITE } from './constants'
8
8
  function SearchBarV2 ({
9
- onSubmit,
10
- onChange,
11
- onClear,
12
- color,
13
- backgroundColor,
14
- placeholder,
15
- dataAttrName,
16
- dataAttrValue,
17
- inputTextClassName
9
+ color = WHITE,
10
+ backgroundColor = RICH_BLACK,
11
+ onSubmit = () => { },
12
+ onChange = () => { },
13
+ onClear = () => { },
14
+ placeholder = 'Search',
15
+ dataAttrName = '',
16
+ dataAttrValue = '',
17
+ inputTextClassName = ''
18
18
  }) {
19
19
  const inputRef = useRef()
20
20
  const baseClassName = `${styles.container} ${styles.wrapperPadding} ` + commonStyles[`background-color-${backgroundColor}`]
@@ -119,17 +119,4 @@ SearchBarV2.propTypes = {
119
119
  inputTextClassName: PropTypes.string
120
120
  }
121
121
 
122
- SearchBarV2.defaultProps = {
123
- color: WHITE,
124
- backgroundColor: RICH_BLACK,
125
- onSubmit: () => { },
126
- onChange: () => { },
127
- onClear: () => { },
128
- placeholder: 'Search',
129
- dataAttrName: '',
130
- dataAttrValue: '',
131
- inputTextClassName: ''
132
-
133
- }
134
-
135
122
  export default SearchBarV2
@@ -10,19 +10,18 @@ import PlatformaticIcon from './PlatformaticIcon'
10
10
  import PropTypes from 'prop-types'
11
11
  import { DULLS_BACKGROUND_COLOR, MEDIUM, WHITE } from './constants'
12
12
 
13
- function Sidebar (props) {
14
- const {
15
- title,
16
- labelButtonSettings,
17
- defaultSelected,
18
- onClickItemSelectedParent,
19
- items,
20
- onClickAdd,
21
- addTitle,
22
- onClickSettings,
23
- disableClickAdd,
24
- disableClickSettings
25
- } = props
13
+ function Sidebar ({
14
+ title = '',
15
+ labelButtonSettings = 'Settings',
16
+ defaultSelected = null,
17
+ onClickItemSelectedParent = () => {},
18
+ items = [],
19
+ onClickAdd = () => {},
20
+ addTitle = 'Add',
21
+ onClickSettings = () => {},
22
+ disableClickAdd = false,
23
+ disableClickSettings = false
24
+ }) {
26
25
  const [collapsed, setCollapsed] = useState(false)
27
26
  const [selectedItem, setSelectedItem] = useState(null)
28
27
  const disabledCreateButton = disableClickAdd ? styles.disabled : ''
@@ -190,17 +189,4 @@ Sidebar.propTypes = {
190
189
  disableClickSettings: PropTypes.bool
191
190
  }
192
191
 
193
- Sidebar.defaultProps = {
194
- title: '',
195
- labelButtonSettings: 'Settings',
196
- defaultSelected: null,
197
- onClickItemSelectedParent: () => {},
198
- items: [],
199
- onClickAdd: () => {},
200
- addTitle: 'Add',
201
- onClickSettings: () => {},
202
- disableClickAdd: false,
203
- disableClickSettings: false
204
- }
205
-
206
192
  export default Sidebar
@@ -4,7 +4,11 @@ import PropTypes from 'prop-types'
4
4
  import PlatformaticIcon from './PlatformaticIcon'
5
5
  import { COLORS_ICON, EXTRA_SMALL, SIZES, WHITE } from './constants'
6
6
 
7
- function Status ({ color, status, size }) {
7
+ function Status ({
8
+ color = WHITE,
9
+ status = '',
10
+ size = EXTRA_SMALL
11
+ }) {
8
12
  const className = `inline-flex items-center text-${color}`
9
13
  return (
10
14
  <div className={className}>
@@ -30,10 +34,4 @@ Status.propTypes = {
30
34
 
31
35
  }
32
36
 
33
- Status.defaultProps = {
34
- color: WHITE,
35
- status: '',
36
- size: EXTRA_SMALL
37
- }
38
-
39
37
  export default Status
@@ -3,7 +3,13 @@ import React, { useEffect, useState } from 'react'
3
3
  import PropTypes from 'prop-types'
4
4
  import styles from './TabbedWindow.module.css'
5
5
 
6
- function TabbedWindow ({ tabs, keySelected, callbackSelected }) {
6
+ function TabbedWindow ({
7
+ tabs = [],
8
+ keySelected = '',
9
+ callbackSelected = () => {},
10
+ tabContainerClassName = '',
11
+ tabContentClassName = ''
12
+ }) {
7
13
  const headers = []
8
14
  const keys = []
9
15
  const components = []
@@ -14,7 +20,8 @@ function TabbedWindow ({ tabs, keySelected, callbackSelected }) {
14
20
  })
15
21
  const [selected, setSelected] = useState(keySelected || tabs?.at(0).key || '')
16
22
  const [currentComponent, setCurrentComponent] = useState(components[0])
17
-
23
+ const containerClassName = tabContainerClassName || styles.tabContainerClassName
24
+ const contentClassName = tabContentClassName || styles.tabContentClassName
18
25
  useEffect(() => {
19
26
  const indexKey = keys.findIndex(key => key === selected)
20
27
  setCurrentComponent(components[indexKey])
@@ -26,7 +33,7 @@ function TabbedWindow ({ tabs, keySelected, callbackSelected }) {
26
33
  }
27
34
 
28
35
  return (
29
- <div className={styles['tabbed-container']}>
36
+ <div className={containerClassName}>
30
37
  <div className={styles['tabs-header']}>
31
38
  {headers.map((header, index) => {
32
39
  return (
@@ -38,7 +45,7 @@ function TabbedWindow ({ tabs, keySelected, callbackSelected }) {
38
45
  )
39
46
  })}
40
47
  </div>
41
- <div className={styles['tabs-content']}>{currentComponent}</div>
48
+ <div className={contentClassName}>{currentComponent}</div>
42
49
  </div>
43
50
  )
44
51
  }
@@ -59,10 +66,4 @@ TabbedWindow.propTypes = {
59
66
 
60
67
  }
61
68
 
62
- TabbedWindow.defaultProps = {
63
- tabs: [],
64
- keySelected: '',
65
- callbackSelected: () => {}
66
- }
67
-
68
69
  export default TabbedWindow
@@ -1,4 +1,4 @@
1
- .tabbed-container {
1
+ .tabContainerClassName {
2
2
  @apply bg-main-dark-blue;
3
3
  }
4
4
  .tabs-header {
@@ -8,10 +8,10 @@
8
8
  @apply mx-8 min-w-[105px] text-center text-sm first:ml-0 last:mr-0 hover:font-semibold;
9
9
  }
10
10
  .selected-tab {
11
- @apply underline text-main-green underline-offset-8 font-semibold;
11
+ @apply underline underline-offset-8 font-semibold;
12
12
  }
13
- .tabs-content {
14
- @apply min-h-screen
13
+ .tabContentClassName {
14
+ @apply max-h-[calc(100vH-10rem)] overflow-y-auto
15
15
  }
16
16
  .tab::before {
17
17
  display: block;
@@ -5,7 +5,15 @@ import commonStyles from './Common.module.css'
5
5
  import styles from './Tag.module.css'
6
6
  import { COLORS_BUTTON, OPACITY_100, OPACITY_20, OPACITY_30, OPACITY_60, WHITE } from './constants'
7
7
 
8
- function Tag ({ text, textClassName, color, backgroundColor, bordered, opaque, fullRounded }) {
8
+ function Tag ({
9
+ text = '',
10
+ textClassName = '',
11
+ color = WHITE,
12
+ backgroundColor = '',
13
+ bordered = true,
14
+ opaque = OPACITY_100,
15
+ fullRounded = false
16
+ }) {
9
17
  const stylesColor = textClassName || commonStyles[`text--${color}`]
10
18
  let stylesBorderColor = ''
11
19
  if (bordered) {
@@ -56,14 +64,4 @@ Tag.propTypes = {
56
64
 
57
65
  }
58
66
 
59
- Tag.defaultProps = {
60
- backgroundColor: '',
61
- color: WHITE,
62
- text: '',
63
- textClassName: '',
64
- bordered: true,
65
- opaque: OPACITY_100,
66
- fullRounded: false
67
- }
68
-
69
67
  export default Tag
@@ -3,7 +3,13 @@ import PropTypes from 'prop-types'
3
3
  import { FONT_BASE, FONT_XS, MAIN_DARK_BLUE, WHITE } from './constants'
4
4
  import commonStyles from './Common.module.css'
5
5
  import styles from './TextWithLabel.module.css'
6
- function TextWithLabel ({ label, text, children, color, fontSize }) {
6
+ function TextWithLabel ({
7
+ label = '',
8
+ text = '',
9
+ children = null,
10
+ color = WHITE,
11
+ fontSize = FONT_BASE
12
+ }) {
7
13
  const className = commonStyles[`text--${color}`] + ' ' + commonStyles[`text--${fontSize}`]
8
14
  return (
9
15
  <div className={className}>
@@ -37,12 +43,4 @@ TextWithLabel.propTypes = {
37
43
  fontSize: PropTypes.oneOf([FONT_BASE, FONT_XS])
38
44
  }
39
45
 
40
- TextWithLabel.defaultProps = {
41
- label: '',
42
- text: '',
43
- children: null,
44
- color: WHITE,
45
- fontSize: FONT_BASE
46
- }
47
-
48
46
  export default TextWithLabel
@@ -5,14 +5,14 @@ import { useEffect, useRef, useState } from 'react'
5
5
  import { DIRECTIONS, DIRECTION_BOTTOM, DIRECTION_LEFT, DIRECTION_RIGHT, DIRECTION_TOP } from './constants'
6
6
 
7
7
  function Tooltip ({
8
- direction,
9
- visible,
10
- activeDependsOnVisible,
11
- content,
12
- delay,
13
- children,
14
- tooltipClassName,
15
- offset
8
+ direction = DIRECTION_TOP,
9
+ visible = false,
10
+ activeDependsOnVisible = false,
11
+ content = null,
12
+ delay = 0,
13
+ children = null,
14
+ tooltipClassName = '',
15
+ offset = 0
16
16
  }) {
17
17
  let timeout
18
18
  const [active, setActive] = useState(activeDependsOnVisible ? visible : false)
@@ -117,15 +117,4 @@ Tooltip.propTypes = {
117
117
  offset: PropTypes.number
118
118
  }
119
119
 
120
- Tooltip.defaultProps = {
121
- direction: DIRECTION_TOP,
122
- tooltipClassName: '',
123
- delay: 0,
124
- activeDependsOnVisible: false,
125
- visible: false,
126
- children: null,
127
- content: null,
128
- offset: 0
129
- }
130
-
131
120
  export default Tooltip
@@ -2,18 +2,18 @@
2
2
  import PropTypes from 'prop-types'
3
3
  import styles from './TooltipAbsolute.module.css'
4
4
  import { useEffect, useState } from 'react'
5
- import { DIRECTIONS, DIRECTION_LEFT, DIRECTION_BOTTOM, DIRECTION_TOP, DIRECTION_RIGHT } from './constants'
5
+ import { DIRECTIONS, DIRECTION_LEFT, DIRECTION_BOTTOM, DIRECTION_TOP, DIRECTION_RIGHT, POSITION_START } from './constants'
6
6
 
7
7
  const TooltipAbsolute = ({
8
- direction,
9
- content,
10
- delay,
11
- children,
12
- tooltipClassName,
13
- offset,
14
- position,
15
- visible,
16
- activeDependsOnVisible
8
+ direction = DIRECTION_TOP,
9
+ tooltipClassName = '',
10
+ delay = 0,
11
+ children = null,
12
+ content = null,
13
+ offset = 0,
14
+ position = POSITION_START,
15
+ visible = false,
16
+ activeDependsOnVisible = false
17
17
  }) => {
18
18
  let timeout
19
19
  const [active, setActive] = useState(activeDependsOnVisible ? visible : false)
@@ -109,16 +109,4 @@ TooltipAbsolute.propTypes = {
109
109
  activeDependsOnVisible: PropTypes.bool
110
110
  }
111
111
 
112
- TooltipAbsolute.defaultProps = {
113
- direction: DIRECTION_TOP,
114
- tooltipClassName: '',
115
- delay: 0,
116
- children: null,
117
- content: null,
118
- offset: 0,
119
- position: 'start',
120
- activeDependsOnVisible: false,
121
- visible: false
122
- }
123
-
124
112
  export default TooltipAbsolute
@@ -5,7 +5,11 @@ import { DARK_GREEN, MAIN_DARK_BLUE, OPACITY_10, OPACITY_20, OPACITY_30, OPACITY
5
5
  import commonStyles from './Common.module.css'
6
6
  import styles from './VerticalSeparator.module.css'
7
7
 
8
- function VerticalSeparator ({ color, backgroundColorOpacity, classes }) {
8
+ function VerticalSeparator ({
9
+ color = DARK_GREEN,
10
+ backgroundColorOpacity = OPACITY_100,
11
+ classes = ''
12
+ }) {
9
13
  const backgroundColor = commonStyles[`background-color-${color}`]
10
14
  const backgroundOpacity = commonStyles[`background-color-opaque-${backgroundColorOpacity}`]
11
15
  const className = `${backgroundColor} ${backgroundOpacity} ${styles.fullHeight} ${classes}`
@@ -32,10 +36,4 @@ VerticalSeparator.propTypes = {
32
36
 
33
37
  }
34
38
 
35
- VerticalSeparator.defaultProps = {
36
- color: DARK_GREEN,
37
- backgroundColorOpacity: 100,
38
- classes: ''
39
- }
40
-
41
39
  export default VerticalSeparator
@@ -4,14 +4,14 @@ import styles from './Field.module.css'
4
4
  import { ERROR_RED, MAIN_DARK_BLUE, WHITE } from '../constants'
5
5
 
6
6
  function Field ({
7
- title,
8
- titleColor,
9
- helper,
10
- children,
11
- disabled,
12
- required,
13
- titleClassName,
14
- helperClassName
7
+ title = '',
8
+ titleColor = MAIN_DARK_BLUE,
9
+ helper = '',
10
+ children = null,
11
+ disabled = false,
12
+ required = false,
13
+ titleClassName = '',
14
+ helperClassName = ''
15
15
  }) {
16
16
  let className = `${styles.container}`
17
17
  if (disabled) className += ` ${styles.disabled}`
@@ -67,15 +67,4 @@ Field.propTypes = {
67
67
  helperClassName: PropTypes.string
68
68
  }
69
69
 
70
- Field.defaultProps = {
71
- title: '',
72
- titleColor: 'main-dark-blue',
73
- helper: '',
74
- children: null,
75
- disabled: false,
76
- required: false,
77
- titleClassName: '',
78
- helperClassName: ''
79
- }
80
-
81
70
  export default Field
@@ -7,23 +7,23 @@ import PlatformaticIcon from '../PlatformaticIcon'
7
7
  import { ERROR_RED, MAIN_DARK_BLUE, MAIN_GREEN, RICH_BLACK, TRANSPARENT, WHITE } from '../constants'
8
8
 
9
9
  function Input ({
10
- placeholder,
11
- value,
12
- name,
13
- borderColor,
14
- errorMessage,
15
- errorMessageTextClassName,
16
- onChange,
17
- disabled,
18
- beforeIcon,
19
- afterIcon,
20
- placeholderApart,
21
- backgroundColor,
22
- inputTextClassName,
23
- verticalPaddingClassName,
24
- dataAttrName,
25
- dataAttrValue,
26
- readOnly
10
+ placeholder = '',
11
+ value = '',
12
+ name = '',
13
+ borderColor = MAIN_GREEN,
14
+ errorMessage = '',
15
+ errorMessageTextClassName = '',
16
+ onChange = () => {},
17
+ disabled = false,
18
+ beforeIcon = null,
19
+ afterIcon = null,
20
+ placeholderApart = '',
21
+ backgroundColor = WHITE,
22
+ inputTextClassName = '',
23
+ verticalPaddingClassName = '',
24
+ dataAttrName = '',
25
+ dataAttrValue = '',
26
+ readOnly = false
27
27
  }) {
28
28
  let baseInputClassName = `${commonStyles.fullWidth} ${styles.input} ${inputTextClassName} `
29
29
  baseInputClassName += verticalPaddingClassName || ` ${styles.inputDefaultVerticalPadding} `
@@ -169,24 +169,4 @@ Input.propTypes = {
169
169
  errorMessageTextClassName: PropTypes.string
170
170
  }
171
171
 
172
- Input.defaultProps = {
173
- placeholder: '',
174
- value: '',
175
- name: '',
176
- borderColor: MAIN_GREEN,
177
- backgroundColor: WHITE,
178
- errorMessage: '',
179
- errorMessageTextClassName: '',
180
- onChange: () => {},
181
- disabled: false,
182
- beforeIcon: null,
183
- afterIcon: null,
184
- shadowPlaceholder: false,
185
- inputTextClassName: '',
186
- verticalPaddingClassName: '',
187
- dataAttrName: '',
188
- dataAttrValue: '',
189
- readOnly: false
190
- }
191
-
192
172
  export default Input
@@ -9,20 +9,20 @@ import BorderedBox from '../BorderedBox'
9
9
  import ButtonFullRounded from '../ButtonFullRounded'
10
10
 
11
11
  function InputWithSeparator ({
12
- placeholder,
13
- name,
14
- borderColor,
15
- backgroundColor,
16
- errorMessage,
17
- errorMessageTextClassName,
18
- onChange,
19
- disabled,
20
- afterIcon,
21
- defaultValue,
22
- defaultValueSeparator,
23
- value,
24
- separators,
25
- inputTextClassName
12
+ placeholder = '',
13
+ name = '',
14
+ value = '',
15
+ borderColor = MAIN_GREEN,
16
+ backgroundColor = WHITE,
17
+ errorMessage = '',
18
+ errorMessageTextClassName = '',
19
+ onChange = () => {},
20
+ disabled = false,
21
+ afterIcon = null,
22
+ defaultValue = '',
23
+ defaultValueSeparator = ',',
24
+ separators = [''],
25
+ inputTextClassName = ''
26
26
  }) {
27
27
  const showError = errorMessage.length > 0
28
28
  const [focus, setFocus] = useState(false)
@@ -235,21 +235,4 @@ InputWithSeparator.propTypes = {
235
235
  errorMessageTextClassName: PropTypes.string
236
236
  }
237
237
 
238
- InputWithSeparator.defaultProps = {
239
- placeholder: '',
240
- value: '',
241
- defaultValue: '',
242
- defaultValueSeparator: ',',
243
- name: '',
244
- borderColor: MAIN_GREEN,
245
- backgroundColor: WHITE,
246
- errorMessage: '',
247
- errorMessageTextClassName: '',
248
- onChange: () => {},
249
- disabled: false,
250
- afterIcon: null,
251
- separators: [''],
252
- inputTextClassName: ''
253
- }
254
-
255
238
  export default InputWithSeparator