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

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 (328) 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/app.scss +3 -0
  10. package/app/styles/components/_sd-notification-panel.scss +48 -0
  11. package/app/styles/design-tokens/_design-tokens-general.scss +2 -5
  12. package/app/styles/design-tokens/_new-colors.scss +5 -0
  13. package/app/styles/form-elements/_inputs.scss +280 -63
  14. package/app/styles/grids/_grid-layout.scss +119 -39
  15. package/app/styles/menus/_sd-bottom-tabs.scss +70 -0
  16. package/app/styles/menus/_sd-left-navigation.scss +24 -1
  17. package/app/styles/menus/_sd-sidebar-menu.scss +10 -14
  18. package/app/styles/menus/_sd-top-menu.scss +19 -5
  19. package/app/styles/primereact/_pr-dropdown.scss +0 -2
  20. package/app-typescript/components/DatePicker.tsx +67 -20
  21. package/app-typescript/components/DonutChart.tsx +1 -1
  22. package/app-typescript/components/Icon.tsx +1 -1
  23. package/app-typescript/components/IconButton.tsx +5 -1
  24. package/app-typescript/components/Input.tsx +17 -3
  25. package/app-typescript/components/Layouts/BottomBarAction.tsx +35 -0
  26. package/app-typescript/components/Layouts/CoreLayout.tsx +62 -0
  27. package/app-typescript/components/Layouts/CoreLayoutContainer.tsx +16 -0
  28. package/app-typescript/components/Layouts/CoreLayoutFooter.tsx +15 -0
  29. package/app-typescript/components/Layouts/CoreLayoutMain.tsx +16 -0
  30. package/app-typescript/components/Layouts/CoreLayoutOverlay.tsx +15 -0
  31. package/app-typescript/components/Layouts/CoreLayoutSlideInMenu.tsx +24 -0
  32. package/app-typescript/components/Layouts/CoreLayoutTopMenu.tsx +35 -0
  33. package/app-typescript/components/Layouts/HamburgerButton.tsx +41 -0
  34. package/app-typescript/components/Layouts/Layout.tsx +1 -1
  35. package/app-typescript/components/Layouts/MainMenu.tsx +101 -0
  36. package/app-typescript/components/Layouts/NotificationPanel.tsx +109 -0
  37. package/app-typescript/components/Layouts/index.tsx +12 -0
  38. package/app-typescript/components/LeftMenu.tsx +6 -0
  39. package/app-typescript/components/Lists/BoxedList.tsx +36 -4
  40. package/app-typescript/components/Menu.tsx +31 -7
  41. package/app-typescript/components/Modal.tsx +5 -2
  42. package/app-typescript/components/MultiSelect.tsx +65 -22
  43. package/app-typescript/components/NavButton.tsx +4 -0
  44. package/app-typescript/components/Navigation/BottomNav.tsx +82 -0
  45. package/app-typescript/components/Select.tsx +8 -0
  46. package/app-typescript/components/SelectGrid.tsx +1 -1
  47. package/app-typescript/components/Skeleton.tsx +1 -1
  48. package/app-typescript/components/Text/Time.tsx +34 -0
  49. package/app-typescript/components/Togglebox.tsx +1 -1
  50. package/app-typescript/components/Tooltip.tsx +7 -5
  51. package/app-typescript/components/WithSizeObserver.tsx +88 -0
  52. package/app-typescript/dist/components/Alert.d.ts +16 -0
  53. package/app-typescript/dist/components/Autocomplete.d.ts +48 -0
  54. package/app-typescript/dist/components/Avatar.d.ts +33 -0
  55. package/app-typescript/dist/components/Badge.d.ts +13 -0
  56. package/app-typescript/dist/components/Button.d.ts +23 -0
  57. package/app-typescript/dist/components/ButtonGroup.d.ts +12 -0
  58. package/app-typescript/dist/components/CheckButtonGroup.d.ts +11 -0
  59. package/app-typescript/dist/components/CheckGroup.d.ts +9 -0
  60. package/app-typescript/dist/components/Checkbox.d.ts +19 -0
  61. package/app-typescript/dist/components/CheckboxButton.d.ts +19 -0
  62. package/app-typescript/dist/components/DatePicker.d.ts +37 -0
  63. package/app-typescript/dist/components/Divider.d.ts +9 -0
  64. package/app-typescript/dist/components/DonutChart.d.ts +12 -0
  65. package/app-typescript/dist/components/Dropdown.d.ts +28 -0
  66. package/app-typescript/dist/components/DropdownFirst.d.ts +42 -0
  67. package/app-typescript/dist/components/EmptyState.d.ts +11 -0
  68. package/app-typescript/dist/components/FormLabel.d.ts +9 -0
  69. package/app-typescript/dist/components/Genie.d.ts +13 -0
  70. package/app-typescript/dist/components/GridItem.d.ts +69 -0
  71. package/app-typescript/dist/components/GridList.d.ts +14 -0
  72. package/app-typescript/dist/components/HeadingText.d.ts +10 -0
  73. package/app-typescript/dist/components/HelloWorld.d.ts +8 -0
  74. package/app-typescript/dist/components/Icon.d.ts +12 -0
  75. package/app-typescript/dist/components/IconButton.d.ts +12 -0
  76. package/app-typescript/dist/components/IconLabel.d.ts +11 -0
  77. package/app-typescript/dist/components/Input.d.ts +24 -0
  78. package/app-typescript/dist/components/Label.d.ts +15 -0
  79. package/app-typescript/dist/components/LeftMenu.d.ts +26 -0
  80. package/app-typescript/dist/components/Loader.d.ts +8 -0
  81. package/app-typescript/dist/components/NavButton.d.ts +15 -0
  82. package/app-typescript/dist/components/Popover.d.ts +13 -0
  83. package/app-typescript/dist/components/PropsList.d.ts +15 -0
  84. package/app-typescript/dist/components/Radio.d.ts +19 -0
  85. package/app-typescript/dist/components/RadioButton.d.ts +20 -0
  86. package/app-typescript/dist/components/Select.d.ts +29 -0
  87. package/app-typescript/dist/components/SelectWithTemplate.d.ts +32 -0
  88. package/app-typescript/dist/components/SlidingToolbar.d.ts +8 -0
  89. package/app-typescript/dist/components/StrechBar.d.ts +4 -0
  90. package/app-typescript/dist/components/SubNav.d.ts +10 -0
  91. package/app-typescript/dist/components/Switch.d.ts +12 -0
  92. package/app-typescript/dist/components/TabCustom.d.ts +25 -0
  93. package/app-typescript/dist/components/TabList.d.ts +22 -0
  94. package/app-typescript/dist/components/Tag.d.ts +9 -0
  95. package/app-typescript/dist/components/TagInput.d.ts +7 -0
  96. package/app-typescript/dist/components/TagInputTest.d.ts +18 -0
  97. package/app-typescript/dist/components/TimePicker.d.ts +11 -0
  98. package/app-typescript/dist/components/Tooltip.d.ts +11 -0
  99. package/app-typescript/dist/components/_Positioner.d.ts +27 -0
  100. package/app-typescript/dist/index.d.ts +56 -0
  101. package/app-typescript/helpers.tsx +3 -0
  102. package/app-typescript/index.ts +3 -0
  103. package/dist/SD-logo.svg +52 -0
  104. package/dist/examples.bundle.css +660 -0
  105. package/dist/examples.bundle.js +29711 -27786
  106. package/dist/playgrounds/accessible-theme-test.html +1 -1
  107. package/dist/playgrounds/layout-test-2.html +1 -1
  108. package/dist/playgrounds/list-item-test.html +1 -1
  109. package/dist/playgrounds/master-desk.html +1 -1
  110. package/dist/playgrounds/media-carousel.html +1 -1
  111. package/dist/playgrounds/photo-desk.html +1 -1
  112. package/dist/playgrounds/planning.html +1 -1
  113. package/dist/playgrounds/publish.html +1 -1
  114. package/dist/playgrounds/publisher-content-analytics.html +1 -1
  115. package/dist/playgrounds/publisher-content-list-automatic.html +1 -1
  116. package/dist/playgrounds/publisher-content-list-manual.html +1 -1
  117. package/dist/playgrounds/publisher-content-lists.html +1 -1
  118. package/dist/playgrounds/publisher-dashboard.html +1 -1
  119. package/dist/playgrounds/publisher-output-control.html +1 -1
  120. package/dist/playgrounds/react-playgrounds/CoreLayout.tsx +145 -0
  121. package/dist/playgrounds/react-playgrounds/Index.tsx +1 -0
  122. package/dist/playgrounds/react-playgrounds/TestGround.tsx +36 -0
  123. package/dist/playgrounds/react-playgrounds/components/Layout.tsx +1 -1
  124. package/dist/playgrounds/swimlane-view.html +1 -1
  125. package/dist/playgrounds/toasts.html +1 -1
  126. package/dist/playgrounds/video-editor.html +1 -1
  127. package/dist/react/DatePicker.tsx +10 -5
  128. package/dist/react/Index.tsx +5 -0
  129. package/dist/react/Inputs.tsx +109 -6
  130. package/dist/react/MultiSelect.tsx +6 -1
  131. package/dist/react/Selects.tsx +55 -0
  132. package/dist/react/WithSizeObserver.tsx +44 -0
  133. package/dist/superdesk-ui.bundle.css +2386 -116
  134. package/dist/superdesk-ui.bundle.js +30241 -28731
  135. package/dist/vendor.bundle.js +25026 -25026
  136. package/examples/index.js +4 -0
  137. package/examples/pages/playgrounds/accessible-theme-test.html +1 -1
  138. package/examples/pages/playgrounds/layout-test-2.html +1 -1
  139. package/examples/pages/playgrounds/list-item-test.html +1 -1
  140. package/examples/pages/playgrounds/master-desk.html +1 -1
  141. package/examples/pages/playgrounds/media-carousel.html +1 -1
  142. package/examples/pages/playgrounds/photo-desk.html +1 -1
  143. package/examples/pages/playgrounds/planning.html +1 -1
  144. package/examples/pages/playgrounds/publish.html +1 -1
  145. package/examples/pages/playgrounds/publisher-content-analytics.html +1 -1
  146. package/examples/pages/playgrounds/publisher-content-list-automatic.html +1 -1
  147. package/examples/pages/playgrounds/publisher-content-list-manual.html +1 -1
  148. package/examples/pages/playgrounds/publisher-content-lists.html +1 -1
  149. package/examples/pages/playgrounds/publisher-dashboard.html +1 -1
  150. package/examples/pages/playgrounds/publisher-output-control.html +1 -1
  151. package/examples/pages/playgrounds/react-playgrounds/CoreLayout.tsx +145 -0
  152. package/examples/pages/playgrounds/react-playgrounds/Index.tsx +1 -0
  153. package/examples/pages/playgrounds/react-playgrounds/TestGround.tsx +36 -0
  154. package/examples/pages/playgrounds/react-playgrounds/components/Layout.tsx +1 -1
  155. package/examples/pages/playgrounds/swimlane-view.html +1 -1
  156. package/examples/pages/playgrounds/toasts.html +1 -1
  157. package/examples/pages/playgrounds/video-editor.html +1 -1
  158. package/examples/pages/react/DatePicker.tsx +10 -5
  159. package/examples/pages/react/Index.tsx +5 -0
  160. package/examples/pages/react/Inputs.tsx +109 -6
  161. package/examples/pages/react/MultiSelect.tsx +6 -1
  162. package/examples/pages/react/Selects.tsx +55 -0
  163. package/examples/pages/react/WithSizeObserver.tsx +44 -0
  164. package/package.json +4 -4
  165. package/patches/@superdesk+primereact+5.0.2-4.patch +44 -0
  166. package/react/components/Alert.js +10 -8
  167. package/react/components/Autocomplete.js +16 -12
  168. package/react/components/Avatar.js +8 -6
  169. package/react/components/Badge.js +7 -5
  170. package/react/components/Button.js +8 -6
  171. package/react/components/ButtonGroup.js +7 -5
  172. package/react/components/Carousel.js +4 -2
  173. package/react/components/CheckButtonGroup.js +6 -4
  174. package/react/components/CheckGroup.js +5 -3
  175. package/react/components/Checkbox.js +5 -3
  176. package/react/components/CheckboxButton.js +6 -4
  177. package/react/components/ContentDivider.js +8 -6
  178. package/react/components/CreateButton.js +6 -4
  179. package/react/components/DatePicker.d.ts +10 -0
  180. package/react/components/DatePicker.js +60 -35
  181. package/react/components/Divider.js +6 -4
  182. package/react/components/DonutChart.d.ts +1 -1
  183. package/react/components/DonutChart.js +24 -6
  184. package/react/components/DropZone.js +6 -4
  185. package/react/components/Dropdown.js +7 -6
  186. package/react/components/DropdownFirst.js +18 -11
  187. package/react/components/EmptyState.js +7 -5
  188. package/react/components/Form/FormGroup.js +7 -5
  189. package/react/components/Form/FormItem.js +5 -3
  190. package/react/components/Form/FormLabel.js +5 -3
  191. package/react/components/Form/FormRow.js +5 -3
  192. package/react/components/Form/FormText.js +4 -2
  193. package/react/components/Form/index.js +1 -0
  194. package/react/components/FormLabel.js +5 -3
  195. package/react/components/GridItem.js +9 -7
  196. package/react/components/GridList.js +8 -6
  197. package/react/components/HeadingText.js +4 -2
  198. package/react/components/HelloWorld.js +4 -2
  199. package/react/components/Icon.d.ts +1 -1
  200. package/react/components/Icon.js +9 -7
  201. package/react/components/IconButton.js +8 -6
  202. package/react/components/IconLabel.js +7 -5
  203. package/react/components/IconPicker.js +13 -9
  204. package/react/components/Input.d.ts +6 -2
  205. package/react/components/Input.js +27 -13
  206. package/react/components/Label.js +10 -8
  207. package/react/components/Layouts/AuthorinInnerSideBar.js +4 -2
  208. package/react/components/Layouts/AuthoringContainer.js +7 -5
  209. package/react/components/Layouts/AuthoringFrame.js +4 -2
  210. package/react/components/Layouts/AuthoringFrameContainer.js +4 -2
  211. package/react/components/Layouts/AuthoringFrameLeftBar.js +4 -2
  212. package/react/components/Layouts/AuthoringFrameMain.js +4 -2
  213. package/react/components/Layouts/AuthoringFrameNavBar.js +4 -2
  214. package/react/components/Layouts/AuthoringFrameOverlay.js +4 -2
  215. package/react/components/Layouts/AuthoringFrameRightBar.js +4 -2
  216. package/react/components/Layouts/AuthoringFrameSidePanel.js +5 -3
  217. package/react/components/Layouts/AuthoringFrameSidePanelOverlay.js +5 -3
  218. package/react/components/Layouts/AuthoringInnerBody.js +4 -2
  219. package/react/components/Layouts/AuthoringInnerHeader.js +6 -4
  220. package/react/components/Layouts/AuthoringMain.js +4 -2
  221. package/react/components/Layouts/AuthoringMainContainer.js +4 -2
  222. package/react/components/Layouts/AuthoringMainContent.js +4 -2
  223. package/react/components/Layouts/AuthoringMainToolBar.js +5 -3
  224. package/react/components/Layouts/BottomBarAction.d.ts +12 -0
  225. package/react/components/Layouts/BottomBarAction.js +59 -0
  226. package/react/components/Layouts/Container.js +9 -7
  227. package/react/components/Layouts/ContentSplitter.js +6 -4
  228. package/react/components/Layouts/CoreLayout.d.ts +19 -0
  229. package/react/components/Layouts/CoreLayout.js +55 -0
  230. package/react/components/Layouts/CoreLayoutContainer.d.ts +9 -0
  231. package/react/components/Layouts/CoreLayoutContainer.js +49 -0
  232. package/react/components/Layouts/CoreLayoutFooter.d.ts +8 -0
  233. package/react/components/Layouts/CoreLayoutFooter.js +49 -0
  234. package/react/components/Layouts/CoreLayoutMain.d.ts +9 -0
  235. package/react/components/Layouts/CoreLayoutMain.js +49 -0
  236. package/react/components/Layouts/CoreLayoutOverlay.d.ts +8 -0
  237. package/react/components/Layouts/CoreLayoutOverlay.js +49 -0
  238. package/react/components/Layouts/CoreLayoutSlideInMenu.d.ts +11 -0
  239. package/react/components/Layouts/CoreLayoutSlideInMenu.js +58 -0
  240. package/react/components/Layouts/CoreLayoutTopMenu.d.ts +14 -0
  241. package/react/components/Layouts/CoreLayoutTopMenu.js +54 -0
  242. package/react/components/Layouts/HamburgerButton.d.ts +14 -0
  243. package/react/components/Layouts/HamburgerButton.js +63 -0
  244. package/react/components/Layouts/HeaderPanel.js +4 -2
  245. package/react/components/Layouts/Layout.js +4 -3
  246. package/react/components/Layouts/LayoutContainer.js +4 -2
  247. package/react/components/Layouts/LeftPanel.js +5 -3
  248. package/react/components/Layouts/MainMenu.d.ts +41 -0
  249. package/react/components/Layouts/MainMenu.js +103 -0
  250. package/react/components/Layouts/MainPanel.js +5 -3
  251. package/react/components/Layouts/NotificationPanel.d.ts +45 -0
  252. package/react/components/Layouts/NotificationPanel.js +110 -0
  253. package/react/components/Layouts/OverlayPanel.js +4 -2
  254. package/react/components/Layouts/PageLayout.js +4 -2
  255. package/react/components/Layouts/Panel.js +16 -14
  256. package/react/components/Layouts/RightPanel.js +4 -2
  257. package/react/components/Layouts/index.d.ts +11 -0
  258. package/react/components/Layouts/index.js +23 -0
  259. package/react/components/LeftMenu.d.ts +2 -0
  260. package/react/components/LeftMenu.js +19 -12
  261. package/react/components/ListItemLoader.js +4 -2
  262. package/react/components/Lists/BoxedList.d.ts +6 -0
  263. package/react/components/Lists/BoxedList.js +36 -15
  264. package/react/components/Lists/SimpleList.js +9 -7
  265. package/react/components/Lists/index.js +1 -0
  266. package/react/components/Loader.js +4 -2
  267. package/react/components/Menu.d.ts +2 -1
  268. package/react/components/Menu.js +48 -12
  269. package/react/components/Modal.d.ts +2 -1
  270. package/react/components/Modal.js +30 -9
  271. package/react/components/NavButton.d.ts +1 -0
  272. package/react/components/NavButton.js +9 -4
  273. package/react/components/Navigation/BottomNav.d.ts +23 -0
  274. package/react/components/Navigation/BottomNav.js +88 -0
  275. package/react/components/Navigation/QuickNavBar.js +13 -9
  276. package/react/components/Navigation/SideBarMenu.js +4 -2
  277. package/react/components/Navigation/SideBarTabs.js +4 -2
  278. package/react/components/Navigation/index.js +1 -0
  279. package/react/components/Popover.js +4 -2
  280. package/react/components/PropsList.js +4 -2
  281. package/react/components/RadioButtonGroup.js +9 -7
  282. package/react/components/RadioGroup.js +6 -4
  283. package/react/components/SearchBar.js +6 -4
  284. package/react/components/Select.d.ts +4 -0
  285. package/react/components/Select.js +19 -11
  286. package/react/components/SelectGrid.d.ts +1 -1
  287. package/react/components/SelectGrid.js +44 -23
  288. package/react/components/SelectWithTemplate.js +4 -2
  289. package/react/components/Skeleton.d.ts +1 -1
  290. package/react/components/Skeleton.js +26 -5
  291. package/react/components/SlidingToolbar.js +6 -4
  292. package/react/components/Spinner.js +6 -4
  293. package/react/components/StrechBar.js +4 -2
  294. package/react/components/SubNav.js +9 -7
  295. package/react/components/Switch.js +6 -4
  296. package/react/components/SwitchGroup.js +5 -3
  297. package/react/components/TabCustom.js +11 -7
  298. package/react/components/TabList.js +6 -4
  299. package/react/components/Tag.js +5 -4
  300. package/react/components/TagInput.js +7 -6
  301. package/react/components/TagInputTest.js +13 -9
  302. package/react/components/Text/Heading.js +10 -8
  303. package/react/components/Text/Text.js +10 -8
  304. package/react/components/Text/Time.d.ts +15 -0
  305. package/react/components/Text/Time.js +65 -0
  306. package/react/components/ThemeSelector.js +7 -5
  307. package/react/components/TimePicker.js +4 -2
  308. package/react/components/Toast.js +1 -1
  309. package/react/components/ToastMessage.js +6 -5
  310. package/react/components/ToastText.js +1 -1
  311. package/react/components/ToastWrapper.d.ts +2 -2
  312. package/react/components/ToastWrapper.js +14 -10
  313. package/react/components/Togglebox.d.ts +1 -1
  314. package/react/components/Togglebox.js +36 -15
  315. package/react/components/Tooltip.d.ts +1 -0
  316. package/react/components/Tooltip.js +14 -10
  317. package/react/components/WithSizeObserver.d.ts +25 -0
  318. package/react/components/WithSizeObserver.js +95 -0
  319. package/react/components/_Positioner.js +4 -2
  320. package/react/helpers.d.ts +1 -0
  321. package/react/helpers.js +7 -0
  322. package/react/index.d.ts +3 -0
  323. package/react/index.js +9 -1
  324. package/yarn-error.log +111 -0
  325. package/sd_icons.eot +0 -0
  326. package/sd_icons.svg +0 -189
  327. package/sd_icons.ttf +0 -0
  328. package/sd_icons.woff +0 -0
