@dtdot/lego 0.14.0 → 0.14.7
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/ActionMessage/ActionMessage.component.js +2 -2
- package/build/components/Card/Card.component.js +15 -9
- package/build/components/Card/Card.context.d.ts +1 -0
- package/build/components/Card/Card.context.js +2 -0
- package/build/components/Card/Card.stories.js +25 -5
- package/build/components/Card/_CardActions.component.js +12 -4
- package/build/components/Card/_CardHeader.component.d.ts +1 -1
- package/build/components/ControlGroup/ControlGroup.component.js +6 -2
- package/build/components/Heading/Heading.component.d.ts +5 -1
- package/build/components/Heading/Heading.component.js +4 -0
- package/build/components/Heading/Heading.stories.d.ts +2 -0
- package/build/components/Heading/Heading.stories.js +2 -0
- package/build/components/Heading/_FormHeading.component.d.ts +2 -0
- package/build/components/Heading/_FormHeading.component.js +16 -0
- package/build/components/{SubHeading/SubHeading.component.d.ts → Heading/_SubHeading.component.d.ts} +1 -1
- package/build/components/{SubHeading/SubHeading.component.js → Heading/_SubHeading.component.js} +1 -1
- package/build/components/ImageUpload/ImageUpload.component.js +1 -0
- package/build/components/InlineCard/InlineCard.component.d.ts +5 -2
- package/build/components/InlineCard/InlineCard.component.js +39 -2
- package/build/components/InlineCard/InlineCard.stories.js +4 -2
- package/build/components/InlineCard/_InlineCardContent.component.d.ts +2 -1
- package/build/components/InlineCard/_InlineCardContent.component.js +9 -2
- package/build/components/InlineCard/_InlineCardMeta.component.d.ts +6 -0
- package/build/components/InlineCard/_InlineCardMeta.component.js +15 -0
- package/build/components/Menu/Menu.stories.js +3 -3
- package/build/components/PageHeader/PageHeader.component.d.ts +6 -0
- package/build/components/PageHeader/PageHeader.component.js +12 -0
- package/build/components/{SubHeading/SubHeading.stories.d.ts → PageHeader/PageHeader.stories.d.ts} +0 -0
- package/build/components/PageHeader/PageHeader.stories.js +9 -0
- package/build/components/Swimlane/Swimlane.component.d.ts +7 -0
- package/build/components/Swimlane/Swimlane.component.js +31 -0
- package/build/components/Swimlane/Swimlane.stories.d.ts +5 -0
- package/build/components/Swimlane/Swimlane.stories.js +55 -0
- package/build/examples/Form.stories.d.ts +5 -0
- package/build/examples/Form.stories.js +19 -0
- package/build/index.d.ts +2 -1
- package/build/index.js +2 -1
- package/build/theme/dark.theme.js +4 -2
- package/build/theme/default.theme.js +2 -0
- package/package.json +1 -1
- package/build/components/SubHeading/SubHeading.stories.js +0 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
import { Button,
|
|
3
|
+
import { Button, Heading, Spacer, Text } from '../..';
|
|
4
4
|
const ActionMessageContainer = styled.div `
|
|
5
5
|
width: 100%;
|
|
6
6
|
padding: 64px 0;
|
|
@@ -16,7 +16,7 @@ const ActionMessageContainer = styled.div `
|
|
|
16
16
|
const ActionMessage = ({ header, info, action, onAction }) => {
|
|
17
17
|
return (React.createElement(ActionMessageContainer, null,
|
|
18
18
|
React.createElement("div", null,
|
|
19
|
-
React.createElement(SubHeading, null, header)),
|
|
19
|
+
React.createElement(Heading.SubHeading, null, header)),
|
|
20
20
|
info && (React.createElement(React.Fragment, null,
|
|
21
21
|
React.createElement(Spacer, { size: '1x' }),
|
|
22
22
|
React.createElement(Text, null, info))),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { motion } from 'framer-motion';
|
|
2
2
|
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
3
|
+
import styled, { useTheme } from 'styled-components';
|
|
4
4
|
import responsive from '../../responsive/responsive';
|
|
5
5
|
import CardContext from './Card.context';
|
|
6
6
|
import { CardActions, CardAction } from './_CardActions.component';
|
|
@@ -10,13 +10,8 @@ import CardMedia from './_CardMedia.component';
|
|
|
10
10
|
import CardSpacer from './_CardSpacer.component';
|
|
11
11
|
import CardSubContent from './_CardSubContent.component';
|
|
12
12
|
const CardActionsContainer = styled.div `
|
|
13
|
-
/* width: 100%; */
|
|
14
|
-
/* height: 32px; */
|
|
15
|
-
|
|
16
13
|
position: absolute;
|
|
17
|
-
/* top: -32px; */
|
|
18
14
|
top: -32px;
|
|
19
|
-
/* z-index: 0; */
|
|
20
15
|
`;
|
|
21
16
|
const CardInner = styled.div `
|
|
22
17
|
position: relative;
|
|
@@ -35,7 +30,7 @@ const CardOuter = styled(motion.div) `
|
|
|
35
30
|
`;
|
|
36
31
|
case 'xs':
|
|
37
32
|
return `
|
|
38
|
-
width:
|
|
33
|
+
width: 360px;
|
|
39
34
|
${responsive.useStylesFor('mobile').andSmaller(`
|
|
40
35
|
width: 100%;
|
|
41
36
|
`)}
|
|
@@ -65,6 +60,10 @@ const CardOuter = styled(motion.div) `
|
|
|
65
60
|
}
|
|
66
61
|
}}
|
|
67
62
|
|
|
63
|
+
&:hover {
|
|
64
|
+
z-index: 1;
|
|
65
|
+
}
|
|
66
|
+
|
|
68
67
|
position: relative;
|
|
69
68
|
cursor: ${(props) => (props.usePointer ? 'pointer' : 'default')};
|
|
70
69
|
padding: ${(props) => (props.padded ? '16px' : 0)};
|
|
@@ -73,6 +72,8 @@ const Card = ({ children, padded, size = 'sm', onClick }) => {
|
|
|
73
72
|
const actionsRef = useRef(null);
|
|
74
73
|
const [htmlActionsRef, setHtmlActionsRef] = useState();
|
|
75
74
|
const [showActions, setShowActions] = useState(false);
|
|
75
|
+
const [hasActions, setHasActions] = useState(false);
|
|
76
|
+
const theme = useTheme();
|
|
76
77
|
useEffect(() => {
|
|
77
78
|
if (actionsRef.current) {
|
|
78
79
|
setHtmlActionsRef(actionsRef.current);
|
|
@@ -86,8 +87,13 @@ const Card = ({ children, padded, size = 'sm', onClick }) => {
|
|
|
86
87
|
onClick();
|
|
87
88
|
}
|
|
88
89
|
};
|
|
89
|
-
return (React.createElement(CardContext.Provider, { value: { size, actionsRef: htmlActionsRef, showActions } },
|
|
90
|
-
React.createElement(CardOuter, { onHoverStart: () => setShowActions(true), onHoverEnd: () => setShowActions(false),
|
|
90
|
+
return (React.createElement(CardContext.Provider, { value: { size, actionsRef: htmlActionsRef, showActions, setHasActions } },
|
|
91
|
+
React.createElement(CardOuter, { onHoverStart: () => setShowActions(true), onHoverEnd: () => setShowActions(false), key: 'actions-container', transition: { type: 'spring', bounce: 0, duration: 0.6 }, whileHover: hasActions
|
|
92
|
+
? {
|
|
93
|
+
scale: 1.005,
|
|
94
|
+
boxShadow: theme.shadows.xlarge,
|
|
95
|
+
}
|
|
96
|
+
: {}, size: size, padded: padded, onClick: handleClick, usePointer: !!onClick },
|
|
91
97
|
React.createElement(CardActionsContainer, { ref: actionsRef }),
|
|
92
98
|
React.createElement(CardInner, null, children))));
|
|
93
99
|
};
|
|
@@ -15,6 +15,10 @@ export const Standard = () => (React.createElement(CardGroup, null,
|
|
|
15
15
|
React.createElement(Card.Content, null,
|
|
16
16
|
React.createElement(LiveInput, { name: 'test', placeholder: 'Name of characters' })))));
|
|
17
17
|
export const Sizes = () => (React.createElement(CardGroup, null,
|
|
18
|
+
React.createElement(Card, { size: 'xs' },
|
|
19
|
+
React.createElement(Card.Media, null,
|
|
20
|
+
React.createElement("img", { src: 'https://www.jotform.com/blog/wp-content/uploads/2012/07/mario-luigi-yoschi-figures-163036.jpeg' })),
|
|
21
|
+
React.createElement(Card.Content, null, "An extra small card!")),
|
|
18
22
|
React.createElement(Card, { size: 'sm' },
|
|
19
23
|
React.createElement(Card.Media, null,
|
|
20
24
|
React.createElement("img", { src: 'https://www.jotform.com/blog/wp-content/uploads/2012/07/mario-luigi-yoschi-figures-163036.jpeg' })),
|
|
@@ -53,11 +57,27 @@ export const WithActions = () => (React.createElement(React.Fragment, null,
|
|
|
53
57
|
React.createElement(FontAwesomeIcon, { icon: faPen })),
|
|
54
58
|
React.createElement(Card.Action, { onClick: () => console.log('Delete Clicked') },
|
|
55
59
|
React.createElement(FontAwesomeIcon, { icon: faTrash }))),
|
|
56
|
-
React.createElement(Card.
|
|
57
|
-
React.createElement(Card.
|
|
58
|
-
React.createElement(Card.Content, null, "
|
|
59
|
-
|
|
60
|
-
React.createElement(Card.
|
|
60
|
+
React.createElement(Card.Header, { heading: 'Mario & Luigi', subHeading: 'mario@gmail.com', meta: React.createElement(Badge, { variant: 'success' }, "approved") }),
|
|
61
|
+
React.createElement(Card.Content, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."),
|
|
62
|
+
React.createElement(Card.Content, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.")),
|
|
63
|
+
React.createElement(Card, { size: 'sm', onClick: () => console.log('Card Clicked') },
|
|
64
|
+
React.createElement(Card.Actions, null,
|
|
65
|
+
React.createElement(Card.Action, { onClick: () => console.log('Edit Clicked') },
|
|
66
|
+
React.createElement(FontAwesomeIcon, { icon: faPen })),
|
|
67
|
+
React.createElement(Card.Action, { onClick: () => console.log('Delete Clicked') },
|
|
68
|
+
React.createElement(FontAwesomeIcon, { icon: faTrash }))),
|
|
69
|
+
React.createElement(Card.Header, { heading: 'Mario & Luigi', subHeading: 'mario@gmail.com', meta: React.createElement(Badge, { variant: 'success' }, "approved") }),
|
|
70
|
+
React.createElement(Card.Content, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."),
|
|
71
|
+
React.createElement(Card.Content, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.")),
|
|
72
|
+
React.createElement(Card, { size: 'sm', onClick: () => console.log('Card Clicked') },
|
|
73
|
+
React.createElement(Card.Actions, null,
|
|
74
|
+
React.createElement(Card.Action, { onClick: () => console.log('Edit Clicked') },
|
|
75
|
+
React.createElement(FontAwesomeIcon, { icon: faPen })),
|
|
76
|
+
React.createElement(Card.Action, { onClick: () => console.log('Delete Clicked') },
|
|
77
|
+
React.createElement(FontAwesomeIcon, { icon: faTrash }))),
|
|
78
|
+
React.createElement(Card.Header, { heading: 'Mario & Luigi', subHeading: 'mario@gmail.com', meta: React.createElement(Badge, { variant: 'success' }, "approved") }),
|
|
79
|
+
React.createElement(Card.Content, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."),
|
|
80
|
+
React.createElement(Card.Content, null, "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.")))));
|
|
61
81
|
export default {
|
|
62
82
|
title: 'Components/Card',
|
|
63
83
|
component: Card,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
2
|
-
import React, { useContext } from 'react';
|
|
2
|
+
import React, { useContext, useEffect } from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import CardContext from './Card.context';
|
|
@@ -23,11 +23,19 @@ const ActionContainer = styled.div `
|
|
|
23
23
|
padding: 4px;
|
|
24
24
|
border-radius: 4px 4px 0 0;
|
|
25
25
|
|
|
26
|
+
box-shadow: ${(props) => props.theme.shadows.xlarge};
|
|
27
|
+
|
|
26
28
|
margin-right: 8px;
|
|
27
29
|
cursor: pointer;
|
|
28
30
|
`;
|
|
29
31
|
export const CardActions = ({ children }) => {
|
|
30
|
-
const { actionsRef, showActions } = useContext(CardContext);
|
|
32
|
+
const { actionsRef, showActions, setHasActions } = useContext(CardContext);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
setHasActions(true);
|
|
35
|
+
return () => {
|
|
36
|
+
setHasActions(false);
|
|
37
|
+
};
|
|
38
|
+
}, [setHasActions]);
|
|
31
39
|
if (!showActions) {
|
|
32
40
|
return null;
|
|
33
41
|
}
|
|
@@ -35,7 +43,7 @@ export const CardActions = ({ children }) => {
|
|
|
35
43
|
return null;
|
|
36
44
|
}
|
|
37
45
|
return createPortal(React.createElement(AnimatePresence, null,
|
|
38
|
-
React.createElement(ActionsContainer, { key: '
|
|
46
|
+
React.createElement(ActionsContainer, { key: 'actions-container', initial: { y: actionsHeight }, animate: { y: 0 }, exit: { y: actionsHeight }, transition: { type: 'spring', bounce: 0, duration: 0.6 } }, children)), actionsRef);
|
|
39
47
|
};
|
|
40
48
|
export const CardAction = ({ children, onClick }) => {
|
|
41
49
|
const handleClick = (e) => {
|
|
@@ -44,5 +52,5 @@ export const CardAction = ({ children, onClick }) => {
|
|
|
44
52
|
onClick();
|
|
45
53
|
}
|
|
46
54
|
};
|
|
47
|
-
return
|
|
55
|
+
return React.createElement(ActionContainer, { onClick: handleClick }, children);
|
|
48
56
|
};
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
export interface CardHeaderProps {
|
|
3
3
|
image?: string;
|
|
4
4
|
heading: string;
|
|
5
|
-
subHeading
|
|
5
|
+
subHeading?: string;
|
|
6
6
|
meta?: React.ReactNode;
|
|
7
7
|
}
|
|
8
8
|
declare const CardHeader: ({ image, heading, subHeading, meta }: CardHeaderProps) => JSX.Element;
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import ButtonContext from '../Button/Button.context';
|
|
4
|
-
import
|
|
4
|
+
import Heading from '../Heading/Heading.component';
|
|
5
5
|
import ControlGroupSpacer from './_ControlGroupSpacer.component';
|
|
6
6
|
const ComfortableContainer = styled.div `
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-direction: column;
|
|
9
9
|
|
|
10
|
-
${SubHeading} {
|
|
10
|
+
${Heading.SubHeading} {
|
|
11
11
|
margin-top: 16px;
|
|
12
12
|
margin-bottom: 16px;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
${Heading.FormHeading} {
|
|
16
|
+
margin-top: 32px;
|
|
17
|
+
}
|
|
18
|
+
|
|
15
19
|
& > * {
|
|
16
20
|
margin-bottom: 16px;
|
|
17
21
|
|
|
@@ -2,5 +2,9 @@ import React from 'react';
|
|
|
2
2
|
export interface HeadingProps {
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
}
|
|
5
|
-
declare const Heading:
|
|
5
|
+
declare const Heading: {
|
|
6
|
+
({ children }: HeadingProps): JSX.Element;
|
|
7
|
+
SubHeading: import("styled-components").StyledComponent<"h3", import("styled-components").DefaultTheme, {}, never>;
|
|
8
|
+
FormHeading: import("styled-components").StyledComponent<"h3", import("styled-components").DefaultTheme, {}, never>;
|
|
9
|
+
};
|
|
6
10
|
export default Heading;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
+
import FormHeading from './_FormHeading.component';
|
|
4
|
+
import SubHeading from './_SubHeading.component';
|
|
3
5
|
const HeadingContainer = styled.h2 `
|
|
4
6
|
font-family: ${(props) => props.theme.fonts.heading.family};
|
|
5
7
|
font-size: ${(props) => props.theme.fonts.heading.size};
|
|
@@ -10,4 +12,6 @@ const HeadingContainer = styled.h2 `
|
|
|
10
12
|
margin: 0;
|
|
11
13
|
`;
|
|
12
14
|
const Heading = ({ children }) => React.createElement(HeadingContainer, null, children);
|
|
15
|
+
Heading.SubHeading = SubHeading;
|
|
16
|
+
Heading.FormHeading = FormHeading;
|
|
13
17
|
export default Heading;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Meta } from '@storybook/react/types-6-0';
|
|
3
3
|
export declare const Standard: () => JSX.Element;
|
|
4
|
+
export declare const SubHeading: () => JSX.Element;
|
|
5
|
+
export declare const FormHeading: () => JSX.Element;
|
|
4
6
|
declare const _default: Meta<import("@storybook/react/types-6-0").Args>;
|
|
5
7
|
export default _default;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Heading } from '../..';
|
|
3
3
|
export const Standard = () => React.createElement(Heading, null, "A Standard Heading");
|
|
4
|
+
export const SubHeading = () => React.createElement(Heading.SubHeading, null, "A Standard Sub Heading");
|
|
5
|
+
export const FormHeading = () => React.createElement(Heading.FormHeading, null, "A Standard Sub Heading");
|
|
4
6
|
export default {
|
|
5
7
|
title: 'Components/Heading',
|
|
6
8
|
component: Heading,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import getThemeControlColours from '../../theme/helpers/getThemeControlColours';
|
|
3
|
+
const FormHeading = styled.h3 `
|
|
4
|
+
font-family: ${(props) => props.theme.fonts.default.family};
|
|
5
|
+
font-size: ${(props) => props.theme.fonts.default.size};
|
|
6
|
+
font-weight: ${(props) => props.theme.fonts.default.weight};
|
|
7
|
+
|
|
8
|
+
color: ${(props) => props.theme.colours.defaultFont};
|
|
9
|
+
|
|
10
|
+
margin: 0;
|
|
11
|
+
|
|
12
|
+
border-left: 4px solid ${(props) => getThemeControlColours(props.theme).background};
|
|
13
|
+
line-height: 48px;
|
|
14
|
+
padding-left: 16px;
|
|
15
|
+
`;
|
|
16
|
+
export default FormHeading;
|
package/build/components/{SubHeading/SubHeading.component.d.ts → Heading/_SubHeading.component.d.ts}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const SubHeading: import("styled-components").StyledComponent<"
|
|
1
|
+
declare const SubHeading: import("styled-components").StyledComponent<"h3", import("styled-components").DefaultTheme, {}, never>;
|
|
2
2
|
export default SubHeading;
|
package/build/components/{SubHeading/SubHeading.component.js → Heading/_SubHeading.component.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
const SubHeading = styled.
|
|
2
|
+
const SubHeading = styled.h3 `
|
|
3
3
|
font-family: ${(props) => props.theme.fonts.subHeading.family};
|
|
4
4
|
font-size: ${(props) => props.theme.fonts.subHeading.size};
|
|
5
5
|
font-weight: ${(props) => props.theme.fonts.subHeading.weight};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
export declare type InlineCardSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
2
3
|
export interface InlineCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
4
|
children: React.ReactNode;
|
|
5
|
+
size?: InlineCardSize;
|
|
4
6
|
}
|
|
5
7
|
declare const InlineCard: {
|
|
6
|
-
({ children, onClick }: InlineCardProps): JSX.Element;
|
|
8
|
+
({ children, size, onClick }: InlineCardProps): JSX.Element;
|
|
7
9
|
Media: ({ children }: import("./_InlineCardMedia.component").InlineCardMediaProps) => JSX.Element;
|
|
8
|
-
Content: ({ children }: import("./_InlineCardContent.component").InlineCardContentProps) => JSX.Element;
|
|
10
|
+
Content: ({ children, center }: import("./_InlineCardContent.component").InlineCardContentProps) => JSX.Element;
|
|
11
|
+
Meta: ({ children }: import("./_InlineCardMeta.component").InlineCardMetaProps) => JSX.Element;
|
|
9
12
|
};
|
|
10
13
|
export default InlineCard;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
+
import { responsive } from '../..';
|
|
3
4
|
import InlineCardContent from './_InlineCardContent.component';
|
|
4
5
|
import InlineCardMedia from './_InlineCardMedia.component';
|
|
6
|
+
import InlineCardMeta from './_InlineCardMeta.component';
|
|
5
7
|
const CardOuter = styled.div `
|
|
6
8
|
height: 64px;
|
|
7
9
|
width: 100%;
|
|
@@ -11,10 +13,45 @@ const CardOuter = styled.div `
|
|
|
11
13
|
|
|
12
14
|
background-color: ${(props) => props.theme.colours.cardBackground};
|
|
13
15
|
box-shadow: ${(props) => props.theme.shadows.small};
|
|
16
|
+
|
|
17
|
+
${(props) => {
|
|
18
|
+
switch (props.size) {
|
|
19
|
+
case 'xs':
|
|
20
|
+
return `
|
|
21
|
+
width: 360px;
|
|
22
|
+
${responsive.useStylesFor('mobile').andSmaller(`
|
|
23
|
+
width: 100%;
|
|
24
|
+
`)}
|
|
25
|
+
`;
|
|
26
|
+
case 'sm':
|
|
27
|
+
return `
|
|
28
|
+
width: ${responsive.getWidthFor('mobile')};
|
|
29
|
+
${responsive.useStylesFor('mobile').andSmaller(`
|
|
30
|
+
width: 100%;
|
|
31
|
+
`)}
|
|
32
|
+
`;
|
|
33
|
+
case 'md':
|
|
34
|
+
return `
|
|
35
|
+
width: ${responsive.getWidthFor('tablet')};
|
|
36
|
+
${responsive.useStylesFor('tablet').andSmaller(`
|
|
37
|
+
width: 100%;
|
|
38
|
+
`)}
|
|
39
|
+
`;
|
|
40
|
+
case 'lg':
|
|
41
|
+
default:
|
|
42
|
+
return `
|
|
43
|
+
width: ${responsive.getWidthFor('desktop')};
|
|
44
|
+
${responsive.useStylesFor('desktop').andSmaller(`
|
|
45
|
+
width: 100%;
|
|
46
|
+
`)}
|
|
47
|
+
`;
|
|
48
|
+
}
|
|
49
|
+
}}
|
|
14
50
|
`;
|
|
15
|
-
const InlineCard = ({ children, onClick }) => {
|
|
16
|
-
return (React.createElement(CardOuter, { usePointer: !!onClick, onClick: onClick }, children));
|
|
51
|
+
const InlineCard = ({ children, size, onClick }) => {
|
|
52
|
+
return (React.createElement(CardOuter, { size: size, usePointer: !!onClick, onClick: onClick }, children));
|
|
17
53
|
};
|
|
18
54
|
InlineCard.Media = InlineCardMedia;
|
|
19
55
|
InlineCard.Content = InlineCardContent;
|
|
56
|
+
InlineCard.Meta = InlineCardMeta;
|
|
20
57
|
export default InlineCard;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { InlineCard, InlineCardGroup } from '../..';
|
|
2
|
+
import { Badge, InlineCard, InlineCardGroup } from '../..';
|
|
3
3
|
export const Standard = () => (React.createElement(InlineCardGroup, null,
|
|
4
4
|
React.createElement(InlineCard, null,
|
|
5
5
|
React.createElement(InlineCard.Content, null, "Some content")),
|
|
@@ -10,7 +10,9 @@ export const Standard = () => (React.createElement(InlineCardGroup, null,
|
|
|
10
10
|
React.createElement(InlineCard, { onClick: () => {
|
|
11
11
|
console.log('Clicked');
|
|
12
12
|
} },
|
|
13
|
-
React.createElement(InlineCard.Content, null, "Clickable card")
|
|
13
|
+
React.createElement(InlineCard.Content, null, "Clickable card"),
|
|
14
|
+
React.createElement(InlineCard.Meta, null,
|
|
15
|
+
React.createElement(Badge, { variant: 'info' }, "Clickable")))));
|
|
14
16
|
export default {
|
|
15
17
|
title: 'Components/InlineCard',
|
|
16
18
|
component: InlineCard,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface InlineCardContentProps {
|
|
3
3
|
children: React.ReactNode;
|
|
4
|
+
center?: boolean;
|
|
4
5
|
}
|
|
5
|
-
declare const InlineCardContent: ({ children }: InlineCardContentProps) => JSX.Element;
|
|
6
|
+
declare const InlineCardContent: ({ children, center }: InlineCardContentProps) => JSX.Element;
|
|
6
7
|
export default InlineCardContent;
|
|
@@ -8,8 +8,15 @@ const ContentContainer = styled.div `
|
|
|
8
8
|
font-weight: ${(props) => props.theme.fonts.default.weight};
|
|
9
9
|
font-size: ${(props) => props.theme.fonts.default.size};
|
|
10
10
|
color: ${(props) => props.theme.colours.defaultFont};
|
|
11
|
+
|
|
12
|
+
${(props) => props.center &&
|
|
13
|
+
`
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
|
|
17
|
+
`}
|
|
11
18
|
`;
|
|
12
|
-
const InlineCardContent = ({ children }) => {
|
|
13
|
-
return React.createElement(ContentContainer,
|
|
19
|
+
const InlineCardContent = ({ children, center }) => {
|
|
20
|
+
return React.createElement(ContentContainer, { center: center }, children);
|
|
14
21
|
};
|
|
15
22
|
export default InlineCardContent;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
const ContentContainer = styled.div `
|
|
4
|
+
height: 100%;
|
|
5
|
+
padding: 8px;
|
|
6
|
+
margin-left: 32px;
|
|
7
|
+
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
margin-left: auto;
|
|
11
|
+
`;
|
|
12
|
+
const InlineCardMeta = ({ children }) => {
|
|
13
|
+
return React.createElement(ContentContainer, null, children);
|
|
14
|
+
};
|
|
15
|
+
export default InlineCardMeta;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { ControlGroup, Heading, Menu, Spacer, Text, FocusLayout, PaddedLayout, Input, Button, menuHelpers, ContentLayout,
|
|
2
|
+
import { ControlGroup, Heading, Menu, Spacer, Text, FocusLayout, PaddedLayout, Input, Button, menuHelpers, ContentLayout, } from '../..';
|
|
3
3
|
import { faCalendarAlt, faCogs, faHamburger } from '@fortawesome/free-solid-svg-icons';
|
|
4
4
|
export const Standard = () => {
|
|
5
5
|
const [route, setRoute] = useState('/eat');
|
|
@@ -33,9 +33,9 @@ export const WithPanel = () => {
|
|
|
33
33
|
React.createElement(Menu.Panel, null,
|
|
34
34
|
React.createElement(PaddedLayout, null,
|
|
35
35
|
React.createElement(ControlGroup, { variation: 'comfortable' },
|
|
36
|
-
React.createElement(SubHeading, null, "You"),
|
|
36
|
+
React.createElement(Heading.SubHeading, null, "You"),
|
|
37
37
|
React.createElement(Input, { label: 'Income', name: 'name', placeholder: '30,000' }),
|
|
38
|
-
React.createElement(SubHeading, null, "Loan"),
|
|
38
|
+
React.createElement(Heading.SubHeading, null, "Loan"),
|
|
39
39
|
React.createElement(Input, { label: 'Deposit', name: 'name', placeholder: '10,000' }),
|
|
40
40
|
React.createElement(Input, { label: 'Interest Rate', name: 'name', placeholder: '4%' })))),
|
|
41
41
|
React.createElement(Menu.Page, null,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { Heading } from '../..';
|
|
4
|
+
const HeaderOuter = styled.div `
|
|
5
|
+
width: 100%;
|
|
6
|
+
padding: 32px;
|
|
7
|
+
`;
|
|
8
|
+
const PageHeader = ({ heading }) => {
|
|
9
|
+
return (React.createElement(HeaderOuter, null,
|
|
10
|
+
React.createElement(Heading, null, heading)));
|
|
11
|
+
};
|
|
12
|
+
export default PageHeader;
|
package/build/components/{SubHeading/SubHeading.stories.d.ts → PageHeader/PageHeader.stories.d.ts}
RENAMED
|
File without changes
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { Heading } from '../..';
|
|
4
|
+
const SwimlaneOuter = styled.div `
|
|
5
|
+
padding: 8px;
|
|
6
|
+
margin: 0 16px;
|
|
7
|
+
border-top: thin solid ${(props) => props.theme.colours.controlBorder};
|
|
8
|
+
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
|
|
12
|
+
:last-child {
|
|
13
|
+
border-bottom: thin solid ${(props) => props.theme.colours.controlBorder};
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
const SwimlaneLabel = styled.div `
|
|
17
|
+
padding-right: 32px;
|
|
18
|
+
width: 240px;
|
|
19
|
+
min-width: 240px;
|
|
20
|
+
`;
|
|
21
|
+
const SwimlaneContent = styled.div `
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-wrap: wrap;
|
|
24
|
+
`;
|
|
25
|
+
const Swimlane = ({ label, children }) => {
|
|
26
|
+
return (React.createElement(SwimlaneOuter, null,
|
|
27
|
+
React.createElement(SwimlaneLabel, null,
|
|
28
|
+
React.createElement(Heading.FormHeading, null, label)),
|
|
29
|
+
React.createElement(SwimlaneContent, null, children)));
|
|
30
|
+
};
|
|
31
|
+
export default Swimlane;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { InlineCard, Badge, Swimlane, CenteredLayout } from '../../';
|
|
4
|
+
const CardWrapper = styled.div `
|
|
5
|
+
margin: 8px;
|
|
6
|
+
`;
|
|
7
|
+
export const Standard = () => {
|
|
8
|
+
return (React.createElement(React.Fragment, null,
|
|
9
|
+
React.createElement(Swimlane, { label: 'Jobs' },
|
|
10
|
+
React.createElement(CardWrapper, null,
|
|
11
|
+
React.createElement(InlineCard, { size: 'xs' },
|
|
12
|
+
React.createElement(InlineCard.Content, { center: true },
|
|
13
|
+
React.createElement(CenteredLayout, null,
|
|
14
|
+
"Jim",
|
|
15
|
+
`'`,
|
|
16
|
+
"s Mowing")),
|
|
17
|
+
React.createElement(InlineCard.Meta, null,
|
|
18
|
+
React.createElement(Badge, { variant: 'success' }, "Full Time"))))),
|
|
19
|
+
React.createElement(Swimlane, { label: 'Properties' },
|
|
20
|
+
React.createElement(CardWrapper, null,
|
|
21
|
+
React.createElement(InlineCard, { size: 'xs' },
|
|
22
|
+
React.createElement(InlineCard.Content, { center: true },
|
|
23
|
+
React.createElement(CenteredLayout, null, "33 Oak Street")),
|
|
24
|
+
React.createElement(InlineCard.Meta, null,
|
|
25
|
+
React.createElement(Badge, { variant: 'success' }, "Primary")))),
|
|
26
|
+
React.createElement(CardWrapper, null,
|
|
27
|
+
React.createElement(InlineCard, { size: 'xs' },
|
|
28
|
+
React.createElement(InlineCard.Content, { center: true },
|
|
29
|
+
React.createElement(CenteredLayout, null, "402 Main Street")),
|
|
30
|
+
React.createElement(InlineCard.Meta, null,
|
|
31
|
+
React.createElement(Badge, { variant: 'info' }, "Investment")))),
|
|
32
|
+
React.createElement(CardWrapper, null,
|
|
33
|
+
React.createElement(InlineCard, { size: 'xs' },
|
|
34
|
+
React.createElement(InlineCard.Content, { center: true },
|
|
35
|
+
React.createElement(CenteredLayout, null, "12 Heart Avenue")),
|
|
36
|
+
React.createElement(InlineCard.Meta, null,
|
|
37
|
+
React.createElement(Badge, { variant: 'info' }, "Investment"))))),
|
|
38
|
+
React.createElement(Swimlane, { label: 'Investments' },
|
|
39
|
+
React.createElement(CardWrapper, null,
|
|
40
|
+
React.createElement(InlineCard, { size: 'xs' },
|
|
41
|
+
React.createElement(InlineCard.Content, { center: true },
|
|
42
|
+
React.createElement(CenteredLayout, null, "ASX 200")),
|
|
43
|
+
React.createElement(InlineCard.Meta, null,
|
|
44
|
+
React.createElement(Badge, { variant: 'info' }, "Index Fund")))),
|
|
45
|
+
React.createElement(CardWrapper, null,
|
|
46
|
+
React.createElement(InlineCard, { size: 'xs' },
|
|
47
|
+
React.createElement(InlineCard.Content, { center: true },
|
|
48
|
+
React.createElement(CenteredLayout, null, "AMP Super")),
|
|
49
|
+
React.createElement(InlineCard.Meta, null,
|
|
50
|
+
React.createElement(Badge, { variant: 'info' }, "Super Fund")))))));
|
|
51
|
+
};
|
|
52
|
+
export default {
|
|
53
|
+
title: 'Components/Swimlane',
|
|
54
|
+
component: Swimlane,
|
|
55
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { ControlGroup, FocusLayout, Form, Heading, Input, ImageUpload } from '../';
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
4
|
+
export const Standard = () => {
|
|
5
|
+
const [value, setValue] = useState({ dragon: '' });
|
|
6
|
+
return (React.createElement(FocusLayout, null,
|
|
7
|
+
React.createElement(Form, { value: value, onChange: setValue },
|
|
8
|
+
React.createElement(ControlGroup, { variation: 'comfortable' },
|
|
9
|
+
React.createElement(ImageUpload, { name: 'image' }),
|
|
10
|
+
React.createElement(Input, { name: 'name', placeholder: 'Something tasty..' }),
|
|
11
|
+
React.createElement(Heading.FormHeading, null, "Components"),
|
|
12
|
+
React.createElement(Input, { name: 'one', placeholder: 'Ingredient #1' }),
|
|
13
|
+
React.createElement(Input, { name: 'two', placeholder: 'Ingredient #2' }),
|
|
14
|
+
React.createElement(Input, { name: 'three', placeholder: 'Ingredient #3' })))));
|
|
15
|
+
};
|
|
16
|
+
export default {
|
|
17
|
+
title: 'Examples/Forms',
|
|
18
|
+
component: Form,
|
|
19
|
+
};
|
package/build/index.d.ts
CHANGED
|
@@ -20,11 +20,12 @@ export { default as LiveInput } from './components/LiveInput/LiveInput.component
|
|
|
20
20
|
export { default as Loader } from './components/Loader/Loader.component';
|
|
21
21
|
export { default as Menu } from './components/Menu/Menu.component';
|
|
22
22
|
export { default as Modal } from './components/Modal/Modal.component';
|
|
23
|
+
export { default as PageHeader } from './components/PageHeader/PageHeader.component';
|
|
23
24
|
export { default as ProfileImage } from './components/ProfileImage/ProfileImage.component';
|
|
24
25
|
export { default as QrCode } from './components/QrCode/QrCode.component';
|
|
25
|
-
export { default as SubHeading } from './components/SubHeading/SubHeading.component';
|
|
26
26
|
export { default as Spacer } from './components/Spacer/Spacer.component';
|
|
27
27
|
export { default as SquareButton } from './components/SquareButton/SquareButton.component';
|
|
28
|
+
export { default as Swimlane } from './components/Swimlane/Swimlane.component';
|
|
28
29
|
export { default as Table } from './components/Table/Table.component';
|
|
29
30
|
export { default as Text } from './components/Text/Text.component';
|
|
30
31
|
export { default as LoginScreen } from './screens/Login/Login.screen';
|
package/build/index.js
CHANGED
|
@@ -20,11 +20,12 @@ export { default as LiveInput } from './components/LiveInput/LiveInput.component
|
|
|
20
20
|
export { default as Loader } from './components/Loader/Loader.component';
|
|
21
21
|
export { default as Menu } from './components/Menu/Menu.component';
|
|
22
22
|
export { default as Modal } from './components/Modal/Modal.component';
|
|
23
|
+
export { default as PageHeader } from './components/PageHeader/PageHeader.component';
|
|
23
24
|
export { default as ProfileImage } from './components/ProfileImage/ProfileImage.component';
|
|
24
25
|
export { default as QrCode } from './components/QrCode/QrCode.component';
|
|
25
|
-
export { default as SubHeading } from './components/SubHeading/SubHeading.component';
|
|
26
26
|
export { default as Spacer } from './components/Spacer/Spacer.component';
|
|
27
27
|
export { default as SquareButton } from './components/SquareButton/SquareButton.component';
|
|
28
|
+
export { default as Swimlane } from './components/Swimlane/Swimlane.component';
|
|
28
29
|
export { default as Table } from './components/Table/Table.component';
|
|
29
30
|
export { default as Text } from './components/Text/Text.component';
|
|
30
31
|
export { default as LoginScreen } from './screens/Login/Login.screen';
|
|
@@ -4,7 +4,7 @@ const darkTheme = {
|
|
|
4
4
|
background: '#424448',
|
|
5
5
|
overlayBackground: '#a4caf9',
|
|
6
6
|
primary: {
|
|
7
|
-
main: '#
|
|
7
|
+
main: '#94b8e3',
|
|
8
8
|
hover: '#83b7f7',
|
|
9
9
|
contrastText: '#191919',
|
|
10
10
|
},
|
|
@@ -56,7 +56,7 @@ const darkTheme = {
|
|
|
56
56
|
},
|
|
57
57
|
heading: {
|
|
58
58
|
family: `'Roboto', sans-serif`,
|
|
59
|
-
size: '
|
|
59
|
+
size: '28px',
|
|
60
60
|
weight: '500',
|
|
61
61
|
},
|
|
62
62
|
subHeading: {
|
|
@@ -68,6 +68,8 @@ const darkTheme = {
|
|
|
68
68
|
shadows: {
|
|
69
69
|
small: '0px 0px 2px rgba(0, 0, 0, 0.15)',
|
|
70
70
|
medium: '0px 0px 4px rgba(0, 0, 0, 0.15)',
|
|
71
|
+
large: '0px 0px 8px rgba(0, 0, 0, 0.15)',
|
|
72
|
+
xlarge: '0px 0px 16px rgba(0, 0, 0, 0.25)',
|
|
71
73
|
},
|
|
72
74
|
};
|
|
73
75
|
export default darkTheme;
|
|
@@ -69,6 +69,8 @@ const defaultTheme = {
|
|
|
69
69
|
shadows: {
|
|
70
70
|
small: '0px 0px 2px rgba(0, 0, 0, 0.15)',
|
|
71
71
|
medium: '0px 0px 4px rgba(0, 0, 0, 0.15)',
|
|
72
|
+
large: '0px 0px 8px rgba(0, 0, 0, 0.15)',
|
|
73
|
+
xlarge: '0px 0px 16px rgba(0, 0, 0, 0.25)',
|
|
72
74
|
},
|
|
73
75
|
};
|
|
74
76
|
export default defaultTheme;
|
package/package.json
CHANGED