Skip to content

Commit 660443e

Browse files
authored
Implemented <Break /> and column flex feature
* Solved packaging issues * Switched to es6 * Improved stories * Implemented <Break /> component * Implemented column flex (grow and shrink) feature
1 parent 346659c commit 660443e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+470
-553
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Build
22
lib/
33
node_modules/
4+
*.tgz
45

56
# Editors & OS
67
.DS_Store

.npmignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
.circleci/
33
.storybook/
44
node_modules/
5+
*.tgz
6+
tslint.json
57

68
# Editors & OS
79
.DS_Store
@@ -17,8 +19,8 @@ test/
1719
junit.xml
1820

1921
# Source
20-
src/**/__snapshots__/*.snap
21-
src/__storybook__/
22+
src/__utils__/
23+
src/**/__snapshots__/*.*
2224
src/**/*.story.*
2325
src/**/*.test.*
2426

jest.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"collectCoverageFrom": [
33
"src/**/*.{js,jsx,ts,tsx}",
4-
"!src/__storybook__/**/*.*",
4+
"!src/__utils__/**/*.*",
55
"!src/**/*.story.{js,jsx,ts,tsx}"
66
],
77
"coverageReporters": ["cobertura", "lcov"],

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"test": "jest --runInBand --config jest.config.json",
2323
"test:coverage": "jest --runInBand --coverage --config jest.config.json"
2424
},
25-
"files": ["lib", "src"],
2625
"peerDependencies": {
2726
"styled-components": ">= 1 < 4"
2827
},

src/__snapshots__/index.test.ts.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
exports[`index should verify the API shape 1`] = `
44
Object {
5+
"Break": [Function],
56
"BreakpointMap": Object {},
67
"BreakpointValue": Object {},
78
"BreakpointValues": Object {},

src/__storybook__/BlueSquare.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,29 @@ import * as _React from "react";
33
import * as _StyledComponents from "styled-components";
44
// -------------------------------------------------------------------
55
import styled from "styled-components";
6+
import Column from "../column";
7+
import Container from "../container";
8+
import Row from "../row";
69

710
const Story = styled.div`
811
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
912
"Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
1013
"Segoe UI Symbol";
11-
text-align: center;
14+
15+
${Container},
16+
${Row} {
17+
background: #ccc;
18+
height: 300px;
19+
}
20+
21+
${Row} > ${Column} {
22+
background: #0a5991;
23+
border: 5px solid #ccc;
24+
color #fff;
25+
font-size: 2em;
26+
line-height: 65px;
27+
text-align: center;
28+
}
1229
`;
1330

1431
export default Story;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const Title = styled.div`
88
color: #0a5991;
99
font-size: 3em;
1010
margin: 30px 0;
11+
text-align: center;
1112
`;
1213

1314
export default Title;

src/__utils__/flatten.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default (source?: string) => {
2+
if (source == null) {
3+
return "";
4+
} else {
5+
return source.replace(/\n|\r|\s|\t/gi, "");
6+
}
7+
};

src/break/Break.story.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import * as React from "react";
2+
import { storiesOf } from "@storybook/react";
3+
import { action } from "@storybook/addon-actions";
4+
import Story from "../__utils__/Story";
5+
import Title from "../__utils__/Title";
6+
7+
import { Break, Column, Container, Row } from "..";
8+
9+
storiesOf("Break", module).add("break", () => (
10+
<Story>
11+
<Title>break</Title>
12+
<Container>
13+
<Row>
14+
<Column size={6}>1</Column>
15+
<Break />
16+
<Column size={6}>2</Column>
17+
</Row>
18+
</Container>
19+
</Story>
20+
));

0 commit comments

Comments
 (0)