@@ -0,0 +1,70 @@
1
+ .sd-bottom-nav-list {
2
+ display: flex;
3
+ flex-grow: 1;
4
+ flex-shrink: 1;
5
+ flex-direction: row;
6
+ justify-content: flex-start;
7
+ align-items: center;
8
+ min-height: 3.2rem;
9
+ overflow-x: auto;
10
+ grid-column: 2/3;
11
+ .sd-bottom-nav-list__item {
12
+ flex: 0 1 24rem;
13
+ display: flex;
14
+ flex-direction: row;
15
+ justify-content: center;
16
+ align-items: center;
17
+ height: 3.2rem;
18
+ padding: 0 0.8rem 0 1.6rem;
19
+ gap: 0.8rem;
20
+ border-inline-end: 1px solid hsla(214, 13%, 90%, 0.14);
21
+ background-color: var(--sd-colour-bottom-bar__item);
22
+ overflow: hidden;
23
+ .sd-bottom-nav-list__item-title {
24
+ font-size: 1.4rem;
25
+ line-height: 1;
26
+ color: hsla(214, 13%, 80%, 1);
27
+ overflow: hidden;
28
+ text-overflow: ellipsis;
29
+ white-space: nowrap;
30
+ display: flex;
31
+ flex: 1 1;
32
+ align-self: stretch;
33
+ align-items: center;
34
+ gap: 8px;
35
+ &:hover {
36
+ color: var(--sd-colour-interactive);
37
+ cursor: pointer;
38
+ }
39
+ [class^="icon-"],
40
+ [class*=" icon-"] {
41
+ flex-shrink: 0;
42
+ color: inherit !important;
43
+ opacity: 0.75;
44
+ }
45
+ span {
46
+ padding-top: 2px;
47
+ overflow: hidden;
48
+ text-overflow: ellipsis;
49
+ white-space: nowrap;
50
+ display: flex;
51
+ display: inline-block;
52
+ flex-shrink: 1;
53
+ }
54
+ }
55
+ &--active {
56
+ background-color: var(--sd-colour-bottom-bar__item--active);
57
+ .sd-bottom-nav-list__item-title,
58
+ .sd-bottom-nav-list__item-title:hover {
59
+ color: hsla(214, 13%, 98%, 1);
60
+ }
61
+ }
62
+ &--disabled {
63
+ opacity: 0.5;
64
+ pointer-events: none;
65
+ .sd-bottom-nav-list__item-title {
66
+ pointer-events: none;
67
+ }
68
+ }
69
+ }
70
+ }
@@ -4,6 +4,7 @@
4
4
  $sd-leftNav-bgColor: var(--sd-colour-background__left-nav);
