@platformatic/ui-components 0.15.5 → 0.17.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 (288) hide show
  1. package/dist/assets/index-BeInQDZN.js +49 -0
  2. package/dist/assets/{index-DMinbJlj.css → index-DE70C3KG.css} +1 -1
  3. package/dist/index.html +2 -2
  4. package/dist/main.css +60 -4
  5. package/package.json +2 -1
  6. package/src/components/ArcMetric.jsx +145 -0
  7. package/src/components/ArcMetric.module.css +31 -0
  8. package/src/components/BorderedBox.jsx +1 -37
  9. package/src/components/Button.jsx +0 -72
  10. package/src/components/ButtonFullRounded.jsx +1 -57
  11. package/src/components/ButtonOnlyIcon.jsx +1 -57
  12. package/src/components/Checkbox.jsx +1 -17
  13. package/src/components/CopyAndPaste.jsx +1 -41
  14. package/src/components/DropDown.jsx +2 -53
  15. package/src/components/FollowUs.jsx +1 -36
  16. package/src/components/HorizontalSeparator.jsx +2 -21
  17. package/src/components/InfoBox.jsx +1 -32
  18. package/src/components/ListElement.jsx +1 -32
  19. package/src/components/LoadingSpinner.jsx +0 -8
  20. package/src/components/LoadingSpinnerV2.jsx +0 -25
  21. package/src/components/LogoDropDown.jsx +0 -28
  22. package/src/components/MetricInfoBox.jsx +80 -0
  23. package/src/components/MetricInfoBox.module.css +42 -0
  24. package/src/components/Modal.jsx +0 -59
  25. package/src/components/ModalDirectional.jsx +0 -28
  26. package/src/components/ModalStepsForward.jsx +1 -21
  27. package/src/components/PlatformaticIcon.jsx +1 -41
  28. package/src/components/SearchBarV2.jsx +1 -45
  29. package/src/components/Sidebar.jsx +0 -53
  30. package/src/components/Status.jsx +1 -18
  31. package/src/components/TabbedWindow.jsx +1 -33
  32. package/src/components/Tag.jsx +1 -44
  33. package/src/components/TextWithLabel.jsx +1 -25
  34. package/src/components/Tooltip.jsx +3 -47
  35. package/src/components/TooltipAbsolute.jsx +1 -41
  36. package/src/components/TrendLine.jsx +146 -0
  37. package/src/components/VerticalSeparator.jsx +1 -22
  38. package/src/components/forms/Field.jsx +1 -37
  39. package/src/components/forms/Input.jsx +1 -85
  40. package/src/components/forms/InputFileUpload.jsx +1 -101
  41. package/src/components/forms/InputWithSeparator.jsx +1 -74
  42. package/src/components/forms/Password.jsx +3 -43
  43. package/src/components/forms/Preview.jsx +1 -51
  44. package/src/components/forms/RadioGroup.jsx +0 -35
  45. package/src/components/forms/Select.jsx +1 -110
  46. package/src/components/forms/SelectWithInput.jsx +1 -111
  47. package/src/components/forms/TextArea.jsx +1 -53
  48. package/src/components/forms/ToggleSwitch.jsx +1 -42
  49. package/src/components/icons/APIDocsIcon.jsx +1 -21
  50. package/src/components/icons/APIKeyIcon.jsx +1 -21
  51. package/src/components/icons/AWSIcon.jsx +1 -21
  52. package/src/components/icons/AddEnvVariableIcon.jsx +1 -17
  53. package/src/components/icons/AddIcon.jsx +1 -21
  54. package/src/components/icons/AddRouteIcon.jsx +1 -17
  55. package/src/components/icons/AddUserIcon.jsx +1 -21
  56. package/src/components/icons/AlertIcon.jsx +1 -21
  57. package/src/components/icons/AllAppsIcon.jsx +1 -21
  58. package/src/components/icons/AllInOneIcon.jsx +1 -21
  59. package/src/components/icons/ApiCloudIcon.jsx +1 -21
  60. package/src/components/icons/ApiEmptyIcon.jsx +1 -21
  61. package/src/components/icons/ApiIcon.jsx +1 -21
  62. package/src/components/icons/ApiIconClosed.jsx +1 -17
  63. package/src/components/icons/ApiPerformanceIcon.jsx +1 -21
  64. package/src/components/icons/AppConfigurationIcon.jsx +1 -21
  65. package/src/components/icons/AppDetailsIcon.jsx +1 -21
  66. package/src/components/icons/AppEditIcon.jsx +1 -21
  67. package/src/components/icons/AppEmptyIcon.jsx +1 -21
  68. package/src/components/icons/AppIcon.jsx +1 -21
  69. package/src/components/icons/AppListIcon.jsx +1 -21
  70. package/src/components/icons/AppMissingIcon.jsx +1 -21
  71. package/src/components/icons/AppOptimizedIcon.jsx +1 -21
  72. package/src/components/icons/AppSettingsIcon.jsx +1 -21
  73. package/src/components/icons/AppStoppedIcon.jsx +1 -21
  74. package/src/components/icons/AppWorkspace.jsx +1 -13
  75. package/src/components/icons/ApplicationTypeIcon.jsx +1 -21
  76. package/src/components/icons/ArrowDownFullIcon.jsx +1 -21
  77. package/src/components/icons/ArrowDownIcon.jsx +1 -21
  78. package/src/components/icons/ArrowLeftIcon.jsx +1 -21
  79. package/src/components/icons/ArrowLongDownIcon.jsx +1 -21
  80. package/src/components/icons/ArrowLongLeftIcon.jsx +1 -21
  81. package/src/components/icons/ArrowLongRightIcon.jsx +1 -21
  82. package/src/components/icons/ArrowLongUpIcon.jsx +1 -21
  83. package/src/components/icons/ArrowRightIcon.jsx +1 -21
  84. package/src/components/icons/ArrowUpIcon.jsx +1 -21
  85. package/src/components/icons/BellIcon.jsx +1 -21
  86. package/src/components/icons/BillingIcon.jsx +1 -21
  87. package/src/components/icons/BranchIcon.jsx +1 -21
  88. package/src/components/icons/BuiltInLoggingIcon.jsx +1 -21
  89. package/src/components/icons/CLIIcon.jsx +1 -21
  90. package/src/components/icons/CacheRecommendationIcon.jsx +1 -21
  91. package/src/components/icons/CachingIcon.jsx +1 -21
  92. package/src/components/icons/Calendar1DayIcon.jsx +1 -21
  93. package/src/components/icons/Calendar7DaysIcon.jsx +1 -21
  94. package/src/components/icons/CalendarIcon.jsx +1 -21
  95. package/src/components/icons/CheckListIcon.jsx +1 -21
  96. package/src/components/icons/CheckListReviewIcon.jsx +1 -21
  97. package/src/components/icons/CircleAddIcon.jsx +1 -21
  98. package/src/components/icons/CircleArrowLeftIcon.jsx +2 -22
  99. package/src/components/icons/CircleArrowRightIcon.jsx +1 -21
  100. package/src/components/icons/CircleCheckMarkButtonIcon.jsx +1 -13
  101. package/src/components/icons/CircleCheckMarkFullIcon.jsx +1 -21
  102. package/src/components/icons/CircleCheckMarkIcon.jsx +1 -21
  103. package/src/components/icons/CircleCloseHoverIcon.jsx +1 -21
  104. package/src/components/icons/CircleCloseIcon.jsx +1 -21
  105. package/src/components/icons/CircleCopyPasteIcon.jsx +1 -21
  106. package/src/components/icons/CircleDownloadIcon.jsx +1 -21
  107. package/src/components/icons/CircleEditIcon.jsx +1 -21
  108. package/src/components/icons/CircleExclamationIcon.jsx +1 -17
  109. package/src/components/icons/CircleFullIcon.jsx +1 -21
  110. package/src/components/icons/CircleGearIcon.jsx +1 -21
  111. package/src/components/icons/CirclePlayIcon.jsx +1 -21
  112. package/src/components/icons/CircleRestartIcon.jsx +1 -21
  113. package/src/components/icons/CircleStopIcon.jsx +1 -21
  114. package/src/components/icons/CircleSubtractIcon.jsx +1 -21
  115. package/src/components/icons/CircleTwoArrowsDownIcon.jsx +1 -21
  116. package/src/components/icons/CircleTwoArrowsUpIcon.jsx +1 -21
  117. package/src/components/icons/CloseIcon.jsx +1 -21
  118. package/src/components/icons/CloudIcon.jsx +1 -21
  119. package/src/components/icons/CodeTestingIcon.jsx +1 -21
  120. package/src/components/icons/CollapseIcon.jsx +1 -21
  121. package/src/components/icons/CollapseSquareIcon.jsx +1 -21
  122. package/src/components/icons/ComputerIcon.jsx +1 -21
  123. package/src/components/icons/ComputerInIcon.jsx +1 -21
  124. package/src/components/icons/ComputerOutIcon.jsx +1 -21
  125. package/src/components/icons/ConfigureDatabaseIcon.jsx +1 -21
  126. package/src/components/icons/CopyPasteIcon.jsx +1 -21
  127. package/src/components/icons/CreateAppIcon.jsx +1 -21
  128. package/src/components/icons/CreatingAppIcon.jsx +1 -21
  129. package/src/components/icons/CreditCardIcon.jsx +1 -21
  130. package/src/components/icons/DatabaseEditIcon.jsx +1 -21
  131. package/src/components/icons/DatabaseIcon.jsx +1 -21
  132. package/src/components/icons/DatabaseMigrationIcon.jsx +1 -21
  133. package/src/components/icons/DepencenciesReloadIcon.jsx +1 -21
  134. package/src/components/icons/DeploymentHistoryIcon.jsx +1 -21
  135. package/src/components/icons/DocumentIcon.jsx +1 -21
  136. package/src/components/icons/DownloadIcon.jsx +1 -21
  137. package/src/components/icons/EditDocumentIcon.jsx +1 -21
  138. package/src/components/icons/EditIcon.jsx +1 -21
  139. package/src/components/icons/EnlargeIcon.jsx +1 -21
  140. package/src/components/icons/EntryIcon.jsx +1 -21
  141. package/src/components/icons/EntrypointIcon.jsx +1 -25
  142. package/src/components/icons/EnvVariableszIcon.jsx +1 -21
  143. package/src/components/icons/ExpandIcon.jsx +1 -25
  144. package/src/components/icons/ExpandSquadreIcon.jsx +1 -21
  145. package/src/components/icons/ExploreDocIcon.jsx +1 -21
  146. package/src/components/icons/ExportIcon.jsx +1 -21
  147. package/src/components/icons/EyeClosedIcon.jsx +1 -21
  148. package/src/components/icons/EyeOpenedIcon.jsx +1 -21
  149. package/src/components/icons/FailureRateIcon.jsx +1 -21
  150. package/src/components/icons/FolderIcon.jsx +1 -21
  151. package/src/components/icons/FoldersIcon.jsx +1 -21
  152. package/src/components/icons/GearIcon.jsx +1 -21
  153. package/src/components/icons/GenerationLoadingIcon.jsx +1 -21
  154. package/src/components/icons/GitHubRepo2Icon.jsx +1 -21
  155. package/src/components/icons/GitHubRepoIcon.jsx +1 -21
  156. package/src/components/icons/GiveOwnershipIcon.jsx +2 -22
  157. package/src/components/icons/GraphQLEditsIcon.jsx +1 -21
  158. package/src/components/icons/GraphQLIcon.jsx +1 -21
  159. package/src/components/icons/HorizontalPodAutoscalerIcon.jsx +1 -21
  160. package/src/components/icons/HourglassIcon.jsx +1 -21
  161. package/src/components/icons/ImportAppIcon.jsx +1 -21
  162. package/src/components/icons/ImportIcon.jsx +1 -21
  163. package/src/components/icons/InfoCircleIcon.jsx +1 -21
  164. package/src/components/icons/InfrastructureIcon.jsx +1 -21
  165. package/src/components/icons/IngressControllIcon.jsx +1 -21
  166. package/src/components/icons/InternalLinkIcon.jsx +1 -25
  167. package/src/components/icons/InternetIcon.jsx +1 -25
  168. package/src/components/icons/K8SIcon.jsx +1 -21
  169. package/src/components/icons/K8SMetricsIcon.jsx +4 -24
  170. package/src/components/icons/KeyIcon.jsx +1 -21
  171. package/src/components/icons/LabelIcon.jsx +1 -21
  172. package/src/components/icons/LayersIcon.jsx +1 -21
  173. package/src/components/icons/LensIcon.jsx +1 -21
  174. package/src/components/icons/LiveIcon.jsx +1 -21
  175. package/src/components/icons/LoadingAppIcon.jsx +1 -21
  176. package/src/components/icons/LogOutIcon.jsx +1 -17
  177. package/src/components/icons/LogsRiskIcon.jsx +1 -21
  178. package/src/components/icons/MailIcon.jsx +1 -21
  179. package/src/components/icons/MetricsIcon.jsx +1 -21
  180. package/src/components/icons/MetricsLoadingIcon.jsx +1 -21
  181. package/src/components/icons/MetricsLogsIcon.jsx +1 -21
  182. package/src/components/icons/MissingTemplateIcon.jsx +1 -21
  183. package/src/components/icons/NameAppIcon.jsx +1 -21
  184. package/src/components/icons/NextJSIcon.jsx +1 -25
  185. package/src/components/icons/NoActivitiesIcon.jsx +1 -21
  186. package/src/components/icons/NoDeploymentsIcon.jsx +1 -21
  187. package/src/components/icons/NoMetricsIcon.jsx +1 -21
  188. package/src/components/icons/NoResultsIcon.jsx +1 -21
  189. package/src/components/icons/NodeJSIcon.jsx +1 -21
  190. package/src/components/icons/NodeJSMetricsIcon.jsx +1 -21
  191. package/src/components/icons/NotCompliantServiceIcon.jsx +1 -25
  192. package/src/components/icons/OpenAPIEditsIcon.jsx +1 -21
  193. package/src/components/icons/OrganizationIcon.jsx +1 -21
  194. package/src/components/icons/OtherLogosGoogleIcon.jsx +1 -21
  195. package/src/components/icons/OutOfBoxGraphQLIcon.jsx +1 -21
  196. package/src/components/icons/OutdatedServiceIcon.jsx +1 -25
  197. package/src/components/icons/PlatformaticComposerIcon.jsx +1 -21
  198. package/src/components/icons/PlatformaticDBIcon.jsx +1 -21
  199. package/src/components/icons/PlatformaticRuntimeIcon.jsx +1 -21
  200. package/src/components/icons/PlatformaticServiceIcon.jsx +1 -21
  201. package/src/components/icons/PlayIcon.jsx +1 -21
  202. package/src/components/icons/PodDetailsIcon.jsx +1 -21
  203. package/src/components/icons/PodLogsIcon.jsx +1 -21
  204. package/src/components/icons/PodMetricsIcon.jsx +1 -21
  205. package/src/components/icons/PodPerformanceIcon.jsx +1 -21
  206. package/src/components/icons/PodServicesIcon.jsx +1 -21
  207. package/src/components/icons/PodSettingsIcon.jsx +1 -21
  208. package/src/components/icons/PodhealthIcon.jsx +1 -21
  209. package/src/components/icons/PreviewPRIcon.jsx +1 -21
  210. package/src/components/icons/PullRequestIcon.jsx +1 -21
  211. package/src/components/icons/PullRequestLoadingIcon.jsx +1 -21
  212. package/src/components/icons/RecentAppsIcon.jsx +1 -21
  213. package/src/components/icons/RemoveAppIcon.jsx +1 -21
  214. package/src/components/icons/RemoveIcon.jsx +1 -21
  215. package/src/components/icons/RequestOwnershipIcon.jsx +1 -21
  216. package/src/components/icons/RequestsIcon.jsx +1 -21
  217. package/src/components/icons/ResourceIcon.jsx +1 -21
  218. package/src/components/icons/RestartIcon.jsx +1 -21
  219. package/src/components/icons/RocketIcon.jsx +1 -21
  220. package/src/components/icons/RouteEditIcon.jsx +1 -21
  221. package/src/components/icons/RouteHistoryIcon.jsx +1 -21
  222. package/src/components/icons/RoutingIcon.jsx +1 -21
  223. package/src/components/icons/RunningAppIcon.jsx +1 -21
  224. package/src/components/icons/RunningIcon.jsx +1 -21
  225. package/src/components/icons/ScalerDetailsIcon.jsx +1 -21
  226. package/src/components/icons/ScalerHistoryIcon.jsx +1 -21
  227. package/src/components/icons/ScheduledJobSettingsIcon.jsx +1 -21
  228. package/src/components/icons/ScheduledJobsAppIcon.jsx +1 -21
  229. package/src/components/icons/ScheduledJobsCreateIcon.jsx +1 -21
  230. package/src/components/icons/ScheduledJobsDetailIcon.jsx +1 -21
  231. package/src/components/icons/ScheduledJobsIcon.jsx +1 -21
  232. package/src/components/icons/ScheduledJobsSuspendIcon.jsx +1 -21
  233. package/src/components/icons/SendIcon.jsx +1 -21
  234. package/src/components/icons/ServiceIcon.jsx +1 -21
  235. package/src/components/icons/ServicesWorkingIcon.jsx +1 -21
  236. package/src/components/icons/SlotIcon.jsx +1 -21
  237. package/src/components/icons/SocialDiscordIcon.jsx +1 -21
  238. package/src/components/icons/SocialGitHubIcon.jsx +1 -21
  239. package/src/components/icons/SocialGitLabIcon.jsx +1 -21
  240. package/src/components/icons/SocialLinkedInIcon.jsx +1 -21
  241. package/src/components/icons/SocialNPMIcon.jsx +1 -21
  242. package/src/components/icons/SocialXIcon.jsx +1 -21
  243. package/src/components/icons/SortDownArrowAndBarIcon.jsx +1 -21
  244. package/src/components/icons/SortDownIcon.jsx +1 -21
  245. package/src/components/icons/SortIcon.jsx +1 -21
  246. package/src/components/icons/SortUpArrowAndBarIcon.jsx +1 -21
  247. package/src/components/icons/SortUpIcon.jsx +1 -21
  248. package/src/components/icons/SortableIcon.jsx +1 -21
  249. package/src/components/icons/StackablesIcon.jsx +1 -21
  250. package/src/components/icons/StackablesPluginIcon.jsx +1 -21
  251. package/src/components/icons/StackablesTemplateIcon.jsx +1 -21
  252. package/src/components/icons/StopIcon.jsx +1 -21
  253. package/src/components/icons/SuspendIcon.jsx +1 -21
  254. package/src/components/icons/SwitchIcon.jsx +1 -21
  255. package/src/components/icons/TableIcon.jsx +1 -21
  256. package/src/components/icons/TaxonomyIcon.jsx +1 -21
  257. package/src/components/icons/TeamsIcon.jsx +1 -21
  258. package/src/components/icons/TerminalIcon.jsx +1 -21
  259. package/src/components/icons/TrashIcon.jsx +1 -21
  260. package/src/components/icons/TrendDownIcon.jsx +41 -0
  261. package/src/components/icons/TrendUpIcon.jsx +43 -0
  262. package/src/components/icons/TwoUsersIcon.jsx +1 -21
  263. package/src/components/icons/UpgradeIcon.jsx +1 -21
  264. package/src/components/icons/UploadFileIcon.jsx +1 -21
  265. package/src/components/icons/UserComputerIcon.jsx +1 -21
  266. package/src/components/icons/UserIcon.jsx +1 -21
  267. package/src/components/icons/UserRemoveIcon.jsx +1 -17
  268. package/src/components/icons/UserRoleIcon.jsx +1 -17
  269. package/src/components/icons/WorkspaceDynamicIcon.jsx +1 -21
  270. package/src/components/icons/WorkspaceEmptyIcon.jsx +1 -21
  271. package/src/components/icons/WorkspaceFailIcon.jsx +1 -21
  272. package/src/components/icons/WorkspaceGitHubIcon.jsx +1 -21
  273. package/src/components/icons/WorkspaceLoadingIcon.jsx +1 -21
  274. package/src/components/icons/WorkspaceReadyIcon.jsx +1 -21
  275. package/src/components/icons/WorkspaceStaticIcon.jsx +1 -21
  276. package/src/components/icons/ZoomInIcon.jsx +2 -22
  277. package/src/components/icons/ZoomOutIcon.jsx +1 -21
  278. package/src/components/icons/index.js +4 -0
  279. package/src/components/layouts/Layout.jsx +0 -12
  280. package/src/components/loaders/SpinnerCircular.jsx +1 -21
  281. package/src/components/logos/AdvancedLogo.jsx +0 -16
  282. package/src/components/logos/BasicLogo.jsx +0 -16
  283. package/src/components/logos/FreeLogo.jsx +0 -16
  284. package/src/components/logos/ProLogo.jsx +0 -16
  285. package/src/stories/ArcMetric.stories.jsx +17 -0
  286. package/src/stories/MetricInfoBox.stories.jsx +39 -0
  287. package/src/stories/TrendLine.stories.jsx +20 -0
  288. package/dist/assets/index-4liAiWzS.js +0 -49
