@dtdot/lego 2.0.0-3 → 2.0.0-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.
@@ -6,5 +6,6 @@ declare const Heading: {
6
6
  ({ children }: HeadingProps): JSX.Element;
7
7
  SubHeading: import("styled-components").StyledComponent<"h3", import("styled-components").DefaultTheme, {}, never>;
8
8
  FormHeading: import("styled-components").StyledComponent<"h3", import("styled-components").DefaultTheme, {}, never>;
9
+ DividerHeading: import("styled-components").StyledComponent<"h3", import("styled-components").DefaultTheme, {}, never>;
9
10
  };
10
11
  export default Heading;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import styled from 'styled-components';
3
+ import DividerHeading from './_DividerHeading.component';
3
4
  import FormHeading from './_FormHeading.component';
4
5
  import SubHeading from './_SubHeading.component';
5
6
  const HeadingContainer = styled.h2 `
@@ -14,4 +15,5 @@ const HeadingContainer = styled.h2 `
14
15
  const Heading = ({ children }) => React.createElement(HeadingContainer, null, children);
15
16
  Heading.SubHeading = SubHeading;
16
17
  Heading.FormHeading = FormHeading;
18
+ Heading.DividerHeading = DividerHeading;
17
19
  export default Heading;
@@ -0,0 +1,2 @@
1
+ declare const DividerHeading: import("styled-components").StyledComponent<"h3", import("styled-components").DefaultTheme, {}, never>;
2
+ export default DividerHeading;
@@ -0,0 +1,15 @@
1
+ import styled from 'styled-components';
2
+ const DividerHeading = styled.h3 `
3
+ font-family: ${(props) => props.theme.fonts.default.family};
4
+ font-size: ${(props) => props.theme.fonts.default.size};
5
+ font-weight: ${(props) => props.theme.fonts.default.weight};
6
+
7
+ color: ${(props) => props.theme.colours.defaultFont};
8
+
9
+ width: 100%;
10
+ padding: 8px;
11
+
12
+ background-color: ${(props) => props.theme.colours.cardBackground};
13
+ box-shadow: ${(props) => props.theme.shadows.small};
14
+ `;
15
+ export default DividerHeading;
@@ -4,6 +4,7 @@ export interface MinimalMenuProps {
4
4
  }
5
5
  declare const MinimalMenu: {
6
6
  ({ children }: MinimalMenuProps): JSX.Element;
7
+ Header: ({ hiddenMenu, text, rightContent }: import("./_MinimalMenuHeader.component").MinimalMenuHeaderProps) => JSX.Element;
7
8
  Item: ({ icon, active, onClick, "data-cy": dataCy }: import("./_MinimalMenuItem.component").MinimalMenuItemProps) => JSX.Element;
8
9
  Page: ({ children, hiddenMenu }: import("./_MinimalMenuPage.component").MinimalMenuPageProps) => JSX.Element;
9
10
  };
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { useIsScreenSize } from '../../responsive/responsive';
3
+ import MinimalMenuHeader from './_MinimalMenuHeader.component';
3
4
  import MinimalMenuItem from './_MinimalMenuItem.component';
4
5
  import MinimalMenuPage from './_MinimalMenuPage.component';
5
6
  import DesktopMinimalMenuContainer from './desktop/_DesktopMinimalMenuContainer.component';
@@ -11,6 +12,7 @@ const MinimalMenu = ({ children }) => {
11
12
  }
12
13
  return React.createElement(DesktopMinimalMenuContainer, null, children);
13
14
  };
15
+ MinimalMenu.Header = MinimalMenuHeader;
14
16
  MinimalMenu.Item = MinimalMenuItem;
15
17
  MinimalMenu.Page = MinimalMenuPage;
16
18
  export default MinimalMenu;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ export interface MinimalMenuHeaderProps {
3
+ /** Set the page to be in hidden menu mode.
4
+ * This is useful for rendering your app and preventing re-renders between a un-authenticated no-menu mode and the regular authenticated mode
5
+ **/
6
+ hiddenMenu?: boolean;
7
+ text?: string;
8
+ rightContent?: React.ReactNode;
9
+ }
10
+ /**
11
+ * A header that is designed to be nested within the page content.
12
+ * You can use a header per page or simply use a single header for your entire application.
13
+ */
14
+ declare const MinimalMenuHeader: ({ hiddenMenu, text, rightContent }: MinimalMenuHeaderProps) => JSX.Element;
15
+ export default MinimalMenuHeader;
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ const MinimalMenuHeaderContainer = styled.div ``;
4
+ const Header = styled.div `
5
+ height: 48px;
6
+ background-color: ${(props) => props.theme.colours.cardBackground};
7
+
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: space-between;
11
+ `;
12
+ const HeaderItem = styled.div `
13
+ padding: 0 16px;
14
+ `;
15
+ const TitleText = styled.div `
16
+ font-family: ${(props) => props.theme.fonts.subHeading.family};
17
+ font-size: ${(props) => props.theme.fonts.subHeading.size};
18
+ font-weight: ${(props) => props.theme.fonts.subHeading.weight};
19
+ color: ${(props) => props.theme.colours.defaultFont};
20
+ `;
21
+ /**
22
+ * A header that is designed to be nested within the page content.
23
+ * You can use a header per page or simply use a single header for your entire application.
24
+ */
25
+ const MinimalMenuHeader = ({ hiddenMenu, text, rightContent }) => {
26
+ return (React.createElement(MinimalMenuHeaderContainer, { hiddenMenu: !!hiddenMenu },
27
+ React.createElement(Header, null,
28
+ React.createElement(HeaderItem, null, text && React.createElement(TitleText, null, text)),
29
+ React.createElement(HeaderItem, null, rightContent))));
30
+ };
31
+ export default MinimalMenuHeader;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dtdot/lego",
3
- "version": "2.0.0-3",
3
+ "version": "2.0.0-5",
4
4
  "description": "Some reusable components for building my applications",
5
5
  "main": "build/index.js",
6
6
  "scripts": {