@dtdot/lego 0.14.6 → 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/Card/Card.component.js +1 -1
- package/build/components/Card/Card.stories.js +4 -0
- package/build/components/Card/_CardHeader.component.d.ts +1 -1
- 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/PageHeader/PageHeader.component.d.ts +6 -0
- package/build/components/PageHeader/PageHeader.component.js +12 -0
- package/build/components/PageHeader/PageHeader.stories.d.ts +5 -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/index.d.ts +2 -0
- package/build/index.js +2 -0
- package/build/theme/dark.theme.js +1 -1
- package/package.json +1 -1
|
@@ -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' })),
|
|
@@ -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,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;
|
|
@@ -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;
|
|
@@ -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
|
+
};
|
package/build/index.d.ts
CHANGED
|
@@ -20,10 +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
26
|
export { default as Spacer } from './components/Spacer/Spacer.component';
|
|
26
27
|
export { default as SquareButton } from './components/SquareButton/SquareButton.component';
|
|
28
|
+
export { default as Swimlane } from './components/Swimlane/Swimlane.component';
|
|
27
29
|
export { default as Table } from './components/Table/Table.component';
|
|
28
30
|
export { default as Text } from './components/Text/Text.component';
|
|
29
31
|
export { default as LoginScreen } from './screens/Login/Login.screen';
|
package/build/index.js
CHANGED
|
@@ -20,10 +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
26
|
export { default as Spacer } from './components/Spacer/Spacer.component';
|
|
26
27
|
export { default as SquareButton } from './components/SquareButton/SquareButton.component';
|
|
28
|
+
export { default as Swimlane } from './components/Swimlane/Swimlane.component';
|
|
27
29
|
export { default as Table } from './components/Table/Table.component';
|
|
28
30
|
export { default as Text } from './components/Text/Text.component';
|
|
29
31
|
export { default as LoginScreen } from './screens/Login/Login.screen';
|