@dtdot/lego 2.0.0-4 → 2.0.0-6
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.
- package/build/components/Button/Button.component.js +2 -2
- package/build/components/MinimalMenu/MinimalMenu.component.d.ts +1 -0
- package/build/components/MinimalMenu/MinimalMenu.component.js +2 -0
- package/build/components/MinimalMenu/_MinimalMenuHeader.component.d.ts +15 -0
- package/build/components/MinimalMenu/_MinimalMenuHeader.component.js +31 -0
- package/package.json +1 -1
|
@@ -35,7 +35,7 @@ const IconOuter = styled.span `
|
|
|
35
35
|
color: ${(props) => getThemeVariantColours(props.variant, props.theme).contrastText};
|
|
36
36
|
background-color: ${(props) => getThemeVariantColours(props.variant, props.theme).darker};
|
|
37
37
|
|
|
38
|
-
height: ${(props) => getIconContainerSizePx(props.size).height};
|
|
38
|
+
height: ${(props) => props.height || getIconContainerSizePx(props.size).height};
|
|
39
39
|
width: ${(props) => getIconContainerSizePx(props.size).width};
|
|
40
40
|
`;
|
|
41
41
|
const StyledButton = styled.button `
|
|
@@ -108,7 +108,7 @@ const Button = React.forwardRef(function Button(props, ref) {
|
|
|
108
108
|
return (React.createElement(StyledButton, { ref: ref, width: width, height: height, alignSelf: alignSelf, marginTop: marginTop, variant: variant, size: size, type: type, onClick: onClick, "data-cy": dataCy || 'button' }, loading ? (React.createElement(SpinnerContainer, null,
|
|
109
109
|
React.createElement(ButtonSpinner, { "data-cy": 'button-loading-spinner', variant: variant, size: size }))) : (React.createElement(ButtonInner, null,
|
|
110
110
|
children && React.createElement(ButtonTextContainer, { size: size }, children),
|
|
111
|
-
icon && (React.createElement(IconOuter, { variant: variant, size: size },
|
|
111
|
+
icon && (React.createElement(IconOuter, { variant: variant, size: size, height: height },
|
|
112
112
|
React.createElement(FontAwesomeIcon, { icon: icon })))))));
|
|
113
113
|
});
|
|
114
114
|
export default Button;
|
|
@@ -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;
|