Skip to content

Commit

Permalink
Merge branch 'master' of github.com:carbon-design-system/gatsby-theme…
Browse files Browse the repository at this point in the history
…-carbon into homepage-updates
  • Loading branch information
vpicone committed May 7, 2019
2 parents 3aef207 + 0617726 commit 26c7ec8
Show file tree
Hide file tree
Showing 17 changed files with 422 additions and 285 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@
],
"devDependencies": {
"babel-eslint": "^9.0.0",
"eslint": "^5.14.1",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^4.1.0",
"eslint-config-prettier": "^4.2.0",
"eslint-config-wesbos": "0.0.19",
"eslint-plugin-html": "^5.0.3",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react": "^7.13.0",
"eslint-plugin-react-hooks": "^1.3.0",
"lerna": "^3.13.3",
"prettier": "^1.16.4",
"lerna": "^3.13.4",
"prettier": "^1.17.0",
"yarn": "^1.15.2"
}
}
2 changes: 1 addition & 1 deletion packages/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"serve": "gatsby serve"
},
"dependencies": {
"gatsby": "^2.3.5",
"gatsby": "^2.4.2",
"gatsby-theme-carbon": "^0.3.1",
"react": "^16.8.6",
"react-dom": "^16.8.6"
Expand Down
2 changes: 2 additions & 0 deletions packages/example/src/data/nav-items.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
path: /component-examples/DoDontExample
- title: Caption
path: /component-examples/Caption
- title: Aside
path: /component-examples/Aside
- title: ResourceCard
path: /component-examples/ResourceCard
- title: ArticleCard
Expand Down
4 changes: 2 additions & 2 deletions packages/example/src/pages/component-examples/ArticleCard.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import { Row, Column, ArticleCard } from 'gatsby-theme-carbon';
<Row>
<Column colMd={4} colLg={4} noGutterMdLeft>
<ArticleCard
title="Explore & Create"
title="Internal link"
author="Josh Black"
date="April 29, 2019"
readTime="Read time: 5 min"
href="https://www.ibm.com"
href="/"
>

![](/images/Article_05.png)
Expand Down
33 changes: 33 additions & 0 deletions packages/example/src/pages/component-examples/Aside.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Aside
---

import { Row, Column, Aside } from 'gatsby-theme-carbon';

## Aside

<Row>
<Column colMd={5} colLg={7} className="bx--type-expressive-heading-03">

<p className="bx--type-expressive-heading-03">Lorem ipsum dolor sit amet, consectetur adipiscing elit. In in pulvinar ipsum. Etiam sit amet nibh ultricies, pretium quam vitae, auctor nunc. Curabitur hendrerit lectus eros, eget imperdiet ante interdum non. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sagittis nisi dictum sapien euismod facilisis. Donec in nisl urna. Sed pellentesque ex dui, vitae egestas ante laoreet id. Ut eros odio, cursus vitae finibus vel, laoreet vel quam.</p>

> Lorem ipsum dolor sit amet, consectetur adipiscing elit. In in pulvinar ipsum. Etiam sit amet nibh ultricies, pretium quam vitae, auctor nunc.

<p className="bx--type-expressive-heading-03">Lorem ipsum dolor sit amet, consectetur adipiscing elit. In in pulvinar ipsum. Etiam sit amet nibh ultricies, pretium quam vitae, auctor nunc. Curabitur hendrerit lectus eros, eget imperdiet ante interdum non. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sagittis nisi dictum sapien euismod facilisis. Donec in nisl urna. Sed pellentesque ex dui, vitae egestas ante laoreet id. Ut eros odio, cursus vitae finibus vel, laoreet vel quam.</p>

</Column>
<Column colSm={0} colMd={2} colLg={3} offsetMd={1} noGutterSm>
<Aside>

**Good design is always good design.**

What we borrow from our own design history is not a mid-century aesthetic in stylistic terms, but the modernist attitudes and approach used at the time.

Eliot Noyes taught us brand is character, and should be built through curation. Paul Rand taught us the importance of endless experimentation. Charles and Ray Eames brought out our playful nature, and were pioneering what is now referred to as “branded content” and “experiential.”

Their methods are as modern today as ever before, maybe more so.

</Aside>

</Column>
</Row>
53 changes: 53 additions & 0 deletions packages/example/src/pages/component-examples/demo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
DoDontExample,
Row,
Column,
Aside,
} from 'gatsby-theme-carbon';