5
5
  $sd-leftNav-borderColor: var(--sd-colour-line--light);
6
6
  $sd-leftNav-width: 24rem;
7
+ $sd-leftNav-width-large: 32rem;
7
8
 
8
9
  $sd-leftNavBtn-bgColor: transparent;
9
10
  $sd-leftNavBtn-bgHoverColor: $sd-colour-background__menu-item--hover;
@@ -33,9 +34,31 @@ $sd-leftNavBtn-borderActive: 4px solid var(--sd-colour-interactive--active);
33
34
  &--blanc {
34
35
  border-color: transparent;
35
36
  background: transparent;
37
+ border-right-width: 0;
36
38
  .sd-left-nav__group-header {
37
39
  border-top-color: transparent;
38
40
  }
41
+ }
42
+ &--large {
43
+ width: $sd-leftNav-width-large;
44
+ max-width: 100%;
45
+ .sd-left-nav__group-header {
46
+ padding-inline: 2.4rem 0;
47
+ }
48
+ .sd-left-nav__btn {
49
+ padding-inline: 4rem 0;
50
+ }
51
+ }
52
+ &--reverse-border {
53
+ .sd-left-nav__btn {
54
+ border-inline-end: none;
55
+ border-inline-start: $sd-leftNavBtn-border;
56
+
57
+ &--active {
58
+ border-inline-end: none;
59
+ border-inline-start: $sd-leftNavBtn-borderActive;
60
+ }
61
+ }
39
62
  }
