@iobroker/adapter-react-v5 7.2.4 → 7.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/README.md +7 -15
  2. package/build/AdminConnection.d.ts +1 -0
  3. package/build/AdminConnection.js +2 -0
  4. package/build/AdminConnection.js.map +1 -0
  5. package/{src/Components/404.tsx → build/Components/404.js} +14 -39
  6. package/build/Components/404.js.map +1 -0
  7. package/{Components → build/Components}/ColorPicker.d.ts +2 -2
  8. package/{Components → build/Components}/ColorPicker.js +50 -65
  9. package/build/Components/ColorPicker.js.map +1 -0
  10. package/{Components → build/Components}/ComplexCron.d.ts +2 -2
  11. package/{Components → build/Components}/ComplexCron.js +43 -71
  12. package/build/Components/ComplexCron.js.map +1 -0
  13. package/{Components → build/Components}/CopyToClipboard.d.ts +1 -2
  14. package/{src/Components/CopyToClipboard.tsx → build/Components/CopyToClipboard.js} +20 -38
  15. package/build/Components/CopyToClipboard.js.map +1 -0
  16. package/{Components → build/Components}/CustomModal.d.ts +3 -3
  17. package/build/Components/CustomModal.js +60 -0
  18. package/build/Components/CustomModal.js.map +1 -0
  19. package/{Components → build/Components}/FileBrowser.d.ts +5 -3
  20. package/{Components → build/Components}/FileBrowser.js +230 -236
  21. package/build/Components/FileBrowser.js.map +1 -0
  22. package/build/Components/FileViewer.d.ts +49 -0
  23. package/build/Components/FileViewer.js +247 -0
  24. package/build/Components/FileViewer.js.map +1 -0
  25. package/{Components → build/Components}/Icon.d.ts +1 -1
  26. package/build/Components/Icon.js +140 -0
  27. package/build/Components/Icon.js.map +1 -0
  28. package/{Components → build/Components}/IconPicker.d.ts +2 -2
  29. package/build/Components/IconPicker.js +73 -0
  30. package/build/Components/IconPicker.js.map +1 -0
  31. package/{Components → build/Components}/IconSelector.d.ts +3 -3
  32. package/{Components → build/Components}/IconSelector.js +29 -57
  33. package/build/Components/IconSelector.js.map +1 -0
  34. package/{Components → build/Components}/Image.d.ts +2 -2
  35. package/{Components → build/Components}/Image.js +16 -22
  36. package/build/Components/Image.js.map +1 -0
  37. package/{Components → build/Components}/Loader.d.ts +2 -2
  38. package/{Components → build/Components}/Loader.js +15 -40
  39. package/build/Components/Loader.js.map +1 -0
  40. package/{Components → build/Components}/Loaders/MV.d.ts +2 -2
  41. package/build/Components/Loaders/MV.js +61 -0
  42. package/build/Components/Loaders/MV.js.map +1 -0
  43. package/{Components → build/Components}/Loaders/PT.d.ts +2 -2
  44. package/{Components → build/Components}/Loaders/PT.js +10 -35
  45. package/build/Components/Loaders/PT.js.map +1 -0
  46. package/{Components → build/Components}/Loaders/Vendor.d.ts +2 -2
  47. package/build/Components/Loaders/Vendor.js +52 -0
  48. package/build/Components/Loaders/Vendor.js.map +1 -0
  49. package/{Components → build/Components}/Logo.d.ts +2 -2
  50. package/build/Components/Logo.js +108 -0
  51. package/build/Components/Logo.js.map +1 -0
  52. package/{Components → build/Components}/MDUtils.d.ts +1 -2
  53. package/{Components → build/Components}/MDUtils.js +4 -9
  54. package/build/Components/MDUtils.js.map +1 -0
  55. package/{Components → build/Components}/ObjectBrowser.d.ts +4 -4
  56. package/{Components → build/Components}/ObjectBrowser.js +1159 -1122
  57. package/build/Components/ObjectBrowser.js.map +1 -0
  58. package/{Components → build/Components}/Router.d.ts +1 -2
  59. package/{Components → build/Components}/Router.js +6 -7
  60. package/build/Components/Router.js.map +1 -0
  61. package/{Components → build/Components}/SaveCloseButtons.d.ts +2 -2
  62. package/build/Components/SaveCloseButtons.js +65 -0
  63. package/build/Components/SaveCloseButtons.js.map +1 -0
  64. package/{Components → build/Components}/Schedule.d.ts +2 -2
  65. package/{Components → build/Components}/Schedule.js +242 -257
  66. package/build/Components/Schedule.js.map +1 -0
  67. package/{Components → build/Components}/SelectWithIcon.d.ts +2 -2
  68. package/build/Components/SelectWithIcon.js +135 -0
  69. package/build/Components/SelectWithIcon.js.map +1 -0
  70. package/build/Components/SimpleCron/cronText.js +15 -0
  71. package/build/Components/SimpleCron/cronText.js.map +1 -0
  72. package/{Components → build/Components}/SimpleCron/index.d.ts +2 -2
  73. package/{Components → build/Components}/SimpleCron/index.js +55 -58
  74. package/build/Components/SimpleCron/index.js.map +1 -0
  75. package/{Components → build/Components}/TabContainer.d.ts +2 -2
  76. package/build/Components/TabContainer.js +23 -0
  77. package/build/Components/TabContainer.js.map +1 -0
  78. package/{Components → build/Components}/TabContent.d.ts +3 -2
  79. package/build/Components/TabContent.js +20 -0
  80. package/build/Components/TabContent.js.map +1 -0
  81. package/build/Components/TabHeader.d.ts +6 -0
  82. package/build/Components/TabHeader.js +6 -0
  83. package/build/Components/TabHeader.js.map +1 -0
  84. package/{Components → build/Components}/TableResize.d.ts +2 -2
  85. package/{src/Components/TableResize.tsx → build/Components/TableResize.js} +64 -134
  86. package/build/Components/TableResize.js.map +1 -0
  87. package/{Components → build/Components}/TextWithIcon.d.ts +2 -2
  88. package/{src/Components/TextWithIcon.tsx → build/Components/TextWithIcon.js} +30 -75
  89. package/build/Components/TextWithIcon.js.map +1 -0
  90. package/{Components → build/Components}/ToggleThemeMenu.d.ts +1 -1
  91. package/build/Components/ToggleThemeMenu.js +13 -0
  92. package/build/Components/ToggleThemeMenu.js.map +1 -0
  93. package/{Components → build/Components}/TreeTable.d.ts +3 -3
  94. package/{Components → build/Components}/TreeTable.js +87 -99
  95. package/build/Components/TreeTable.js.map +1 -0
  96. package/{Components → build/Components}/UploadImage.d.ts +2 -2
  97. package/{Components → build/Components}/UploadImage.js +45 -69
  98. package/build/Components/UploadImage.js.map +1 -0
  99. package/{Components → build/Components}/Utils.d.ts +2 -2
  100. package/{Components → build/Components}/Utils.js +47 -60
  101. package/build/Components/Utils.js.map +1 -0
  102. package/build/Components/withWidth.d.ts +2 -0
  103. package/build/Components/withWidth.js +22 -0
  104. package/build/Components/withWidth.js.map +1 -0
  105. package/build/Connection.d.ts +1 -0
  106. package/build/Connection.js +2 -0
  107. package/build/Connection.js.map +1 -0
  108. package/{Dialogs → build/Dialogs}/ComplexCron.d.ts +2 -2
  109. package/build/Dialogs/ComplexCron.js +85 -0
  110. package/build/Dialogs/ComplexCron.js.map +1 -0
  111. package/{Dialogs → build/Dialogs}/Confirm.d.ts +2 -2
  112. package/build/Dialogs/Confirm.js +83 -0
  113. package/build/Dialogs/Confirm.js.map +1 -0
  114. package/{Dialogs → build/Dialogs}/Cron.d.ts +2 -2
  115. package/build/Dialogs/Cron.js +72 -0
  116. package/build/Dialogs/Cron.js.map +1 -0
  117. package/{Dialogs → build/Dialogs}/Error.d.ts +2 -2
  118. package/build/Dialogs/Error.js +27 -0
  119. package/build/Dialogs/Error.js.map +1 -0
  120. package/{Dialogs → build/Dialogs}/Message.d.ts +2 -2
  121. package/build/Dialogs/Message.js +29 -0
  122. package/build/Dialogs/Message.js.map +1 -0
  123. package/{Dialogs → build/Dialogs}/SelectFile.d.ts +2 -2
  124. package/build/Dialogs/SelectFile.js +116 -0
  125. package/build/Dialogs/SelectFile.js.map +1 -0
  126. package/{Dialogs → build/Dialogs}/SelectID.d.ts +3 -3
  127. package/{Dialogs → build/Dialogs}/SelectID.js +28 -53
  128. package/build/Dialogs/SelectID.js.map +1 -0
  129. package/{Dialogs → build/Dialogs}/SimpleCron.d.ts +2 -2
  130. package/build/Dialogs/SimpleCron.js +46 -0
  131. package/build/Dialogs/SimpleCron.js.map +1 -0
  132. package/build/Dialogs/TextInput.d.ts +2 -0
  133. package/build/Dialogs/TextInput.js +31 -0
  134. package/build/Dialogs/TextInput.js.map +1 -0
  135. package/{GenericApp.d.ts → build/GenericApp.d.ts} +2 -3
  136. package/{GenericApp.js → build/GenericApp.js} +162 -176
  137. package/build/GenericApp.js.map +1 -0
  138. package/{LegacyConnection.d.ts → build/LegacyConnection.d.ts} +69 -4
  139. package/{LegacyConnection.js → build/LegacyConnection.js} +106 -99
  140. package/build/LegacyConnection.js.map +1 -0
  141. package/{Prompt.d.ts → build/Prompt.d.ts} +1 -1
  142. package/{Prompt.js → build/Prompt.js} +3 -4
  143. package/build/Prompt.js.map +1 -0
  144. package/build/Theme.d.ts +5 -0
  145. package/{Theme.js → build/Theme.js} +36 -32
  146. package/build/Theme.js.map +1 -0
  147. package/build/assets/devices/parseNames.d.ts +0 -0
  148. package/build/assets/devices/parseNames.js +35 -0
  149. package/build/assets/devices/parseNames.js.map +1 -0
  150. package/build/assets/rooms/parseNames.d.ts +0 -0
  151. package/build/assets/rooms/parseNames.js +35 -0
  152. package/build/assets/rooms/parseNames.js.map +1 -0
  153. package/build/dictionary.d.ts +1 -0
  154. package/build/dictionary.js +25 -0
  155. package/build/dictionary.js.map +1 -0
  156. package/build/i18n/de.json +449 -0
  157. package/build/i18n/en.json +449 -0
  158. package/build/i18n/es.json +449 -0
  159. package/build/i18n/fr.json +449 -0
  160. package/build/i18n/it.json +449 -0
  161. package/build/i18n/nl.json +449 -0
  162. package/build/i18n/pl.json +449 -0
  163. package/build/i18n/pt.json +449 -0
  164. package/build/i18n/ru.json +449 -0
  165. package/build/i18n/uk.json +449 -0
  166. package/build/i18n/zh-cn.json +449 -0
  167. package/{i18n.d.ts → build/i18n.d.ts} +2 -2
  168. package/{i18n.js → build/i18n.js} +9 -11
  169. package/build/i18n.js.map +1 -0
  170. package/build/icons/IconAdapter.d.ts +3 -0
  171. package/build/icons/IconAdapter.js +5 -0
  172. package/build/icons/IconAdapter.js.map +1 -0
  173. package/build/icons/IconAlias.d.ts +3 -0
  174. package/build/icons/IconAlias.js +5 -0
  175. package/build/icons/IconAlias.js.map +1 -0
  176. package/build/icons/IconChannel.d.ts +3 -0
  177. package/build/icons/IconChannel.js +8 -0
  178. package/build/icons/IconChannel.js.map +1 -0
  179. package/build/icons/IconClearFilter.d.ts +3 -0
  180. package/build/icons/IconClearFilter.js +6 -0
  181. package/build/icons/IconClearFilter.js.map +1 -0
  182. package/build/icons/IconClosed.d.ts +3 -0
  183. package/build/icons/IconClosed.js +5 -0
  184. package/build/icons/IconClosed.js.map +1 -0
  185. package/build/icons/IconCopy.d.ts +3 -0
  186. package/build/icons/IconCopy.js +4 -0
  187. package/build/icons/IconCopy.js.map +1 -0
  188. package/build/icons/IconDevice.d.ts +3 -0
  189. package/build/icons/IconDevice.js +14 -0
  190. package/build/icons/IconDevice.js.map +1 -0
  191. package/build/icons/IconDocument.d.ts +3 -0
  192. package/build/icons/IconDocument.js +5 -0
  193. package/build/icons/IconDocument.js.map +1 -0
  194. package/build/icons/IconDocumentReadOnly.d.ts +3 -0
  195. package/build/icons/IconDocumentReadOnly.js +6 -0
  196. package/build/icons/IconDocumentReadOnly.js.map +1 -0
  197. package/build/icons/IconExpert.d.ts +3 -0
  198. package/build/icons/IconExpert.js +5 -0
  199. package/build/icons/IconExpert.js.map +1 -0
  200. package/build/icons/IconFx.d.ts +3 -0
  201. package/build/icons/IconFx.js +4 -0
  202. package/build/icons/IconFx.js.map +1 -0
  203. package/build/icons/IconInstance.d.ts +3 -0
  204. package/build/icons/IconInstance.js +5 -0
  205. package/build/icons/IconInstance.js.map +1 -0
  206. package/build/icons/IconLogout.d.ts +3 -0
  207. package/build/icons/IconLogout.js +5 -0
  208. package/build/icons/IconLogout.js.map +1 -0
  209. package/build/icons/IconNoIcon.d.ts +3 -0
  210. package/build/icons/IconNoIcon.js +4 -0
  211. package/build/icons/IconNoIcon.js.map +1 -0
  212. package/build/icons/IconOpen.d.ts +3 -0
  213. package/build/icons/IconOpen.js +5 -0
  214. package/build/icons/IconOpen.js.map +1 -0
  215. package/{icons → build/icons}/IconProps.d.ts +1 -1
  216. package/build/icons/IconProps.js +2 -0
  217. package/build/icons/IconProps.js.map +1 -0
  218. package/build/icons/IconState.d.ts +3 -0
  219. package/build/icons/IconState.js +5 -0
  220. package/build/icons/IconState.js.map +1 -0
  221. package/build/index.d.ts +76 -0
  222. package/build/index.js +75 -0
  223. package/build/index.js.map +1 -0
  224. package/{types.d.ts → build/types.d.ts} +1 -1
  225. package/package.json +84 -48
  226. package/AdminConnection.d.ts +0 -2
  227. package/AdminConnection.js +0 -4
  228. package/Components/404.js +0 -101
  229. package/Components/CopyToClipboard.js +0 -163
  230. package/Components/CustomModal.js +0 -88
  231. package/Components/FileViewer.d.ts +0 -10
  232. package/Components/FileViewer.js +0 -305
  233. package/Components/Icon.js +0 -148
  234. package/Components/IconPicker.js +0 -98
  235. package/Components/Loaders/MV.js +0 -66
  236. package/Components/Loaders/Vendor.js +0 -77
  237. package/Components/Logo.js +0 -117
  238. package/Components/SaveCloseButtons.js +0 -69
  239. package/Components/SelectWithIcon.js +0 -168
  240. package/Components/SimpleCron/cronText.js +0 -19
  241. package/Components/TabContainer.js +0 -25
  242. package/Components/TabContent.js +0 -21
  243. package/Components/TabHeader.d.ts +0 -6
  244. package/Components/TabHeader.js +0 -11
  245. package/Components/TableResize.js +0 -226
  246. package/Components/TextWithIcon.js +0 -119
  247. package/Components/ToggleThemeMenu.js +0 -18
  248. package/Components/withWidth.d.ts +0 -3
  249. package/Components/withWidth.js +0 -27
  250. package/Connection.d.ts +0 -3
  251. package/Connection.js +0 -8
  252. package/Dialogs/ComplexCron.js +0 -90
  253. package/Dialogs/Confirm.js +0 -111
  254. package/Dialogs/Cron.js +0 -100
  255. package/Dialogs/Error.js +0 -55
  256. package/Dialogs/Message.js +0 -57
  257. package/Dialogs/SelectFile.js +0 -119
  258. package/Dialogs/SimpleCron.js +0 -51
  259. package/Dialogs/TextInput.d.ts +0 -3
  260. package/Dialogs/TextInput.js +0 -35
  261. package/Theme.d.ts +0 -6
  262. package/i18n/de.json +0 -449
  263. package/i18n/en.json +0 -449
  264. package/i18n/es.json +0 -449
  265. package/i18n/fr.json +0 -449
  266. package/i18n/it.json +0 -449
  267. package/i18n/nl.json +0 -449
  268. package/i18n/pl.json +0 -449
  269. package/i18n/pt.json +0 -449
  270. package/i18n/ru.json +0 -449
  271. package/i18n/uk.json +0 -449
  272. package/i18n/zh-cn.json +0 -449
  273. package/icons/IconAdapter.d.ts +0 -4
  274. package/icons/IconAdapter.js +0 -10
  275. package/icons/IconAlias.d.ts +0 -4
  276. package/icons/IconAlias.js +0 -10
  277. package/icons/IconChannel.d.ts +0 -4
  278. package/icons/IconChannel.js +0 -13
  279. package/icons/IconClearFilter.d.ts +0 -4
  280. package/icons/IconClearFilter.js +0 -11
  281. package/icons/IconClosed.d.ts +0 -4
  282. package/icons/IconClosed.js +0 -10
  283. package/icons/IconCopy.d.ts +0 -4
  284. package/icons/IconCopy.js +0 -9
  285. package/icons/IconDevice.d.ts +0 -4
  286. package/icons/IconDevice.js +0 -19
  287. package/icons/IconDocument.d.ts +0 -4
  288. package/icons/IconDocument.js +0 -10
  289. package/icons/IconDocumentReadOnly.d.ts +0 -4
  290. package/icons/IconDocumentReadOnly.js +0 -11
  291. package/icons/IconExpert.d.ts +0 -4
  292. package/icons/IconExpert.js +0 -10
  293. package/icons/IconFx.d.ts +0 -4
  294. package/icons/IconFx.js +0 -9
  295. package/icons/IconInstance.d.ts +0 -4
  296. package/icons/IconInstance.js +0 -10
  297. package/icons/IconLogout.d.ts +0 -4
  298. package/icons/IconLogout.js +0 -10
  299. package/icons/IconNoIcon.d.ts +0 -4
  300. package/icons/IconNoIcon.js +0 -9
  301. package/icons/IconOpen.d.ts +0 -4
  302. package/icons/IconOpen.js +0 -10
  303. package/icons/IconProps.js +0 -2
  304. package/icons/IconState.d.ts +0 -4
  305. package/icons/IconState.js +0 -10
  306. package/index.d.ts +0 -128
  307. package/index.js +0 -215
  308. package/src/AdminConnection.tsx +0 -3
  309. package/src/Components/ColorPicker.tsx +0 -343
  310. package/src/Components/ComplexCron.tsx +0 -561
  311. package/src/Components/CustomModal.tsx +0 -170
  312. package/src/Components/FileBrowser.tsx +0 -2560
  313. package/src/Components/FileViewer.tsx +0 -412
  314. package/src/Components/Icon.tsx +0 -238
  315. package/src/Components/IconPicker.tsx +0 -165
  316. package/src/Components/IconSelector.tsx +0 -2220
  317. package/src/Components/Image.tsx +0 -193
  318. package/src/Components/Loader.tsx +0 -328
  319. package/src/Components/Logo.tsx +0 -176
  320. package/src/Components/MDUtils.tsx +0 -104
  321. package/src/Components/ObjectBrowser.tsx +0 -8947
  322. package/src/Components/Router.tsx +0 -90
  323. package/src/Components/SaveCloseButtons.tsx +0 -117
  324. package/src/Components/Schedule.tsx +0 -1998
  325. package/src/Components/SelectWithIcon.tsx +0 -239
  326. package/src/Components/TabContainer.tsx +0 -57
  327. package/src/Components/TabContent.tsx +0 -38
  328. package/src/Components/TabHeader.tsx +0 -20
  329. package/src/Components/ToggleThemeMenu.tsx +0 -52
  330. package/src/Components/TreeTable.tsx +0 -1002
  331. package/src/Components/UploadImage.tsx +0 -643
  332. package/src/Components/Utils.tsx +0 -1802
  333. package/src/Components/loader.css +0 -231
  334. package/src/Components/withWidth.tsx +0 -32
  335. package/src/Connection.tsx +0 -5
  336. package/src/Dialogs/ComplexCron.tsx +0 -163
  337. package/src/Dialogs/Confirm.tsx +0 -185
  338. package/src/Dialogs/Cron.tsx +0 -192
  339. package/src/Dialogs/Error.tsx +0 -67
  340. package/src/Dialogs/Message.tsx +0 -73
  341. package/src/Dialogs/SelectFile.tsx +0 -280
  342. package/src/Dialogs/SelectID.tsx +0 -310
  343. package/src/Dialogs/SimpleCron.tsx +0 -101
  344. package/src/Dialogs/TextInput.tsx +0 -99
  345. package/src/GenericApp.tsx +0 -1076
  346. package/src/LegacyConnection.tsx +0 -3720
  347. package/src/Prompt.tsx +0 -22
  348. package/src/Theme.tsx +0 -472
  349. package/src/icons/IconAdapter.tsx +0 -22
  350. package/src/icons/IconAlias.tsx +0 -22
  351. package/src/icons/IconChannel.tsx +0 -60
  352. package/src/icons/IconClearFilter.tsx +0 -24
  353. package/src/icons/IconClosed.tsx +0 -22
  354. package/src/icons/IconCopy.tsx +0 -21
  355. package/src/icons/IconDevice.tsx +0 -126
  356. package/src/icons/IconDocument.tsx +0 -22
  357. package/src/icons/IconDocumentReadOnly.tsx +0 -27
  358. package/src/icons/IconExpert.tsx +0 -26
  359. package/src/icons/IconFx.tsx +0 -38
  360. package/src/icons/IconInstance.tsx +0 -22
  361. package/src/icons/IconLogout.tsx +0 -32
  362. package/src/icons/IconNoIcon.tsx +0 -21
  363. package/src/icons/IconOpen.tsx +0 -22
  364. package/src/icons/IconProps.tsx +0 -16
  365. package/src/icons/IconState.tsx +0 -38
  366. package/src/index.css +0 -56
  367. /package/{Components → build/Components}/404.d.ts +0 -0
  368. /package/{Components → build/Components}/SimpleCron/cronText.d.ts +0 -0
  369. /package/{assets → build/assets}/devices.json +0 -0
  370. /package/{assets → build/assets}/lamp_ceiling.svg +0 -0
  371. /package/{assets → build/assets}/lamp_table.svg +0 -0
  372. /package/{assets → build/assets}/no_icon.svg +0 -0
  373. /package/{assets → build/assets}/rooms.json +0 -0
  374. /package/{index.css → build/index.css} +0 -0
  375. /package/{tasks.js → tasksExample.js} +0 -0