<PageDescription>
Expand All @@ -29,6 +30,58 @@ import {
<AnchorLink>Tools</AnchorLink>
</AnchorLinks>

Add-on repositories, or repos, are components built for a specific product or
experience. The repos are built on top of the core Carbon repo, and enable
teams to create their own custom components that follow Carbon's visual style
and guidelines.

> Add-on repositories, or repos, are components built for a specific product or
> experience. The repos are built on top of the core Carbon repo, and enable
> teams to create their own custom components that follow Carbon's visual style
> and guidelines.

Add-on repositories, or repos, are components built for a specific product or
experience. The repos are built on top of the core Carbon repo, and enable
teams to create their own custom components that follow Carbon's visual style
and guidelines.

<Row>
<Column colMd={6} colLg={8}>

IBMers believe in progress—that application of intelligence, reason and science can improve business, society and the human condition.

Given our scale and scope, ‘good design’ is not only a requirement, it’s a deeper responsibility to relationships we seek to serve.

<h2>Design is how <br/>
we <em>build</em> bonds.</h2>

Today, the talent, techniques, thinking and tools of design, like technology, have become more and more abundant and accessible to all alike.

Paradoxically, decisions are more distributed, and experiences can become less and less distinctive. The rapid, relentless pace to produce can create an uneven emphasis on immediacy and incrementalism over individuality and innovation.

It is more important than ever that we own our own ethos, make palpable our brand values, and incorporate an instantly identifiable IBMness in everything we do.

> Without aesthetic, design is either the humdrum repetition of familiar clichés or a wild scramble for novelty. Without aesthetic, the computer is but a mindless speed machine, producing effects without substance, form without relevant content, or content without meaningful form.
> – Paul Rand

Aesthetic is defined as the philosophical theory or set of principles governing outward appearance or actions. This characteristic applied to any experience is essential to its effectiveness. Everything we do (and don’t do) communicates. The care and craft we put into every experience is equal to any confidence or consideration we should expect in return.

</Column>
<Column colMd={2} colLg={4}>
<Aside>

**Good design is always good design.**

What we borrow from our own design history is not a mid-century aesthetic in stylistic terms, but the modernist attitudes and approach used at the time.

Eliot Noyes taught us brand is character, and should be built through curation. Paul Rand taught us the importance of endless experimentation. Charles and Ray Eames brought out our playful nature, and were pioneering what is now referred to as “branded content” and “experiential.”

Their methods are as modern today as ever before, maybe more so.

</Aside>
</Column>
</Row>

## Heading 2

![blossom](../../images/blossom.jpg)
Expand Down
2 changes: 2 additions & 0 deletions packages/gatsby-theme-carbon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ export { default as Caption } from './src/components/Caption';
export { default as ResourceCard } from './src/components/ResourceCard';
export { default as ArticleCard } from './src/components/ArticleCard';
export { Callout, Banner } from './src/components/Homepage';
export { default as Aside } from './src/components/Aside';

// export { default as ImageComponent } from './src/components/ImageComponent'; // in progress
26 changes: 13 additions & 13 deletions packages/gatsby-theme-carbon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@
},
"license": "Apache 2.0",
"peerDependencies": {
"gatsby": "^2.3.5",
"gatsby": "^2.4.2",
"react": "^16.8.6",
"react-dom": "^16.8.6"
},
"devDependencies": {
"gatsby": "^2.3.5",
"gatsby": "^2.4.2",
"react": "^16.8.6",
"react-dom": "^16.8.6"
},
"dependencies": {
"@carbon/addons-website": "0.0.1-alpha.21",
"@carbon/colors": "^10.0.0",
"@carbon/elements": "^10.0.0",
"@carbon/grid": "^10.0.0",
"@carbon/icons-react": "^10.0.0",
"@carbon/layout": "^10.0.0",
"@carbon/themes": "^10.0.0",
"@carbon/type": "^10.0.0",
"@carbon/colors": "^10.1.1",
"@carbon/elements": "^10.1.1",
"@carbon/grid": "^10.1.1",
"@carbon/icons-react": "^10.1.1",
"@carbon/layout": "^10.1.1",
"@carbon/themes": "^10.1.1",
"@carbon/type": "^10.1.1",
"@emotion/core": "^10.0.10",
"@emotion/styled": "^10.0.10",
"@mdx-js/mdx": "^1.0.5",
Expand All @@ -36,14 +36,14 @@
"carbon-components-react": "^7.2.0",
"classnames": "^2.2.6",
"emotion-theming": "^10.0.10",
"gatsby-mdx": "^0.6.2",
"gatsby-mdx": "^0.6.3",
"gatsby-plugin-compile-es6-packages": "^1.1.0",
"gatsby-plugin-emotion": "^4.0.6",
"gatsby-plugin-manifest": "^2.0.29",
"gatsby-plugin-manifest": "^2.1.1",
"gatsby-plugin-react-helmet": "^3.0.12",
"gatsby-plugin-sass": "^2.0.11",
"gatsby-plugin-sharp": "^2.0.33",
"gatsby-remark-images": "^3.0.10",
"gatsby-plugin-sharp": "^2.0.36",
"gatsby-remark-images": "^3.0.11",
"gatsby-remark-responsive-iframe": "^2.1.1",
"gatsby-remark-smartypants": "^2.0.9",
"gatsby-remark-unwrap-images": "^1.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default class ArticleCard extends React.Component {
isLink = href.charAt(0) === '/';
}