40
63
  }
41
64
 
@@ -75,7 +98,7 @@ $sd-leftNavBtn-borderActive: 4px solid var(--sd-colour-interactive--active);
75
98
  line-height: 100%;
76
99
  text-transform: uppercase;
77
100
  letter-spacing: 0.1em;
78
- color: var(--color-text-light);
101
+ color: var(--color-text-lighter);
79
102
  padding-block-start: 2.6rem;
80
103
  padding-block-end: 0.9rem;
81
104
  padding-inline: 1.6rem 0;
@@ -141,7 +141,9 @@ $sd-sideTabMenu-background: var(--sd-colour-sidebar-menu--20);
141
141
  }
142
142
 
143
143
  .sd-sidetab-menu__btn {
144
- display:block;
144
+ display: flex;
145
+ align-items: center;
146
+ justify-content: center;
145
147
  position: relative;
146
148
  width: 100%;
147
149
  height: $sd-sidebarMenu-width;
@@ -161,8 +163,8 @@ $sd-sideTabMenu-background: var(--sd-colour-sidebar-menu--20);
161
163
  .sd-sidetab-menu__main-icon {
162
164
  color: $sd-text-light;
163
165
  position: absolute;
164
- top: 10px;
165
- left: 10px;
166
+ inset-block-start: 1rem;
167
+ inset-inline-start: 1rem;
166
168
  display: flex;
167
169
  align-items: center;
168
170
  justify-content: center;
@@ -170,25 +172,19 @@ $sd-sideTabMenu-background: var(--sd-colour-sidebar-menu--20);
170
172
  color: $sd-text-light;
171
173
  }
172
174
  }
