-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d43566f
commit f91efca
Showing
4 changed files
with
120 additions
and
16 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,3 +1,13 @@ | ||
.dui-space { | ||
color: red; | ||
display: inline-flex; | ||
} | ||
|
||
@each $dir in start, end, center,baseline { | ||
.dui-space-align-#{$dir} { | ||
align-items: $dir; | ||
} | ||
} | ||
|
||
.dui-space-vertical { | ||
flex-direction: column; | ||
} |
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 |
---|---|---|
@@ -1,8 +1,70 @@ | ||
import React from "react"; | ||
import { storiesOf } from "@storybook/react"; | ||
|
||
import Button from "../Button"; | ||
import Space from "./index"; | ||
|
||
const defaultSpace = () => <Space> default button </Space>; | ||
const defaultSpace = () => ( | ||
<Space> | ||
Space | ||
<Button type="primary"> primary button </Button> | ||
<Button danger> danger button </Button> | ||
<div>Text</div> | ||
{null} | ||
{undefined} | ||
</Space> | ||
); | ||
|
||
const sizeSpace = () => ( | ||
<> | ||
<Space size="large"> | ||
Space | ||
<Button type="primary"> primary button </Button> | ||
<Button danger> danger button </Button> | ||
<div>Text</div> | ||
</Space> | ||
<br /> | ||
<br /> | ||
<Space size={50}> | ||
Space | ||
<Button type="primary"> primary button </Button> | ||
<Button danger> danger button </Button> | ||
<div>Text</div> | ||
</Space> | ||
</> | ||
); | ||
|
||
const wrapSpace = () => ( | ||
<div style={{ width: 300 }}> | ||
<Space wrap> | ||
Space | ||
<Button type="primary"> primary button </Button> | ||
<Button danger> danger button </Button> | ||
<div>Text</div> | ||
</Space> | ||
</div> | ||
); | ||
|
||
const splitSpace = () => ( | ||
<Space split="|"> | ||
Space | ||
<Button type="primary"> primary button </Button> | ||
<Button danger> danger button </Button> | ||
<div>Text</div> | ||
</Space> | ||
); | ||
|
||
const verticalSpace = () => ( | ||
<Space direction="vertical" size="middle"> | ||
Space | ||
<Button type="primary"> primary button </Button> | ||
<Button danger> danger button </Button> | ||
<div>Text</div> | ||
</Space> | ||
); | ||
|
||
storiesOf("Space 间距", module).add("Space", defaultSpace); | ||
storiesOf("Space 间距", module) | ||
.add("Space", defaultSpace) | ||
.add("Space 大小", sizeSpace) | ||
.add("Space 换行", wrapSpace) | ||
.add("Space 分隔符", splitSpace) | ||
.add("Space 垂直间距", verticalSpace); |
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 |
---|---|---|
|
@@ -37,3 +37,6 @@ | |
|
||
// Empty | ||
@import "../components/Empty/style"; | ||
|
||
// Space | ||
@import "../components/Space/style"; |