Skip to content

Commit

Permalink
Merge branch 'winter-17' into feature/feeds-v2
Browse files Browse the repository at this point in the history
* winter-17: (28 commits)
  Quiet the hound
  Vertical record home updates
  Syntax fixes
  Fix media object path
  Remove immutables
  Move grid class to utiities
  Add linting comment
  Make zero spacing helpers immutable
  Add record home vertical
  Add additional vertical spacing on list helper
  Add grid helper helper for flex-start
  Fix path to media objects module
  Remove comment
  Initial commit
  Fix Windows compatibility. Fixes #208.
  Remove the background on active footer links (#905)
  Add title to icon for a11y
  fixed url paths within documentation
  moved grid and media object to utilities
  Make sure state and flavor IDs are unique
  ...
  • Loading branch information
brandonferrua committed May 9, 2016
2 parents c5b2fc1 + 59d6c45 commit 4a2892f
Show file tree
Hide file tree
Showing 138 changed files with 468 additions and 164 deletions.
5 changes: 5 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Salesforce Lightning Design System
# Release notes

## Release [1.0.3] - April 26, 2016

- Fixed Sass build issue for npm module

## Release [1.0.2] - April 8, 2016

- Added a link to an [archive of v1.0.0](https://design-system-v-1-0-0.herokuapp.com/), so you can access the documentation and downloads for that previous version
Expand Down Expand Up @@ -369,5 +373,6 @@ The following features are being marked as deprecated in this release and will b

Lots of bug fixes and TLC.

[1.0.3]: https://github.com/salesforce-ux/design-system/compare/v1.0.2...v1.0.3
[1.0.2]: https://github.com/salesforce-ux/design-system/compare/v1.0.1...v1.0.2
[1.0.1]: https://github.com/salesforce-ux/design-system/compare/v1.0.0...v1.0.1
3 changes: 2 additions & 1 deletion app_modules/global/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export default {
],
unmanagedPackageUrls: [
{ version: '1.0.0', url: 'https://login.salesforce.com/packaging/installPackage.apexp?p0=04t61000000kZwH' },
{ version: '1.0.2', url: 'https://login.salesforce.com/packaging/installPackage.apexp?p0=04t61000000kavo' }
{ version: '1.0.2', url: 'https://login.salesforce.com/packaging/installPackage.apexp?p0=04t61000000kavo' },
{ version: '1.0.3', url: 'https://login.salesforce.com/packaging/installPackage.apexp?p0=04t61000000YIVO' }
],
moduleName: 'salesforce-lightning-design-system',
resetWrappingClass: '.slds',
Expand Down
5 changes: 3 additions & 2 deletions app_modules/site/components/page/component/flavor/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import classNames from 'classnames';
import Prism from 'app_modules/site/vendor/prism';
import SvgIcon from 'app_modules/ui/svg-icon';
import { prefix as pf } from 'app_modules/ui/util/component';
import { pathToURL } from 'app_modules/util/string';
import _ from 'lodash';

import Heading from 'app_modules/site/components/page/heading';
Expand Down Expand Up @@ -108,7 +109,7 @@ class ComponentFlavor extends React.Component {
const { flavor } = this.props;
return (
<section className={pf('m-bottom--xx-large p-top--x-large')} data-slds-status={flavor.status}>
<Heading type="h2" id={flavor.id} className={pf('site-text-heading--large site-text-heading--callout')}>
<Heading type="h2" id={`flavor-${flavor.id}`} className={pf('site-text-heading--large site-text-heading--callout')}>
{flavor.title}
{this.renderBadge(flavor.status)}
{this.renderBadge(flavor.formFactorStatus)}
Expand Down Expand Up @@ -197,7 +198,7 @@ class ComponentFlavor extends React.Component {
const src = previewState ? previewState.id : 'default';
const iframe = (
<iframe
src={`/${flavor.path}/_${src}.html?iframe&initial`}
src={`/${pathToURL(flavor.path)}/_${src}.html?iframe&initial`}
height="100%"
id={`iframe-${flavor.uid}`}
name={flavor.uid}
Expand Down
7 changes: 4 additions & 3 deletions app_modules/site/components/page/component/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import SvgIcon from 'app_modules/ui/svg-icon';
import ComponentFlavor from './flavor';
import TableYAML from './table-yaml';
import { prefix as pf } from 'app_modules/ui/util/component';
import { pathToURL } from 'app_modules/util/string';
import classNames from 'classnames';

export default React.createClass({
Expand Down Expand Up @@ -62,9 +63,9 @@ export default React.createClass({
return (
<li className={className} key={state.id}>
<a
href={`#${flavor.id}`}
href={`/${pathToURL(flavor.path)}/_${state.id}.html?iframe`}
data-slds-flavor-states={flavor.uid}
data-slds-flavor-states-src={`/${flavor.path}/_${state.id}.html?iframe`}>
data-slds-flavor-href={`#flavor-${flavor.id}`}>
{state.label}
</a>
</li>
Expand All @@ -75,7 +76,7 @@ export default React.createClass({
}
return (
<li className={pf('list__name site-states-parent')} key={flavor.uid} data-slds-status={flavor.status}>
<a href={`#${flavor.id}`}>
<a href={`#flavor-${flavor.id}`}>
{flavor.title}
{ states ? <SvgIcon className={pf('icon icon-text-default icon__svg align-middle col--bump-left')} sprite="utility" symbol="down" /> : null }
</a>
Expand Down
2 changes: 1 addition & 1 deletion app_modules/ui/code-block/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CodeBlock extends React.Component {
const line = lines.length > 1 ? lines[1] : '';
const offsetMatch = line.match(/^\s*/);
const offset = offsetMatch ? offsetMatch[0].length : 0;
const codeTrimmed = lines.map(line => line.slice(offset)).join('\n');
const codeTrimmed = lines.map(line => line.slice(offset)).join('\n').trim();
return {
__html: highlight(codeTrimmed, language)
};
Expand Down
7 changes: 4 additions & 3 deletions app_modules/ui/util/schema/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import glob from 'glob';
import yaml from 'js-yaml';
import _ from 'lodash';

import { pathTrimStart } from 'app_modules/util/string';

const createTitle = str => _.map(_.words(str), w => _.capitalize(w)).join(' ');

export default props => {
Expand All @@ -36,12 +38,11 @@ export default props => {
let title = createTitle(id);
let config = yaml.safeLoad(fs.readFileSync(configPath).toString());
let localPath = path.dirname(configPath)
.replace(this.path, '')
.replace(/^\//, '');
.replace(this.path, '');
return _.merge({}, {
id,
title,
path: localPath
path: pathTrimStart(localPath)
}, config);
},
getComponents (categoryConfig) {
Expand Down
19 changes: 19 additions & 0 deletions app_modules/util/string/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
Copyright (c) 2015, salesforce.com, inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import _ from 'lodash';
import path from 'path';

export const pathToURL = (p) =>
p.replace(new RegExp(_.escapeRegExp(path.sep), 'g'), '/');

export const pathTrimStart = (p) =>
_.trimStart(p, path.sep);
4 changes: 3 additions & 1 deletion gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import url from 'url';
import webpack from 'webpack';
import webpackDevMiddleware from 'webpack-dev-middleware';

import { pathToURL } from 'app_modules/util/string';

import './scripts/gulp/assets';
import './scripts/gulp/generate';
import { generateUI } from './scripts/gulp/generate-ui';
Expand Down Expand Up @@ -123,7 +125,7 @@ const siteMiddleware = (req, res, next) => {
const log = SLDSLog();
for (const category of ui) {
for (const component of category.components) {
const pattern = new RegExp(_.escapeRegExp(component.path));
const pattern = new RegExp(_.escapeRegExp(pathToURL(component.path)));
if (pattern.test(url)) {
return generateComponentPages([component], err => {
if (err) console.log(err.stack);
Expand Down
16 changes: 14 additions & 2 deletions site/assets/scripts/pages/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,21 @@ const updateComponentPreviewSVG = document => svg4everybody(document);
* and then update the src of the <iframe>
*/
const handleFlavorStateNavClick = (event, element) => {
// Ignore the click handler if Cmd/Ctrl keys are pressed during the click
// to allow users to open links in a new window
if (event.metaKey || event.ctrlKey) {
return;
}

event.preventDefault();
const [ flavor, src ] = ['', '-src'].map(key =>
element.getAttribute(`data-slds-flavor-states${key}`));

const flavor = element.getAttribute('data-slds-flavor-states');
const flavorHref = element.getAttribute('data-slds-flavor-href');
const src = element.href;

// Point to the state's flavor
window.location.hash = flavorHref;

fastdom.mutate(() => {
// Remove all "is-active" classes from the states
$(`[data-slds-flavor-states="${flavor}"]`).forEach(node => {
Expand Down
13 changes: 0 additions & 13 deletions site/assets/styles/_site/regions/_contentinfo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,12 @@

a {
color: $color-text-default;

&:hover,
&:focus {
background-color: rgba($color-background-alt-2, 0.5);
}

&:active {
background-color: darken($color-background-alt-2, 10);
}
}



@include mq-medium-min {
margin-left: $width-sidebar;
}



@include mq-large-min {
z-index: $z-index-dropdown;

Expand Down
2 changes: 1 addition & 1 deletion site/faq/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class FAQ extends React.Component {
`How can I design responsively using the ${g.displayName}?`,
<p className={pf('container--large')}>
We recommend that you make good use of our flexible and
powerful <CTALink href="/components/grid-system" eventType="responsive-grid">Grid System</CTALink>,
powerful <CTALink href="/components/utilities/grid" eventType="responsive-grid">Grid System</CTALink>,
which will help you construct responsive layouts that
scale elegantly across screen sizes.
</p>
Expand Down
36 changes: 21 additions & 15 deletions site/getting-started/heroku/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ export default (
</a>
</li>
<li>
<a href="https://www.npmjs.com/package/npm" target="_blank">
NPM
<a href="https://www.npmjs.com/" target="_blank">
npm
</a>
</li>
<li>
Expand Down Expand Up @@ -119,7 +119,7 @@ $ cd demo_slds_heroku
</div>

<p>
Inside of your <code>demo_slds_heroku/</code> folder create a <code>package.json</code>.
Inside of your <code>demo_slds_heroku/</code> folder, create a <code>package.json</code>.
</p>

<div className={pf('site-code--content scrollable--x')}>
Expand Down Expand Up @@ -157,7 +157,7 @@ license: (ISC)
"description": "demo_slds_heroku",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \\"Error: no test specified\\" && exit 1"
},
"author": "",
"license": "ISC"
Expand Down Expand Up @@ -185,8 +185,10 @@ $ touch public/index.html
<div className={pf('site-code--content scrollable--x')}>
<CodeBlock language="bash">{`
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Playground</title>
</head>
<body>
Expand All @@ -202,7 +204,7 @@ $ touch public/index.html
$ touch server.js
`}</CodeBlock>
</div>
<p>Copy the following code into <code>server.js</code>. Make sure you are in the root of your project (not your /public folder!):</p>
<p>Copy the following code into <code>server.js</code>. Make sure you are in the root of your project (not your <code>/public</code> folder!):</p>
<div className={pf('site-code--content scrollable--x')}>
<CodeBlock language="bash">{`
var express = require('express');
Expand Down Expand Up @@ -246,17 +248,19 @@ demo_slds_heroku/
<p>Add {g.displayName} styles to your <code>public/index.html</code> page by adding the following underneath the <code>title</code> tags:</p>
<div className={pf('site-code--content scrollable--x')}>
<CodeBlock language="bash">{`
<link rel="stylesheet" type="text/css" href="/assets/styles/salesforce-lightning-design-system.css">
<link rel="stylesheet" type="text/css" href="/assets/styles/salesforce-lightning-design-system.css" />
`}</CodeBlock>
</div>
<p>Your <code>public/index.html</code> file should look similar to the following:</p>
<div className={pf('site-code--content scrollable--x')}>
<CodeBlock language="bash">{`
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Playground</title>
<link rel="stylesheet" type="text/css" href="/assets/styles/salesforce-lightning-design-system.css">
<link rel="stylesheet" type="text/css" href="/assets/styles/salesforce-lightning-design-system.css" />
</head>
<body>
Kaixo!
Expand All @@ -269,7 +273,7 @@ demo_slds_heroku/
<h3 className="site-text-heading--medium">
A. Use the Grid System Component (Order)
</h3>
<p>Replace the text inside the <code>body</code> tags with the following. You can find the markup on the <a href="/components/grid-system#order" target="_blank">Grid System component page</a>.</p>
<p>Replace the text inside the <code>body</code> tags with the following. You can find the markup on the <a href="/components/utilities/grid/#order" target="_blank">Grid System component page</a>.</p>
<div className={pf('site-code--content scrollable--x')}>
<CodeBlock language="bash">{`
<div class="slds-grid slds-wrap">
Expand All @@ -292,10 +296,12 @@ demo_slds_heroku/
<div className={pf('site-code--content scrollable--x')}>
<CodeBlock language="bash">{`
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Playground</title>
<link rel="stylesheet" type="text/css" href="/assets/styles/salesforce-lightning-design-system.css">
<link rel="stylesheet" type="text/css" href="/assets/styles/salesforce-lightning-design-system.css" />
</head>
<body>
Expand Down Expand Up @@ -331,7 +337,7 @@ demo_slds_heroku/
<p>Swap the text <code>Image</code> with an image.</p>
<div className={pf('site-code--content scrollable--x')}>
<CodeBlock language="bash">{`
<img src="https://s3-us-west-1.amazonaws.com/sfdc-demo/realty/house08.jpg" alt="Cool house.">
<img src="https://s3-us-west-1.amazonaws.com/sfdc-demo/realty/house08.jpg" alt="Cool house." />
`}</CodeBlock>
</div>

Expand Down Expand Up @@ -386,7 +392,7 @@ $ heroku create [name-of-your-project]
<div className={pf('site-code--content scrollable--x')}>
<CodeBlock language="bash">{`
$ git add .
$ git commit -m "Init"
$ git commit -m "Initial commit"
$ git push heroku master
`}</CodeBlock>
</div>
Expand All @@ -397,7 +403,7 @@ $ heroku open
`}</CodeBlock>
</div>

<Heading type="h2" id="step-8" className="site-text-heading--large">Congrats! You now have a static application!</Heading>
<Heading type="h2" id="step-8" className="site-text-heading--large">Congrats! You now have a static application!</Heading>
<p>Now that you have a static project using the {g.displayName} and Heroku you can use it with any framework, add a database to it, whatever! The world is your oyster!</p>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions site/getting-started/native/ios/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ UIColor* c = [UIColor sldsButtonColor:SLDSColorBtnBackgroundButtonBrand];

<div className={pf('site-code--content scrollable--x')}>
<CodeBlock language="bash">{`
#import <DesignSystem/DesignSystem.h>
#import <DesignSystem/DesignSystem.h>
...
...
UIColor* c = [UIColor sldsInputColor:SLDSColorInputBackgroundInputActive];
UIColor* c = [UIColor sldsInputColor:SLDSColorInputBackgroundInputActive];
`}</CodeBlock>
</div>
Expand Down
Loading

0 comments on commit 4a2892f

Please sign in to comment.