173
- .sd-sidetab-menu__helper-icon {
175
+
176
+ .sd-sidetab-menu__helper-icon,
177
+ i.sd-sidetab-menu__helper-icon {
174
178
  opacity: 0;
175
179
  margin: 0;
176
- left: 1.2rem;
180
+ inset-block-start: 1.2rem;
181
+ inset-inline-start: 1.2rem;
177
182
  width: 2.4rem;
178
183
  height: 2.4rem;
179
184
  font-size: 2.4rem;
180
185
  line-height: 2.4rem;
181
186
  z-index: 2;
182
187
  transition: all 0.4s 0s, transform 0.3s 0s;
183
- i {
184
- opacity: 0;
185
- margin: 0;
186
- width: 2.4rem;
187
- height: 2.4rem;
188
- font-size: 2.4rem;
189
- line-height: 2.4rem;
190
- transition: all 0.4s 0s, transform 0.3s 0s;
191
- }
192
188
  }
193
189
  .sd-sidetab-menu__main-icon,
194
190
  .sd-sidetab-menu__main-icon i {
@@ -17,19 +17,33 @@ $sd-topMenu-background: var(--sd-colour-top-menu);
17
17
  }
18
18
 
19
19
  .sd-top-menu__collapse-nav {
20
- display: inline-block;
21
20
  height: $nav-height;
22
- line-height: $nav-height + 3;
21
+ display: flex;
22
+ align-items: center;
23
+ justify-content: center;
23
24
  width: $sd-sidebarMenu-width;
24
25
  text-align: center;
25
26
  padding: 0;
26
27
  background-color: var(--sd-colour-top-menu__btn);
27
- box-shadow: 2px 0 5px 0 rgba(0,0,0,.35);
28
+ box-shadow: 2px 0 5px 0 hsla(0, 0%, 0%, 0.35);
28
29
  position: relative;
30
+ transition: all 0.3s ease;
29
31
  &:hover {
30
- background: #000;
32
+ background-color: hsl(0, 0%, 0%);
31
33
  cursor: pointer;
32
34
  }
35
+ &.is-active {
36
+ margin-inline-start: -$sd-sidebarMenu-width;
37
+ background-color: hsla(0, 0%, 0%, 0.02);
38
+ box-shadow: none;
39
+ &:hover {
40
+ background-color: hsla(0, 0%, 0%, 0.24);
41
+ }
42
+ }
43
+ &--disabled {
44
+ pointer-events: none !important;
45
+ opacity: 0.5;
46
+ }
33
47
  }
34
48
  .sd-top-menu__header {
35
49
  display: inline-block;
@@ -38,7 +52,7 @@ $sd-topMenu-background: var(--sd-colour-top-menu);
38
52
  font-size: 1.5rem;
39
53
  text-align: center;
40
54
  padding: 0 2rem;
41
- color: #aaa;
55
+ color: hsl(214, 13%, 75%);
42
56
  margin: 0;
43
57
  }
44
58
 
@@ -71,8 +71,6 @@
71
71
  .p-multiselect-label {
72
72
  display: flex;
73
73
  align-items: center;
74
- justify-content: center;
75
-
76
74
  }
77
75
 
78
76
  .p-multiselect-token {
@@ -3,6 +3,8 @@ import addDays from 'date-fns/addDays';
3
3
  import format from 'date-fns/format';
4
4
  import {Calendar, LocaleSettings, CalendarProps} from '@superdesk/primereact/calendar';
5
5
  import {throttle} from 'lodash';
6
+ import classNames from 'classnames';
7
+ import nextId from "react-id-generator";
6
8
 
7
9
  export type DatePickerLocaleSettings = Omit<LocaleSettings, 'today' | 'clear'>;
8
10
 
@@ -29,6 +31,17 @@ interface IDatePickerBase {
29
31
  }}
30
32
  */
31
33
  locale?: DatePickerLocaleSettings;
34
+
35
+ // label props
36
+ inlineLabel?: boolean;
37
+ required?: boolean;
38
+ fullWidth?: boolean;
39
+ invalid?: boolean;
40
+ labelHidden?: boolean;
41
+ tabindex?: number;
42
+ label?: string;
43
+ info?: string;
44
+ error?: string;
32
45
  }
