superdesk-ui-framework 3.0.1-beta.2 → 3.0.1-beta.5

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 (384) hide show
  1. package/.vscode/settings.json +5 -0
  2. package/app/img/SD-logo.svg +52 -0
  3. package/app/styles/_accessibility.scss +1 -0
  4. package/app/styles/_big-icon-font.scss +3 -0
  5. package/app/styles/_boxed-list.scss +3 -0
  6. package/app/styles/_hamburger.scss +160 -0
  7. package/app/styles/_helpers.scss +11 -4
  8. package/app/styles/_icon-font.scss +3 -0
  9. package/app/styles/_sd-tag-input.scss +201 -296
  10. package/app/styles/app.scss +3 -0
  11. package/app/styles/components/_list-item.scss +13 -1
  12. package/app/styles/components/_sd-notification-panel.scss +48 -0
  13. package/app/styles/components/_sd-photo-preview.scss +1 -1
  14. package/app/styles/design-tokens/_design-tokens-general.scss +2 -5
  15. package/app/styles/design-tokens/_new-colors.scss +6 -1
  16. package/app/styles/form-elements/_forms-general.scss +22 -7
  17. package/app/styles/form-elements/_inputs.scss +356 -62
  18. package/app/styles/grids/_grid-layout.scss +119 -39
  19. package/app/styles/menus/_sd-bottom-tabs.scss +70 -0
  20. package/app/styles/menus/_sd-left-navigation.scss +24 -1
  21. package/app/styles/menus/_sd-sidebar-menu.scss +10 -14
  22. package/app/styles/menus/_sd-top-menu.scss +19 -5
  23. package/app/styles/primereact/_pr-dropdown.scss +0 -2
  24. package/app-typescript/components/Badge.tsx +3 -2
  25. package/app-typescript/components/DatePicker.tsx +71 -36
  26. package/app-typescript/components/DonutChart.tsx +1 -1
  27. package/app-typescript/components/DurationInput.tsx +328 -0
  28. package/app-typescript/components/Form/InputBase.tsx +85 -0
  29. package/app-typescript/components/Form/InputNew.tsx +107 -0
  30. package/app-typescript/components/Form/InputWrapper.tsx +79 -0
  31. package/app-typescript/components/Form/index.tsx +3 -0
  32. package/app-typescript/components/Icon.tsx +1 -1
  33. package/app-typescript/components/IconButton.tsx +5 -1
  34. package/app-typescript/components/Input.tsx +39 -42
  35. package/app-typescript/components/Label.tsx +49 -10
  36. package/app-typescript/components/Layouts/BottomBarAction.tsx +35 -0
  37. package/app-typescript/components/Layouts/CoreLayout.tsx +62 -0
  38. package/app-typescript/components/Layouts/CoreLayoutContainer.tsx +16 -0
  39. package/app-typescript/components/Layouts/CoreLayoutFooter.tsx +15 -0
  40. package/app-typescript/components/Layouts/CoreLayoutMain.tsx +16 -0
  41. package/app-typescript/components/Layouts/CoreLayoutOverlay.tsx +15 -0
  42. package/app-typescript/components/Layouts/CoreLayoutSlideInMenu.tsx +24 -0
  43. package/app-typescript/components/Layouts/CoreLayoutTopMenu.tsx +35 -0
  44. package/app-typescript/components/Layouts/HamburgerButton.tsx +41 -0
  45. package/app-typescript/components/Layouts/Layout.tsx +2 -2
  46. package/app-typescript/components/Layouts/MainMenu.tsx +101 -0
  47. package/app-typescript/components/Layouts/NotificationPanel.tsx +109 -0
  48. package/app-typescript/components/Layouts/index.tsx +12 -0
  49. package/app-typescript/components/LeftMenu.tsx +6 -0
  50. package/app-typescript/components/Lists/BoxedList.tsx +36 -4
  51. package/app-typescript/components/Lists/ContentList.tsx +4 -4
  52. package/app-typescript/components/Menu.tsx +31 -7
  53. package/app-typescript/components/Modal.tsx +5 -2
  54. package/app-typescript/components/MultiSelect.tsx +35 -5
  55. package/app-typescript/components/NavButton.tsx +4 -0
  56. package/app-typescript/components/Navigation/BottomNav.tsx +83 -0
  57. package/app-typescript/components/Select.tsx +27 -37
  58. package/app-typescript/components/SelectGrid.tsx +1 -1
  59. package/app-typescript/components/SelectWithTemplate.tsx +32 -7
  60. package/app-typescript/components/Skeleton.tsx +1 -1
  61. package/app-typescript/components/Text/Time.tsx +34 -0
  62. package/app-typescript/components/TimePicker.tsx +48 -16
  63. package/app-typescript/components/Togglebox.tsx +1 -1
  64. package/app-typescript/components/Tooltip.tsx +7 -5
  65. package/app-typescript/components/TreeSelect.tsx +423 -195
  66. package/app-typescript/components/WithSizeObserver.tsx +88 -0
  67. package/app-typescript/dist/components/Alert.d.ts +16 -0
  68. package/app-typescript/dist/components/Autocomplete.d.ts +48 -0
  69. package/app-typescript/dist/components/Avatar.d.ts +33 -0
  70. package/app-typescript/dist/components/Badge.d.ts +13 -0
  71. package/app-typescript/dist/components/Button.d.ts +23 -0
  72. package/app-typescript/dist/components/ButtonGroup.d.ts +12 -0
  73. package/app-typescript/dist/components/CheckButtonGroup.d.ts +11 -0
  74. package/app-typescript/dist/components/CheckGroup.d.ts +9 -0
  75. package/app-typescript/dist/components/Checkbox.d.ts +19 -0
  76. package/app-typescript/dist/components/CheckboxButton.d.ts +19 -0
  77. package/app-typescript/dist/components/DatePicker.d.ts +37 -0
  78. package/app-typescript/dist/components/Divider.d.ts +9 -0
  79. package/app-typescript/dist/components/DonutChart.d.ts +12 -0
  80. package/app-typescript/dist/components/Dropdown.d.ts +28 -0
  81. package/app-typescript/dist/components/DropdownFirst.d.ts +42 -0
  82. package/app-typescript/dist/components/EmptyState.d.ts +11 -0
  83. package/app-typescript/dist/components/FormLabel.d.ts +9 -0
  84. package/app-typescript/dist/components/Genie.d.ts +13 -0
  85. package/app-typescript/dist/components/GridItem.d.ts +69 -0
  86. package/app-typescript/dist/components/GridList.d.ts +14 -0
  87. package/app-typescript/dist/components/HeadingText.d.ts +10 -0
  88. package/app-typescript/dist/components/HelloWorld.d.ts +8 -0
  89. package/app-typescript/dist/components/Icon.d.ts +12 -0
  90. package/app-typescript/dist/components/IconButton.d.ts +12 -0
  91. package/app-typescript/dist/components/IconLabel.d.ts +11 -0
  92. package/app-typescript/dist/components/Input.d.ts +24 -0
  93. package/app-typescript/dist/components/Label.d.ts +15 -0
  94. package/app-typescript/dist/components/LeftMenu.d.ts +26 -0
  95. package/app-typescript/dist/components/Loader.d.ts +8 -0
  96. package/app-typescript/dist/components/NavButton.d.ts +15 -0
  97. package/app-typescript/dist/components/Popover.d.ts +13 -0
  98. package/app-typescript/dist/components/PropsList.d.ts +15 -0
  99. package/app-typescript/dist/components/Radio.d.ts +19 -0
  100. package/app-typescript/dist/components/RadioButton.d.ts +20 -0
  101. package/app-typescript/dist/components/Select.d.ts +29 -0
  102. package/app-typescript/dist/components/SelectWithTemplate.d.ts +32 -0
  103. package/app-typescript/dist/components/SlidingToolbar.d.ts +8 -0
  104. package/app-typescript/dist/components/StrechBar.d.ts +4 -0
  105. package/app-typescript/dist/components/SubNav.d.ts +10 -0
  106. package/app-typescript/dist/components/Switch.d.ts +12 -0
  107. package/app-typescript/dist/components/TabCustom.d.ts +25 -0
  108. package/app-typescript/dist/components/TabList.d.ts +22 -0
  109. package/app-typescript/dist/components/Tag.d.ts +9 -0
  110. package/app-typescript/dist/components/TagInput.d.ts +7 -0
  111. package/app-typescript/dist/components/TagInputTest.d.ts +18 -0
  112. package/app-typescript/dist/components/TimePicker.d.ts +11 -0
  113. package/app-typescript/dist/components/Tooltip.d.ts +11 -0
  114. package/app-typescript/dist/components/_Positioner.d.ts +27 -0
  115. package/app-typescript/dist/index.d.ts +56 -0
  116. package/app-typescript/helpers.tsx +3 -0
  117. package/app-typescript/index.ts +6 -1
  118. package/dist/SD-logo.svg +52 -0
  119. package/dist/examples.bundle.css +660 -0
  120. package/dist/examples.bundle.js +44468 -41459
  121. package/dist/playgrounds/accessible-theme-test.html +1 -1
  122. package/dist/playgrounds/layout-test-2.html +1 -1
  123. package/dist/playgrounds/list-item-test.html +1 -1
  124. package/dist/playgrounds/master-desk.html +1 -1
  125. package/dist/playgrounds/media-carousel.html +1 -1
  126. package/dist/playgrounds/photo-desk.html +1 -1
  127. package/dist/playgrounds/planning.html +1 -1
  128. package/dist/playgrounds/publish.html +1 -1
  129. package/dist/playgrounds/publisher-content-analytics.html +1 -1
  130. package/dist/playgrounds/publisher-content-list-automatic.html +1 -1
  131. package/dist/playgrounds/publisher-content-list-manual.html +1 -1
  132. package/dist/playgrounds/publisher-content-lists.html +1 -1
  133. package/dist/playgrounds/publisher-dashboard.html +1 -1
  134. package/dist/playgrounds/publisher-output-control.html +1 -1
  135. package/dist/playgrounds/react-playgrounds/CoreLayout.tsx +155 -0
  136. package/dist/playgrounds/react-playgrounds/Index.tsx +1 -0
  137. package/dist/playgrounds/react-playgrounds/RundownEditor.tsx +24 -16
  138. package/dist/playgrounds/react-playgrounds/TestGround.tsx +112 -1
  139. package/dist/playgrounds/react-playgrounds/components/Layout.tsx +2 -2
  140. package/dist/playgrounds/swimlane-view.html +1 -1
  141. package/dist/playgrounds/toasts.html +1 -1
  142. package/dist/playgrounds/video-editor.html +1 -1
  143. package/dist/react/Badges.tsx +18 -0
  144. package/dist/react/ContentList.tsx +15 -9
  145. package/dist/react/DatePicker.tsx +31 -6
  146. package/dist/react/DurationInput.tsx +104 -0
  147. package/dist/react/Index.tsx +10 -0
  148. package/dist/react/Inputs.tsx +262 -8
  149. package/dist/react/Labels.tsx +51 -1
  150. package/dist/react/MultiSelect.tsx +9 -1
  151. package/dist/react/SelectWithTemplate.tsx +6 -1
  152. package/dist/react/Selects.tsx +55 -0
  153. package/dist/react/TableList.tsx +22 -44
  154. package/dist/react/TimePicker.tsx +16 -8
  155. package/dist/react/TreeSelect.tsx +301 -48
  156. package/dist/react/WithSizeObserver.tsx +44 -0
  157. package/dist/react/tree-select/TreeSelect.tsx +273 -0
  158. package/dist/react/tree-select/example-1.tsx +71 -0
  159. package/dist/react/tree-select/example-2.tsx +59 -0
  160. package/dist/superdesk-ui.bundle.css +2761 -450
  161. package/dist/superdesk-ui.bundle.js +42992 -40401
  162. package/dist/vendor.bundle.js +25027 -25027
  163. package/examples/index.js +4 -0
  164. package/examples/pages/playgrounds/accessible-theme-test.html +1 -1
  165. package/examples/pages/playgrounds/layout-test-2.html +1 -1
  166. package/examples/pages/playgrounds/list-item-test.html +1 -1
  167. package/examples/pages/playgrounds/master-desk.html +1 -1
  168. package/examples/pages/playgrounds/media-carousel.html +1 -1
  169. package/examples/pages/playgrounds/photo-desk.html +1 -1
  170. package/examples/pages/playgrounds/planning.html +1 -1
  171. package/examples/pages/playgrounds/publish.html +1 -1
  172. package/examples/pages/playgrounds/publisher-content-analytics.html +1 -1
  173. package/examples/pages/playgrounds/publisher-content-list-automatic.html +1 -1
  174. package/examples/pages/playgrounds/publisher-content-list-manual.html +1 -1
  175. package/examples/pages/playgrounds/publisher-content-lists.html +1 -1
  176. package/examples/pages/playgrounds/publisher-dashboard.html +1 -1
  177. package/examples/pages/playgrounds/publisher-output-control.html +1 -1
  178. package/examples/pages/playgrounds/react-playgrounds/CoreLayout.tsx +155 -0
  179. package/examples/pages/playgrounds/react-playgrounds/Index.tsx +1 -0
  180. package/examples/pages/playgrounds/react-playgrounds/RundownEditor.tsx +24 -16
  181. package/examples/pages/playgrounds/react-playgrounds/TestGround.tsx +112 -1
  182. package/examples/pages/playgrounds/react-playgrounds/components/Layout.tsx +2 -2
  183. package/examples/pages/playgrounds/swimlane-view.html +1 -1
  184. package/examples/pages/playgrounds/toasts.html +1 -1
  185. package/examples/pages/playgrounds/video-editor.html +1 -1
  186. package/examples/pages/react/Badges.tsx +18 -0
  187. package/examples/pages/react/ContentList.tsx +15 -9
  188. package/examples/pages/react/DatePicker.tsx +31 -6
  189. package/examples/pages/react/DurationInput.tsx +104 -0
  190. package/examples/pages/react/Index.tsx +10 -0
  191. package/examples/pages/react/Inputs.tsx +262 -8
  192. package/examples/pages/react/Labels.tsx +51 -1
  193. package/examples/pages/react/MultiSelect.tsx +9 -1
  194. package/examples/pages/react/SelectWithTemplate.tsx +6 -1
  195. package/examples/pages/react/Selects.tsx +55 -0
  196. package/examples/pages/react/TableList.tsx +22 -44
  197. package/examples/pages/react/TimePicker.tsx +16 -8
  198. package/examples/pages/react/TreeSelect.tsx +301 -48
  199. package/examples/pages/react/WithSizeObserver.tsx +44 -0
  200. package/examples/pages/react/tree-select/TreeSelect.tsx +273 -0
  201. package/examples/pages/react/tree-select/example-1.tsx +71 -0
  202. package/examples/pages/react/tree-select/example-2.tsx +59 -0
  203. package/package.json +5 -4
  204. package/patches/@superdesk+primereact+5.0.2-4.patch +53 -0
  205. package/react/components/Alert.js +10 -8
  206. package/react/components/Autocomplete.js +16 -12
  207. package/react/components/Avatar.js +8 -6
  208. package/react/components/Badge.d.ts +1 -0
  209. package/react/components/Badge.js +9 -7
  210. package/react/components/Button.js +8 -6
  211. package/react/components/ButtonGroup.js +7 -5
  212. package/react/components/Carousel.js +4 -2
  213. package/react/components/CheckButtonGroup.js +6 -4
  214. package/react/components/CheckGroup.js +5 -3
  215. package/react/components/Checkbox.js +5 -3
  216. package/react/components/CheckboxButton.js +6 -4
  217. package/react/components/ContentDivider.js +8 -6
  218. package/react/components/CreateButton.js +6 -4
  219. package/react/components/DatePicker.d.ts +11 -0
  220. package/react/components/DatePicker.js +44 -35
  221. package/react/components/Divider.js +6 -4
  222. package/react/components/DonutChart.d.ts +1 -1
  223. package/react/components/DonutChart.js +24 -6
  224. package/react/components/DropZone.js +6 -4
  225. package/react/components/Dropdown.js +7 -6
  226. package/react/components/DropdownFirst.js +18 -11
  227. package/react/components/DurationInput.d.ts +41 -0
  228. package/react/components/DurationInput.js +289 -0
  229. package/react/components/EmptyState.js +7 -5
  230. package/react/components/Form/FormGroup.js +7 -5
  231. package/react/components/Form/FormItem.js +5 -3
  232. package/react/components/Form/FormLabel.js +5 -3
  233. package/react/components/Form/FormRow.js +5 -3
  234. package/react/components/Form/FormText.js +4 -2
  235. package/react/components/Form/InputBase.d.ts +42 -0
  236. package/react/components/Form/InputBase.js +72 -0
  237. package/react/components/Form/InputNew.d.ts +45 -0
  238. package/react/components/Form/InputNew.js +75 -0
  239. package/react/components/Form/InputWrapper.d.ts +28 -0
  240. package/react/components/Form/InputWrapper.js +91 -0
  241. package/react/components/Form/index.d.ts +3 -0
  242. package/react/components/Form/index.js +7 -0
  243. package/react/components/FormLabel.js +5 -3
  244. package/react/components/GridItem.js +9 -7
  245. package/react/components/GridList.js +8 -6
  246. package/react/components/HeadingText.js +4 -2
  247. package/react/components/HelloWorld.js +4 -2
  248. package/react/components/Icon.d.ts +1 -1
  249. package/react/components/Icon.js +9 -7
  250. package/react/components/IconButton.js +8 -6
  251. package/react/components/IconLabel.js +7 -5
  252. package/react/components/IconPicker.js +13 -9
  253. package/react/components/Input.d.ts +6 -2
  254. package/react/components/Input.js +16 -31
  255. package/react/components/Label.d.ts +1 -0
  256. package/react/components/Label.js +28 -10
  257. package/react/components/Layouts/AuthorinInnerSideBar.js +4 -2
  258. package/react/components/Layouts/AuthoringContainer.js +7 -5
  259. package/react/components/Layouts/AuthoringFrame.js +4 -2
  260. package/react/components/Layouts/AuthoringFrameContainer.js +4 -2
  261. package/react/components/Layouts/AuthoringFrameLeftBar.js +4 -2
  262. package/react/components/Layouts/AuthoringFrameMain.js +4 -2
  263. package/react/components/Layouts/AuthoringFrameNavBar.js +4 -2
  264. package/react/components/Layouts/AuthoringFrameOverlay.js +4 -2
  265. package/react/components/Layouts/AuthoringFrameRightBar.js +4 -2
  266. package/react/components/Layouts/AuthoringFrameSidePanel.js +5 -3
  267. package/react/components/Layouts/AuthoringFrameSidePanelOverlay.js +5 -3
  268. package/react/components/Layouts/AuthoringInnerBody.js +4 -2
  269. package/react/components/Layouts/AuthoringInnerHeader.js +6 -4
  270. package/react/components/Layouts/AuthoringMain.js +4 -2
  271. package/react/components/Layouts/AuthoringMainContainer.js +4 -2
  272. package/react/components/Layouts/AuthoringMainContent.js +4 -2
  273. package/react/components/Layouts/AuthoringMainToolBar.js +5 -3
  274. package/react/components/Layouts/BottomBarAction.d.ts +12 -0
  275. package/react/components/Layouts/BottomBarAction.js +59 -0
  276. package/react/components/Layouts/Container.js +9 -7
  277. package/react/components/Layouts/ContentSplitter.js +6 -4
  278. package/react/components/Layouts/CoreLayout.d.ts +19 -0
  279. package/react/components/Layouts/CoreLayout.js +55 -0
  280. package/react/components/Layouts/CoreLayoutContainer.d.ts +9 -0
  281. package/react/components/Layouts/CoreLayoutContainer.js +49 -0
  282. package/react/components/Layouts/CoreLayoutFooter.d.ts +8 -0
  283. package/react/components/Layouts/CoreLayoutFooter.js +49 -0
  284. package/react/components/Layouts/CoreLayoutMain.d.ts +9 -0
  285. package/react/components/Layouts/CoreLayoutMain.js +49 -0
  286. package/react/components/Layouts/CoreLayoutOverlay.d.ts +8 -0
  287. package/react/components/Layouts/CoreLayoutOverlay.js +49 -0
  288. package/react/components/Layouts/CoreLayoutSlideInMenu.d.ts +11 -0
  289. package/react/components/Layouts/CoreLayoutSlideInMenu.js +58 -0
  290. package/react/components/Layouts/CoreLayoutTopMenu.d.ts +14 -0
  291. package/react/components/Layouts/CoreLayoutTopMenu.js +54 -0
  292. package/react/components/Layouts/HamburgerButton.d.ts +14 -0
  293. package/react/components/Layouts/HamburgerButton.js +63 -0
  294. package/react/components/Layouts/HeaderPanel.js +4 -2
  295. package/react/components/Layouts/Layout.js +4 -3
  296. package/react/components/Layouts/LayoutContainer.js +4 -2
  297. package/react/components/Layouts/LeftPanel.js +5 -3
  298. package/react/components/Layouts/MainMenu.d.ts +41 -0
  299. package/react/components/Layouts/MainMenu.js +103 -0
  300. package/react/components/Layouts/MainPanel.js +5 -3
  301. package/react/components/Layouts/NotificationPanel.d.ts +45 -0
  302. package/react/components/Layouts/NotificationPanel.js +110 -0
  303. package/react/components/Layouts/OverlayPanel.js +4 -2
  304. package/react/components/Layouts/PageLayout.js +4 -2
  305. package/react/components/Layouts/Panel.js +16 -14
  306. package/react/components/Layouts/RightPanel.js +4 -2
  307. package/react/components/Layouts/index.d.ts +11 -0
  308. package/react/components/Layouts/index.js +23 -0
  309. package/react/components/LeftMenu.d.ts +2 -0
  310. package/react/components/LeftMenu.js +19 -12
  311. package/react/components/ListItemLoader.js +4 -2
  312. package/react/components/Lists/BoxedList.d.ts +6 -0
  313. package/react/components/Lists/BoxedList.js +36 -15
  314. package/react/components/Lists/ContentList.d.ts +45 -0
  315. package/react/components/Lists/ContentList.js +85 -0
  316. package/react/components/Lists/SimpleList.js +9 -7
  317. package/react/components/Lists/index.js +1 -0
  318. package/react/components/Loader.js +4 -2
  319. package/react/components/Menu.d.ts +2 -1
  320. package/react/components/Menu.js +48 -12
  321. package/react/components/Modal.d.ts +2 -1
  322. package/react/components/Modal.js +30 -9
  323. package/react/components/NavButton.d.ts +1 -0
  324. package/react/components/NavButton.js +9 -4
  325. package/react/components/Navigation/BottomNav.d.ts +24 -0
  326. package/react/components/Navigation/BottomNav.js +88 -0
  327. package/react/components/Navigation/QuickNavBar.js +13 -9
  328. package/react/components/Navigation/SideBarMenu.js +4 -2
  329. package/react/components/Navigation/SideBarTabs.js +4 -2
  330. package/react/components/Navigation/index.js +1 -0
  331. package/react/components/Popover.js +4 -2
  332. package/react/components/PropsList.js +4 -2
  333. package/react/components/RadioButtonGroup.js +9 -7
  334. package/react/components/RadioGroup.js +6 -4
  335. package/react/components/SearchBar.js +6 -4
  336. package/react/components/Select.d.ts +5 -1
  337. package/react/components/Select.js +9 -23
  338. package/react/components/SelectGrid.d.ts +1 -1
  339. package/react/components/SelectGrid.js +44 -23
  340. package/react/components/SelectWithTemplate.d.ts +11 -1
  341. package/react/components/SelectWithTemplate.js +23 -12
  342. package/react/components/Skeleton.d.ts +1 -1
  343. package/react/components/Skeleton.js +26 -5
  344. package/react/components/SlidingToolbar.js +6 -4
  345. package/react/components/Spinner.js +6 -4
  346. package/react/components/StrechBar.js +4 -2
  347. package/react/components/SubNav.js +9 -7
  348. package/react/components/Switch.js +6 -4
  349. package/react/components/SwitchGroup.js +5 -3
  350. package/react/components/TabCustom.js +11 -7
  351. package/react/components/TabList.js +6 -4
  352. package/react/components/Tag.js +5 -4
  353. package/react/components/TagInput.js +7 -6
  354. package/react/components/TagInputTest.js +13 -9
  355. package/react/components/Text/Heading.js +10 -8
  356. package/react/components/Text/Text.js +10 -8
  357. package/react/components/Text/Time.d.ts +15 -0
  358. package/react/components/Text/Time.js +65 -0
  359. package/react/components/ThemeSelector.js +7 -5
  360. package/react/components/TimePicker.d.ts +15 -2
  361. package/react/components/TimePicker.js +19 -6
  362. package/react/components/Toast.js +1 -1
  363. package/react/components/ToastMessage.js +6 -5
  364. package/react/components/ToastText.js +1 -1
  365. package/react/components/ToastWrapper.d.ts +2 -2
  366. package/react/components/ToastWrapper.js +14 -10
  367. package/react/components/Togglebox.d.ts +1 -1
  368. package/react/components/Togglebox.js +36 -15
  369. package/react/components/Tooltip.d.ts +1 -0
  370. package/react/components/Tooltip.js +14 -10
  371. package/react/components/TreeSelect.d.ts +75 -0
  372. package/react/components/TreeSelect.js +448 -0
  373. package/react/components/WithSizeObserver.d.ts +25 -0
  374. package/react/components/WithSizeObserver.js +95 -0
  375. package/react/components/_Positioner.js +4 -2
  376. package/react/helpers.d.ts +1 -0
  377. package/react/helpers.js +7 -0
  378. package/react/index.d.ts +6 -0
  379. package/react/index.js +15 -2
  380. package/yarn-error.log +111 -0
  381. package/sd_icons.eot +0 -0
  382. package/sd_icons.svg +0 -189
  383. package/sd_icons.ttf +0 -0
  384. package/sd_icons.woff +0 -0
