@dtdot/lego 0.14.0
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/colours/colours.d.ts +16 -0
- package/build/colours/colours.js +15 -0
- package/build/components/ActionMessage/ActionMessage.component.d.ts +9 -0
- package/build/components/ActionMessage/ActionMessage.component.js +27 -0
- package/build/components/ActionMessage/ActionMessage.stories.d.ts +6 -0
- package/build/components/ActionMessage/ActionMessage.stories.js +20 -0
- package/build/components/Alert/Alert.component.d.ts +16 -0
- package/build/components/Alert/Alert.component.js +54 -0
- package/build/components/Alert/Alert.stories.d.ts +8 -0
- package/build/components/Alert/Alert.stories.js +21 -0
- package/build/components/Badge/Badge.component.d.ts +9 -0
- package/build/components/Badge/Badge.component.js +20 -0
- package/build/components/Badge/Badge.stories.d.ts +5 -0
- package/build/components/Badge/Badge.stories.js +18 -0
- package/build/components/Button/Button.component.d.ts +11 -0
- package/build/components/Button/Button.component.js +60 -0
- package/build/components/Button/Button.context.d.ts +8 -0
- package/build/components/Button/Button.context.js +7 -0
- package/build/components/Button/Button.stories.d.ts +7 -0
- package/build/components/Button/Button.stories.js +27 -0
- package/build/components/ButtonGroup/ButtonGroup.component.d.ts +6 -0
- package/build/components/ButtonGroup/ButtonGroup.component.js +17 -0
- package/build/components/ButtonGroup/ButtonGroup.stories.d.ts +7 -0
- package/build/components/ButtonGroup/ButtonGroup.stories.js +17 -0
- package/build/components/Card/Card.component.d.ts +19 -0
- package/build/components/Card/Card.component.js +101 -0
- package/build/components/Card/Card.context.d.ts +9 -0
- package/build/components/Card/Card.context.js +7 -0
- package/build/components/Card/Card.stories.d.ts +9 -0
- package/build/components/Card/Card.stories.js +64 -0
- package/build/components/Card/CardGroup.component.d.ts +9 -0
- package/build/components/Card/CardGroup.component.js +31 -0
- package/build/components/Card/_CardActions.component.d.ts +10 -0
- package/build/components/Card/_CardActions.component.js +48 -0
- package/build/components/Card/_CardContent.component.d.ts +6 -0
- package/build/components/Card/_CardContent.component.js +24 -0
- package/build/components/Card/_CardHeader.component.d.ts +9 -0
- package/build/components/Card/_CardHeader.component.js +48 -0
- package/build/components/Card/_CardMedia.component.d.ts +6 -0
- package/build/components/Card/_CardMedia.component.js +48 -0
- package/build/components/Card/_CardSpacer.component.d.ts +3 -0
- package/build/components/Card/_CardSpacer.component.js +4 -0
- package/build/components/Card/_CardSubContent.component.d.ts +6 -0
- package/build/components/Card/_CardSubContent.component.js +24 -0
- package/build/components/ControlGroup/ControlGroup.component.d.ts +11 -0
- package/build/components/ControlGroup/ControlGroup.component.js +75 -0
- package/build/components/ControlGroup/ControlGroup.stories.d.ts +7 -0
- package/build/components/ControlGroup/ControlGroup.stories.js +24 -0
- package/build/components/ControlGroup/_ControlGroupSpacer.component.d.ts +3 -0
- package/build/components/ControlGroup/_ControlGroupSpacer.component.js +4 -0
- package/build/components/FancyCheckbox/FancyCheckbox.component.d.ts +14 -0
- package/build/components/FancyCheckbox/FancyCheckbox.component.js +53 -0
- package/build/components/FancyCheckbox/FancyCheckbox.stories.d.ts +5 -0
- package/build/components/FancyCheckbox/FancyCheckbox.stories.js +29 -0
- package/build/components/Form/Form.component.d.ts +9 -0
- package/build/components/Form/Form.component.js +24 -0
- package/build/components/Form/Form.stories.d.ts +5 -0
- package/build/components/Form/Form.stories.js +21 -0
- package/build/components/Form/FormState.context.d.ts +7 -0
- package/build/components/Form/FormState.context.js +6 -0
- package/build/components/Form/useFormNode.hook.d.ts +5 -0
- package/build/components/Form/useFormNode.hook.js +16 -0
- package/build/components/Heading/Heading.component.d.ts +6 -0
- package/build/components/Heading/Heading.component.js +13 -0
- package/build/components/Heading/Heading.stories.d.ts +5 -0
- package/build/components/Heading/Heading.stories.js +7 -0
- package/build/components/ImageUpload/ImageUpload.component.d.ts +11 -0
- package/build/components/ImageUpload/ImageUpload.component.js +92 -0
- package/build/components/ImageUpload/ImageUpload.stories.d.ts +8 -0
- package/build/components/ImageUpload/ImageUpload.stories.js +49 -0
- package/build/components/InlineCard/InlineCard.component.d.ts +10 -0
- package/build/components/InlineCard/InlineCard.component.js +20 -0
- package/build/components/InlineCard/InlineCard.stories.d.ts +5 -0
- package/build/components/InlineCard/InlineCard.stories.js +17 -0
- package/build/components/InlineCard/InlineCardGroup.component.d.ts +6 -0
- package/build/components/InlineCard/InlineCardGroup.component.js +17 -0
- package/build/components/InlineCard/_InlineCardContent.component.d.ts +6 -0
- package/build/components/InlineCard/_InlineCardContent.component.js +15 -0
- package/build/components/InlineCard/_InlineCardMedia.component.d.ts +6 -0
- package/build/components/InlineCard/_InlineCardMedia.component.js +17 -0
- package/build/components/Input/Input.component.d.ts +11 -0
- package/build/components/Input/Input.component.js +57 -0
- package/build/components/Input/Input.stories.d.ts +6 -0
- package/build/components/Input/Input.stories.js +12 -0
- package/build/components/LiveInput/LiveInput.component.d.ts +10 -0
- package/build/components/LiveInput/LiveInput.component.js +22 -0
- package/build/components/LiveInput/LiveInput.stories.d.ts +6 -0
- package/build/components/LiveInput/LiveInput.stories.js +12 -0
- package/build/components/Loader/Loader.component.d.ts +3 -0
- package/build/components/Loader/Loader.component.js +48 -0
- package/build/components/Loader/Loader.stories.d.ts +5 -0
- package/build/components/Loader/Loader.stories.js +9 -0
- package/build/components/Menu/Menu.component.d.ts +13 -0
- package/build/components/Menu/Menu.component.js +26 -0
- package/build/components/Menu/Menu.stories.d.ts +7 -0
- package/build/components/Menu/Menu.stories.js +98 -0
- package/build/components/Menu/_MenuContent.component.d.ts +10 -0
- package/build/components/Menu/_MenuContent.component.js +31 -0
- package/build/components/Menu/_MenuContent.context.d.ts +7 -0
- package/build/components/Menu/_MenuContent.context.js +6 -0
- package/build/components/Menu/_MenuHeading.component.d.ts +6 -0
- package/build/components/Menu/_MenuHeading.component.js +27 -0
- package/build/components/Menu/_MenuItem.component.d.ts +10 -0
- package/build/components/Menu/_MenuItem.component.js +50 -0
- package/build/components/Menu/_MenuPage.component.d.ts +6 -0
- package/build/components/Menu/_MenuPage.component.js +39 -0
- package/build/components/Menu/_MenuPanel.component.d.ts +6 -0
- package/build/components/Menu/_MenuPanel.component.js +62 -0
- package/build/components/Menu/menu.helpers.d.ts +4 -0
- package/build/components/Menu/menu.helpers.js +10 -0
- package/build/components/Modal/Modal.component.d.ts +14 -0
- package/build/components/Modal/Modal.component.js +100 -0
- package/build/components/Modal/Modal.stories.d.ts +6 -0
- package/build/components/Modal/Modal.stories.js +55 -0
- package/build/components/Modal/_Modal.context.d.ts +6 -0
- package/build/components/Modal/_Modal.context.js +6 -0
- package/build/components/Modal/_ModalBody.component.d.ts +2 -0
- package/build/components/Modal/_ModalBody.component.js +5 -0
- package/build/components/Modal/_ModalHeader.component.d.ts +7 -0
- package/build/components/Modal/_ModalHeader.component.js +54 -0
- package/build/components/Notification/Notification.component.d.ts +6 -0
- package/build/components/Notification/Notification.component.js +15 -0
- package/build/components/Notification/Notification.stories.d.ts +8 -0
- package/build/components/Notification/Notification.stories.js +28 -0
- package/build/components/Notifications/Notifications.component.d.ts +15 -0
- package/build/components/Notifications/Notifications.component.js +37 -0
- package/build/components/Notifications/Notifications.stories.d.ts +7 -0
- package/build/components/Notifications/Notifications.stories.js +99 -0
- package/build/components/ProfileImage/ProfileImage.component.d.ts +7 -0
- package/build/components/ProfileImage/ProfileImage.component.js +53 -0
- package/build/components/ProfileImage/ProfileImage.stories.d.ts +6 -0
- package/build/components/ProfileImage/ProfileImage.stories.js +8 -0
- package/build/components/QrCode/QrCode.component.d.ts +6 -0
- package/build/components/QrCode/QrCode.component.js +71 -0
- package/build/components/QrCode/QrCode.stories.d.ts +5 -0
- package/build/components/QrCode/QrCode.stories.js +8 -0
- package/build/components/Spacer/Spacer.component.d.ts +7 -0
- package/build/components/Spacer/Spacer.component.js +25 -0
- package/build/components/SquareButton/SquareButton.component.d.ts +9 -0
- package/build/components/SquareButton/SquareButton.component.js +31 -0
- package/build/components/SquareButton/SquareButton.stories.d.ts +5 -0
- package/build/components/SquareButton/SquareButton.stories.js +14 -0
- package/build/components/SubHeading/SubHeading.component.d.ts +2 -0
- package/build/components/SubHeading/SubHeading.component.js +11 -0
- package/build/components/SubHeading/SubHeading.stories.d.ts +5 -0
- package/build/components/SubHeading/SubHeading.stories.js +7 -0
- package/build/components/Table/Table.component.d.ts +16 -0
- package/build/components/Table/Table.component.js +24 -0
- package/build/components/Table/Table.stories.d.ts +7 -0
- package/build/components/Table/Table.stories.js +39 -0
- package/build/components/Table/_Table.context.d.ts +7 -0
- package/build/components/Table/_Table.context.js +5 -0
- package/build/components/Table/_TableRow.component.d.ts +6 -0
- package/build/components/Table/_TableRow.component.js +17 -0
- package/build/components/Text/Text.component.d.ts +8 -0
- package/build/components/Text/Text.component.js +26 -0
- package/build/components/Text/Text.stories.d.ts +6 -0
- package/build/components/Text/Text.stories.js +11 -0
- package/build/constants/zIndex.constants.d.ts +6 -0
- package/build/constants/zIndex.constants.js +5 -0
- package/build/contexts/File.context.d.ts +7 -0
- package/build/contexts/File.context.js +8 -0
- package/build/examples/Modal.stories.d.ts +5 -0
- package/build/examples/Modal.stories.js +37 -0
- package/build/global/BodyStyle.component.d.ts +2 -0
- package/build/global/BodyStyle.component.js +16 -0
- package/build/hooks/useForm.d.ts +7 -0
- package/build/hooks/useForm.js +20 -0
- package/build/index.d.ts +47 -0
- package/build/index.js +43 -0
- package/build/layouts/Action/Action.layout.d.ts +17 -0
- package/build/layouts/Action/Action.layout.js +45 -0
- package/build/layouts/Action/Action.stories.d.ts +6 -0
- package/build/layouts/Action/Action.stories.js +14 -0
- package/build/layouts/Centered/Centered.layout.d.ts +2 -0
- package/build/layouts/Centered/Centered.layout.js +6 -0
- package/build/layouts/Centered/Centered.stories.d.ts +5 -0
- package/build/layouts/Centered/Centered.stories.js +8 -0
- package/build/layouts/Column/Column.layout.d.ts +6 -0
- package/build/layouts/Column/Column.layout.js +5 -0
- package/build/layouts/Column/Column.stories.d.ts +5 -0
- package/build/layouts/Column/Column.stories.js +8 -0
- package/build/layouts/Content/Content.layout.d.ts +10 -0
- package/build/layouts/Content/Content.layout.js +11 -0
- package/build/layouts/Content/Content.stories.d.ts +9 -0
- package/build/layouts/Content/Content.stories.js +37 -0
- package/build/layouts/Content/_ContentContent.component.d.ts +8 -0
- package/build/layouts/Content/_ContentContent.component.js +29 -0
- package/build/layouts/Content/_ContentHeader.component.d.ts +7 -0
- package/build/layouts/Content/_ContentHeader.component.js +17 -0
- package/build/layouts/Emphasis/Emphasis.layout.d.ts +6 -0
- package/build/layouts/Emphasis/Emphasis.layout.js +39 -0
- package/build/layouts/Focus/Focus.layout.d.ts +6 -0
- package/build/layouts/Focus/Focus.layout.js +28 -0
- package/build/layouts/Focus/Focus.stories.d.ts +5 -0
- package/build/layouts/Focus/Focus.stories.js +16 -0
- package/build/layouts/Padded/Padded.layout.d.ts +9 -0
- package/build/layouts/Padded/Padded.layout.js +11 -0
- package/build/layouts/Padded/Padded.stories.d.ts +6 -0
- package/build/layouts/Padded/Padded.stories.js +10 -0
- package/build/responsive/responsive.d.ts +13 -0
- package/build/responsive/responsive.js +63 -0
- package/build/screens/Login/Login.screen.d.ts +13 -0
- package/build/screens/Login/Login.screen.js +60 -0
- package/build/screens/Register/Register.screen.d.ts +12 -0
- package/build/screens/Register/Register.screen.js +32 -0
- package/build/screens/Verification/Verification.screen.d.ts +12 -0
- package/build/screens/Verification/Verification.screen.js +39 -0
- package/build/theme/dark.theme.d.ts +3 -0
- package/build/theme/dark.theme.js +73 -0
- package/build/theme/default.theme.d.ts +3 -0
- package/build/theme/default.theme.js +74 -0
- package/build/theme/helpers/getThemeControlColours.d.ts +10 -0
- package/build/theme/helpers/getThemeControlColours.js +10 -0
- package/build/theme/helpers/getThemeStatusColour.d.ts +4 -0
- package/build/theme/helpers/getThemeStatusColour.js +14 -0
- package/build/theme/helpers/getThemeVariantColours.d.ts +8 -0
- package/build/theme/helpers/getThemeVariantColours.js +23 -0
- package/build/theme/theme.types.d.ts +2 -0
- package/build/theme/theme.types.js +1 -0
- package/build/theme/themes.d.ts +5 -0
- package/build/theme/themes.js +7 -0
- package/package.json +65 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare type ContentSize = 'sm' | 'md' | 'lg' | 'full';
|
|
3
|
+
export interface ContentContentActions {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
size?: ContentSize;
|
|
6
|
+
}
|
|
7
|
+
declare const ContentContent: ({ children, size }: ContentContentActions) => JSX.Element;
|
|
8
|
+
export default ContentContent;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import responsive from '../../responsive/responsive';
|
|
4
|
+
const getWidth = (size) => {
|
|
5
|
+
switch (size) {
|
|
6
|
+
case 'sm':
|
|
7
|
+
return responsive.getWidthFor('mobile');
|
|
8
|
+
case 'md':
|
|
9
|
+
return responsive.getWidthFor('tablet');
|
|
10
|
+
case 'lg':
|
|
11
|
+
return responsive.getWidthFor('desktop');
|
|
12
|
+
case 'full':
|
|
13
|
+
default:
|
|
14
|
+
return 'calc(100% - 32px)';
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const ContentOuter = styled.div `
|
|
18
|
+
display: flex;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
padding: 16px;
|
|
21
|
+
`;
|
|
22
|
+
const ContentInner = styled.div `
|
|
23
|
+
width: ${(props) => getWidth(props.size)};
|
|
24
|
+
`;
|
|
25
|
+
const ContentContent = ({ children, size = 'full' }) => {
|
|
26
|
+
return (React.createElement(ContentOuter, null,
|
|
27
|
+
React.createElement(ContentInner, { size: size }, children)));
|
|
28
|
+
};
|
|
29
|
+
export default ContentContent;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
const HeaderContainer = styled.div `
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: space-between;
|
|
6
|
+
padding: 16px;
|
|
7
|
+
`;
|
|
8
|
+
const ActionsContainer = styled.div `
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
`;
|
|
12
|
+
const ContentHeader = ({ children, actions }) => {
|
|
13
|
+
return (React.createElement(HeaderContainer, null,
|
|
14
|
+
React.createElement("div", null, children),
|
|
15
|
+
actions && React.createElement(ActionsContainer, null, actions)));
|
|
16
|
+
};
|
|
17
|
+
export default ContentHeader;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import responsive from '../../responsive/responsive';
|
|
4
|
+
const EmphasisOuter = styled.div `
|
|
5
|
+
position: fixed;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
top: 0;
|
|
9
|
+
left: 0;
|
|
10
|
+
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
|
|
16
|
+
background-color: ${(props) => props.theme.colours.overlayBackground};
|
|
17
|
+
`;
|
|
18
|
+
const EmphasisInner = styled.div `
|
|
19
|
+
background-color: ${(props) => props.theme.colours.background};
|
|
20
|
+
|
|
21
|
+
width: 600px;
|
|
22
|
+
padding: 48px;
|
|
23
|
+
|
|
24
|
+
${responsive.useStylesFor('mobile').andSmaller(`
|
|
25
|
+
width: 100%;
|
|
26
|
+
height: 100%;
|
|
27
|
+
padding: 16px;
|
|
28
|
+
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
padding-bottom: 128px;
|
|
33
|
+
`)};
|
|
34
|
+
`;
|
|
35
|
+
const EmphasisLayout = ({ children }) => {
|
|
36
|
+
return (React.createElement(EmphasisOuter, null,
|
|
37
|
+
React.createElement(EmphasisInner, null, children)));
|
|
38
|
+
};
|
|
39
|
+
export default EmphasisLayout;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import responsive from '../../responsive/responsive';
|
|
4
|
+
const FocusOuter = styled.div `
|
|
5
|
+
width: 100%;
|
|
6
|
+
|
|
7
|
+
background-color: ${(props) => props.theme.colours.background};
|
|
8
|
+
padding: 32px 16px;
|
|
9
|
+
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
|
|
13
|
+
${responsive.useStylesFor('mobile').andSmaller(`
|
|
14
|
+
padding-top: 64px;
|
|
15
|
+
`)};
|
|
16
|
+
`;
|
|
17
|
+
const FocusInner = styled.div `
|
|
18
|
+
width: ${responsive.getWidthFor('mobile')};
|
|
19
|
+
|
|
20
|
+
${responsive.useStylesFor('mobile').andSmaller(`
|
|
21
|
+
width: 100%;
|
|
22
|
+
`)};
|
|
23
|
+
`;
|
|
24
|
+
const FocusLayout = ({ children }) => {
|
|
25
|
+
return (React.createElement(FocusOuter, null,
|
|
26
|
+
React.createElement(FocusInner, null, children)));
|
|
27
|
+
};
|
|
28
|
+
export default FocusLayout;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button, ControlGroup, FocusLayout, Heading, Input, Spacer, Text } from '../..';
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
4
|
+
export const Standard = () => (React.createElement(FocusLayout, null,
|
|
5
|
+
React.createElement(Heading, null, "Lets get setup.."),
|
|
6
|
+
React.createElement(Spacer, { size: '4x' }),
|
|
7
|
+
React.createElement(ControlGroup, { variation: 'submission' },
|
|
8
|
+
React.createElement(Text, null, "Enter your name here. This will be used to identify you when connecting with friends."),
|
|
9
|
+
React.createElement(ControlGroup.Spacer, null),
|
|
10
|
+
React.createElement(Input, { name: 'name', placeholder: 'name' }),
|
|
11
|
+
React.createElement(ControlGroup.Spacer, null),
|
|
12
|
+
React.createElement(Button, null, "Next"))));
|
|
13
|
+
export default {
|
|
14
|
+
title: 'Layouts/Focus',
|
|
15
|
+
component: FocusLayout,
|
|
16
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface PaddedLayoutProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
declare const PaddedLayout: {
|
|
6
|
+
({ children }: PaddedLayoutProps): JSX.Element;
|
|
7
|
+
Small: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
8
|
+
};
|
|
9
|
+
export default PaddedLayout;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
const SmallPaddedLayout = styled.div `
|
|
4
|
+
padding: 8px;
|
|
5
|
+
`;
|
|
6
|
+
const PaddedLayoutDiv = styled.div `
|
|
7
|
+
padding: 16px;
|
|
8
|
+
`;
|
|
9
|
+
const PaddedLayout = ({ children }) => React.createElement(PaddedLayoutDiv, null, children);
|
|
10
|
+
PaddedLayout.Small = SmallPaddedLayout;
|
|
11
|
+
export default PaddedLayout;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Meta } from '@storybook/react/types-6-0';
|
|
3
|
+
export declare const Standard: () => JSX.Element;
|
|
4
|
+
export declare const Small: () => JSX.Element;
|
|
5
|
+
declare const _default: Meta<import("@storybook/react/types-6-0").Args>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PaddedLayout } from '../..';
|
|
3
|
+
export const Standard = () => (React.createElement("div", { style: { backgroundColor: 'white' } },
|
|
4
|
+
React.createElement(PaddedLayout, null, "some content....")));
|
|
5
|
+
export const Small = () => (React.createElement("div", { style: { backgroundColor: 'white' } },
|
|
6
|
+
React.createElement(PaddedLayout.Small, null, "some content....")));
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Layouts/Padded',
|
|
9
|
+
component: PaddedLayout,
|
|
10
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare type ScreenSize = 'mobile' | 'tablet' | 'desktop' | 'wide';
|
|
2
|
+
export interface IStyleBoundFunctions {
|
|
3
|
+
andSmaller: (styled: string | TemplateStringsArray, ...templateArgs: any) => string;
|
|
4
|
+
andLarger: (styled: string | TemplateStringsArray, ...templateArgs: any) => string;
|
|
5
|
+
only: (styled: string | TemplateStringsArray, ...templateArgs: any) => string;
|
|
6
|
+
}
|
|
7
|
+
declare function useStylesFor(screenSize: ScreenSize): IStyleBoundFunctions;
|
|
8
|
+
declare function getWidthFor(screenSize: ScreenSize): string;
|
|
9
|
+
declare const _default: {
|
|
10
|
+
useStylesFor: typeof useStylesFor;
|
|
11
|
+
getWidthFor: typeof getWidthFor;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const responsiveScreens = {
|
|
2
|
+
mobile: {
|
|
3
|
+
min: 0,
|
|
4
|
+
max: 480,
|
|
5
|
+
},
|
|
6
|
+
tablet: {
|
|
7
|
+
min: 481,
|
|
8
|
+
max: 768,
|
|
9
|
+
},
|
|
10
|
+
desktop: {
|
|
11
|
+
min: 769,
|
|
12
|
+
max: 1200,
|
|
13
|
+
},
|
|
14
|
+
wide: {
|
|
15
|
+
min: 1201,
|
|
16
|
+
max: 3840,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
function useStylesFor(screenSize) {
|
|
20
|
+
if (!screenSize) {
|
|
21
|
+
return {
|
|
22
|
+
andSmaller: () => '',
|
|
23
|
+
andLarger: () => '',
|
|
24
|
+
only: () => '',
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const screenDefinition = responsiveScreens[screenSize];
|
|
28
|
+
if (!screenDefinition) {
|
|
29
|
+
return {
|
|
30
|
+
andSmaller: () => '',
|
|
31
|
+
andLarger: () => '',
|
|
32
|
+
only: () => '',
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
andSmaller: (styles) => `
|
|
37
|
+
@media only screen and (max-width: ${screenDefinition.max}px) {
|
|
38
|
+
${styles}
|
|
39
|
+
}
|
|
40
|
+
`,
|
|
41
|
+
andLarger: (styles) => `
|
|
42
|
+
@media only screen and (min-width: ${screenDefinition.min}px) {
|
|
43
|
+
${styles}
|
|
44
|
+
}
|
|
45
|
+
`,
|
|
46
|
+
only: (styles) => `
|
|
47
|
+
@media only screen and (min-width: ${screenDefinition.min}px) and (max-width: ${screenDefinition.max}px) {
|
|
48
|
+
${styles}
|
|
49
|
+
}
|
|
50
|
+
`,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function getWidthFor(screenSize) {
|
|
54
|
+
if (!screenSize) {
|
|
55
|
+
return '';
|
|
56
|
+
}
|
|
57
|
+
const screenDefinition = responsiveScreens[screenSize];
|
|
58
|
+
if (!screenDefinition) {
|
|
59
|
+
return '';
|
|
60
|
+
}
|
|
61
|
+
return `${screenDefinition.max}px`;
|
|
62
|
+
}
|
|
63
|
+
export default { useStylesFor, getWidthFor };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface LoginData {
|
|
3
|
+
email?: string;
|
|
4
|
+
password?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface LoginScreenProps {
|
|
7
|
+
handleLogin: (data: LoginData) => void;
|
|
8
|
+
onRegisterClicked: () => void;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
error?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const LoginScreen: ({ loading, error, handleLogin, onRegisterClicked }: LoginScreenProps) => JSX.Element;
|
|
13
|
+
export default LoginScreen;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import Button from '../../components/Button/Button.component';
|
|
4
|
+
import ControlGroup from '../../components/ControlGroup/ControlGroup.component';
|
|
5
|
+
import Form from '../../components/Form/Form.component';
|
|
6
|
+
import Heading from '../../components/Heading/Heading.component';
|
|
7
|
+
import Input from '../../components/Input/Input.component';
|
|
8
|
+
import Spacer from '../../components/Spacer/Spacer.component';
|
|
9
|
+
import EmphasisLayout from '../../layouts/Emphasis/Emphasis.layout';
|
|
10
|
+
const ErrorText = styled.div `
|
|
11
|
+
font-family: ${(props) => props.theme.fonts.default.family};
|
|
12
|
+
font-size: ${(props) => props.theme.fonts.default.size};
|
|
13
|
+
|
|
14
|
+
line-height: ${(props) => props.theme.fonts.default.size};
|
|
15
|
+
min-height: ${(props) => props.theme.fonts.default.size};
|
|
16
|
+
|
|
17
|
+
color: ${(props) => props.theme.colours.statusDanger.main};
|
|
18
|
+
`;
|
|
19
|
+
const CreateAccountMessage = styled.div `
|
|
20
|
+
font-family: ${(props) => props.theme.fonts.default.family};
|
|
21
|
+
font-size: ${(props) => props.theme.fonts.default.size};
|
|
22
|
+
|
|
23
|
+
color: ${(props) => props.theme.colours.defaultFont};
|
|
24
|
+
`;
|
|
25
|
+
const CreateAccountButton = styled.button `
|
|
26
|
+
font-family: ${(props) => props.theme.fonts.default.family};
|
|
27
|
+
font-size: ${(props) => props.theme.fonts.default.size};
|
|
28
|
+
color: ${(props) => props.theme.colours.defaultFont};
|
|
29
|
+
|
|
30
|
+
outline: none;
|
|
31
|
+
border: none;
|
|
32
|
+
padding: 0;
|
|
33
|
+
margin: 0;
|
|
34
|
+
background-color: transparent;
|
|
35
|
+
|
|
36
|
+
font-weight: normal;
|
|
37
|
+
|
|
38
|
+
box-shadow: none;
|
|
39
|
+
text-decoration: underline;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
`;
|
|
42
|
+
const LoginScreen = ({ loading, error, handleLogin, onRegisterClicked }) => {
|
|
43
|
+
const [value, setValue] = useState({ email: '', password: '' });
|
|
44
|
+
return (React.createElement(EmphasisLayout, null,
|
|
45
|
+
React.createElement(Heading, null, "Welcome"),
|
|
46
|
+
React.createElement(Spacer, { size: '4x' }),
|
|
47
|
+
React.createElement(Form, { value: value, onChange: setValue, onSubmit: () => handleLogin(value) },
|
|
48
|
+
React.createElement(ControlGroup, null,
|
|
49
|
+
React.createElement(ErrorText, null, error),
|
|
50
|
+
React.createElement(Input, { name: 'email', placeholder: 'Email', type: 'text' }),
|
|
51
|
+
React.createElement(Input, { name: 'password', placeholder: 'Password', type: 'password' }),
|
|
52
|
+
React.createElement(ControlGroup.Spacer, null),
|
|
53
|
+
React.createElement(Button, { type: 'submit', loading: loading }, "Login"))),
|
|
54
|
+
React.createElement(Spacer, { size: '6x' }),
|
|
55
|
+
React.createElement(CreateAccountMessage, null,
|
|
56
|
+
`Don't have an account?`,
|
|
57
|
+
" ",
|
|
58
|
+
React.createElement(CreateAccountButton, { onClick: onRegisterClicked }, "sign up now"))));
|
|
59
|
+
};
|
|
60
|
+
export default LoginScreen;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface RegisterData {
|
|
3
|
+
email?: string;
|
|
4
|
+
password?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface RegisterScreenProps {
|
|
7
|
+
handleRegister: (data: RegisterData) => void;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
error?: string;
|
|
10
|
+
}
|
|
11
|
+
declare const RegisterScreen: ({ loading, error, handleRegister }: RegisterScreenProps) => JSX.Element;
|
|
12
|
+
export default RegisterScreen;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import Button from '../../components/Button/Button.component';
|
|
4
|
+
import ControlGroup from '../../components/ControlGroup/ControlGroup.component';
|
|
5
|
+
import Form from '../../components/Form/Form.component';
|
|
6
|
+
import Heading from '../../components/Heading/Heading.component';
|
|
7
|
+
import Input from '../../components/Input/Input.component';
|
|
8
|
+
import Spacer from '../../components/Spacer/Spacer.component';
|
|
9
|
+
import EmphasisLayout from '../../layouts/Emphasis/Emphasis.layout';
|
|
10
|
+
const ErrorText = styled.div `
|
|
11
|
+
font-family: ${(props) => props.theme.fonts.default.family};
|
|
12
|
+
font-size: ${(props) => props.theme.fonts.default.size};
|
|
13
|
+
|
|
14
|
+
line-height: ${(props) => props.theme.fonts.default.size};
|
|
15
|
+
min-height: ${(props) => props.theme.fonts.default.size};
|
|
16
|
+
|
|
17
|
+
color: ${(props) => props.theme.colours.statusDanger.main};
|
|
18
|
+
`;
|
|
19
|
+
const RegisterScreen = ({ loading, error, handleRegister }) => {
|
|
20
|
+
const [value, setValue] = useState({ email: '', password: '' });
|
|
21
|
+
return (React.createElement(EmphasisLayout, null,
|
|
22
|
+
React.createElement(Heading, null, "Register"),
|
|
23
|
+
React.createElement(Spacer, { size: '4x' }),
|
|
24
|
+
React.createElement(Form, { value: value, onChange: setValue, onSubmit: () => handleRegister(value) },
|
|
25
|
+
React.createElement(ControlGroup, null,
|
|
26
|
+
React.createElement(ErrorText, null, error),
|
|
27
|
+
React.createElement(Input, { name: 'email', placeholder: 'Email', type: 'text' }),
|
|
28
|
+
React.createElement(Input, { name: 'password', placeholder: 'Password', type: 'password' }),
|
|
29
|
+
React.createElement(ControlGroup.Spacer, null),
|
|
30
|
+
React.createElement(Button, { type: 'submit', loading: loading }, "Create Account")))));
|
|
31
|
+
};
|
|
32
|
+
export default RegisterScreen;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface VerificationData {
|
|
3
|
+
code?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface VerificationScreenProps {
|
|
6
|
+
handleVerification: (data: VerificationData) => void;
|
|
7
|
+
message?: string;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
error?: string;
|
|
10
|
+
}
|
|
11
|
+
declare const VerificationScreen: ({ message, loading, error, handleVerification }: VerificationScreenProps) => JSX.Element;
|
|
12
|
+
export default VerificationScreen;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import Button from '../../components/Button/Button.component';
|
|
4
|
+
import ControlGroup from '../../components/ControlGroup/ControlGroup.component';
|
|
5
|
+
import Form from '../../components/Form/Form.component';
|
|
6
|
+
import Heading from '../../components/Heading/Heading.component';
|
|
7
|
+
import Input from '../../components/Input/Input.component';
|
|
8
|
+
import Spacer from '../../components/Spacer/Spacer.component';
|
|
9
|
+
import EmphasisLayout from '../../layouts/Emphasis/Emphasis.layout';
|
|
10
|
+
const ErrorText = styled.div `
|
|
11
|
+
font-family: ${(props) => props.theme.fonts.default.family};
|
|
12
|
+
font-size: ${(props) => props.theme.fonts.default.size};
|
|
13
|
+
|
|
14
|
+
line-height: ${(props) => props.theme.fonts.default.size};
|
|
15
|
+
min-height: ${(props) => props.theme.fonts.default.size};
|
|
16
|
+
|
|
17
|
+
color: ${(props) => props.theme.colours.statusDanger.main};
|
|
18
|
+
`;
|
|
19
|
+
const MessageContainer = styled.div `
|
|
20
|
+
font-family: ${(props) => props.theme.fonts.default.family};
|
|
21
|
+
font-size: ${(props) => props.theme.fonts.default.size};
|
|
22
|
+
|
|
23
|
+
color: ${(props) => props.theme.colours.defaultFont};
|
|
24
|
+
`;
|
|
25
|
+
const VerificationScreen = ({ message, loading, error, handleVerification }) => {
|
|
26
|
+
const [value, setValue] = useState({ code: '' });
|
|
27
|
+
return (React.createElement(EmphasisLayout, null,
|
|
28
|
+
React.createElement(Heading, null, "Verification"),
|
|
29
|
+
React.createElement(Spacer, { size: '1x' }),
|
|
30
|
+
React.createElement(MessageContainer, null, message),
|
|
31
|
+
React.createElement(Spacer, { size: '2x' }),
|
|
32
|
+
React.createElement(Form, { value: value, onChange: setValue, onSubmit: () => handleVerification(value) },
|
|
33
|
+
React.createElement(ControlGroup, null,
|
|
34
|
+
React.createElement(ErrorText, null, error),
|
|
35
|
+
React.createElement(Input, { name: 'code', placeholder: 'code', type: 'text' }),
|
|
36
|
+
React.createElement(ControlGroup.Spacer, null),
|
|
37
|
+
React.createElement(Button, { type: 'submit', loading: loading }, "Verify")))));
|
|
38
|
+
};
|
|
39
|
+
export default VerificationScreen;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
const darkTheme = {
|
|
2
|
+
name: 'dark',
|
|
3
|
+
colours: {
|
|
4
|
+
background: '#424448',
|
|
5
|
+
overlayBackground: '#a4caf9',
|
|
6
|
+
primary: {
|
|
7
|
+
main: '#61a4f5',
|
|
8
|
+
hover: '#83b7f7',
|
|
9
|
+
contrastText: '#191919',
|
|
10
|
+
},
|
|
11
|
+
secondary: {
|
|
12
|
+
main: '#424448',
|
|
13
|
+
hover: '#4b4e54',
|
|
14
|
+
contrastText: '#e2e2e2',
|
|
15
|
+
},
|
|
16
|
+
tertiary: {
|
|
17
|
+
main: '#4b4e54',
|
|
18
|
+
hover: '#575b63',
|
|
19
|
+
contrastText: '#e2e2e2',
|
|
20
|
+
},
|
|
21
|
+
defaultFont: '#e2e2e2',
|
|
22
|
+
secondaryFont: '#adabab',
|
|
23
|
+
secondaryFontHover: '##989898',
|
|
24
|
+
defaultBorder: '#989898',
|
|
25
|
+
faintBorder: '#cccccc1f',
|
|
26
|
+
controlBackground: '#5e6167',
|
|
27
|
+
controlBorder: '#565656',
|
|
28
|
+
controlBorderFocus: '#4289de',
|
|
29
|
+
controlBorderHover: '#4a4949',
|
|
30
|
+
controlPlaceholder: '#949494',
|
|
31
|
+
uploadBackground: '#5e6167',
|
|
32
|
+
uploadIcon: '#e2e2e2',
|
|
33
|
+
cardBackground: '#494b50',
|
|
34
|
+
statusInfo: {
|
|
35
|
+
main: '#83bfff',
|
|
36
|
+
contrast: '#191919',
|
|
37
|
+
},
|
|
38
|
+
statusSuccess: {
|
|
39
|
+
main: '#8ddaa9',
|
|
40
|
+
contrast: '#191919',
|
|
41
|
+
},
|
|
42
|
+
statusWarn: {
|
|
43
|
+
main: '#f1a374',
|
|
44
|
+
contrast: '#191919',
|
|
45
|
+
},
|
|
46
|
+
statusDanger: {
|
|
47
|
+
main: '#e87a7a',
|
|
48
|
+
contrast: '#191919',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
fonts: {
|
|
52
|
+
default: {
|
|
53
|
+
family: `'Roboto', sans-serif`,
|
|
54
|
+
size: '16px',
|
|
55
|
+
weight: '400',
|
|
56
|
+
},
|
|
57
|
+
heading: {
|
|
58
|
+
family: `'Roboto', sans-serif`,
|
|
59
|
+
size: '36px',
|
|
60
|
+
weight: '500',
|
|
61
|
+
},
|
|
62
|
+
subHeading: {
|
|
63
|
+
family: `'Roboto', sans-serif`,
|
|
64
|
+
size: '24px',
|
|
65
|
+
weight: '400',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
shadows: {
|
|
69
|
+
small: '0px 0px 2px rgba(0, 0, 0, 0.15)',
|
|
70
|
+
medium: '0px 0px 4px rgba(0, 0, 0, 0.15)',
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
export default darkTheme;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import colours from '../colours/colours';
|
|
2
|
+
const defaultTheme = {
|
|
3
|
+
name: 'default',
|
|
4
|
+
colours: {
|
|
5
|
+
background: colours.grey10,
|
|
6
|
+
overlayBackground: colours.grey50,
|
|
7
|
+
primary: {
|
|
8
|
+
main: colours.grey70,
|
|
9
|
+
hover: 'red',
|
|
10
|
+
contrastText: colours.grey10,
|
|
11
|
+
},
|
|
12
|
+
secondary: {
|
|
13
|
+
main: colours.yellow,
|
|
14
|
+
hover: 'red',
|
|
15
|
+
contrastText: colours.grey90,
|
|
16
|
+
},
|
|
17
|
+
tertiary: {
|
|
18
|
+
main: colours.yellow,
|
|
19
|
+
hover: 'red',
|
|
20
|
+
contrastText: colours.grey90,
|
|
21
|
+
},
|
|
22
|
+
defaultFont: colours.grey90,
|
|
23
|
+
secondaryFont: colours.grey35,
|
|
24
|
+
secondaryFontHover: colours.grey40,
|
|
25
|
+
defaultBorder: colours.grey20,
|
|
26
|
+
faintBorder: colours.grey20,
|
|
27
|
+
controlBackground: colours.white,
|
|
28
|
+
controlBorder: colours.grey20,
|
|
29
|
+
controlBorderFocus: colours.grey50,
|
|
30
|
+
controlBorderHover: colours.grey30,
|
|
31
|
+
controlPlaceholder: colours.grey30,
|
|
32
|
+
uploadBackground: colours.grey20,
|
|
33
|
+
uploadIcon: colours.grey10,
|
|
34
|
+
cardBackground: colours.white,
|
|
35
|
+
statusInfo: {
|
|
36
|
+
main: colours.blue,
|
|
37
|
+
contrast: colours.blue,
|
|
38
|
+
},
|
|
39
|
+
statusSuccess: {
|
|
40
|
+
main: colours.green,
|
|
41
|
+
contrast: colours.green,
|
|
42
|
+
},
|
|
43
|
+
statusWarn: {
|
|
44
|
+
main: colours.yellow,
|
|
45
|
+
contrast: colours.yellow,
|
|
46
|
+
},
|
|
47
|
+
statusDanger: {
|
|
48
|
+
main: colours.red,
|
|
49
|
+
contrast: colours.red,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
fonts: {
|
|
53
|
+
default: {
|
|
54
|
+
family: `'Roboto', sans-serif`,
|
|
55
|
+
size: '16px',
|
|
56
|
+
weight: '400',
|
|
57
|
+
},
|
|
58
|
+
heading: {
|
|
59
|
+
family: `'Roboto', sans-serif`,
|
|
60
|
+
size: '36px',
|
|
61
|
+
weight: '400',
|
|
62
|
+
},
|
|
63
|
+
subHeading: {
|
|
64
|
+
family: `'Roboto', sans-serif`,
|
|
65
|
+
size: '24px',
|
|
66
|
+
weight: '400',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
shadows: {
|
|
70
|
+
small: '0px 0px 2px rgba(0, 0, 0, 0.15)',
|
|
71
|
+
medium: '0px 0px 4px rgba(0, 0, 0, 0.15)',
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
export default defaultTheme;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default (theme) => {
|
|
2
|
+
return {
|
|
3
|
+
font: theme.colours.defaultFont,
|
|
4
|
+
background: theme.colours.controlBackground,
|
|
5
|
+
border: theme.colours.controlBorder,
|
|
6
|
+
borderFocus: theme.colours.controlBorderFocus,
|
|
7
|
+
borderHover: theme.colours.controlBorderHover,
|
|
8
|
+
placeholder: theme.colours.controlPlaceholder,
|
|
9
|
+
};
|
|
10
|
+
};
|