33
46
 
34
47
  interface IDatePicker extends IDatePickerBase {
@@ -53,6 +66,7 @@ interface IState {
53
66
  // valid means it can be parsed
54
67
  // if a value is invalid on blur, it will be set to an empty string and `props.onChange` called with `null`
55
68
  valid: boolean;
69
+ invalid: boolean;
56
70
  }
57
71
 
58
72
  // tries to parse primereact/calendar value format to IDatePicker['value']
@@ -84,6 +98,7 @@ export class DatePicker extends React.PureComponent<IDatePicker, IState> {
84
98
  this.state = {
85
99
  value: parseToPrimeReactCalendarFormat(this.props.value),
86
100
  valid: true,
101
+ invalid: this.props.invalid ?? false,
87
102
  };
88
103
 
89
104
  this.hidePopupOnScroll = throttle(() => {
@@ -130,9 +145,26 @@ export class DatePicker extends React.PureComponent<IDatePicker, IState> {
130
145
  clear: 'clear',
131
146
  };
132
147
  }
148
+ const classes = classNames('sd-input', {
149
+ 'sd-input--inline-label': this.props.inlineLabel,
150
+ 'sd-input--required': this.props.required,
151
+ 'sd-input--disabled': this.props.disabled,
152
+ 'sd-input--full-width': this.props.fullWidth,
153
+ 'sd-input--invalid': this.props.invalid || this.state.invalid,
154
+ });
155
+ const labelClasses = classNames('sd-input__label', {
156
+ 'a11y-only': this.props.labelHidden,
157
+ });
158
+
159
+ let htmlId = nextId();
133
160
 
134
161
  return (
135
- <Calendar
162
+ <div className={classes}>
163
+ <label className={labelClasses} htmlFor={htmlId} id={htmlId + 'label'}
164
+ tabIndex={this.props.tabindex === undefined ? undefined : -1}>
165
+ {this.props.label}
166
+ </label>
167
+ <Calendar
136
168
  ref={(ref) => {
137
169
  this.instance = ref as unknown as IPrivatePrimeReactCalendarApi;
138
170
  }}
@@ -153,24 +185,22 @@ export class DatePicker extends React.PureComponent<IDatePicker, IState> {
153
185
  showIcon={true}
154
186
  icon="icon-calendar"
155
187
  headerTemplate={() => this.props.shortcuts == null ? null : (
156
- <div style={{width: '100%', display: 'flex', justifyContent: 'space-between', marginBottom: 10}}>
157
- {
158
- this.props.shortcuts.map(({label, days}, i) => (
159
- <button
160
- key={i}
161
- className="btn btn--hollow btn--small"
162
- onClick={() => {
163
- this.props.onChange(addDays(new Date(), days));
164
-
165
- if (this.instance != null && typeof this.instance.hideOverlay === 'function') {
166
- this.instance.hideOverlay();
167
- }
168
- }}
169
- >
170
- {label}
171
- </button>
172
- ))
173
- }
188
+ <div
189
+ style={{width: '100%', display: 'flex', justifyContent: 'space-between', marginBottom: 10}}>
190
+ {this.props.shortcuts.map(({label, days}, i) => (
191
+ <button
192
+ key={i}
193
+ className="btn btn--hollow btn--small"
194
+ onClick={() => {
195
+ this.props.onChange(addDays(new Date(), days));
196
+
197
+ if (this.instance != null && typeof this.instance.hideOverlay === 'function') {
198
+ this.instance.hideOverlay();
199
+ }
200
+ }}>
201
+ {label}
202
+ </button>
203
+ ))}
174
204
  </div>
175
205
  )}
176
206
  appendTo={document.body} // making it work inside `overflow:hidden`
@@ -185,7 +215,15 @@ export class DatePicker extends React.PureComponent<IDatePicker, IState> {
185
215
  this.setState({valid: true, value: parseToPrimeReactCalendarFormat(this.props.value)});
186
216
  }
187
217
  }}
188
- />
218
+ />
219
+ <div className='sd-input__message-box'>
220
+ {this.props.info && !this.props.invalid && !this.state.invalid ?
221
+ <div className='sd-input__hint'>{this.props.info}</div> : null}
222
+ {this.props.invalid || this.state.invalid ?
223
+ <div className='sd-input__message'>{this.props.error}</div>
224
+ : null}
225
+ </div>
226
+ </div>
189
227
  );
190
228
  }
191
229
  }
