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,35 @@
1
+ import * as React from 'react';
2
+
3
+ import { HamburgerButton } from '.';
4
+ import { Container } from './';
5
+
6
+ interface IProps {
7
+ children?: React.ReactNode;
8
+ menuOpen?: boolean;
9
+ heading?: string;
10
+ onClick(): void;
11
+ active?: boolean;
12
+ ariaControls?: string;
13
+ buttonAnimation?: 'spin' | 'squeeze' | 'none';
14
+ }
15
+
16
+ export class CoreLayoutTopMenu extends React.PureComponent<IProps> {
17
+ render() {
18
+ return (
19
+ <header className='sd-top-menu' data-theme='dark-ui'>
20
+ <HamburgerButton
21
+ buttonAnimation={this.props.buttonAnimation}
22
+ arialabel='Toggle main menu'
23
+ ariaControls={this.props.ariaControls}
24
+ onClick={this.props.onClick}
25
+ active={this.props.active} />
26
+ <Container className='sd-margin-e--auto'>
27
+ {this.props.heading && (
28
+ <p className='sd-top-menu__header'>{this.props.heading}</p>
29
+ )}
30
+ </Container>
31
+ {this.props.children}
32
+ </header>
33
+ );
34
+ }
35
+ }
@@ -0,0 +1,41 @@
1
+ import * as React from 'react';
2
+ import classNames from 'classnames';
3
+
4
+ interface IProps {
5
+ id?: string;
6
+ arialabel?: string;
7
+ ariaControls?: string;
8
+ onClick(): void;
9
+ active?: boolean;
10
+ buttonAnimation?: 'spin' | 'squeeze' | 'none';
11
+ disabled?: boolean;
12
+ }
13
+
14
+ export class HamburgerButton extends React.PureComponent<IProps> {
15
+ render() {
16
+ let classes = classNames(
17
+ 'sd-top-menu__collapse-nav hamburger',
18
+ {
19
+ 'is-active': this.props.active,
20
+ 'hamburger--spin': this.props.buttonAnimation === undefined,
21
+ [`hamburger--${this.props.buttonAnimation}`]:
22
+ this.props.buttonAnimation || this.props.buttonAnimation !== undefined,
23
+ 'sd-top-menu__collapse-nav--disabled': this.props.disabled,
24
+ },
25
+ );
26
+ return (
27
+ <button type='button'
28
+ className={classes}
29
+ tabIndex={0}
30
+ onClick={this.props.onClick}
31
+ aria-label={this.props.arialabel}
32
+ aria-controls={this.props.ariaControls}
33
+ aria-expanded={this.props.active}
34
+ id={this.props.id}>
35
+ <span className="hamburger__box">
36
+ <span className="hamburger__inner"></span>
37
+ </span>
38
+ </button>
39
+ );
40
+ }
41
+ }
@@ -25,7 +25,7 @@ export const Layout = ({
25
25
  <section id='1' className='sd-content sd-content-wrapper'>
26
26
  {children}
27
27
  </section>
28
- <footer className='bottom-bar'>
28
+ <footer className='sd-bottom-bar'>
29
29
  This is the footer.
30
30
  </footer>
31
31
  </div>
@@ -0,0 +1,101 @@
1
+ import * as React from 'react';
2
+
3
+ interface IPropsContainer {
4
+ children?: React.ReactNode;
5
+ id?: string;
6
+ theme?: 'light' | 'dark';
7
+ }
8
+ class MainMenuContainer extends React.PureComponent<IPropsContainer> {
9
+ render() {
10
+ return (
11
+ <div id={this.props.id}
12
+ aria-labelledby='main-menu_title'
13
+ className='sd-main-menu__navigation'
14
+ data-theme={this.props.theme ? `${this.props.theme}-ui` : null}>
15
+ {this.props.children}
16
+ </div>
17
+ );
18
+ }
19
+ }
20
+
21
+ interface IPropsHeader {
22
+ headerTitle?: string;
23
+ }
24
+ class MainMenuHeader extends React.PureComponent<IPropsHeader> {
25
+ render() {
26
+ return (
27
+ <div className='sd-main-menu__header'>
28
+ <h3 id='main-menu_title' className='sd-main-menu__title'>{this.props.headerTitle}</h3>
29
+ </div>
30
+ );
31
+ }
32
+ }
33
+ interface IPropsContent {
34
+ children?: React.ReactNode;
35
+ }
36
+ class MainMenuContent extends React.PureComponent<IPropsContent> {
37
+ render() {
38
+ return (
39
+ <div className='sd-main-menu__content'>
40
+ {this.props.children}
41
+ </div>
42
+ );
43
+ }
44
+ }
45
+ interface IPropsFooter {
46
+ children?: React.ReactNode;
47
+ poweredBy?: string;
48
+ footerContent?: boolean;
49
+ }
50
+ class MainMenuFooter extends React.PureComponent<IPropsFooter> {
51
+ render() {
52
+ return (
53
+ <div className='sd-main-menu__footer'>
54
+ {this.props.poweredBy &&
55
+ <div className='sd-main-menu__footer-info'>
56
+ {this.props.poweredBy}
57
+ </div>
58
+ }
59
+ <div className='sd-main-menu__footer-logo'></div>
60
+ {this.props.footerContent &&
61
+ <div className='sd-main-menu__footer-content'>
62
+ {this.props.children}
63
+ </div>
64
+ }
65
+ </div>
66
+ );
67
+ }
68
+ }
69
+
70
+ interface IProps {
71
+ header: React.ReactNode;
72
+ footer?: React.ReactNode;
73
+ children?: React.ReactNode;
74
+ headerTitle?: string;
75
+ poweredBy?: string;
76
+ footerContent?: boolean;
77
+ }
78
+
79
+ export default class MainMenu extends React.PureComponent<IProps> {
80
+ render() {
81
+ return (
82
+ <MainMenuContainer>
83
+ <MainMenuHeader headerTitle={this.props.headerTitle}>
84
+ {this.props.header}
85
+ </MainMenuHeader>
86
+ <MainMenuContent>
87
+ {this.props.children}
88
+ </MainMenuContent>
89
+ {this.props.footer && (
90
+ <MainMenuFooter footerContent={this.props.footerContent} poweredBy={this.props.poweredBy}>
91
+ {this.props.footer}
92
+ </MainMenuFooter>
93
+ )}
94
+ </MainMenuContainer>
95
+ );
96
+ }
97
+ }
98
+
99
+ export {
100
+ MainMenu, MainMenuContainer, MainMenuHeader, MainMenuContent, MainMenuFooter
101
+ };
@@ -0,0 +1,109 @@
1
+ import * as React from 'react';
2
+ import classNames from 'classnames';
3
+ import { IconButton} from '../IconButton';
4
+
5
+ interface IPropsContainer {
6
+ children?: React.ReactNode;
7
+ id?: string;
8
+ theme?: 'light' | 'dark';
9
+ open?: boolean;
10
+ }
11
+ class NotificationPanelContainer extends React.PureComponent<IPropsContainer> {
12
+ render() {
13
+ let classes = classNames('sd-notification-panel', {
14
+ [`sd-notification-panel--open`]: this.props.open,
15
+ });
16
+ return (
17
+ <div id={this.props.id}
18
+ aria-labelledby='notifications_title'
19
+ className={classes}
20
+ data-theme={this.props.theme ? `${this.props.theme}-ui` : null}>
21
+ {this.props.children}
22
+ </div>
23
+ );
24
+ }
25
+ }
26
+
27
+ interface IPropsHeader {
28
+ headerTitle?: string;
29
+ onClick(): void;
30
+ }
31
+ class NotificationPanelHeader extends React.PureComponent<IPropsHeader> {
32
+ render() {
33
+ return (
34
+ <div className='sd-notification-panel__header'>
35
+ <h3 id='notifications_title' className='sd-notification-panel__title'>{this.props.headerTitle}</h3>
36
+ <IconButton
37
+ toolTipFlow='left'
38
+ ariaValue='Close'
39
+ icon='close-small'
40
+ onClick={() => this.props.onClick()} />
41
+ </div>
42
+ );
43
+ }
44
+ }
45
+ interface IPropsContent {
46
+ children?: React.ReactNode;
47
+ }
48
+ class NotificationPanelContent extends React.PureComponent<IPropsContent> {
49
+ render() {
50
+ return (
51
+ <div className='sd-notification-panel__content'>
52
+ {this.props.children}
53
+ </div>
54
+ );
55
+ }
56
+ }
57
+ interface IPropsFooter {
58
+ children?: React.ReactNode;
59
+ footerContent?: boolean;
60
+ }
61
+ class NotificationPanelFooter extends React.PureComponent<IPropsFooter> {
62
+ render() {
63
+ return (
64
+ <div className='sd-notification-panel__footer'>
65
+ {this.props.children}
66
+ </div>
67
+ );
68
+ }
69
+ }
70
+
71
+ interface IProps {
72
+ header: React.ReactNode;
73
+ footer?: React.ReactNode;
74
+ children?: React.ReactNode;
75
+ headerTitle?: string;
76
+ poweredBy?: string;
77
+ footerContent?: boolean;
78
+ open?: boolean;
79
+ theme?: 'light' | 'dark';
80
+ onClick(): void;
81
+ }
82
+
83
+ export default class NotificationPanel extends React.PureComponent<IProps> {
84
+ render() {
85
+ return (
86
+ <NotificationPanelContainer open={this.props.open} theme={this.props.theme}>
87
+ <NotificationPanelHeader headerTitle={this.props.headerTitle} onClick={() => this.props.onClick()}>
88
+ {this.props.header}
89
+ </NotificationPanelHeader>
90
+ <NotificationPanelContent>
91
+ {this.props.children}
92
+ </NotificationPanelContent>
93
+ {this.props.footer && (
94
+ <NotificationPanelFooter>
95
+ {this.props.footer}
96
+ </NotificationPanelFooter>
97
+ )}
98
+ </NotificationPanelContainer>
99
+ );
100
+ }
101
+ }
102
+
103
+ export {
104
+ NotificationPanel,
105
+ NotificationPanelContainer,
106
+ NotificationPanelHeader,
107
+ NotificationPanelContent,
108
+ NotificationPanelFooter
109
+ };
@@ -29,3 +29,15 @@ export { AuthoringMainContent } from './AuthoringMainContent';
29
29
  export { AuthoringInnerHeader } from './AuthoringInnerHeader';
30
30
  export { AuthoringInnerBody } from './AuthoringInnerBody';
31
31
  export { AuthorinInnerSideBar } from './AuthorinInnerSideBar';
32
+
33
+ export { CoreLayout } from './CoreLayout';
34
+ export { CoreLayoutContainer } from './CoreLayoutContainer';
35
+ export { CoreLayoutTopMenu } from './CoreLayoutTopMenu';
36
+ export { CoreLayoutMain } from './CoreLayoutMain';
37
+ export { CoreLayoutSlideInMenu } from './CoreLayoutSlideInMenu';
38
+ export { CoreLayoutFooter } from './CoreLayoutFooter';
39
+ export { CoreLayoutOverlay } from './CoreLayoutOverlay';
40
+ export { HamburgerButton } from './HamburgerButton';
41
+ export { BottomBarAction } from './BottomBarAction';
42
+ export { MainMenu } from './MainMenu';
43
+ export { NotificationPanel } from './NotificationPanel';
@@ -22,7 +22,9 @@ interface IMenu {
22
22
  ariaLabel?: string;
23
23
  scrollSpy?: string;
24
24
  offset?: number;
25
+ reverseItemBorder?: boolean;
25
26
  style?: "default" | "inverse" | "blanc";
27
+ size?: "medium" | "large";
26
28
  onSelect(id: string, route: string): void;
27
29
  }
28
30
 
@@ -66,6 +68,10 @@ export class LeftMenu extends React.PureComponent<IMenu, IState> {
66
68
  "sd-left-nav--default": this.props.style === undefined,
67
69
  [`sd-left-nav--${this.props.style}`]:
68
70
  this.props.style || this.props.style !== undefined,
71
+ "sd-left-nav--medium": this.props.size === undefined,
72
+ [`sd-left-nav--${this.props.size}`]:
73
+ this.props.size || this.props.size !== undefined,
74
+ "sd-left-nav--reverse-border": this.props.reverseItemBorder,
69
75
  },
70
76
  this.props.className,
71
77
  );
@@ -47,13 +47,20 @@ interface IPropsActions {
47
47
  }
48
48
 
49
49
  class BoxedListActions extends React.PureComponent<IPropsActions> {
50
+ public rootElement?: HTMLDivElement | null;
51
+
50
52
  render() {
51
53
  let classes = classNames({
52
54
  'boxed-list__actions--static': this.props.slideIn === undefined,
53
55
  'boxed-list__actions--slide-in': this.props.slideIn === true || this.props.slideIn !== undefined,
54
56
  });
55
57
  return (
56
- <div className={classes}>
58
+ <div
59
+ className={classes}
60
+ ref={(el) => {
61
+ this.rootElement = el;
62
+ }}
63
+ >
57
64
  {this.props.children}
58
65
  </div>
59
66
  );
@@ -71,21 +78,40 @@ interface IPropsItem {
71
78
  alignVertical?: 'start' | 'center';
72
79
  slideInActions?: boolean;
73
80
  selected?: boolean;
81
+ unread?: boolean;
74
82
  onClick?(): void;
75
83
  }
76
84
 
77
85
  class BoxedListItem extends React.PureComponent<IPropsItem> {
86
+ private actionsRef: BoxedListActions | null;
87
+
88
+ constructor(props: IPropsItem) {
89
+ super(props);
90
+
91
+ this.actionsRef = null;
92
+ this.handleClick = this.handleClick.bind(this);
93
+ }
94
+
95
+ handleClick(event: React.MouseEvent<HTMLLIElement, MouseEvent>) {
96
+ if (this.actionsRef?.rootElement != null && this.actionsRef.rootElement.contains(event.target as HTMLElement)) {
97
+ return;
98
+ } else {
99
+ this.props.onClick?.();
100
+ }
101
+ }
102
+
78
103
  render() {
79
104
  let classes = classNames('boxed-list__item', {
80
105
  'boxed-list__item--comfortable': this.props.density === undefined,
81
106
  [`boxed-list__item--${this.props.density}`]: this.props.density || this.props.density !== undefined,
82
107
  'boxed-list__item--clickable': this.props.clickable === true,
83
108
  'boxed-list__item--selected': this.props.selected,
109
+ 'boxed-list__item--unread': this.props.unread,
84
110
  [`boxed-list__item--${this.props.type}`]: this.props.type || this.props.type !== undefined,
85
111
  [`boxed-list__item--align-${this.props.alignVertical}`]: this.props.alignVertical,
86
112
  });
87
113
  return (
88
- <li className={classes} onClick={this.props.onClick}>
114
+ <li className={classes} onClick={this.handleClick}>
89
115
 
90
116
  {this.props.media && (
91
117
  <BoxedListMedia>
@@ -104,7 +130,12 @@ class BoxedListItem extends React.PureComponent<IPropsItem> {
104
130
  )}
105
131
 
106
132
  {this.props.actions && (
107
- <BoxedListActions slideIn={this.props.slideInActions}>
133
+ <BoxedListActions
134
+ slideIn={this.props.slideInActions}
135
+ ref={(ref) => {
136
+ this.actionsRef = ref;
137
+ }}
138
+ >
108
139
  {this.props.actions}
109
140
  </BoxedListActions>
110
141
  )}
@@ -116,6 +147,7 @@ class BoxedListItem extends React.PureComponent<IPropsItem> {
116
147
  interface IProps {
117
148
  children?: React.ReactNode;
118
149
  density?: 'compact' | 'comfortable'; // defaults to 'compact'
150
+ className?: string;
119
151
  }
120
152
 
121
153
  class BoxedList extends React.PureComponent<IProps> {
@@ -123,7 +155,7 @@ class BoxedList extends React.PureComponent<IProps> {
123
155
  let classes = classNames('boxed-list', {
124
156
  'boxed-list--compact': this.props.density === undefined,
125
157
  [`boxed-list--${this.props.density}`]: this.props.density || this.props.density !== undefined,
126
- });
158
+ }, this.props.className);
127
159
  return (
128
160
  <ul className={classes}>
129
161
  {this.props.children}
@@ -1,5 +1,9 @@
1
- import React, {SyntheticEvent} from 'react';
1
+ import * as React from 'react';
2
+ import {SyntheticEvent} from 'react';
3
+
2
4
  import {TieredMenu} from '@superdesk/primereact/tieredmenu';
5
+ import {MenuItem as IPrimeMenuItem} from '@superdesk/primereact/components/menuitem/MenuItem';
6
+ import {assertNever} from '../helpers';
3
7
 
4
8
  /**
5
9
  * Known issues:
@@ -58,6 +62,18 @@ interface IProps {
58
62
 
59
63
  const superdeskTopBarZIndex = 1030;
60
64
 
65
+ function isSeparator(item: IMenuItem): item is ISeparator {
66
+ return (item as any)['separator'] === true;
67
+ }
68
+
69
+ function isMenuLeaf(item: IMenuItem): item is IMenuLeaf {
70
+ return (item as any)['onClick'] != null;
71
+ }
72
+
73
+ function isMenuBranch(item: IMenuItem): item is IMenuBranch {
74
+ return isSeparator(item) !== true && isMenuLeaf(item) !== true;
75
+ }
76
+
61
77
  export class Menu extends React.Component<IProps, {}> {
62
78
  private menu: TieredMenu | null;
63
79
  private focusedBefore: Element | null;
@@ -73,26 +89,34 @@ export class Menu extends React.Component<IProps, {}> {
73
89
  this.toPrimeReactInterface = this.toPrimeReactInterface.bind(this);
74
90
  }
75
91
 
76
- private toPrimeReactInterface(items: Array<any>): any {
92
+ private toPrimeReactInterface(items: Array<IMenuItem>): Array<IPrimeMenuItem> {
77
93
  return items.map((item) => {
78
- if (item.separator != null) {
94
+ if (isSeparator(item)) {
79
95
  return {separator: true};
80
- } else if (item.children != null) {
96
+ } else if (isMenuBranch(item)) {
81
97
  return {
82
98
  label: item.label,
83
99
  icon: item.icon,
84
100
  items: this.toPrimeReactInterface(item.children),
85
101
  };
86
- } else {
102
+ } else if (isMenuLeaf(item)) {
87
103
  return {
88
104
  label: item.label,
89
105
  icon: item.icon,
90
- command: (event: SyntheticEvent) => {
91
- this.close(event);
106
+ command: (event) => {
107
+ /**
108
+ * a click on menu item should not trigger other click handlers
109
+ * above in the DOM tree. e.g. if menu is inside a clickable list item
110
+ */
111
+ event.originalEvent.stopPropagation();
112
+
113
+ this.close(event.originalEvent as unknown as SyntheticEvent);
92
114
  item.onClick();
93
115
  },
94
116
  disabled: item.disabled,
95
117
  };
118
+ } else {
119
+ return assertNever(item);
96
120
  }
97
121
  });
98
122
  }
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import * as React from 'react';
2
2
  import { Dialog as PrimeDialog } from '@superdesk/primereact/dialog';
3
3
  import classNames from 'classnames';
4
4
 
@@ -14,6 +14,7 @@ interface IProps {
14
14
  headerTemplate?: JSX.Element | string;
15
15
  footerTemplate?: JSX.Element | string;
16
16
  closeOnEscape?: boolean;
17
+ zIndex?: number;
17
18
  onShow?(): void;
18
19
  onHide(): void;
19
20
  }
@@ -39,7 +40,9 @@ export class Modal extends React.Component<IProps, {}> {
39
40
  maximized={this.props.maximized}
40
41
  contentClassName={classes}
41
42
  onShow={this.props.onShow}
42
- onHide={this.props.onHide}>
43
+ onHide={this.props.onHide}
44
+ zIndex={this.props.zIndex}
45
+ >
43
46
  {this.props.children}
44
47
  </PrimeDialog>
45
48
  </div>
@@ -1,6 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { MultiSelect as PrimeMultiSelect } from "@superdesk/primereact/multiselect";
3
3
  import classNames from 'classnames';
4
+ import nextId from "react-id-generator";
4
5
 
5
6
  interface IProps<T> {
6
7
  value: Array<T>;
@@ -12,18 +13,29 @@ interface IProps<T> {
12
13
  maxSelectedLabels?: number;
13
14
  selectedItemsLabel?: string;
14
15
  ariaLabelledBy?: string;
15
- tabIndex?: string;
16
+ tabIndex?: string | any;
16
17
  filter?: boolean;
17
18
  showClear?: boolean;
18
19
  showSelectAll?: boolean;
19
20
  itemTemplate?(item: any): JSX.Element | undefined;
20
21
  selectedItemTemplate?(value: any): JSX.Element | undefined;
21
22
  onChange(newValue: string): void;
23
+ invalid?: boolean;
24
+ inlineLabel?: boolean;
25
+ labelHidden?: boolean;
26
+ tabindex?: number;
27
+ fullWidth?: boolean;
28
+ info?: string;
29
+ error?: string;
30
+ required?: boolean;
31
+ label?: string;
32
+ disabled?: boolean;
22
33
  }
23
34
 
24
35
  interface IState<T> {
25
36
  options: Array<T>;
26
37
  value: Array<T>;
38
+ invalid: boolean;
27
39
  }
28
40
 
29
41
  export class MultiSelect<T> extends React.Component<IProps<T>, IState<T>> {
@@ -32,6 +44,7 @@ export class MultiSelect<T> extends React.Component<IProps<T>, IState<T>> {
32
44
  this.state = {
33
45
  value: [],
34
46
  options: [],
47
+ invalid: this.props.invalid ? this.props.invalid : false,
35
48
  };
36
49
  }
37
50
 
@@ -42,28 +55,58 @@ export class MultiSelect<T> extends React.Component<IProps<T>, IState<T>> {
42
55
  'showFilter': this.props.filter,
43
56
  });
44
57
 
58
+ const labelClasses = classNames('sd-input__label', {
59
+ 'a11y-only': this.props.labelHidden,
60
+ });
61
+
62
+ const classesLabel = classNames('sd-input', {
63
+ 'sd-input--inline-label': this.props.inlineLabel,
64
+ 'sd-input--required': this.props.required,
65
+ 'sd-input--disabled': this.props.disabled,
66
+ 'sd-input--full-width': this.props.fullWidth,
67
+ 'sd-input--invalid': this.props.invalid || this.state.invalid,
68
+ });
69
+
70
+ const htmlId = nextId();
71
+
45
72
  return (
46
- <PrimeMultiSelect
47
- panelClassName={classes}
48
- value={this.props.value}
49
- options={this.props.options}
50
- onChange={(e: any) => this.props.onChange(e)}
51
- display="chip"
52
- filter={this.props.filter}
53
- filterBy={this.props.optionLabel}
54
- appendTo={document.body}
55
- placeholder={this.props.placeholder}
56
- optionLabel={this.props.optionLabel}
57
- emptyFilterMessage={this.props.emptyFilterMessage}
58
- filterPlaceholder={this.props.filterPlaceholder}
59
- itemTemplate={this.props.itemTemplate}
60
- selectedItemTemplate={this.props.selectedItemTemplate}
61
- maxSelectedLabels={this.props.maxSelectedLabels ?? 4}
62
- selectedItemsLabel={this.props.selectedItemsLabel}
63
- ariaLabelledBy={this.props.ariaLabelledBy}
64
- tabIndex={this.props.tabIndex ?? '0'}
65
- showClear={this.props.showClear}
66
- />
73
+ <div className={classesLabel}>
74
+ <label className={labelClasses} htmlFor={htmlId} id={htmlId + 'label'}
75
+ tabIndex={this.props.tabindex === undefined ? undefined : -1}>
76
+ {this.props.label}
77
+ </label>
78
+
79
+ <PrimeMultiSelect
80
+ panelClassName={classes}
81
+ value={this.props.value}
82
+ options={this.props.options}
83
+ onChange={(e: any) => this.props.onChange(e)}
84
+ display="chip"
85
+ filter={this.props.filter}
86
+ filterBy={this.props.optionLabel}
87
+ appendTo={document.body}
88
+ placeholder={this.props.placeholder}
89
+ optionLabel={this.props.optionLabel}
90
+ emptyFilterMessage={this.props.emptyFilterMessage}
91
+ filterPlaceholder={this.props.filterPlaceholder}
92
+ itemTemplate={this.props.itemTemplate}
93
+ selectedItemTemplate={this.props.selectedItemTemplate}
94
+ maxSelectedLabels={this.props.maxSelectedLabels ?? 4}
95
+ selectedItemsLabel={this.props.selectedItemsLabel}
96
+ ariaLabelledBy={this.props.ariaLabelledBy}
97
+ tabIndex={this.props.tabIndex ? this.props.tabIndex : '0'}
98
+ showClear={this.props.showClear}
99
+ disabled={this.props.disabled}
100
+ />
101
+
102
+ <div className='sd-input__message-box'>
103
+ {this.props.info && !this.props.invalid && !this.state.invalid ?
104
+ <div className='sd-input__hint'>{this.props.info}</div> : null}
105
+ {this.props.invalid || this.state.invalid ?
106
+ <div className='sd-input__message'>{this.props.error}</div>
107
+ : null}
108
+ </div>
109
+ </div>
67
110
  );
68
111
  }
69
112
  }
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import classNames from 'classnames';
3
3
  import { Icon } from './Icon';
4
+ import { Badge } from './Badge';
4
5
  interface IProps {
5
6
  id?: string;
6
7
  icon?: string;
@@ -11,6 +12,7 @@ interface IProps {
11
12
  state?: 'normal' | 'active'; // defaults to 'normal'
12
13
  value?: 'button' | 'submit' | 'reset'; // defaults to 'button'
13
14
  onClick(): void;
15
+ badgeValue?: string;
14
16
  }
15
17
  export class NavButton extends React.PureComponent<IProps> {
16
18
  render() {
@@ -28,6 +30,8 @@ export class NavButton extends React.PureComponent<IProps> {
28
30
  onClick={this.props.onClick}
29
31
  aria-label={this.props.text}
30
32
  id={this.props.id}>
33
+ {this.props.badgeValue &&
34
+ <Badge text={this.props.badgeValue} type='primary' />}
31
35
  {this.props.icon ? <Icon name={this.props.icon} size={this.props.iconSize} /> : null}
32
36
  {!this.props.icon && this.props.text ?
33
37
  <span className="sd-navbtn__text">{this.props.text}</span> : null}