This repository has been archived by the owner on Nov 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Dialog and add it to the website
- Loading branch information
1 parent
4949f37
commit 0ea1a16
Showing
10 changed files
with
102 additions
and
22 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
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,22 @@ | ||
class DialogExample extends Component { | ||
render() { | ||
return ( | ||
<Dialog style={{ maxWidth: '500px' }}> | ||
<Dialog.Title>Dialog Title</Dialog.Title> | ||
<Dialog.Body> | ||
<p> | ||
Lorem ipsum dolor sit amet consectetur adipisicing elit. Numquam | ||
consequatur enim voluptates nobis perferendis voluptatibus alias | ||
modi voluptate dolorum ipsa amet. | ||
</p> | ||
</Dialog.Body> | ||
<Dialog.Actions> | ||
<Button flat>Cancel</Button> | ||
<Button flat>Accept</Button> | ||
</Dialog.Actions> | ||
</Dialog> | ||
); | ||
} | ||
} | ||
|
||
return <DialogExample />; |
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 @@ | ||
## Usage | ||
|
||
```jsx | ||
import { Dialog } from 'materialish'; | ||
import 'materialish/dialog.css'; | ||
``` | ||
|
||
Take note of the fact that a dialog is made up of several components. To see how they | ||
are used together, refer to the example above. | ||
|
||
## Props | ||
|
||
All of the components of a dialog receive the same props. | ||
|
||
| Prop Name | Default Value | Required | Description | | ||
| --------- | ------------- | -------- | ------------------------------------------------------------------ | | ||
| className | | No | Additional class name(s) to add to the dialog component | | ||
| ...rest | | No | Other props are placed on the root element of the dialog component | | ||
|
||
## CSS Variables | ||
|
||
These CSS variables should be applied to the `<Dialog/>` component, and not the sub-components. | ||
|
||
| Variable | Default Value | Description | | ||
| ----------------- | ------------- | ---------------------------------------------------------------------- | | ||
| --mt-baseFontSize | 1rem | The text size and dimensions of the dialog are based off of this value | | ||
| --mt-fontFamily | 'Roboto' | The font family to use for text | |
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 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,27 +1,30 @@ | ||
.mt-dialog { | ||
font-family: var(--mt-fontFamily, 'Roboto'); | ||
font-size: var(--mt-baseFontSize, 1rem); | ||
text-align: left; | ||
background-color: #fff; | ||
box-shadow: 0 11px 15px -7px rgba(0, 0, 0, 0.2), | ||
0 24px 38px 3px rgba(0, 0, 0, 0.14), 0 9px 46px 8px rgba(0, 0, 0, 0.12); | ||
padding: 0 0 0 1.5em; | ||
text-align: left; | ||
box-shadow: 0 11px 15px -7px rgba(0, 0, 0, 0.2), 0 24px 38px 3px rgba(0, 0, 0, 0.14), 0 9px 46px 8px rgba(0, 0, 0, 0.12); | ||
border-radius: 0.125em; | ||
color: #000; | ||
} | ||
|
||
.mt-dialog_title { | ||
padding: 1.5em 0 0; | ||
color: #212121; | ||
font-size: 1.25em; | ||
font-weight: 800; | ||
padding: 1.2em 1.2em 0; | ||
font-weight: 500; | ||
} | ||
|
||
.mt-dialog_content { | ||
padding: 1.25em 1.5em 1.5em 0; | ||
color: #757575; | ||
margin: 1.25em 1.5em 1.5em; | ||
} | ||
|
||
.mt-dialog_actions { | ||
padding: 0.5em 0.25em 0.5em 1.25em; | ||
padding: 0.5em; | ||
display: flex; | ||
justify-content: flex-end; | ||
} | ||
|
||
.mt-dialog_actions .mt-button+.mt-button { | ||
margin-left: 6px; | ||
} |
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