@@ -211,6 +249,15 @@ export class DatePickerISO extends React.PureComponent<IDatePickerISO> {
211
249
  shortcuts={this.props.shortcuts}
212
250
  dateFormat={this.props.dateFormat}
213
251
  locale={this.props.locale}
252
+ inlineLabel={this.props.inlineLabel}
253
+ required={this.props.required}
254
+ fullWidth={this.props.fullWidth}
255
+ invalid={this.props.invalid}
256
+ labelHidden={this.props.labelHidden}
257
+ tabindex={this.props.tabindex}
258
+ label={this.props.label}
259
+ info={this.props.info}
260
+ error={this.props.error}
214
261
  />
215
262
  );
216
263
  }
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import * as React from 'react';
2
2
  import { Chart } from '@superdesk/primereact/chart';
3
3
  import { ChartData, ChartOptions } from 'chart.js';
4
4
 
@@ -3,7 +3,7 @@ import classNames from 'classnames';
3
3
  interface IProps {
4
4
  name?: string;
5
5
  size?: 'small' | 'big'; // defaults to 'small'
6
- type?: 'default' | 'primary' | 'success' | 'warning' | 'alert' | 'highlight' | 'light';
6
+ type?: 'default' | 'primary' | 'success' | 'warning' | 'alert' | 'highlight' | 'light' | 'white';
7
7
  className?: string;
8
8
  scale?: '2x' | '3x' | '4x';
9
9
  ariaHidden?: boolean;
@@ -26,7 +26,11 @@ export class IconButton extends React.PureComponent<IProps> {
26
26
  'icn-btn--disabled': this.props.disabled,
27
27
  });