@@ -0,0 +1,448 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
37
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
38
+ if (ar || !(i in from)) {
39
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
40
+ ar[i] = from[i];
41
+ }
42
+ }
43
+ return to.concat(ar || Array.prototype.slice.call(from));
44
+ };
45
+ var __importDefault = (this && this.__importDefault) || function (mod) {
46
+ return (mod && mod.__esModule) ? mod : { "default": mod };
47
+ };
48
+ Object.defineProperty(exports, "__esModule", { value: true });
49
+ exports.TreeSelect = void 0;
50
+ var React = __importStar(require("react"));
51
+ var Icon_1 = require("./Icon");
52
+ var Loader_1 = require("./Loader");
53
+ var classnames_1 = __importDefault(require("classnames"));
54
+ var react_id_generator_1 = __importDefault(require("react-id-generator"));
55
+ var TreeSelect = /** @class */ (function (_super) {
56
+ __extends(TreeSelect, _super);
57
+ function TreeSelect(props) {
58
+ var _this = _super.call(this, props) || this;
59
+ _this.htmlId = (0, react_id_generator_1.default)();
60
+ _this.backButton = function () {
61
+ if (_this.state.activeTree.length > 0) {
62
+ _this.setState({
63
+ options: _this.state.activeTree.pop(),
64
+ });
65
+ return;
66
+ }
67
+ else {
68
+ return false;
69
+ }
70
+ };
71
+ _this.backButtonValue = function () {
72
+ _this.setState({
73
+ buttonValue: _this.state.buttonTree.pop(),
74
+ });
75
+ };
76
+ _this.componentDidMount = function () {
77
+ _this.recursion(_this.state.options);
78
+ document.addEventListener("mousedown", function (event) {
79
+ if ((_this.dropdownRef.current && !_this.dropdownRef.current.contains(event.target))
80
+ && (_this.openDropdownRef.current && !_this.openDropdownRef.current.contains(event.target))) {
81
+ _this.setState({ openDropdown: false });
82
+ }
83
+ });
84
+ };
85
+ _this.state = {
86
+ value: _this.props.value ? _this.props.value : [],
87
+ options: _this.props.getOptions ? _this.props.getOptions() : [],
88
+ firstBranchOptions: _this.props.getOptions ? _this.props.getOptions() : [],
89
+ activeTree: [],
90
+ filterArr: [],
91
+ searchFieldValue: '',
92
+ buttonTree: [],
93
+ buttonValue: [],
94
+ buttonMouseEvent: false,
95
+ openDropdown: false,
96
+ loading: _this.props.loading ? _this.props.loading : false,
97
+ invalid: _this.props.invalid ? _this.props.invalid : false,
98
+ };
99
+ _this.removeClick = _this.removeClick.bind(_this);
100
+ _this.handleMultiLevel = _this.handleMultiLevel.bind(_this);
101
+ _this.backButton = _this.backButton.bind(_this);
102
+ _this.handleButton = _this.handleButton.bind(_this);
103
+ _this.backButtonValue = _this.backButtonValue.bind(_this);
104
+ _this.handleTree = _this.handleTree.bind(_this);
105
+ _this.filteredItem = _this.filteredItem.bind(_this);
106
+ _this.banchButton = _this.banchButton.bind(_this);
107
+ _this.dropdownRef = React.createRef();
108
+ _this.openDropdownRef = React.createRef();
109
+ return _this;
110
+ }
111
+ TreeSelect.prototype.removeClick = function (i) {
112
+ var newTags = this.state.value;
113
+ newTags === null || newTags === void 0 ? void 0 : newTags.splice(i, 1);
114
+ this.setState({
115
+ value: newTags,
116
+ });
117
+ this.props.onChange(this.state.value);
118
+ };
119
+ TreeSelect.prototype.handleMultiLevel = function (item) {
120
+ if (item.children) {
121
+ this.setState({
122
+ activeTree: __spreadArray(__spreadArray([], this.state.activeTree, true), [this.state.options], false),
123
+ options: item.children,
124
+ });
125
+ }
126
+ };
127
+ TreeSelect.prototype.handleButton = function (item) {
128
+ this.setState({
129
+ buttonTree: __spreadArray(__spreadArray([], this.state.buttonTree, true), [this.state.buttonValue], false),
130
+ buttonValue: item,
131
+ });
132
+ };
133
+ TreeSelect.prototype.handleValue = function (event, item) {
134
+ var _this = this;
135
+ if (this.props.allowMultiple) {
136
+ var checkItem = this.state.value.find(function (valueItem) {
137
+ return _this.props.getId(valueItem) === _this.props.getId(item.value);
138
+ });
139
+ if (!checkItem) {
140
+ this.setState({ value: __spreadArray(__spreadArray([], this.state.value, true), [item.value], false) });
141
+ }
142
+ if (!event.ctrlKey) {
143
+ if (this.props.getOptions) {
144
+ this.setState({ options: this.state.firstBranchOptions, activeTree: [], openDropdown: false });
145
+ }
146
+ else {
147
+ this.setState({ activeTree: [], openDropdown: false });
148
+ }
149
+ }
150
+ this.setState({ buttonMouseEvent: false });
151
+ }
152
+ else {
153
+ var checkItem = this.state.value.find(function (valueItem) {
154
+ return _this.props.getId(valueItem) === _this.props.getId(item.value);
155
+ });
156
+ if (!checkItem) {
157
+ this.setState({ value: [item.value] });
158
+ }
159
+ if (!event.ctrlKey) {
160
+ this.setState({ options: this.state.firstBranchOptions, activeTree: [], openDropdown: false });
161
+ }
162
+ this.setState({ buttonMouseEvent: false });
163
+ }
164
+ };
165
+ TreeSelect.prototype.handleBranchValue = function (event, item) {
166
+ var _this = this;
167
+ if (this.props.allowMultiple) {
168
+ if (this.props.selectBranchWithChildren) {
169
+ var checkItem = this.state.value.find(function (valueItem) {
170
+ return _this.props.getId(valueItem) === _this.props.getId(item.value);
171
+ });
172
+ if (!checkItem) {
173
+ this.setState({ value: __spreadArray(__spreadArray([], this.state.value, true), [item.value], false) });
174
+ }
175
+ if (!event.ctrlKey) {
176
+ this.setState({ options: this.state.firstBranchOptions, activeTree: [], openDropdown: false });
177
+ }
178
+ this.setState({ buttonMouseEvent: false });
179
+ }
180
+ }
181
+ else {
182
+ if (this.props.selectBranchWithChildren) {
183
+ var checkItem = this.state.value.find(function (valueItem) {
184
+ return _this.props.getId(valueItem) === _this.props.getId(item.value);
185
+ });
186
+ if (!checkItem) {
187
+ this.setState({ value: [item.value] });
188
+ }
189
+ if (!event.ctrlKey) {
190
+ this.setState({ options: this.state.firstBranchOptions, activeTree: [], openDropdown: false });
191
+ }
192
+ this.setState({ buttonMouseEvent: false });
193
+ }
194
+ }
195
+ };
196
+ TreeSelect.prototype.handleTree = function (event, option) {
197
+ var _this = this;
198
+ if (option.children) {
199
+ this.handleButton(option);
200
+ this.handleMultiLevel(option);
201
+ if (event.altKey && this.props.allowMultiple) {
202
+ if (this.props.selectBranchWithChildren) {
203
+ var filteredItems_1 = [];
204
+ option.children.forEach(function (item) {
205
+ if (!_this.state.value.includes(item.value)) {
206
+ filteredItems_1.push(item.value);
207
+ }
208
+ });
209
+ this.setState({
210
+ value: __spreadArray(__spreadArray([], this.state.value, true), filteredItems_1, true),
211
+ options: this.state.firstBranchOptions,
212
+ openDropdown: false,
213
+ activeTree: [],
214
+ });
215
+ }
216
+ else {
217
+ var filteredItems_2 = [];
218
+ option.children.forEach(function (item) {
219
+ if (!_this.state.value.includes(item.value)
220
+ && !item.children) {
221
+ filteredItems_2.push(item.value);
222
+ }
223
+ });
224
+ if (filteredItems_2.length > 0) {
225
+ this.setState({
226
+ value: __spreadArray(__spreadArray([], this.state.value, true), filteredItems_2, true),
227
+ options: this.state.firstBranchOptions,
228
+ openDropdown: false,
229
+ activeTree: [],
230
+ });
231
+ }
232
+ }
233
+ }
234
+ }
235
+ else {
236
+ this.handleValue(event, option);
237
+ if (!event.ctrlKey) {
238
+ this.setState({ openDropdown: false });
239
+ }
240
+ }
241
+ };
242
+ TreeSelect.prototype.recursion = function (arr) {
243
+ var _this = this;
244
+ arr.map(function (item) {
245
+ _this.state.filterArr.push(item);
246
+ if (item.children) {
247
+ _this.recursion(item.children);
248
+ }
249
+ });
250
+ };
251
+ TreeSelect.prototype.componentDidUpdate = function (prevProps, prevState) {
252
+ if (prevState.value !== this.state.value) {
253
+ this.props.onChange(this.state.value);
254
+ }
255
+ else if (prevProps.value !== this.props.value) {
256
+ this.props.onChange(this.state.value);
257
+ }
258
+ };
259
+ TreeSelect.prototype.filteredItem = function (arr) {
260
+ var _this = this;
261
+ if (this.props.kind === 'synchronous') {
262
+ return arr.filter(function (item) {
263
+ if (_this.state.searchFieldValue) {
264
+ if (_this.props.getLabel(item.value)
265
+ .toLowerCase().includes(_this.state.searchFieldValue.toLowerCase())) {
266
+ return item.value;
267
+ }
268
+ else {
269
+ return;
270
+ }
271
+ }
272
+ else {
273
+ return item.value;
274
+ }
275
+ }).map(function (option, i) {
276
+ var selectedItem = _this.state.value.some(function (obj) {
277
+ return _this.props.getId(obj) === _this.props.getId(option.value);
278
+ });
279
+ return React.createElement("li", { key: i, className: "suggestion-item suggestion-item--multi-select", onClick: function (event) {
280
+ _this.setState({
281
+ searchFieldValue: '',
282
+ }),
283
+ event.preventDefault();
284
+ event.stopPropagation();
285
+ _this.handleTree(event, option);
286
+ } },
287
+ _this.props.optionTemplate
288
+ ? _this.props.optionTemplate(option.value)
289
+ : React.createElement("span", { className: selectedItem
290
+ ? 'suggestion-item--disabled' : undefined }, _this.props.getLabel(option.value)),
291
+ option.children && React.createElement("span", { className: "suggestion-item__icon" },
292
+ React.createElement(Icon_1.Icon, { name: "chevron-right-thin" })));
293
+ });
294
+ }
295
+ else if (this.props.kind === 'asynchronous') {
296
+ return this.state.options.map(function (item, i) {
297
+ var selectedItem = _this.state.value.some(function (obj) {
298
+ return _this.props.getId(obj) === _this.props.getId(item.value);
299
+ });
300
+ return (React.createElement("li", { key: i, className: "suggestion-item suggestion-item--multi-select", onClick: function (event) {
301
+ _this.handleValue(event, item);
302
+ } }, _this.props.optionTemplate
303
+ ? _this.props.optionTemplate(item.value)
304
+ : React.createElement("span", { className: selectedItem
305
+ ? 'suggestion-item--disabled' : undefined }, _this.props.getLabel(item.value))));
306
+ });
307
+ }
308
+ else {
309
+ return;
310
+ }
311
+ };
312
+ TreeSelect.prototype.banchButton = function () {
313
+ var _this = this;
314
+ var selectedButton = this.state.value.some(function (obj) {
315
+ return _this.props.getId(obj) === _this.props.getId(_this.state.buttonValue.value);
316
+ });
317
+ if (!selectedButton) {
318
+ return React.createElement("button", { className: 'autocomplete__button' + (this.props.selectBranchWithChildren ? ' autocomplete__button--multi-select' : ''), onMouseOver: function () { return _this.setState({ buttonMouseEvent: true }); }, onMouseOut: function () { return _this.setState({ buttonMouseEvent: false }); }, value: this.state.buttonValue, onClick: function (event) { return _this.handleBranchValue(event, _this.state.buttonValue); } }, "Choose entire category");
319
+ }
320
+ else {
321
+ return React.createElement("button", { className: 'autocomplete__button' + (this.props.selectBranchWithChildren ? ' autocomplete__button--multi-select' : '') + ' autocomplete__button--disabled', value: this.state.buttonValue }, "Category selected");
322
+ }
323
+ };
324
+ TreeSelect.prototype.render = function () {
325
+ var _this = this;
326
+ var labelClasses = (0, classnames_1.default)('sd-input__label', {
327
+ 'a11y-only': this.props.labelHidden,
328
+ });
329
+ var classesLabel = (0, classnames_1.default)('sd-input', {
330
+ 'sd-input--inline-label': this.props.inlineLabel,
331
+ 'sd-input--required': this.props.required,
332
+ 'sd-input--disabled': this.props.disabled,
333
+ 'sd-input--full-width': this.props.fullWidth,
334
+ 'sd-input--invalid': this.props.invalid || this.state.invalid,
335
+ });
336
+ return (React.createElement("div", { className: classesLabel },
337
+ React.createElement("label", { className: labelClasses, htmlFor: this.htmlId, id: this.htmlId + 'label', tabIndex: this.props.tabindex === undefined ? undefined : -1 }, this.props.label),
338
+ React.createElement("div", { className: "tags-input tags-input--".concat(this.props.allowMultiple ? 'multi-select' : 'single-select', " sd-input__input") },
339
+ this.props.allowMultiple
340
+ ? React.createElement("div", { className: "tags-input__tags" },
341
+ this.props.readOnly
342
+ || React.createElement("button", { ref: this.openDropdownRef, className: "tags-input__add-button", onClick: function () { return _this.setState({ openDropdown: !_this.state.openDropdown }); } },
343
+ React.createElement("i", { className: "icon-plus-large" })),
344
+ React.createElement("ul", { className: "tags-input__tag-list" }, this.state.value.map(function (item, i) {
345
+ return React.createElement(React.Fragment, { key: i },
346
+ React.createElement("li", { className: "tags-input__tag-item tags-input__tag-item--multi-select"
347
+ + (_this.props.readOnly ? ' tags-input__tag-item--readonly' : ''), onClick: function () { return _this.props.readOnly || _this.removeClick(i); } },
348
+ React.createElement("span", { className: "tags-input__helper-box" },
349
+ _this.props.valueTemplate
350
+ ? _this.props.valueTemplate(item)
351
+ : React.createElement("span", null, _this.props.getLabel(item)),
352
+ _this.props.readOnly
353
+ || React.createElement("span", { className: "tags-input__remove-button" },
354
+ React.createElement(Icon_1.Icon, { name: "close-small" })))));
355
+ })),
356
+ this.state.value.length > 0 ?
357
+ this.props.readOnly
358
+ || React.createElement("button", { className: "tags-input__remove-value", onClick: function () { return _this.setState({ value: [] }); } },
359
+ React.createElement(Icon_1.Icon, { name: 'remove-sign' })) : null)
360
+ : React.createElement("div", { className: "tags-input__tags" },
361
+ React.createElement("button", { className: "tags-input__overlay-button", ref: this.openDropdownRef, onClick: function () { return _this.setState({ openDropdown: !_this.state.openDropdown }); } }),
362
+ this.state.value.length < 1 && React.createElement("span", { className: 'tags-input__single-item'
363
+ + (this.props.readOnly ? ' tags-input__tag-item--readonly' : '') },
364
+ React.createElement("span", { className: "tags-input__placeholder" }, this.props.placeholder)),
365
+ this.state.value.map(function (item, i) {
366
+ return React.createElement(React.Fragment, { key: i },
367
+ React.createElement("span", { className: 'tags-input__single-item'
368
+ + (_this.props.readOnly ? ' tags-input__tag-item--readonly' : ''), onClick: function () { return _this.props.readOnly || _this.removeClick(i); } },
369
+ React.createElement("span", { className: "tags-input__helper-box" },
370
+ _this.props.valueTemplate
371
+ ? _this.props.valueTemplate(item)
372
+ : React.createElement("span", null, _this.props.getLabel(item)),
373
+ _this.props.readOnly
374
+ || React.createElement("span", { className: "tags-input__remove-button" },
375
+ React.createElement(Icon_1.Icon, { name: 'remove-sign' })))));
376
+ })),
377
+ this.state.openDropdown &&
378
+ React.createElement("div", { className: "autocomplete autocomplete--multi-select" + (this.props.width === 'medium' ? ' autocomplete--fixed-width' : ''), ref: this.dropdownRef },
379
+ React.createElement("div", { className: 'autocomplete__header' },
380
+ React.createElement("div", { className: "autocomplete__icon", onClick: function () {
381
+ _this.backButtonValue();
382
+ _this.backButton();
383
+ } },
384
+ React.createElement(Icon_1.Icon, { name: "search", className: "search" })),
385
+ React.createElement("div", { className: 'autocomplete__filter' },
386
+ React.createElement("input", { placeholder: this.props.singleLevelSearch ? 'Search this category...' : 'Search...', type: "text", className: "autocomplete__input", ref: function (input) { return input && input.focus(); }, value: this.state.searchFieldValue, onChange: function (event) {
387
+ var value = event.target.value;
388
+ if (_this.props.kind === 'asynchronous') {
389
+ _this.setState({
390
+ searchFieldValue: value,
391
+ loading: true,
392
+ }),
393
+ _this.props.searchOptions(value, function (items) {
394
+ _this.setState({ options: items, loading: false });
395
+ });
396
+ }
397
+ else if (_this.props.kind === 'synchronous') {
398
+ _this.setState({ searchFieldValue: value });
399
+ }
400
+ } }))),
401
+ this.state.activeTree.length > 0 &&
402
+ React.createElement("div", { className: 'autocomplete__category-header' },
403
+ React.createElement("div", { className: "autocomplete__icon", onClick: function () {
404
+ _this.backButtonValue();
405
+ _this.backButton();
406
+ } },
407
+ React.createElement(Icon_1.Icon, { name: "arrow-left", className: "arrow-left" })),
408
+ React.createElement("div", { className: 'autocomplete__filter' },
409
+ React.createElement("button", { className: 'autocomplete__category-title', value: this.state.buttonValue }, this.props.optionTemplate
410
+ ? this.props.optionTemplate(this.state.buttonValue.value)
411
+ : this.props.getLabel(this.state.buttonValue.value)),
412
+ this.props.selectBranchWithChildren && this.banchButton())),
413
+ this.state.loading
414
+ ? React.createElement("ul", { className: "suggestion-list--loader" },
415
+ React.createElement(Loader_1.Loader, { overlay: true }))
416
+ :
417
+ this.state.searchFieldValue === ''
418
+ ? this.props.getOptions ?
419
+ React.createElement("ul", { className: "suggestion-list suggestion-list--multi-select" }, this.state.options
420
+ .map(function (option, i) {
421
+ var selectedItem = _this.state.value.some(function (obj) {
422
+ return _this.props.getId(obj) === _this.props.getLabel(option.value);
423
+ });
424
+ return (React.createElement("li", { key: i, className: "suggestion-item suggestion-item--multi-select", onClick: function (event) {
425
+ event.preventDefault();
426
+ event.stopPropagation();
427
+ _this.handleTree(event, option);
428
+ } },
429
+ _this.props.optionTemplate
430
+ ? _this.props.optionTemplate(option.value)
431
+ : React.createElement("span", { className: selectedItem
432
+ ? 'suggestion-item--disabled' : undefined }, _this.props.getLabel(option.value)),
433
+ option.children && React.createElement("span", { className: "suggestion-item__icon" },
434
+ React.createElement(Icon_1.Icon, { name: "chevron-right-thin" }))));
435
+ })) : null
436
+ :
437
+ React.createElement("ul", { className: "suggestion-list suggestion-list--multi-select" }, this.filteredItem(this.props.singleLevelSearch
438
+ ? this.state.options : this.state.filterArr)))),
439
+ React.createElement("div", { className: 'sd-input__message-box' },
440
+ this.props.info && !this.props.invalid && !this.state.invalid ?
441
+ React.createElement("div", { className: 'sd-input__hint' }, this.props.info) : null,
442
+ this.props.invalid || this.state.invalid ?
443
+ React.createElement("div", { className: 'sd-input__message' }, this.props.error)
444
+ : null)));
445
+ };
446
+ return TreeSelect;
447
+ }(React.Component));
448
+ exports.TreeSelect = TreeSelect;
@@ -0,0 +1,25 @@
1
+ import * as React from 'react';
2
+ interface ISize {
3
+ width: number;
4
+ height: number;
5
+ }
6
+ interface IProps {
7
+ children: (props: ISize) => JSX.Element;
8
+ style?: React.CSSProperties;
9
+ }
10
+ interface IState {
11
+ dimensions: ISize | 'not-initialized';
12
+ }
13
+ /**
14
+ * Higher order component for dynamically retrieving dimensions of any element.
15
+ * It uses `ResizeObserver` to listen for updates and re-render children efficiently.
16
+ */
17
+ export declare class WithSizeObserver extends React.PureComponent<IProps, IState> {
18
+ private el;
19
+ private observerInstance?;
20
+ constructor(props: IProps);
21
+ componentDidMount(): void;
22
+ componentWillUnmount(): void;
23
+ render(): JSX.Element;
24
+ }
25
+ export {};
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
28
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
29
+ if (k2 === undefined) k2 = k;
30
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
31
+ }) : (function(o, m, k, k2) {
32
+ if (k2 === undefined) k2 = k;
33
+ o[k2] = m[k];
34
+ }));
35
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
36
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
37
+ }) : function(o, v) {
38
+ o["default"] = v;
39
+ });
40
+ var __importStar = (this && this.__importStar) || function (mod) {
41
+ if (mod && mod.__esModule) return mod;
42
+ var result = {};
43
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
44
+ __setModuleDefault(result, mod);
45
+ return result;
46
+ };
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.WithSizeObserver = void 0;
49
+ var React = __importStar(require("react"));
50
+ /**
51
+ * Higher order component for dynamically retrieving dimensions of any element.
52
+ * It uses `ResizeObserver` to listen for updates and re-render children efficiently.
53
+ */
54
+ var WithSizeObserver = /** @class */ (function (_super) {
55
+ __extends(WithSizeObserver, _super);
56
+ function WithSizeObserver(props) {
57
+ var _this = _super.call(this, props) || this;
58
+ _this.state = {
59
+ dimensions: 'not-initialized',
60
+ };
61
+ _this.el = null;
62
+ return _this;
63
+ }
64
+ WithSizeObserver.prototype.componentDidMount = function () {
65
+ var _this = this;
66
+ this.observerInstance = new ResizeObserver(function (entries) {
67
+ _this.setState({
68
+ dimensions: {
69
+ width: Math.floor(entries[0].contentRect.width),
70
+ height: Math.floor(entries[0].contentRect.height),
71
+ },
72
+ });
73
+ });
74
+ if (this.el != null) {
75
+ this.observerInstance.observe(this.el);
76
+ }
77
+ };
78
+ WithSizeObserver.prototype.componentWillUnmount = function () {
79
+ if (this.observerInstance != null && this.el != null) {
80
+ this.observerInstance.unobserve(this.el);
81
+ }
82
+ };
83
+ WithSizeObserver.prototype.render = function () {
84
+ var _this = this;
85
+ var dimensions = this.state.dimensions;
86
+ return (React.createElement("div", { ref: function (el) {
87
+ _this.el = el;
88
+ }, style: __assign({ position: 'relative', width: '100%', height: '100%' }, this.props.style) },
89
+ React.createElement("div", { style: { position: 'absolute', top: 0, left: 0, width: '100%', height: '100%' } }, dimensions === 'not-initialized'
90
+ ? null
91
+ : this.props.children(dimensions))));
92
+ };
93
+ return WithSizeObserver;
94
+ }(React.PureComponent));
95
+ exports.WithSizeObserver = WithSizeObserver;
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
3
3
  var extendStatics = function (d, b) {
4
4
  extendStatics = Object.setPrototypeOf ||
5
5
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -38,7 +40,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
38
40
  var __importStar = (this && this.__importStar) || function (mod) {
39
41
  if (mod && mod.__esModule) return mod;
40
42
  var result = {};
41
- if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
43
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
42
44
  __setModuleDefault(result, mod);
43
45
  return result;
44
46
  };
@@ -0,0 +1 @@
1
+ export declare function assertNever(x: never): never;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assertNever = void 0;
4
+ function assertNever(x) {
5
+ throw new Error('Unexpected object: ' + x);
6
+ }
7
+ exports.assertNever = assertNever;
package/react/index.d.ts CHANGED
@@ -14,6 +14,7 @@ export { AvatarGroup } from './components/Avatar';
14
14
  export { IconButton } from './components/IconButton';
15
15
  export { IconLabel } from './components/IconLabel';
16
16
  export { Tooltip } from './components/Tooltip';
17
+ export { DurationInput } from './components/DurationInput';
17
18
  export { DatePicker } from './components/DatePicker';
18
19
  export { DatePickerISO } from './components/DatePicker';
19
20
  export { DatePickerLocaleSettings } from './components/DatePicker';
@@ -65,6 +66,7 @@ export { ThemeSelector } from './components/ThemeSelector';
65
66
  export { DropZone } from './components/DropZone';
66
67
  export { CreateButton } from './components/CreateButton';
67
68
  export { SearchBar } from './components/SearchBar';
69
+ export { WithSizeObserver } from './components/WithSizeObserver';
68
70
  export * from './components/Layouts';
69
71
  export * from './components/Form';
70
72
  export * from './components/Navigation';
@@ -73,6 +75,10 @@ export { Skeleton } from './components/Skeleton';
73
75
  export { ListItemLoader } from './components/ListItemLoader';
74
76
  export { Spinner, LoadingOverlay } from './components/Spinner';
75
77
  export { Text } from './components/Text/Text';
78
+ export { Time } from './components/Text/Time';
76
79
  export { Heading } from './components/Text/Heading';
80
+ export { BottomNav } from './components/Navigation/BottomNav';
81
+ export { TreeSelect } from './components/TreeSelect';
82
+ export { ContentListItem } from './components/Lists/ContentList';
77
83
  export declare const ToggleBoxNext: any;
78
84
  export declare const reactToAngular1: any;