package/src/Prompt.tsx DELETED
@@ -1,22 +0,0 @@
1
- /**
2
- * Print the ioBroker welcome screen to the developer console.
3
- */
4
- function printPrompt(): void {
5
- const prompt = `
6
- ██╗ ██████╗ ██████╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
7
- ██║██╔═══██╗██╔══██╗██╔══██╗██╔═══██╗██║ ██╔╝██╔════╝██╔══██╗
8
- ██║██║ ██║██████╔╝██████╔╝██║ ██║█████╔╝ █████╗ ██████╔╝
9
- ██║██║ ██║██╔══██╗██╔══██╗██║ ██║██╔═██╗ ██╔══╝ ██╔══██╗
10
- ██║╚██████╔╝██████╔╝██║ ██║╚██████╔╝██║ ██╗███████╗██║ ██║
11
- ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
12
- `;
13
-
14
- console.log(prompt);
15
- console.log(
16
- 'Nice to see you here! :) Join our dev community here https://github.com/ioBroker/ioBroker or here https://github.com/iobroker-community-adapters',
17
- );
18
- console.log('Help us to create open source project with reactJS!');
19
- console.log('See you :)');
20
- }
21
-
22
- export default printPrompt;
package/src/Theme.tsx DELETED
@@ -1,472 +0,0 @@
1
- import { type CSSProperties } from 'react';
2
- import { createTheme, alpha, type PaletteOptions as PaletteOptionsMui } from '@mui/material/styles';
3
- import { orange, grey } from '@mui/material/colors';
4
-
5
- import type { SimplePaletteColorOptions } from '@mui/material/styles/createPalette';
6
- import type { ThemeOptions as ThemeOptionsMui } from '@mui/material/styles/createTheme';
7
- import type { IobTheme, ThemeName, ThemeType } from './types';
8
-
9
- const step = (16 - 5) / 23 / 100;
10
-
11
- /**
12
- * Convert hex color in the format '#rrggbb' or '#rgb' to an RGB object.
13
- */
14
- function toInt(hex: string): { r: number; g: number; b: number } {
15
- const rgb: { r: number; g: number; b: number } = {
16
- r: 0,
17
- g: 0,
18
- b: 0,
19
- };
20
-
21
- if (hex.length === 7) {
22
- rgb.r = parseInt(hex.substr(1, 2), 16);
23
- rgb.g = parseInt(hex.substr(3, 2), 16);
24
- rgb.b = parseInt(hex.substr(5, 2), 16);
25
- } else if (hex.length === 4) {
26
- const r = hex.substr(1, 1);
27
- const g = hex.substr(2, 1);
28
- const b = hex.substr(3, 1);
29
-
30
- rgb.r = parseInt(r + r, 16);
31
- rgb.g = parseInt(g + g, 16);
32
- rgb.b = parseInt(b + b, 16);
33
- }
34
-
35
- return rgb;
36
- }
37
-
38
- /**
39
- * Convert an RGB object to a hex color string in the format '#rrggbb'.
40
- */
41
- function toHex(int: { r: number; g: number; b: number }): string {
42
- return `#${Math.round(int.r).toString(16)}${Math.round(int.g).toString(16)}${Math.round(int.b).toString(16)}`;
43
- }
44
-
45
- /** Returns the hex color string in the format '#rrggbb' */
46
- function getElevation(
47
- /** color in the format '#rrggbb' or '#rgb' */
48
- color: string,
49
- /** overlay color in the format '#rrggbb' or '#rgb' */
50
- overlayColor: string,
51
- /** elevation as an integer starting with 1 */
52
- elevation: number,
53
- ): string {
54
- const rgb: { r: number; g: number; b: number } = toInt(color);
55
- const overlay: { r: number; g: number; b: number } = toInt(overlayColor);
56
-
57
- rgb.r += overlay.r * (0.05 + step * (elevation - 1));
58
- rgb.g += overlay.g * (0.05 + step * (elevation - 1));
59
- rgb.b += overlay.b * (0.05 + step * (elevation - 1));
60
-
61
- return toHex(rgb);
62
- }
63
-
64
- /**
65
- * Get all 24 elevations of the given color and overlay.
66
- *
67
- * @param color color in the format '#rrggbb' or '#rgb'
68
- * @param overlay overlay color in the format '#rrggbb' or '#rgb'
69
- */
70
- function getElevations(color: string, overlay: string): Record<string, CSSProperties> {
71
- const elevations: Record<string, CSSProperties> = {};
72
-
73
- for (let i = 1; i <= 24; i++) {
74
- elevations[`elevation${i}`] = {
75
- backgroundColor: getElevation(color, overlay, i),
76
- };
77
- }
78
-
79
- return elevations;
80
- }
81
-
82
- // const buttonsPalette = () => ({
83
- // palette: {
84
- // // mode: "dark",
85
- // grey: {
86
- // main: grey[300],
87
- // dark: grey[400],
88
- // },
89
- // },
90
- // });
91
-
92
- // const buttonsTheme = theme => ({
93
- // components: {
94
- // MuiButton: {
95
- // variants: [
96
- // {
97
- // props: { variant: 'contained', color: 'grey' },
98
- // style: {
99
- // color: theme.palette.getContrastText(theme.palette.grey[300]),
100
- // },
101
- // },
102
- // {
103
- // props: { variant: 'outlined', color: 'grey' },
104
- // style: {
105
- // color: theme.palette.text.primary,
106
- // borderColor:
107
- // theme.palette.mode === 'light'
108
- // ? 'rgba(0, 0, 0, 0.23)'
109
- // : 'rgba(255, 255, 255, 0.23)',
110
- // '&.Mui-disabled': {
111
- // border: `1px solid ${theme.palette.action.disabledBackground}`,
112
- // },
113
- // '&:hover': {
114
- // borderColor:
115
- // theme.palette.mode === 'light'
116
- // ? 'rgba(0, 0, 0, 0.23)'
117
- // : 'rgba(255, 255, 255, 0.23)',
118
- // backgroundColor: alpha(
119
- // theme.palette.text.primary,
120
- // theme.palette.action.hoverOpacity,
121
- // ),
122
- // },
123
- // },
124
- // },
125
- // {
126
- // props: { color: 'grey', variant: 'text' },
127
- // style: {
128
- // color: 'black',
129
- // '&:hover': {
130
- // backgroundColor: alpha(
131
- // theme.palette.text.primary,
132
- // theme.palette.action.hoverOpacity,
133
- // ),
134
- // },
135
- // },
136
- // },
137
- // ],
138
- // },
139
- // },
140
- // });
141
-
142
- interface PaletteOptions extends PaletteOptionsMui {
143
- mode: ThemeType;
144
- expert: string;
145
- grey?: {
146
- main?: string;
147
- dark?: string;
148
- 50?: string;
149
- 100?: string;
150
- 200?: string;
151
- 300?: string;
152
- 400?: string;
153
- 500?: string;
154
- 600?: string;
155
- 700?: string;
156
- 800?: string;
157
- 900?: string;
158
- A100?: string;
159
- A200?: string;
160
- A400?: string;
161
- A700?: string;
162
- };
163
- }
164
-
165
- interface ThemeOptions extends ThemeOptionsMui {
166
- name: ThemeName;
167
- palette?: PaletteOptions;
168
- toolbar?: CSSProperties;
169
- saveToolbar?: {
170
- background: string;
171
- button: CSSProperties;
172
- };
173
- }
174
-
175
- /**
176
- * The theme creation factory function.
177
- */
178
- function customTheme(type: ThemeName, overrides?: Record<string, any>): IobTheme {
179
- let options: ThemeOptions;
180
- let localOverrides: Record<string, any>;
181
-
182
- if (type === 'dark') {
183
- localOverrides = {
184
- MuiAppBar: {
185
- colorDefault: {
186
- backgroundColor: '#272727',
187
- },
188
- },
189
- MuiLink: {
190
- root: {
191
- textTransform: 'uppercase',
192
- transition: 'color .3s ease',
193
- color: orange[200],
194
- '&:hover': {
195
- color: orange[100],
196
- },
197
- },
198
- },
199
- MuiPaper: getElevations('#121212', '#fff'),
200
- };
201
-
202
- options = {
203
- name: type,
204
- palette: {
205
- mode: 'dark',
206
- background: {
207
- paper: '#121212',
208
- default: '#121212',
209
- },
210
- primary: {
211
- main: '#4dabf5',
212
- },
213
- secondary: {
214
- main: '#436a93',
215
- },
216
- expert: '#14bb00',
217
- text: {
218
- primary: '#ffffff',
219
- secondary: '#ffffff',
220
- },
221
- },
222
- };
223
- } else if (type === 'blue') {
224
- localOverrides = {
225
- MuiAppBar: {
226
- colorDefault: {
227
- backgroundColor: '#3399CC',
228
- },
229
- },
230
- MuiLink: {
231
- root: {
232
- textTransform: 'uppercase',
233
- transition: 'color .3s ease',
234
- color: orange[400],
235
- '&:hover': {
236
- color: orange[300],
237
- },
238
- },
239
- },
240
- };
241
-
242
- options = {
243
- name: type,
244
- palette: {
245
- mode: 'dark',
246
- background: {
247
- paper: '#151d21',
248
- default: '#151d21',
249
- },
250
- primary: {
251
- main: '#4dabf5',
252
- },
253
- secondary: {
254
- main: '#436a93',
255
- },
256
- expert: '#14bb00',
257
- text: {
258
- primary: '#ffffff',
259
- secondary: '#ffffff',
260
- },
261
- },
262
- };
263
- } else if (type === 'colored') {
264
- localOverrides = {
265
- MuiAppBar: {
266
- colorDefault: {
267
- backgroundColor: '#2a3135',
268
- },
269
- },
270
- MuiLink: {
271
- root: {
272
- textTransform: 'uppercase',
273
- transition: 'color .3s ease',
274
- color: orange[200],
275
- '&:hover': {
276
- color: orange[100],
277
- },
278
- },
279
- },
280
- MuiPaper: getElevations('#151d21', '#fff'),
281
- };
282
-
283
- options = {
284
- name: type,
285
- palette: {
286
- mode: 'light',
287
- primary: {
288
- main: '#3399CC',
289
- },
290
- secondary: {
291
- main: '#164477',
292
- },
293
- expert: '#96fc96',
294
- },
295
- };
296
- } else if (type === 'PT') {
297
- localOverrides = {
298
- MuiAppBar: {
299
- colorDefault: {
300
- backgroundColor: '#0F99DE',
301
- },
302
- },
303
- MuiLink: {
304
- root: {
305
- textTransform: 'uppercase',
306
- transition: 'color .3s ease',
307
- color: orange[400],
308
- '&:hover': {
309
- color: orange[300],
310
- },
311
- },
312
- },
313
- };
314
-
315
- options = {
316
- name: type,
317
- palette: {
318
- mode: 'light',
319
- primary: {
320
- main: '#0F99DE',
321
- },
322
- secondary: {
323
- main: '#88A536',
324
- },
325
- expert: '#BD1B24',
326
- },
327
- };
328
- } else if (type === 'DX') {
329
- localOverrides = {
330
- MuiAppBar: {
331
- colorDefault: {
332
- backgroundColor: '#a9a9a9',
333
- },
334
- },
335
- MuiLink: {
336
- root: {
337
- textTransform: 'uppercase',
338
- transition: 'color .3s ease',
339
- color: orange[400],
340
- '&:hover': {
341
- color: orange[300],
342
- },
343
- },
344
- },
345
- };
346
-
347
- options = {
348
- name: type,
349
- palette: {
350
- mode: 'light',
351
- primary: {
352
- main: '#F5F5F7',
353
- },
354
- secondary: {
355
- main: '#a9a9a9',
356
- },
357
- expert: '#BD1B24',
358
- text: {
359
- primary: '#007AFE',
360
- secondary: '#007AFE',
361
- disabled: '#007AFEAA',
362
- },
363
- },
364
- };
365
- } else {
366
- localOverrides = {
367
- MuiLink: {
368
- root: {
369
- textTransform: 'uppercase',
370
- transition: 'color .3s ease',
371
- color: orange[400],
372
- '&:hover': {
373
- color: orange[300],
374
- },
375
- },
376
- },
377
- };
378
-
379
- options = {
380
- name: type,
381
- palette: {
382
- mode: 'light',
383
- primary: {
384
- main: '#3399CC',
385
- dark: '#256c97',
386
- light: '#76d0fd',
387
- },
388
- secondary: {
389
- main: '#164477',
390
- },
391
- expert: '#14bb00',
392
- },
393
- };
394
- }
395
-
396
- options.toolbar = {
397
- height: 48,
398
- };
399
-
400
- options.saveToolbar = {
401
- background: (options.palette?.primary as SimplePaletteColorOptions)?.main,
402
- button: {
403
- borderRadius: 3,
404
- height: 32,
405
- },
406
- };
407
-
408
- if (options.palette) {
409
- options.palette.grey = {
410
- main: grey[300],
411
- dark: grey[400],
412
- };
413
- }
414
-
415
- const theme: IobTheme = createTheme(options) as IobTheme;
416
-
417
- const palette: PaletteOptions = theme.palette as PaletteOptions;
418
-
419
- return createTheme(theme, {
420
- ...(overrides || undefined),
421
- components: {
422
- ...localOverrides,
423
- MuiButton: {
424
- variants: [
425
- {
426
- props: { variant: 'contained', color: 'grey' },
427
- style: {
428
- backgroundColor: palette.grey?.[300],
429
- color:
430
- palette.getContrastText && palette.grey?.[300]
431
- ? palette.getContrastText(palette.grey[300])
432
- : undefined,
433
- },
434
- },
435
- {
436
- props: { variant: 'outlined', color: 'grey' },
437
- style: {
438
- color: palette.text?.primary,
439
- borderColor: palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)',
440
- '&.Mui-disabled': {
441
- border: `1px solid ${palette.action?.disabledBackground}`,
442
- },
443
- '&:hover': {
444
- borderColor:
445
- palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)',
446
- backgroundColor: alpha(
447
- palette.text?.primary || '',
448
- palette.action?.hoverOpacity || 0.04,
449
- ),
450
- },
451
- },
452
- },
453
- {
454
- props: { variant: 'text', color: 'grey' },
455
- style: {
456
- color: palette.text?.primary,
457
- '&:hover': {
458
- backgroundColor: alpha(
459
- palette.text?.primary || '',
460
- palette.action?.hoverOpacity || 0.04,
461
- ),
462
- },
463
- },
464
- },
465
- ],
466
- },
467
- ...(overrides?.components || undefined),
468
- },
469
- }) as IobTheme;
470
- }
471
-
472
- export default customTheme;
@@ -1,22 +0,0 @@
1
- import React from 'react';
2
- import type IconProps from './IconProps';
3
-
4
- // Icon copied from https://github.com/FortAwesome/Font-Awesome/blob/0d1f27efb836eb2ab994ba37221849ed64a73e5c/svgs/regular/
5
- const IconAdapter = (props: IconProps): React.JSX.Element => (
6
- <svg
7
- xmlns="http://www.w3.org/2000/svg"
8
- onClick={e => props.onClick && props.onClick(e)}
9
- viewBox="0 0 512 512"
10
- width={props.width || (props.fontSize === 'small' ? 16 : 20)}
11
- height={props.height || props.width || (props.fontSize === 'small' ? 16 : 20)}
12
- className={props.className}
13
- style={props.style}
14
- >
15
- <path
16
- fill="currentColor"
17
- d="M448 0L320 96v62.06l-83.03 83.03c6.79 4.25 13.27 9.06 19.07 14.87 5.8 5.8 10.62 12.28 14.87 19.07L353.94 192H416l96-128-64-64zM128 278.59L10.92 395.67c-14.55 14.55-14.55 38.15 0 52.71l52.7 52.7c14.56 14.56 38.15 14.56 52.71 0L233.41 384c29.11-29.11 29.11-76.3 0-105.41s-76.3-29.11-105.41 0z"
18
- />
19
- </svg>
20
- );
21
-
22
- export default IconAdapter;
@@ -1,22 +0,0 @@
1
- import React from 'react';
2
- import type IconProps from './IconProps';
3
-
4
- // Icon copied from https://github.com/FortAwesome/Font-Awesome/blob/0d1f27efb836eb2ab994ba37221849ed64a73e5c/svgs/regular/
5
- const IconAlias = (props: IconProps): React.JSX.Element => (
6
- <svg
7
- xmlns="http://www.w3.org/2000/svg"
8
- onClick={e => props.onClick && props.onClick(e)}
9
- viewBox="0 0 512 512"
10
- width={props.width || (props.fontSize === 'small' ? 16 : 20)}
11
- height={props.height || props.width || (props.fontSize === 'small' ? 16 : 20)}
12
- className={props.className}
13
- style={props.style}
14
- >
15
- <path
16
- fill="currentColor"
17
- d="M96.06 454.35c.01 6.29 1.87 12.45 5.36 17.69l17.09 25.69a31.99 31.99 0 0 0 26.64 14.28h61.71a31.99 31.99 0 0 0 26.64-14.28l17.09-25.69a31.989 31.989 0 0 0 5.36-17.69l.04-38.35H96.01l.05 38.35zM0 176c0 44.37 16.45 84.85 43.56 115.78 16.52 18.85 42.36 58.23 52.21 91.45.04.26.07.52.11.78h160.24c.04-.26.07-.51.11-.78 9.85-33.22 35.69-72.6 52.21-91.45C335.55 260.85 352 220.37 352 176 352 78.61 272.91-.3 175.45 0 73.44.31 0 82.97 0 176zm176-80c-44.11 0-80 35.89-80 80 0 8.84-7.16 16-16 16s-16-7.16-16-16c0-61.76 50.24-112 112-112 8.84 0 16 7.16 16 16s-7.16 16-16 16z"
18
- />
19
- </svg>
20
- );
21
-
22
- export default IconAlias;
@@ -1,60 +0,0 @@
1
- import React from 'react';
2
- import type IconProps from './IconProps';
3
-
4
- const IconChannel = (props: IconProps): React.JSX.Element => (
5
- <svg
6
- xmlns="http://www.w3.org/2000/svg"
7
- onClick={e => props.onClick && props.onClick(e)}
8
- viewBox="0 0 320 320"
9
- width={props.width || (props.fontSize === 'small' ? 16 : 20)}
10
- height={props.height || props.width || (props.fontSize === 'small' ? 16 : 20)}
11
- className={props.className}
12
- style={props.style}
13
- >
14
- <g fill="currentColor">
15
- <rect
16
- rx="32"
17
- height="272"
18
- width="267"
19
- y="25"
20
- x="25"
21
- strokeWidth="15"
22
- stroke="currentColor"
23
- fill="none"
24
- />
25
- <ellipse
26
- stroke="currentColor"
27
- ry="26"
28
- rx="26"
29
- cy="248"
30
- cx="160"
31
- fill="none"
32
- strokeWidth="15"
33
- />
34
- <line
35
- y2="201.94531"
36
- x2="159.5"
37
- y1="46.94531"
38
- x1="159.5"
39
- fillOpacity="null"
40
- strokeOpacity="null"
41
- strokeWidth="15"
42
- stroke="currentColor"
43
- fill="none"
44
- />
45
- <rect
46
- height="27"
47
- width="50"
48
- y="79.7979"
49
- x="133.5"
50
- fillOpacity="null"
51
- strokeOpacity="null"
52
- strokeWidth="15"
53
- stroke="currentColor"
54
- fill="#fff"
55
- />
56
- </g>
57
- </svg>
58
- );
59
-
60
- export default IconChannel;
@@ -1,24 +0,0 @@
1
- import React from 'react';
2
- import type IconProps from './IconProps';
3
-
4
- // Copyright Apache 2.0 https://raw.githubusercontent.com/material-icons/material-icons/master/svg/filter_alt/baseline.svg
5
- // https://github.com/material-icons/material-icons/blob/master/LICENSE
6
- const IconClearFilter = (props: IconProps): React.JSX.Element => (
7
- <svg
8
- xmlns="http://www.w3.org/2000/svg"
9
- onClick={e => props.onClick && props.onClick(e)}
10
- viewBox="0 0 24 24"
11
- width={props.width || (props.fontSize === 'small' ? 16 : 20)}
12
- height={props.height || props.width || (props.fontSize === 'small' ? 16 : 20)}
13
- className={props.className}
14
- style={props.style}
15
- >
16
- <path
17
- fill="currentColor"
18
- stroke="currentColor"
19
- d="M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39A.998.998 0 0 0 18.95 4H5.04c-.83 0-1.3.95-.79 1.61z"
20
- />
21
- </svg>
22
- );
23
-
24
- export default IconClearFilter;
@@ -1,22 +0,0 @@
1
- import React from 'react';
2
- import type IconProps from './IconProps';
3
-
4
- // Icon copied from https://github.com/FortAwesome/Font-Awesome/blob/0d1f27efb836eb2ab994ba37221849ed64a73e5c/svgs/regular/
5
- const IconClosed = (props: IconProps): React.JSX.Element => (
6
- <svg
7
- xmlns="http://www.w3.org/2000/svg"
8
- onClick={e => props.onClick && props.onClick(e)}
9
- viewBox="0 0 650 512"
10
- width={props.width || (props.fontSize === 'small' ? 16 : 20)}
11
- height={props.height || props.width || (props.fontSize === 'small' ? 16 : 20)}
12
- className={props.className}
13
- style={props.style}
14
- >
15
- <path
16
- fill="currentColor"
17
- d="m524,128l-192,0l-64,-64l-160,0c-26.51,0 -48,21.49 -48,48l0,288c0,26.51 21.49,48 48,48l416,0c26.51,0 48,-21.49 48,-48l0,-224c0,-26.51 -21.49,-48 -48,-48z"
18
- />
19
- </svg>
20
- );
21
-
22
- export default IconClosed;
@@ -1,21 +0,0 @@
1
- import React from 'react';
2
- import type IconProps from './IconProps';
3
-
4
- const IconCopy = (props: IconProps): React.JSX.Element => (
5
- <svg
6
- xmlns="http://www.w3.org/2000/svg"
7
- onClick={e => props.onClick && props.onClick(e)}
8
- viewBox="0 0 512 512"
9
- width={props.width || (props.fontSize === 'small' ? 16 : 20)}
10
- height={props.height || props.width || (props.fontSize === 'small' ? 16 : 20)}
11
- className={props.className}
12
- style={props.style}
13
- >
14
- <path
15
- fill="currentColor"
16
- d="M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM266 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h74v224c0 26.51 21.49 48 48 48h96v42a6 6 0 0 1-6 6zm128-96H182a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h106v88c0 13.255 10.745 24 24 24h88v202a6 6 0 0 1-6 6zm6-256h-64V48h9.632c1.591 0 3.117.632 4.243 1.757l48.368 48.368a6 6 0 0 1 1.757 4.243V112z"
17
- />
18
- </svg>
19
- );
20
-
21
- export default IconCopy;