const ResourceCardClassNames = classnames([`${prefix}--article-card`], {
const ArticleCardClassNames = classnames([`${prefix}--article-card`], {
[className]: className,
[`${prefix}--article-card--disabled`]: disabled,
[`${prefix}--article-card--dark`]: dark,
Expand Down Expand Up @@ -124,10 +124,10 @@ export default class ArticleCard extends React.Component {
</div>
<div className={`${prefix}--article-card__icon--action`}>
{actionIcon === 'launch' && !disabled ? (
<Launch20 aria-label="Open resource" />
<Launch20 aria-label="Open" />
) : null}
{actionIcon === 'arrowRight' && !disabled ? (
<ArrowRight20 aria-label="Open resource" />
<ArrowRight20 aria-label="Open" />
) : null}
{actionIcon === 'download' && !disabled ? (
<Download20 aria-label="Download" />
Expand All @@ -141,25 +141,28 @@ export default class ArticleCard extends React.Component {
</>
);

let cardContainer;
if (disabled === true) {
return (
<div className={ResourceCardClassNames}>
<div className={carbonTileclassNames}>{cardContent}</div>
</div>
cardContainer = <div className={carbonTileclassNames}>{cardContent}</div>;
} else if (isLink === true) {
cardContainer = (
<Link to={href} className={carbonTileclassNames}>
{cardContent}
</Link>
);
} else {
return (
<div className={ResourceCardClassNames}>
<a
target="_blank"
rel="noopener noreferrer"
href={href}
className={carbonTileclassNames}
>
{cardContent}
</a>
</div>
cardContainer = (
<a
target="_blank"
rel="noopener noreferrer"
href={href}
className={carbonTileclassNames}
>
{cardContent}
</a>
);
}

return <div className={ArticleCardClassNames}>{cardContainer}</div>;
}
}
27 changes: 27 additions & 0 deletions packages/gatsby-theme-carbon/src/components/Aside/Aside.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { settings } from 'carbon-components';

const { prefix } = settings;

export default class Aside extends React.Component {
static propTypes = {
children: PropTypes.node,

/**
* Specify a custom class
*/
className: PropTypes.string,
};

render() {
const { children, className } = this.props;

const captionClasses = classnames([`${prefix}--aside`], {
[className]: className,
});

return <aside className={captionClasses}>{children}</aside>;
}
}
20 changes: 20 additions & 0 deletions packages/gatsby-theme-carbon/src/components/Aside/aside.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.#{$prefix}--aside {
@include carbon--type-style('body-long-01');
position: relative;
padding-top: $spacing-04;
}

.#{$prefix}--aside:before {
content: '';
position: absolute;
top: 0;
left: -1rem;
width: 75%;
height: 1px;
background: $ui-05;
}

.#{$prefix}--aside .#{$prefix}--paragraph {
@include carbon--type-style('body-long-01');
width: 75%;
}
3 changes: 3 additions & 0 deletions packages/gatsby-theme-carbon/src/components/Aside/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Aside from './Aside';

export default Aside;
47 changes: 29 additions & 18 deletions packages/gatsby-theme-carbon/src/components/markdown/P.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
import React from 'react';
import responsiveStyles from '../shared/responsiveStyles';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { settings } from 'carbon-components';

const pCss = ({ typeStyles, layout }) => [
typeStyles.bodyLong02,
responsiveStyles,
{
marginBottom: layout[1],
'& :empty': {
padding: 0,
margin: 0,
},
},
];
const { prefix } = settings;

const P = ({ children }) => (
<p css={pCss} className="carbon--mdx__p">
{children}
</p>
);
export default class P extends React.Component {
static propTypes = {
children: PropTypes.node,

export default P;
/**
* Set to full width
*/
fullWidth: PropTypes.bool,

/**
* Specify a custom class
*/
className: PropTypes.string,
};

render() {
const { children, className, fullWidth } = this.props;

const paragraphClasses = classnames([`${prefix}--paragraph`], {
[className]: className,
[`${prefix}--paragraph--responsive`]: !fullWidth,
});

return <p className={paragraphClasses}>{children}</p>;
}
}
Loading

0 comments on commit 26c7ec8

Please sign in to comment.