@dtdot/lego 0.14.3 → 0.14.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/ActionMessage/ActionMessage.component.js +2 -2
- 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/Menu/Menu.stories.js +3 -3
- package/build/{components/SubHeading/SubHeading.stories.d.ts → examples/Form.stories.d.ts} +0 -0
- package/build/examples/Form.stories.js +19 -0
- package/build/index.d.ts +0 -1
- package/build/index.js +0 -1
- 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,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,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,
|
|
File without changes
|
|
@@ -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
|
@@ -22,7 +22,6 @@ export { default as Menu } from './components/Menu/Menu.component';
|
|
|
22
22
|
export { default as Modal } from './components/Modal/Modal.component';
|
|
23
23
|
export { default as ProfileImage } from './components/ProfileImage/ProfileImage.component';
|
|
24
24
|
export { default as QrCode } from './components/QrCode/QrCode.component';
|
|
25
|
-
export { default as SubHeading } from './components/SubHeading/SubHeading.component';
|
|
26
25
|
export { default as Spacer } from './components/Spacer/Spacer.component';
|
|
27
26
|
export { default as SquareButton } from './components/SquareButton/SquareButton.component';
|
|
28
27
|
export { default as Table } from './components/Table/Table.component';
|
package/build/index.js
CHANGED
|
@@ -22,7 +22,6 @@ export { default as Menu } from './components/Menu/Menu.component';
|
|
|
22
22
|
export { default as Modal } from './components/Modal/Modal.component';
|
|
23
23
|
export { default as ProfileImage } from './components/ProfileImage/ProfileImage.component';
|
|
24
24
|
export { default as QrCode } from './components/QrCode/QrCode.component';
|
|
25
|
-
export { default as SubHeading } from './components/SubHeading/SubHeading.component';
|
|
26
25
|
export { default as Spacer } from './components/Spacer/Spacer.component';
|
|
27
26
|
export { default as SquareButton } from './components/SquareButton/SquareButton.component';
|
|
28
27
|
export { default as Table } from './components/Table/Table.component';
|
package/package.json
CHANGED