Skip to content

Commit

Permalink
feat(illustration): add empty state illustrations (#3041)
Browse files Browse the repository at this point in the history
* feat(illustration): add illustration component

* feat(illustration): add empty state illustrations

* feat(illustration): remove vector-effect property

* feat(illustration): add addition svgs

* feat(illustration): fix lint error

* feat(illiustration): fix linter errors

* feat(illiustration): fix vnu errors

* feat(illustration): add classnames to svg elements

* feat(illustration): edit svg attributes

* feat(illustration): create docblocks

* feat(illustration): add snapshots

* feat(illustrations): update snapshots

* feat(illustration): add call to action variants and improve docs

* feat(illustrations): update snapshots

* chore(illustration): remove ids

chore(illustration): remove ids

* chore(illustration): clean up svgs

chore(illustration): update tests

* chore(illustration): update snapshots

* chore(illustration): use lorum ipsum

* chore(illustration): update tests

* chore(illustration): add tokens

* fix(illustration): doc fixes and text longform

fix(illustration): update tests
  • Loading branch information
engai committed Feb 8, 2018
1 parent 9d7b861 commit a1824e0
Show file tree
Hide file tree
Showing 45 changed files with 55,840 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/gulp/lint.js
Expand Up @@ -92,7 +92,13 @@ gulp.task('lint:html', ['generate:wrappedexamples'], () => {
// Rules documentation:
// https://github.com/yaniswang/HTMLHint/wiki/Rules
'alt-require': true,
'attr-lowercase': ['viewBox', 'preserveAspectRatio'],
'attr-lowercase': [
'viewBox',
'preserveAspectRatio',
'filterUnits',
'gradientTransform',
'stdDeviation'
],
'attr-no-duplication': true,
'attr-unsafe-chars': true,
'attr-value-double-quotes': true,
Expand All @@ -104,7 +110,7 @@ gulp.task('lint:html', ['generate:wrappedexamples'], () => {
'src-not-empty': true,
'tag-pair': true,
'tag-self-close': true,
'tagname-lowercase': true,
'tagname-lowercase': false,
'title-require': true,
// TODO: enable when https://github.com/yaniswang/HTMLHint/issues/139 is fixed
// as <div>&lt;div></div> raises errors at the moment
Expand Down
194 changes: 194 additions & 0 deletions test/__tests__/__snapshots__/Error_alert.json

Large diffs are not rendered by default.

105 changes: 105 additions & 0 deletions test/__tests__/__snapshots__/Illustration_Base.json

Large diffs are not rendered by default.

1,289 changes: 1,289 additions & 0 deletions test/__tests__/__snapshots__/Illustration_Desert.json

Large diffs are not rendered by default.

2,416 changes: 2,416 additions & 0 deletions test/__tests__/__snapshots__/Illustration_Fishing_Deals.json

Large diffs are not rendered by default.

2,359 changes: 2,359 additions & 0 deletions test/__tests__/__snapshots__/Illustration_Going_Camping.json

Large diffs are not rendered by default.

1,473 changes: 1,473 additions & 0 deletions test/__tests__/__snapshots__/Illustration_Gone_Fishing.json

Large diffs are not rendered by default.

1,551 changes: 1,551 additions & 0 deletions test/__tests__/__snapshots__/Illustration_Lake_Mountain.json

Large diffs are not rendered by default.

1,553 changes: 1,553 additions & 0 deletions test/__tests__/__snapshots__/Illustration_Maintenance.json

Large diffs are not rendered by default.

2,089 changes: 2,089 additions & 0 deletions test/__tests__/__snapshots__/Illustration_No_Access.json

Large diffs are not rendered by default.

2,040 changes: 2,040 additions & 0 deletions test/__tests__/__snapshots__/Illustration_No_Access_2.json

Large diffs are not rendered by default.

1,956 changes: 1,956 additions & 0 deletions test/__tests__/__snapshots__/Illustration_No_Connection.json

Large diffs are not rendered by default.

2,097 changes: 2,097 additions & 0 deletions test/__tests__/__snapshots__/Illustration_No_Content.json

Large diffs are not rendered by default.

1,757 changes: 1,757 additions & 0 deletions test/__tests__/__snapshots__/Illustration_No_Events.json

Large diffs are not rendered by default.

2,296 changes: 2,296 additions & 0 deletions test/__tests__/__snapshots__/Illustration_No_Preview.json

Large diffs are not rendered by default.

1,523 changes: 1,523 additions & 0 deletions test/__tests__/__snapshots__/Illustration_No_Task.json

Large diffs are not rendered by default.

1,338 changes: 1,338 additions & 0 deletions test/__tests__/__snapshots__/Illustration_Not_Available_In_Lightning.json

Large diffs are not rendered by default.

1,650 changes: 1,650 additions & 0 deletions test/__tests__/__snapshots__/Illustration_One_CTA_Button.json

Large diffs are not rendered by default.

1,650 changes: 1,650 additions & 0 deletions test/__tests__/__snapshots__/Illustration_One_CTA_Button_Brand.json

Large diffs are not rendered by default.

1,650 changes: 1,650 additions & 0 deletions test/__tests__/__snapshots__/Illustration_One_CTA_Link.json

Large diffs are not rendered by default.

1,513 changes: 1,513 additions & 0 deletions test/__tests__/__snapshots__/Illustration_Open_Road.json

Large diffs are not rendered by default.

1,979 changes: 1,979 additions & 0 deletions test/__tests__/__snapshots__/Illustration_Page_Not_Available.json

Large diffs are not rendered by default.

2,829 changes: 2,829 additions & 0 deletions test/__tests__/__snapshots__/Illustration_Preview.json

Large diffs are not rendered by default.

2,118 changes: 2,118 additions & 0 deletions test/__tests__/__snapshots__/Illustration_Research.json

Large diffs are not rendered by default.

2,011 changes: 2,011 additions & 0 deletions test/__tests__/__snapshots__/Illustration_Setup.json

Large diffs are not rendered by default.

60 changes: 60 additions & 0 deletions test/__tests__/__snapshots__/Illustration_Text_Only_Heading.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

60 changes: 60 additions & 0 deletions test/__tests__/__snapshots__/Illustration_Text_Only_Message.json

Large diffs are not rendered by default.

1,674 changes: 1,674 additions & 0 deletions test/__tests__/__snapshots__/Illustration_Two_CTA.json

Large diffs are not rendered by default.

1,528 changes: 1,528 additions & 0 deletions test/__tests__/__snapshots__/Illustration_Walkthrough_Not_Available.json

Large diffs are not rendered by default.

2,430 changes: 2,430 additions & 0 deletions test/__tests__/__snapshots__/Illustration_With_Message.json

Large diffs are not rendered by default.

194 changes: 194 additions & 0 deletions test/__tests__/__snapshots__/Informational_alert.json

Large diffs are not rendered by default.

194 changes: 194 additions & 0 deletions test/__tests__/__snapshots__/Offline_alert.json

Large diffs are not rendered by default.

194 changes: 194 additions & 0 deletions test/__tests__/__snapshots__/Warning_alert.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions ui/components/_index.scss
Expand Up @@ -224,6 +224,9 @@
// Expandable
'expandable-section/base/index',

// Illustration
'illustration/base/index',

// Regions
'regions/base/index',

Expand Down
19 changes: 19 additions & 0 deletions ui/components/illustration/_doc.scss
@@ -0,0 +1,19 @@
// Copyright (c) 2015-present, salesforce.com, inc. All rights reserved
// Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license

/**
* An illustration is a component that displays an stateful image and message.
* Illustrations should be used within other components, such as cards, to express the state of the component (i.e. empty states).
* They should be accompanied by text that also describes the state of the component.
*
* #### Accessibility
*
* Each SVG tag requires an `aria-hidden="true"` attribute
*
* @summary Illustrations are used to display illustration images. They should be used within other components, such as cards.
*
* @base
* @name illustration
* @selector .slds-illustration
* @support dev-ready
*/
70 changes: 70 additions & 0 deletions ui/components/illustration/base/_index.scss
@@ -0,0 +1,70 @@
// Copyright (c) 2015-present, salesforce.com, inc. All rights reserved
// Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license

/**
*
* @summary Initiates an illustration component
*
* @name base
* @selector .slds-illustration
* @restrict div
* @variant
*/
.slds-illustration {

text-align: center;

/**
* @summary Applies width and height values for small illustrations
* @selector .slds-illustration_small
* @restrict .slds-illustration
* @modifier
* @group width
*/
&_small svg {
width: 100%;
max-width: 300px;
max-height: 200px;
margin-bottom: $spacing-medium;
}

/**
* @summary Applies width and height values for large illustrations
* @selector .slds-illustration_large
* @restrict .slds-illustration
* @modifier
* @group width
*/
&_large svg {
width: 100%;
max-width: 600px;
max-height: 400px;
margin-bottom: $spacing-medium;
}

.slds-illustration__stroke-primary {
stroke: $illustration-color-primary;
stop-color: $illustration-color-primary;
}

.slds-illustration__stroke-secondary {
stroke: $illustration-color-secondary;
stop-color: $illustration-color-secondary;
}

.slds-illustration__fill-primary {
fill: $illustration-color-primary;
}

.slds-illustration__fill-secondary {
fill: $illustration-color-secondary;
}

.slds-illustration__stop-color-primary {
stop-color: $illustration-color-primary;
}

.slds-illustration__stop-color-secondary {
stop-color: $illustration-color-secondary;
}
}

0 comments on commit a1824e0

Please sign in to comment.