@@ -0,0 +1,146 @@
1
+ import React, { useRef, useEffect, useState } from 'react'
2
+ import * as d3 from 'd3'
3
+
4
+ /**
5
+ * TrendLine component
6
+ * @param {Object} props
7
+ * @param {number[]} props.yValues - Array of y-values (equally spaced on x-axis)
8
+ * @param {number} [props.width=400] - Width of the SVG
9
+ * @param {number} [props.height=120] - Height of the SVG
10
+ */
11
+ function TrendLine ({ yValues }) {
12
+ const ref = useRef(null)
13
+ const containerRef = useRef(null)
14
+ /** @type {React.RefObject<HTMLDivElement>} */
15
+ // @ts-ignore
16
+ const typedContainerRef = containerRef
17
+ const [dimensions, setDimensions] = useState({ width: 400, height: 120 })
18
+
19
+ useEffect(() => {
20
+ if (!typedContainerRef.current) return
21
+ // Initial set
22
+ const bounding = typedContainerRef.current.getBoundingClientRect()
23
+ if (bounding) {
24
+ setDimensions({ width: bounding.width, height: bounding.height })
25
+ }
26
+ // Resize observer
27
+ const resizeObserver = new window.ResizeObserver(entries => {
28
+ for (const entry of entries) {
29
+ if (entry.target === typedContainerRef.current) {
30
+ const { width, height } = entry.contentRect
31
+ setDimensions({ width, height })
32
+ }
33
+ }
34
+ })
35
+ resizeObserver.observe(typedContainerRef.current)
36
+ return () => resizeObserver.disconnect()
37
+ }, [])
38
+
39
+ useEffect(() => {
40
+ const { width, height } = dimensions
41
+ if (!yValues || yValues.length === 0) return
42
+ // Limit to max 5 points by downsampling if needed
43
+ let limitedYValues = yValues
44
+ if (yValues.length > 5) {
45
+ const step = (yValues.length - 1) / 4
46
+ limitedYValues = Array.from({ length: 5 }, (_, i) => yValues[Math.round(i * step)])
47
+ }
48
+ const svg = d3.select(ref.current)
49
+ svg.selectAll('*').remove() // Clear previous
50
+
51
+ // Margins for padding
52
+ // const margin = { top: 10, right: 10, bottom: 10, left: 10 }
53
+ const margin = { top: 0, right: 0, bottom: 0, left: 0 }
54
+ const w = width - margin.left - margin.right
55
+ const h = height - margin.top - margin.bottom
56
+
57
+ // Ensure yValues is a number[] and filter out undefined/null
58
+ const cleanYValues = limitedYValues.filter(v => typeof v === 'number' && !isNaN(v))
59
+ if (cleanYValues.length === 0) return
60
+
61
+ // Helper to ensure [number, number][]
62
+ function toXYPairs (arr) {
63
+ const out = []
64
+ for (let i = 0; i < arr.length; i++) {
65
+ const x = i
66
+ const y = arr[i]
67
+ if (typeof x === 'number' && typeof y === 'number' && Number.isFinite(x) && Number.isFinite(y)) {
68
+ out.push([x, y])
69
+ }
70
+ }
71
+ return out
72
+ }
73
+ const points = toXYPairs(cleanYValues)
74
+ if (points.length < 2) return
75
+
76
+ // X and Y scales
77
+ const x = d3.scaleLinear()
78
+ .domain([0, points.length - 1])
79
+ .range([0, w])
80
+ const y = d3.scaleLinear()
81
+ .domain([
82
+ Number(d3.max(cleanYValues) ?? 1),
83
+ Number(d3.min(cleanYValues) ?? 0)
84
+ ]) // Invert so higher values are up
85
+ .range([margin.top, h + margin.top])
86
+
87
+ // Line generator for [x, y] pairs
88
+ const line = d3.line()
89
+ .x(d => x(d[0]) + margin.left)
90
+ .y(d => y(d[1]))
91
+ .curve(d3.curveCatmullRom.alpha(0.5))
92
+
93
+ // Area generator for [x, y] pairs
94
+ const area = d3.area()
95
+ .x(d => x(d[0]) + margin.left)
96
+ .y0(h + margin.top)
97
+ .y1(d => y(d[1]))
98
+ .curve(d3.curveCatmullRom.alpha(0.5))
99
+
100
+ // Draw area (shadow/fill)
101
+ svg.append('path')
102
+ // @ts-ignore
103
+ .attr('d', area(points))
104
+ .attr('fill', 'url(#trend-gradient)')
105
+ .attr('opacity', 1)
106
+
107
+ // Draw line
108
+ svg.append('path')
109
+ // @ts-ignore
110
+ .attr('d', line(points))
111
+ .attr('fill', 'none')
112
+ .attr('stroke', '#BFC3C7')
113
+ .attr('stroke-width', 2)
114
+ .attr('stroke-linecap', 'round')
115
+
116
+ // Gradient for area
117
+ const defs = svg.append('defs')
118
+ const gradient = defs.append('linearGradient')
119
+ .attr('id', 'trend-gradient')
120
+ .attr('x1', '0%')
121
+ .attr('y1', '0%')
122
+ .attr('x2', '0%')
123
+ .attr('y2', '100%')
124
+ gradient.append('stop')
125
+ .attr('offset', '0%')
126
+ .attr('stop-color', '#BFC3C7')
127
+ .attr('stop-opacity', 0.12)
128
+ gradient.append('stop')
129
+ .attr('offset', '100%')
130
+ .attr('stop-color', '#BFC3C7')
131
+ .attr('stop-opacity', 0)
132
+ }, [yValues, dimensions])
133
+
134
+ return (
135
+ <div className='w-full h-full' ref={typedContainerRef} style={{ position: 'relative' }}>
136
+ <svg
137
+ ref={ref}
138
+ width='100%'
139
+ height='100%'
140
+ style={{ display: 'block', background: '#0B1016', borderRadius: 6 }}
141
+ />
142
+ </div>
143
+ )
144
+ }
145
+
146
+ export default TrendLine
@@ -1,6 +1,5 @@
1
1
  import React from 'react'
