Skip to content

Commit

Permalink
chore(Docs): module imports fixes #34
Browse files Browse the repository at this point in the history
  • Loading branch information
James Friedman committed Dec 6, 2017
1 parent b41a20e commit c8da84e
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 17 deletions.
6 changes: 5 additions & 1 deletion docs/components/detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ export class Detail extends React.Component {
<Grid
id={'detail-section-' + section.name.toLowerCase().replace(' ', '-')}
>
<Header title={section.name} link={section.url} />
<Header
title={section.name}
link={section.url}
module={section.module}
/>

<GridCell span="12">
<div className="demo-example">
Expand Down
37 changes: 21 additions & 16 deletions docs/components/header.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
import React from 'react';
import { GridCell, Typography } from '../../src';

export const Header = ({ title, description, link }) => (
<GridCell span="12" className="header">
<Typography use="display1" tag="h2">
{title}
</Typography>
{description && (
<Typography use="subheading2" tag="div">
{description}
</Typography>
)}
{link && (
<Typography use="body1">
<a href={link}>{link}</a>
</Typography>
)}
</GridCell>
export const Header = ({ title, description, link, module }) => (
<GridCell span="12" className="header">
<Typography use="display1" tag="h2">
{title}
</Typography>
{description && (
<Typography use="subheading2" tag="div">
{description}
</Typography>
)}
{module && (
<Typography use="subheading2" tag="div">
import from <code>{module}</code>
</Typography>
)}
{link && (
<Typography use="body1">
<a href={link}>{link}</a>
</Typography>
)}
</GridCell>
);

export default Header;
28 changes: 28 additions & 0 deletions docs/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export default [
{
name: 'Buttons',
section: 'buttons',
module: 'rmwc/Button',
class: 'Button',
url: 'https://material.io/components/web/catalog/buttons/',
example: `
Expand All @@ -17,6 +18,7 @@ export default [
{
name: 'Fabs',
section: 'fabs',
module: 'rmwc/Fab',
class: 'Fab',
url:
'https://material.io/components/web/catalog/buttons/floating-action-buttons/',
Expand All @@ -28,6 +30,7 @@ export default [
{
name: 'Icon Toggles',
section: 'icon-toggles',
module: 'rmwc/IconToggle',
class: 'IconToggle',
url:
'https://material.io/components/web/catalog/buttons/icon-toggle-buttons/',
Expand All @@ -41,6 +44,7 @@ export default [
{
name: 'Cards',
section: 'cards',
module: 'rmwc/Card',
class: [
'Card',
'CardMedia',
Expand Down Expand Up @@ -75,6 +79,7 @@ export default [
{
name: 'PermanentDrawer',
section: 'permanent-drawer',
module: 'rmwc/Drawer',
class: ['PermanentDrawer', 'PermanentDrawerContent'],
url:
'https://material.io/components/web/catalog/drawers/#permanent-drawer-usage',
Expand All @@ -99,6 +104,7 @@ export default [
{
name: 'PersistentDrawer',
section: 'persistent-drawer',
module: 'rmwc/Drawer',
class: [
'PersistentDrawer',
'PersistentDrawerHeader',
Expand Down Expand Up @@ -138,6 +144,7 @@ export default [
{
name: 'TemporaryDrawer',
section: 'temporary-drawer',
module: 'rmwc/Drawer',
class: [
'TemporaryDrawer',
'TemporaryDrawerHeader',
Expand Down Expand Up @@ -177,6 +184,7 @@ export default [
{
name: 'Dialogs',
section: 'dialogs',
module: 'rmwc/Dialog',
class: [
'Dialog',
'DefaultDialogTemplate',
Expand Down Expand Up @@ -240,6 +248,7 @@ export default [
{
name: 'Elevation',
section: 'elevation',
module: 'rmwc/Elevation',
class: 'Elevation',
url: 'https://material.io/components/web/catalog/elevation/',
example: `
Expand All @@ -265,6 +274,7 @@ export default [
{
name: 'Grid Lists',
section: 'grid-lists',
module: 'rmwc/GridList',
class: [
'GridList',
'GridTile',
Expand Down Expand Up @@ -314,6 +324,7 @@ export default [
{
name: 'Checkboxes',
section: 'checkboxes',
module: 'rmwc/Checkbox',
class: ['Checkbox'],
url:
'https://material.io/components/web/catalog/input-controls/checkboxes/',
Expand All @@ -326,6 +337,7 @@ export default [
},
{
name: 'Form Fields',
module: 'rmwc/FormField',
section: 'form-fields',
class: 'FormField',
url:
Expand All @@ -344,6 +356,7 @@ export default [
{
name: 'Radio Buttons',
section: 'radio-buttons',
module: 'rmwc/RadioButton',
class: 'Radio',
url:
'https://material.io/components/web/catalog/input-controls/radio-buttons/',
Expand All @@ -356,6 +369,7 @@ export default [
{
name: 'Select Menus',
section: 'select-menus',
module: 'rmwc/Select',
class: 'Select',
url:
'https://material.io/components/web/catalog/input-controls/select-menus/',
Expand All @@ -375,6 +389,7 @@ export default [
{
name: 'Sliders',
section: 'sliders',
module: 'rmwc/Slider',
class: 'Slider',
url: 'https://material.io/components/web/catalog/input-controls/sliders/',
example: `
Expand Down Expand Up @@ -407,6 +422,7 @@ export default [
{
name: 'Switches',
section: 'switches',
module: 'rmwc/Switch',
class: 'Switch',
url: 'https://material.io/components/web/catalog/input-controls/switches/',
example: `
Expand All @@ -418,6 +434,7 @@ export default [
{
name: 'TextFields',
section: 'textfields',
module: 'rmwc/TextField',
class: ['TextField', 'TextFieldHelpText', 'TextFieldIcon'],
url:
'https://material.io/components/web/catalog/input-controls/text-fields/',
Expand All @@ -436,6 +453,7 @@ export default [
{
name: 'Layout Grid',
section: 'layout-grid',
module: 'rmwc/Grid',
class: ['Grid', 'GridCell'],
url: 'https://material.io/components/web/catalog/layout-grid/',
example: `
Expand All @@ -449,6 +467,7 @@ export default [
{
name: 'Linear Progress',
section: 'linear-progress',
module: 'rmwc/LinearProgress',
class: 'LinearProgress',
url: 'https://material.io/components/web/catalog/linear-progress/',
example: `
Expand All @@ -461,6 +480,7 @@ export default [
{
name: 'Lists',
section: 'lists',
module: 'rmwc/List',
class: [
'List',
'ListItem',
Expand Down Expand Up @@ -498,6 +518,7 @@ export default [
{
name: 'Menus',
section: 'menus',
module: 'rmwc/Menu',
class: ['Menu', 'MenuItem'],
url: 'https://material.io/components/web/catalog/menus/',
example: `
Expand All @@ -523,6 +544,7 @@ export default [
{
name: 'Ripples',
section: 'ripples',
module: 'rmwc/Ripple',
class: ['Ripple'],
url: 'https://material.io/components/web/catalog/ripples/',
example: `
Expand All @@ -545,6 +567,7 @@ export default [
},
{
name: 'Snackbars',
module: 'rmwc/Snackbar',
section: 'snackbars',
class: ['Snackbar'],
url: 'https://material.io/components/web/catalog/snackbars/',
Expand Down Expand Up @@ -582,6 +605,7 @@ export default [
},
{
name: 'Tabs',
module: 'rmwc/Tabs',
section: 'tabs',
class: ['TabBar', 'Tab'],
url: 'https://material.io/components/web/catalog/tabs/',
Expand All @@ -598,6 +622,7 @@ export default [
},
{
name: 'Theme',
module: 'rmwc/Theme',
section: 'theme',
class: ['Theme'],
url: 'https://material.io/components/web/catalog/theme/',
Expand Down Expand Up @@ -663,6 +688,7 @@ export default [
},
{
name: 'Toolbars',
module: 'rmwc/Toolbar',
section: 'toolbars',
class: [
'Toolbar',
Expand Down Expand Up @@ -709,6 +735,7 @@ export default [
},
{
name: 'Typography',
module: 'rmwc/Typography',
section: 'typography',
class: ['Typography'],
url: 'https://material.io/components/web/catalog/typography/',
Expand All @@ -729,6 +756,7 @@ export default [
},
{
name: 'Icons',
module: 'rmwc/Icon',
section: 'icons',
class: 'Icon',
url: 'https://material.io/components/web/catalog/',
Expand Down
4 changes: 4 additions & 0 deletions docs/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ ul li {
margin-right: -12px;
}

.header code {
color: rgb(0, 0, 128);
}

table {
border-collapse: collapse;
font-size: 13px;
Expand Down

0 comments on commit c8da84e

Please sign in to comment.