-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented <Break /> and column flex feature
* Solved packaging issues * Switched to es6 * Improved stories * Implemented <Break /> component * Implemented column flex (grow and shrink) feature
- Loading branch information
Showing
47 changed files
with
470 additions
and
553 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Build | ||
lib/ | ||
node_modules/ | ||
*.tgz | ||
|
||
# Editors & OS | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default (source?: string) => { | ||
if (source == null) { | ||
return ""; | ||
} else { | ||
return source.replace(/\n|\r|\s|\t/gi, ""); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import * as React from "react"; | ||
import { storiesOf } from "@storybook/react"; | ||
import { action } from "@storybook/addon-actions"; | ||
import Story from "../__utils__/Story"; | ||
import Title from "../__utils__/Title"; | ||
|
||
import { Break, Column, Container, Row } from ".."; | ||
|
||
storiesOf("Break", module).add("break", () => ( | ||
<Story> | ||
<Title>break</Title> | ||
<Container> | ||
<Row> | ||
<Column size={6}>1</Column> | ||
<Break /> | ||
<Column size={6}>2</Column> | ||
</Row> | ||
</Container> | ||
</Story> | ||
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import "jest-styled-components"; | ||
import { shallow } from "enzyme"; | ||
import * as React from "react"; | ||
import styled from "styled-components"; | ||
import Break from "./Break"; | ||
|
||
describe("<Break />", () => { | ||
it("should match the snapshot", () => { | ||
// act | ||
const result = shallow(<Break />); | ||
|
||
// assert | ||
expect(result).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import "../utils/bootstrap"; | ||
import { ClassAttributes, HTMLAttributes } from "react"; | ||
import { StyledComponentClass } from "styled-components"; | ||
import { styled, Theme } from "../theme"; | ||
|
||
const Break = styled.div` | ||
width: 100%; | ||
height: 0; | ||
`; | ||
|
||
export default Break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<Break /> should match the snapshot 1`] = ` | ||
.c0 { | ||
width: 100%; | ||
height: 0; | ||
} | ||
<div | ||
className="c0" | ||
/> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`index should verify the API shape 1`] = ` | ||
Object { | ||
"default": [Function], | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import * as module from "."; | ||
|
||
describe("index", () => { | ||
it("should verify the API shape", () => { | ||
expect(module).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Break from "./Break"; | ||
|
||
export default Break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import * as React from "react"; | ||
import { storiesOf } from "@storybook/react"; | ||
import { action } from "@storybook/addon-actions"; | ||
import Story from "../__utils__/Story"; | ||
import Title from "../__utils__/Title"; | ||
|
||
import { Column, Container, Row } from ".."; | ||
|
||
storiesOf("ColumnFlex", module).add("flex", () => ( | ||
<Story> | ||
<Title>flex</Title> | ||
<Container> | ||
<Row> | ||
<Column size={"none"} flex={"grow"}> | ||
grow grow grow grow | ||
</Column> | ||
<Column size={"auto"} flex={"shrink"}> | ||
shrink | ||
</Column> | ||
<Column size={"none"} flex={"none"}> | ||
none | ||
</Column> | ||
<Column size={"none"}>undefined</Column> | ||
</Row> | ||
</Container> | ||
</Story> | ||
)); |
Oops, something went wrong.