2
- import PropTypes from 'prop-types'
3
- import { DARK_GREEN, MAIN_DARK_BLUE, OPACITY_10, OPACITY_20, OPACITY_30, OPACITY_60, OPACITY_100, WHITE } from './constants'
2
+ import { DARK_GREEN, OPACITY_100 } from './constants'
4
3
  import commonStyles from './Common.module.css'
5
4
  import styles from './VerticalSeparator.module.css'
6
5
 
@@ -15,24 +14,4 @@ function VerticalSeparator ({
15
14
  return <div className={className} />
16
15
  }
17
16
 
18
- VerticalSeparator.propTypes = {
19
- /**
20
- * color
21
- */
22
- color: PropTypes.oneOf([DARK_GREEN, MAIN_DARK_BLUE, WHITE]),
23
- /**
24
- * backgroundColorOpacity
25
- */
26
- backgroundColorOpacity: PropTypes.oneOf([OPACITY_10,
27
- OPACITY_20,
28
- OPACITY_30,
29
- OPACITY_60,
30
- OPACITY_100]),
31
- /**
32
- * backgroundColorOpacity
33
- */
34
- classes: PropTypes.string
35
-
36
- }
37
-
38
17
  export default VerticalSeparator
@@ -1,7 +1,6 @@
1
1
  import React from 'react'
2
- import PropTypes from 'prop-types'
3
2
  import styles from './Field.module.css'
4
- import { ERROR_RED, MAIN_DARK_BLUE, WHITE } from '../constants'
3
+ import { MAIN_DARK_BLUE } from '../constants'
5
4
 
6
5
  function Field ({
7
6
  title = '',
@@ -31,39 +30,4 @@ function Field ({
31
30
  )
32
31
  }
33
32
 
34
- Field.propTypes = {
35
- /**
36
- * title
37
- */
38
- title: PropTypes.string,
39
- /**
40
- * titleColor
41
- */
42
- titleColor: PropTypes.oneOf([ERROR_RED, MAIN_DARK_BLUE, WHITE]),
43
- /**
44
- * helper
45
- */
46
- helper: PropTypes.string,
47
- /**
48
- * color of border
49
- */
50
- children: PropTypes.node,
51
- /**
52
- * disabled
53
- */
54
- disabled: PropTypes.bool,
55
- /**
56
- * required
57
- */
58
- required: PropTypes.bool,
59
- /**
60
- * titleClassName
61
- */
62
- titleClassName: PropTypes.string,
63
- /**
64
- * titleClassName
65
- */
66
- helperClassName: PropTypes.string
67
- }
68
-
69
33
  export default Field
@@ -1,9 +1,8 @@
1
1
  import React, { useState } from 'react'
2
- import PropTypes from 'prop-types'
3
2
  import styles from './Input.module.css'
4
3
  import commonStyles from '../Common.module.css'
5
4
  import PlatformaticIcon from '../PlatformaticIcon'
6
- import { ERROR_RED, MAIN_DARK_BLUE, MAIN_GREEN, RICH_BLACK, TRANSPARENT, WHITE } from '../constants'
5
+ import { ERROR_RED, MAIN_GREEN, WHITE } from '../constants'
7
6
 
8
7
  function Input ({
9
8
  placeholder = '',
@@ -85,87 +84,4 @@ function Input ({
85
84
  )
86
85
  }
87
86
 
88
- Input.propTypes = {
89
- /**
90
- * placeholder
91
- */
92
- placeholder: PropTypes.string,
93
- /**
94
- * value
95
- */
96
- value: PropTypes.string,
97
- /**
98
- * name
99
- */
100
- name: PropTypes.string,
101
- /**
102
- * color of border
103
- */
104
- borderColor: PropTypes.oneOf([MAIN_GREEN, MAIN_DARK_BLUE, WHITE, RICH_BLACK]),
105
- /**
106
- * color of border
107
- */
108
- backgroundColor: PropTypes.oneOf([MAIN_GREEN, MAIN_DARK_BLUE, WHITE, RICH_BLACK, TRANSPARENT]),
109
- /**
110
- * onChange
111
- */
112
- onChange: PropTypes.func,
113
- /**
114
- * Disabled
115
- */
116
- disabled: PropTypes.bool,
117
- /**
118
- * beforeIcon: PlatformaticIcon props
119
- */
120
- beforeIcon: PropTypes.shape({
121
- iconName: PropTypes.string,
122
- color: PropTypes.string,
123
- onClick: PropTypes.func
124
- }),
125
- /**
126
- * afterIcon: PlatformaticIcon props
127
- */
128
- afterIcon: PropTypes.shape({
129
- iconName: PropTypes.string,
130
- color: PropTypes.string,
131
- onClick: PropTypes.func
132
- }),
133
- /**
134
- * placeholderApart
135
- */
136
- placeholderApart: PropTypes.bool,
137
- /**
138
- * backgroundTransparent
139
- */
140
- backgroundTransparent: PropTypes.bool,
141
- /**
142
- * inputTextClassName
143
- */
144
- inputTextClassName: PropTypes.string,
145
- /**
146
- * verticalPaddingClassName
147
- */
148
- verticalPaddingClassName: PropTypes.string,
149
- /**
150
- * dataAttrName
151
- */
152
- dataAttrName: PropTypes.string,
153
- /**
154
- * dataAttrValue
155
- */
156
- dataAttrValue: PropTypes.string,
157
- /**
158
- * readOnly
159
- */
160
- readOnly: PropTypes.bool,
161
- /**
162
- * errorMessage
163
- */
164
- errorMessage: PropTypes.string,
165
- /**
166
- * errorMessageTextClassName
167
- */
168
- errorMessageTextClassName: PropTypes.string
169
- }
170
-
171
87
  export default Input
@@ -1,10 +1,9 @@
1
1
  import React, { useState } from 'react'
2
- import PropTypes from 'prop-types'
3
2
  import styles from './InputFileUpload.module.css'
4
3
  import commonStyles from '../Common.module.css'
5
4
  import PlatformaticIcon from '../PlatformaticIcon'
6
5
  import Button from '../Button'
7
- import { ACTIVE_AND_INACTIVE_STATUS, ERROR_RED, MAIN_DARK_BLUE, MAIN_GREEN, RICH_BLACK, TRANSPARENT, WHITE } from '../constants'
6
+ import { ACTIVE_AND_INACTIVE_STATUS, ERROR_RED, MAIN_GREEN, WHITE } from '../constants'
8
7
 
9
8
  function InputFileUpload ({
10
9
  idInputFile = 'fileUpload',
@@ -139,103 +138,4 @@ function InputFileUpload ({
139
138
  )
140
139
  }
141
140
 
142
- InputFileUpload.propTypes = {
143
- /**
144
- * idInputFile
145
- */
146
- idInputFile: PropTypes.string,
147
- /**
148
- * placeholder
149
- */
150
- placeholder: PropTypes.string,
151
- /**
152
- * color of border
153
- */
154
- borderColor: PropTypes.oneOf([MAIN_GREEN, MAIN_DARK_BLUE, WHITE, RICH_BLACK]),
155
- /**
156
- * color of border
157
- */
158
- backgroundColor: PropTypes.oneOf([MAIN_GREEN, MAIN_DARK_BLUE, WHITE, RICH_BLACK, TRANSPARENT]),
159
- /**
160
- * onFileSelect
161
- */
162
- onFileSelect: PropTypes.func,
163
- /**
164
- * Disabled
165
- */
166
- disabled: PropTypes.bool,
167
- /**
168
- * beforeIcon: PlatformaticIcon props
169
- */
170
- beforeIcon: PropTypes.shape({
171
- iconName: PropTypes.string,
172
- color: PropTypes.string,
173
- onClick: PropTypes.func
174
- }),
175
- /**
176
- * afterIcon: PlatformaticIcon props
177
- */
178
- afterIcon: PropTypes.shape({
179
- iconName: PropTypes.string,
180
- color: PropTypes.string,
181
- onClick: PropTypes.func
182
- }),
183
- /**
184
- * backgroundTransparent
185
- */
186
- backgroundTransparent: PropTypes.bool,
187
- /**
188
- * inputTextClassName
189
- */
190
- inputTextClassName: PropTypes.string,
191
- /**
192
- * detailTextClassName
193
- */
194
- detailTextClassName: PropTypes.string,
195
- /**
196
- * accept
197
- */
198
- accept: PropTypes.string,
199
- /**
200
- * verticalPaddingClassName
201
- */
202
- verticalPaddingClassName: PropTypes.string,
203
- /**
204
- * dataAttrName
205
- */
206
- dataAttrName: PropTypes.string,
207
- /**
208
- * dataAttrValue
209
- */
210
- dataAttrValue: PropTypes.string,
211
- /**
212
- * readOnly
213
- */
214
- readOnly: PropTypes.bool,
215
- /**
216
- * errorMessage
217
- */
218
- errorMessage: PropTypes.string,
219
- /**
220
- * errorMessageTextClassName
221
- */
222
- errorMessageTextClassName: PropTypes.string,
223
- /**
224
- * removeFileButton
225
- */
226
- removeFileButton: PropTypes.object,
227
- /**
228
- * showDetailButton
229
- */
230
- showDetailButton: PropTypes.bool,
231
- /**
232
- * detailFileButton
233
- */
234
- detailFileButton: PropTypes.object,
235
- /**
236
- * onClickDetail
237
- */
238
- onClickDetail: PropTypes.func
239
- }
240
-
241
141
  export default InputFileUpload
@@ -1,9 +1,8 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import PropTypes from 'prop-types'
3
2
  import inputStyles from './Input.module.css'
4
3
  import styles from './InputWithSeparator.module.css'
5
4
  import commonStyles from '../Common.module.css'
6
- import { DULLS_BACKGROUND_COLOR, ERROR_RED, MAIN_DARK_BLUE, MAIN_GREEN, MEDIUM, OPACITY_30, RICH_BLACK, SIZES, SMALL, TRANSPARENT, WHITE } from '../constants'
5
+ import { DULLS_BACKGROUND_COLOR, ERROR_RED, MAIN_GREEN, MEDIUM, OPACITY_30, SMALL, TRANSPARENT, WHITE } from '../constants'
7
6
  import BorderedBox from '../BorderedBox'
8
7
  import ButtonFullRounded from '../ButtonFullRounded'
9
8
  import PlatformaticIcon from '../PlatformaticIcon'
@@ -182,76 +181,4 @@ function InputWithSeparator ({
182
181
  )
183
182
  }
184
183
 
185
- InputWithSeparator.propTypes = {
186
- /**
187
- * placeholder
188
- */
189
- placeholder: PropTypes.string,
190
- /**
191
- * name
192
- */
193
- name: PropTypes.string,
194
- /**
195
- * value
196
- */
197
- value: PropTypes.string,
198
- /**
199
- * defaultValue
200
- */
201
- defaultValue: PropTypes.string,
202
- /**
203
- * defaultValueSeparator
204
- */
205
- defaultValueSeparator: PropTypes.string,
206
- /**
207
- * separators
208
- */
209
- separators: PropTypes.arrayOf(PropTypes.string),
210
- /**
211
- * inputTextClassName
212
- */
213
- inputTextClassName: PropTypes.string,
214
- /**
215
- * color of border
216
- */
217
- borderColor: PropTypes.oneOf([MAIN_GREEN, MAIN_DARK_BLUE, WHITE, RICH_BLACK]),
218
- /**
219
- * color of border
220
- */
221
- backgroundColor: PropTypes.oneOf([MAIN_GREEN, MAIN_DARK_BLUE, WHITE, RICH_BLACK, TRANSPARENT]),
222
- /**
223
- * onChange
224
- */
225
- onChange: PropTypes.func,
226
- /**
227
- * Disabled
228
- */
229
- disabled: PropTypes.bool,
230
- /**
231
- * afterIcon: PlatformaticIcon props
232
- */
233
- afterIcon: PropTypes.shape({
234
- iconName: PropTypes.string,
235
- color: PropTypes.string,
236
- handleClick: PropTypes.func,
237
- disabled: PropTypes.bool
238
- }),
239
- /**
240
- * beforeIcon: PlatformaticIcon props
241
- */
242
- beforeIcon: PropTypes.shape({
243
- iconName: PropTypes.string,
244
- color: PropTypes.string,
245
- size: PropTypes.oneOf(SIZES)
246
- }),
247
- /**
248
- * errorMessage
249
- */
250
- errorMessage: PropTypes.string,
251
- /**
252
- * errorMessageTextClassName
253
- */
254
- errorMessageTextClassName: PropTypes.string
255
- }
256
-
257
184
  export default InputWithSeparator
@@ -1,11 +1,10 @@
1
1
  import React, { useState } from 'react'
2
- import PropTypes from 'prop-types'
3
2
  import styles from './Password.module.css'
4
3
  import commonStyles from '../Common.module.css'
5
4
  import PlatformaticIcon from '../PlatformaticIcon'
6
- import { MAIN_DARK_BLUE, MAIN_GREEN } from '../constants'
5
+ import { MAIN_DARK_BLUE } from '../constants'
7
6
 
8
- function Input ({
7
+ function Password ({
9
8
  placeholder = '',
10
9
  value = '',
11
10
  name = '',
@@ -38,43 +37,4 @@ function Input ({
38
37
  )
39
38
  }
40
39
 
41
- Input.propTypes = {
42
- /**
43
- * placeholder
44
- */
45
- placeholder: PropTypes.string,
46
- /**
47
- * value
48
- */
49
- value: PropTypes.string,
50
- /**
51
- * name
52
- */
53
- name: PropTypes.string,
54
- /**
55
- * color of border
56
- */
57
- borderColor: PropTypes.oneOf([MAIN_GREEN, MAIN_DARK_BLUE]),
58
- /**
59
- * onChange
60
- */
61
- onChange: PropTypes.func,
62
- /**
63
- * Disabled
64
- */
65
- disabled: PropTypes.bool,
66
- /**
67
- * placeholderApart
68
- */
69
- placeholderApart: PropTypes.bool,
70
- /**
71
- * errorMessage
72
- */
73
- errorMessage: PropTypes.string,
74
- /**
75
- * errorMessageTextClassName
76
- */
77
- errorMessageTextClassName: PropTypes.string
78
- }
79
-
80
- export default Input
40
+ export default Password
@@ -1,9 +1,8 @@
1
1
  import React from 'react'
2
- import PropTypes from 'prop-types'
3
2
  import styles from './Preview.module.css'
4
3
  import PlatformaticIcon from '../PlatformaticIcon'
5
4
  import CopyAndPaste from '../CopyAndPaste'
6
- import { SIZES, COLORS_ICON } from '../constants'
5
+ import {} from '../constants'
7
6
 
8
7
  function renderLink (value) {
9
8
  return (<a className={styles.link} href={value} target='_blank' rel='noreferrer'>{value}</a>)
@@ -41,53 +40,4 @@ function Preview ({
41
40
  )
42
41
  }
43
42
 
44
- Preview.propTypes = {
45
- /**
46
- * title
47
- */
48
- title: PropTypes.string,
49
- /**
50
- * value
51
- */
52
- value: PropTypes.oneOfType([
53
- PropTypes.string,
54
- PropTypes.number
55
- ]),
56
- /**
57
- * isLink
58
- */
59
- isLink: PropTypes.bool,
60
- /**
61
- * color of border
62
- */
63
- children: PropTypes.node,
64
- /**
65
- * useCopyAndPaste
66
- */
67
- useCopyAndPaste: PropTypes.bool,
68
- /**
69
- * copyAndPaste
70
- */
71
- copyAndPaste: PropTypes.shape({
72
- value: PropTypes.string,
73
- tooltipLabel: PropTypes.string,
74
- iconSize: PropTypes.oneOf(SIZES),
75
- iconColor: PropTypes.oneOf(COLORS_ICON),
76
- timeout: PropTypes.number
77
- }),
78
- /**
79
- * usePlatformaticIcon
80
- */
81
- usePlatformaticIcon: PropTypes.bool,
82
- /**
83
- * platformaticIcon
84
- */
85
- platformaticIcon: PropTypes.shape({
86
- iconName: PropTypes.string.isRequired,
87
- color: PropTypes.oneOf(COLORS_ICON),
88
- size: PropTypes.oneOf(SIZES),
89
- onClick: PropTypes.func
90
- })
91
- }
92
-
93
43
  export default Preview
@@ -1,5 +1,4 @@
1
1
  import React from 'react'
2
- import PropTypes from 'prop-types'
3
2
  import styles from './RadioGroup.module.css'
4
3
  import commonStyles from '../Common.module.css'
5
4
 
@@ -33,38 +32,4 @@ function RadioGroup ({
33
32
  )
34
33
  }
35
34
 
36
- RadioGroup.propTypes = {
37
- /**
38
- * name
39
- */
40
- name: PropTypes.string,
41
- /**
42
- * radios
43
- */
44
- radios: PropTypes.arrayOf(PropTypes.shape({
45
- value: PropTypes.string,
46
- label: PropTypes.string
47
- })),
48
- /**
49
- * errorMessage
50
- */
51
- errorMessage: PropTypes.string,
52
- /**
53
- * errorMessageTextClassName
54
- */
55
- errorMessageTextClassName: PropTypes.string,
56
- /**
57
- * onChange
58
- */
59
- onChange: PropTypes.func,
60
- /**
61
- * Disabled
62
- */
63
- disabled: PropTypes.bool,
64
- /**
65
- * value
66
- */
67
- value: PropTypes.string
68
- }
69
-
70
35
  export default RadioGroup