28
28
  return (
29
- <Tooltip text={this.props.ariaValue} flow={this.props.toolTipFlow} appendToBody={this.props.toolTipAppend}>
29
+ <Tooltip
30
+ text={this.props.ariaValue}
31
+ flow={this.props.toolTipFlow}
32
+ appendToBody={this.props.toolTipAppend}
33
+ disabled={this.props.disabled}>
30
34
  <button
31
35
  id={this.props.id}
32
36
  tabIndex={0}
@@ -14,6 +14,10 @@ interface IPropsBase {
14
14
  labelHidden?: boolean;
15
15
  tabindex?: number;
16
16
  fullWidth?: boolean;
17
+ boxedStyle?: boolean;
18
+ boxedLable?: boolean;
19
+ placeholder?: string;
20
+ size?: 'medium' | 'large' | 'x-large'; // default: 'medium'
17
21
  }
18
22
 
19
23
  interface IPropsText extends IPropsBase {
@@ -30,8 +34,8 @@ interface IPropsPassword extends IPropsBase {
30
34
 
31
35
  interface IPropsNumber extends IPropsBase {
32
36
  type: 'number';
33
- value: number | any;
34
- onChange(newValue: number | any): void;
37
+ value: number;
38
+ onChange(newValue: number): void;
35
39
  }
36
40
 
37
41
  type IProps = IPropsText | IPropsNumber | IPropsPassword;
@@ -57,7 +61,11 @@ export class Input extends React.Component<IProps, IState> {
57
61
 
58
62
  handleChange(event: React.ChangeEvent<HTMLInputElement>) {
59
63
  this.setState({ value: event.target.value });
60
- this.props.onChange(event.target.value);
64
+ if (this.props.type === 'number') {
65
+ this.props.onChange(Number(event.target.value));
66
+ } else {
67
+ this.props.onChange(event.target.value);
68
+ }
61
69
 
62
70
  if (this.props.maxLength && !this.props.invalid) {
63
71
  this.setState({ invalid: event.target.value.length > this.props.maxLength });
@@ -77,9 +85,14 @@ export class Input extends React.Component<IProps, IState> {
77
85
  'sd-input--disabled': this.props.disabled,
78
86
  'sd-input--full-width': this.props.fullWidth,
79
87
  'sd-input--invalid': this.props.invalid || this.state.invalid,
88
+ 'sd-input--medium': this.props.size === undefined,
89
+ [`sd-input--${this.props.size}`]: this.props.size || this.props.size !== undefined,
90
+ 'sd-input--boxed-style': this.props.boxedStyle,
91
+ 'sd-input--boxed-label': this.props.boxedLable,
80
92
  });
81
93
  const labelClasses = classNames('sd-input__label', {
82
94
  'a11y-only': this.props.labelHidden,
95
+ 'sd-input__label--boxed': this.props.boxedLable,
83
96
  });
84
97
 
85
98
  return (
@@ -96,6 +109,7 @@ export class Input extends React.Component<IProps, IState> {
96
109
  aria-describedby={this.htmlId + 'label'}
97
110
  tabIndex={this.props.tabindex}
98
111
  onChange={this.handleChange}
112
+ placeholder={this.props.placeholder}
99
113
  disabled={this.props.disabled} />
100
114
 
101
115
  {this.props.maxLength ?
@@ -0,0 +1,35 @@
1
+ import * as React from 'react';
2
+ import classNames from 'classnames';
3
+ import {Icon} from '../Icon';
4
+
5
+ interface IProps {
6
+ arialabel?: string;
7
+ ariaControls?: string;
8
+ onClick(): void;
9
+ active?: boolean;
10
+ disabled?: boolean;
11
+ }
12
+
13
+ export class BottomBarAction extends React.PureComponent<IProps> {
14
+ render() {
15
+ let classes = classNames(
16
+ 'sd-bottom-bar__action',
17
+ {
18
+ 'sd-bottom-bar__action--active': this.props.active,
19
+ 'sd-bottom-bar__action--disabled': this.props.disabled,
20
+ },
21
+ );
22
+ return (
23
+ <button type='button'
24
+ className={classes}
25
+ tabIndex={0}
26
+ onClick={this.props.onClick}
27
+ aria-label={this.props.arialabel}
28
+ aria-controls={this.props.ariaControls}
29
+ aria-expanded={this.props.active}
30
+ >
31
+ <Icon type='white' name='th-large' />
32
+ </button>
33
+ );
34
+ }
35
+ }
@@ -0,0 +1,62 @@
1
+ import * as React from 'react';
2
+
3
+ import {
4
+ CoreLayoutContainer,
5
+ CoreLayoutMain,
6
+ CoreLayoutTopMenu,
7
+ CoreLayoutSlideInMenu,
8
+ CoreLayoutFooter,
9
+ CoreLayoutOverlay,
10
+ } from '.';
11
+
12
+ interface IProps {
13
+ topMenu?: React.ReactNode;
14
+ main?: React.ReactNode;
15
+ slideInMenu?: React.ReactNode;
16
+ footer?: React.ReactNode;
17
+ overlay?: React.ReactNode;
18
+ heading?: string;
19
+ menuOpen?: boolean;
20
+ onClick(): void;
21
+ active?: boolean;
22
+ menuId?: string;
23
+ ariaControls?: string;
24
+ buttonAnimation?: 'spin' | 'squeeze' | 'none';
25
+ }
26
+
27
+ export class CoreLayout extends React.PureComponent<IProps> {
28
+ render() {
29
+ return (
30
+ <CoreLayoutContainer>
31
+ {this.props.slideInMenu && (
32
+ <CoreLayoutSlideInMenu menuId={this.props.menuId} menuOpen={this.props.menuOpen}>
33
+ {this.props.slideInMenu}
34
+ </CoreLayoutSlideInMenu>
35
+ )}
36
+ {this.props.topMenu && (
37
+ <CoreLayoutTopMenu
38
+ buttonAnimation={this.props.buttonAnimation}
39
+ heading={this.props.heading}
40
+ onClick={this.props.onClick}
41
+ active={this.props.active}
42
+ ariaControls={this.props.ariaControls}>
43
+ {this.props.topMenu}
44
+ </CoreLayoutTopMenu>
45
+ )}
46
+ <CoreLayoutMain>
47
+ {this.props.children}
48
+ </CoreLayoutMain>
49
+ {this.props.footer && (
50
+ <CoreLayoutFooter>
51
+ {this.props.footer}
52
+ </CoreLayoutFooter>
53
+ )}
54
+ {this.props.overlay && (
55
+ <CoreLayoutOverlay>
56
+ {this.props.overlay}
57
+ </CoreLayoutOverlay>
58
+ )}
59
+ </CoreLayoutContainer>
60
+ );
61
+ }
62
+ }
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+
3
+ interface IProps {
4
+ children?: React.ReactNode;
5
+ theme?: string;
6
+ }
7
+
8
+ export class CoreLayoutContainer extends React.PureComponent<IProps> {
9
+ render() {
10
+ return (
11
+ <div className='sd-page-grid--test docs-page__full-width-helper' data-theme={this.props.theme}>
12
+ {this.props.children}
13
+ </div>
14
+ );
15
+ }
16
+ }
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+
3
+ interface IProps {
4
+ children?: React.ReactNode;
5
+ }
6
+
7
+ export class CoreLayoutFooter extends React.PureComponent<IProps> {
8
+ render() {
9
+ return (
10
+ <footer className='sd-bottom-bar'>
11
+ {this.props.children}
12
+ </footer>
13
+ );
14
+ }
15
+ }
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+
3
+ interface IProps {
4
+ children?: React.ReactNode;
5
+ id?: string;
6
+ }
7
+
8
+ export class CoreLayoutMain extends React.PureComponent<IProps> {
9
+ render() {
10
+ return (
11
+ <section id={this.props.id} className='sd-content sd-content-wrapper'>
12
+ {this.props.children}
13
+ </section>
14
+ );
15
+ }
16
+ }
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+
3
+ interface IProps {
4
+ children?: React.ReactNode;
5
+ }
6
+
7
+ export class CoreLayoutOverlay extends React.PureComponent<IProps> {
8
+ render() {
9
+ return (
10
+ <footer className='sd-notifications-slot'>
11
+ {this.props.children}
12
+ </footer>
13
+ );
14
+ }
15
+ }
@@ -0,0 +1,24 @@
1
+ import * as React from 'react';
2
+ import classNames from 'classnames';
3
+
4
+ interface IProps {
5
+ children?: React.ReactNode;
6
+ theme?: string;
7
+ menuOpen?: boolean;
8
+ menuId?: string;
9
+ }
10
+
11
+ export class CoreLayoutSlideInMenu extends React.PureComponent<IProps> {
12
+ render() {
13
+ let classes = classNames('sd-main-menu', {
14
+ [`sd-main-menu--open`]: this.props.menuOpen,
15
+ });
16
+ return (
17
+ <div id={this.props.menuId} className={classes} data-theme='dark-ui'>
18
+ <div className='sd-main-menu__inner'>
19
+ {this.props.children}
20
+ </div>
21
+ </div>
22
+ );
23
+ }
24
+ }