diff --git a/demo/i18n/en.js b/demo/i18n/en.js
index 0ae4af694d..f4981bab30 100644
--- a/demo/i18n/en.js
+++ b/demo/i18n/en.js
@@ -29,7 +29,7 @@ I18n.translations['en'] = {
get_started: {
ready: 'Ready to Get Started?',
- checkout: 'Checkout the Github repository or download Carbon'
+ checkout: 'Check out the Github repository or download Carbon'
},
learn_more: {
@@ -47,7 +47,7 @@ I18n.translations['en'] = {
page_header_large: {
heading1: 'Carbon is a library of React components for building great web applications.',
- heading2: 'Carbon is open source. It’s hosted, developed, and maintained on Github.',
+ heading2: 'Carbon is Open Source. It’s hosted, developed, and maintained on Github.',
version: 'Currently: v1.0.0.beta'
},
@@ -73,7 +73,7 @@ I18n.translations['en'] = {
},
brush: {
heading: 'Designed for UX',
- text: 'Meet your users’ needs with a simple, elegant, delightful experience'
+ text: 'Meet your users’ needs with a simple, elegant, delightful experience.'
},
hammer: {
heading: 'Build smarter',
@@ -91,7 +91,8 @@ I18n.translations['en'] = {
},
component_page: {
- design_notes: 'Designer Notes'
+ design_notes: 'Designer Notes',
+ related_components: 'Related Components'
},
errors: {
@@ -105,11 +106,11 @@ I18n.translations['en'] = {
style: {
colors: {
- subtitle: 'Enables a consistent styling across your application'
+ subtitle: 'A vibrant palette for a consistent visual style across your app.'
},
icons: {
- subtitle: 'Free open source icons to use in your project',
+ subtitle: 'Free icons to use in your project.',
},
}
};
diff --git a/demo/views/common/information-styles/information-styles.js b/demo/views/common/information-styles/information-styles.js
new file mode 100644
index 0000000000..f8d6cc915e
--- /dev/null
+++ b/demo/views/common/information-styles/information-styles.js
@@ -0,0 +1,13 @@
+import React from 'react';
+
+/**
+ * Wraps children in styling wrapper
+ *
+ * @param {object} props
+ * @return {InformationStyled}
+ */
+export default props => (
+
+ { props.children }
+
+);
diff --git a/demo/views/common/information-styles/information-styles.scss b/demo/views/common/information-styles/information-styles.scss
new file mode 100644
index 0000000000..12e6421f9f
--- /dev/null
+++ b/demo/views/common/information-styles/information-styles.scss
@@ -0,0 +1,18 @@
+@import 'colors';
+
+.demo-information-styles {
+ a {
+ color: $blue;
+ font-weight: bold;
+ text-decoration: none;
+
+ &:hover {
+ color: $blue-dark;
+ text-decoration: underline;
+ }
+ }
+
+ li {
+ line-height: 20px;
+ }
+}
diff --git a/demo/views/common/information-styles/package.json b/demo/views/common/information-styles/package.json
new file mode 100644
index 0000000000..a896bb984d
--- /dev/null
+++ b/demo/views/common/information-styles/package.json
@@ -0,0 +1,4 @@
+{
+ "main": "./information-styles.js",
+ "style": "./information-styles.scss"
+}
diff --git a/demo/views/common/page-content-area/page-content-area.js b/demo/views/common/page-content-area/page-content-area.js
index 6a4417daf6..9cd9cf079e 100644
--- a/demo/views/common/page-content-area/page-content-area.js
+++ b/demo/views/common/page-content-area/page-content-area.js
@@ -11,7 +11,7 @@ import SimpleHeading from './../../../components/simple-heading';
* @return {PageContentArea}
*/
export default props => (
-
+
{ props.children }
diff --git a/demo/views/common/sub-page-navigation/sub-page-navigation.scss b/demo/views/common/sub-page-navigation/sub-page-navigation.scss
index 8e5125f2e6..c17678ced9 100644
--- a/demo/views/common/sub-page-navigation/sub-page-navigation.scss
+++ b/demo/views/common/sub-page-navigation/sub-page-navigation.scss
@@ -27,7 +27,7 @@
.demo-arrow-link {
align-items: stretch;
&__icon {
- margin-top: 1em;
+ padding-top: 20px;
}
}
}
diff --git a/demo/views/pages/component/component.js b/demo/views/pages/component/component.js
index 5a2dcfc1f2..23eb04a65f 100644
--- a/demo/views/pages/component/component.js
+++ b/demo/views/pages/component/component.js
@@ -5,6 +5,7 @@ import I18n from 'i18n-js';
// App Components
import PageContentArea from '../../common/page-content-area';
+import InformationStyles from '../../common/information-styles';
import ComponentPreview from './component-preview';
import ComponentAPI from './component-api';
@@ -25,17 +26,34 @@ class Component extends React.Component {
{ this.renderAPIs(definition) }
{ this.renderDesignerNotes(definition) }
+ { this.renderRelatedComponentsNotes(definition) }
);
}
+ renderRelatedComponentsNotes = (definition) => {
+ let relatedComponentsNotes = definition.get('relatedComponentsNotes');
+
+ if (relatedComponentsNotes) {
+ return (
+
+
+
+
+
+ );
+ }
+ }
+
renderDesignerNotes = (definition) => {
let designerNotes = definition.get('designerNotes');
if (designerNotes) {
return (
-
+
+
+
);
} else {
diff --git a/demo/views/pages/document/document.js b/demo/views/pages/document/document.js
index 7dae62b433..2a24c86e4f 100644
--- a/demo/views/pages/document/document.js
+++ b/demo/views/pages/document/document.js
@@ -4,6 +4,7 @@ import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
import DocumentStore from './../../../stores/document';
import DocumentActions from './../../../actions/document';
import marked from 'marked';
+import InformationStyles from '../../common/information-styles';
import Spinner from 'components/spinner';
import Row from 'components/row';
import Highlight from 'react-highlight';
@@ -53,20 +54,22 @@ class Document extends React.Component {
}
return (
-
- { content }
+
+
+ { content }
-
- { spinner }
-
-
+
+ { spinner }
+
+
+
);
}
}
diff --git a/demo/views/pages/document/document.scss b/demo/views/pages/document/document.scss
index b31e78b71c..3568c9c8ca 100644
--- a/demo/views/pages/document/document.scss
+++ b/demo/views/pages/document/document.scss
@@ -14,17 +14,6 @@ $doc-animation: opacity 100ms 200ms ease-in;
}
}
- a {
- color: $blue;
- font-weight: bold;
- text-decoration: none;
-
- &:hover {
- color: $blue-dark;
- text-decoration: underline;
- }
- }
-
code {
background-color: $grey-dark-blue-15;
border-radius: 4px;
diff --git a/src/components/alert/definition.js b/src/components/alert/definition.js
index ccf212e432..86459f7fcc 100644
--- a/src/components/alert/definition.js
+++ b/src/components/alert/definition.js
@@ -3,6 +3,20 @@ import OptionsHelper from '../../utils/helpers/options-helper';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('alert', Alert, {
+ description: `An important message that interrupts user activity, but can be dismissed.`,
+ designerNotes: `
+* Useful if a message is so important you’d like to prevent any other activity until the user resolves it.
+* If the message isn’t so important, or you want to avoid disrupting the user’s activity, consider showing a static Message component in the underlying screen.
+* Include a Message component within the Alert component, use plain text, or apply a standard Carbon Error or Warning icon.
+* This component has the same options and properties as the Dialog component.
+ `,
+ relatedComponentsNotes: `
+* Simple positive or negative confirmation? [Try Flash](/components/flash).
+* Longer message which stays on-screen? [Try Message](/components/message).
+* Longer, time sensitive message that must be dismissed? [Try Toast](/components/toast).
+* Confirm or cancel an action I’ve initiated? [Try Confirm](/components/confirm).
+* Simple task in context? [Try Dialog](/components/dialog).
+ `,
propOptions: {
size: OptionsHelper.sizesFull
},
diff --git a/src/components/animated-menu-button/definition.js b/src/components/animated-menu-button/definition.js
index 1e3baed3d3..d90471b4bc 100644
--- a/src/components/animated-menu-button/definition.js
+++ b/src/components/animated-menu-button/definition.js
@@ -3,6 +3,18 @@ import OptionsHelper from '../../utils/helpers/options-helper';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('animated-menu-button', AnimatedMenuButton, {
+ description: `Quick access to a number of especially useful hyperlinks.`,
+ designerNotes: `
+* A quick way for users to access a number of useful hyperlinks in context.
+* This pattern tends to be used as a quick way of allowing the user to create a range of new items (e.g. New Sales Invoice, New Quote, New Payment).
+* Try not to mix navigation options with action options.
+* Try not to create any duplication between the Menu component, and this component.
+ `,
+ relatedComponentsNotes: `
+* Choosing between variants of the same page, or filtering content? [Try Tabs](/components/tabs).
+* Positioning your primary navigation? [Try Navigation Bar](/components/navigation-bar).
+* Navigating the hierarchy of the app? [Try Menu](/components/menu).
+ `,
hiddenProps: ["children"],
propOptions: {
direction: OptionsHelper.alignBinary,
diff --git a/src/components/app-wrapper/definition.js b/src/components/app-wrapper/definition.js
index f9f3738468..31ad5db070 100644
--- a/src/components/app-wrapper/definition.js
+++ b/src/components/app-wrapper/definition.js
@@ -3,6 +3,12 @@ import OptionsHelper from '../../utils/helpers/options-helper';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('app-wrapper', AppWrapper, {
+ description: `Wraps all components inside an overall container.`,
+ relatedComponentsNotes: `
+* Need a container for your primary navigation? [Try Navigation Bar](/components/navigation-bar).
+* Navigating the hierarchy of the app? [Try Menu](/components/menu).
+* Laying out a page in columns? [Try Row](/components/row).
+ `,
propValues: {
children: "This component will wrap its children within the width constraints of your application."
},
diff --git a/src/components/button-toggle/definition.js b/src/components/button-toggle/definition.js
index ef10de7e88..9e2a3ef69b 100644
--- a/src/components/button-toggle/definition.js
+++ b/src/components/button-toggle/definition.js
@@ -3,6 +3,20 @@ import Definition from './../../../demo/utils/definition';
import OptionsHelper from 'utils/helpers/options-helper';
let definition = new Definition('button-toggle', ButtonToggle, {
+ description: `Selects one option from a small number of highly visible options.`,
+ designerNotes: `
+* Useful if the user has a choice between a small number of options, that you’d like to be highly visible (e.g. choosing between three or fewer subscription packages, with short names).
+* To make the meaning of an option clearer, you can add an icon to it. Just name one of the Carbon icons.
+ `,
+ relatedComponentsNotes: `
+* Performing a single action? [Try Button](/components/button).
+* Range of buttons where one is more important? [Try Split Button](/components/split-button).
+* Range of buttons of the same importance? [Try Multi Action Button](/components/multi-action-button).
+* Choosing one option from a longer list? [Try Radio Button](/components/radio-button).
+* Choosing one option from a very long list? [Try Dropdown](/components/dropdown).
+* Choosing more than one option? [Try Checkbox](/components/checkbox).
+* Need a visual? [Try Icons](/style/icons).
+ `,
type: 'action',
numberOfExamples: 3,
propOptions: {
diff --git a/src/components/button/definition.js b/src/components/button/definition.js
index b54225fa77..d7a81042c6 100644
--- a/src/components/button/definition.js
+++ b/src/components/button/definition.js
@@ -3,6 +3,20 @@ import OptionsHelper from '../../utils/helpers/options-helper';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('button', Button, {
+ description: `Performs an action.`,
+ designerNotes: `
+* Avoid using buttons for navigation (taking the user somewhere else) - use them for performing an action or command.
+* Use a Primary configuration for positive actions that are the main goal for the user (e.g. Save, Submit, Continue).
+* Avoid placing Secondary actions on a form if you can.
+* If an action is particularly destructive (e.g. Delete or Clear), consider using Red configuration. It might be a good idea to show a confirmation dialog, or the ability to undo it too.
+* Try to create a single path to completion by aligning your action with your inputs.
+* You can disable a Button, but try to avoid this. If you need to, make it clear what the user needs to do in order to activate the Button. A good case for disabling an action is to prevent a form being submitted twice (e.g. on a payment page).
+ `,
+ relatedComponentsNotes: `
+* Range of buttons where one is more important? [Try Split Button](/components/split-button).
+* Range of buttons all of the same importance? [Try Multi Action Button](/components/multi-action-button).
+* Choosing one option from a highly visible range? [Try Button Toggle](/components/button-toggle).
+ `,
propOptions: {
as: OptionsHelper.themesBinary,
theme: OptionsHelper.buttonColors,
diff --git a/src/components/carousel/definition.js b/src/components/carousel/definition.js
index d94c1b9141..0e3d027f8d 100644
--- a/src/components/carousel/definition.js
+++ b/src/components/carousel/definition.js
@@ -4,6 +4,11 @@ import Definition from './../../../demo/utils/definition';
import slideDefinition from './slide/definition';
let definition = new Definition('carousel', Carousel, {
+ description: `Steps through a series of images.`,
+ designerNotes: `
+* Presents a series of images which the user can step through one-by-one, or quickly jump to a particular step.
+* Useful for showcasing a set of new features, for example.
+ `,
associatedDefinitions: [slideDefinition],
propTypes: {
children: 'Node',
diff --git a/src/components/checkbox/definition.js b/src/components/checkbox/definition.js
index 15fbaa9d8f..2fe3e4a922 100644
--- a/src/components/checkbox/definition.js
+++ b/src/components/checkbox/definition.js
@@ -2,6 +2,18 @@ import Checkbox from './';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('checkbox', Checkbox, {
+ description: `Selects more than one option.`,
+ designerNotes: `
+* Checkbox provides a way to efficiently select more than one item from a list.
+* Disabled or read-only checkboxes might be difficult for a user to distinguish visually, so try to avoid this.
+* Consider ‘smart default’ selections, based on what your user is likely to choose. But, users may well leave the defaults in place, so make sure any consequences are easy to undo, and not harmful.
+* Rather than a checkbox to accept legal terms, consider labelling a button ‘Accept Terms and Continue’ instead.
+ `,
+ relatedComponentsNotes: `
+* Choosing one option from a longer list? [Try Radio Button](/components/radio-button).
+* Choosing one option from a very long list? [Try Dropdown](/components/dropdown).
+* Choosing one option from a highly visible range? [Try Button Toggle](/components/button-toggle).
+ `,
type: 'form',
propTypes: {
reverse: 'Boolean'
diff --git a/src/components/confirm/definition.js b/src/components/confirm/definition.js
index a3baa96000..c2f882eeef 100644
--- a/src/components/confirm/definition.js
+++ b/src/components/confirm/definition.js
@@ -3,6 +3,21 @@ import OptionsHelper from '../../utils/helpers/options-helper';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('confirm', Confirm, {
+ description: `Confirms or cancels an action.`,
+ designerNotes: `
+* Shows a static message in a dialog which asks the user to confirm or cancel an action they’ve initiated.
+* Useful to confirm actions which may be difficult to undo, or potentially harmful.
+* Include a Message component within the Alert component (a warning Message component may be particularly useful for a potentially harmful choice), use plain text, or apply a standard Carbon Error or Warning icon.
+* This component has the same options and properties as the Dialog component.
+* A good example could be confirming deletion of a large number of records.
+ `,
+ relatedComponentsNotes: `
+* Simple positive or negative confirmation? [Try Flash](/components/flash).
+* Longer message which stays on-screen? [Try Message](/components/message).
+* Longer, time sensitive message that must be dismissed? [Try Toast](/components/toast).
+* Error or warning message that interrupts activity? [Try Alert](/components/alert).
+* Simple task in context? [Try Dialog](/components/dialog).
+ `,
propOptions: {
size: OptionsHelper.sizesFull
},
diff --git a/src/components/content/definition.js b/src/components/content/definition.js
index 2d805d0ccf..00b14ef9bc 100644
--- a/src/components/content/definition.js
+++ b/src/components/content/definition.js
@@ -3,6 +3,16 @@ import OptionsHelper from '../../utils/helpers/options-helper';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('content', Content, {
+ description: `Text content with simple styles.`,
+ designerNotes: `
+* Useful to show simple text content in a common arrangement.
+* Shows a title in bold, with plain text content children.
+* Make sure that the colour of all text has a contrast ratio of at least 4.5.1, to meet the [WCAG 2.0 AA standard](https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html) for text less than 19px in size. Webaim have a good online [Contrast Checker](http://webaim.org/resources/contrastchecker/).
+ `,
+ relatedComponentsNotes: `
+* Prominent text callout? [Try Detail](/components/detail).
+* Headings and sections? [Try Heading](/components/heading).
+ `,
propValues: {
title: "Content Component",
children: "An example of some content."
diff --git a/src/components/create/definition.js b/src/components/create/definition.js
index a4645b50dc..b25d63daf1 100644
--- a/src/components/create/definition.js
+++ b/src/components/create/definition.js
@@ -3,6 +3,16 @@ import OptionsHelper from '../../utils/helpers/options-helper';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('create', Create, {
+ description: `Creates a new set of content that's grouped together.`,
+ designerNotes: `
+* Creates an item of data usually presented in a Pod or Fieldset, for example, an address.
+ `,
+ relatedComponentsNotes: `
+* Editing a number of closely related inputs? [Try Fieldset](/components/fieldset).
+* Filling in a broad series of inputs? [Try Form](/components/form).
+* Viewing content that’s grouped together visually? [Try Pod](/components/pod).
+* Using Fieldset and Pod components together? [Try Show/Edit Pod](/components/show-edit-pod).
+ `,
hiddenProps: ["linkProps"],
propValues: {
children: "Resource Name"
diff --git a/src/components/date-range/definition.js b/src/components/date-range/definition.js
index d11adef598..33f9e3797f 100644
--- a/src/components/date-range/definition.js
+++ b/src/components/date-range/definition.js
@@ -3,6 +3,13 @@ import OptionsHelper from '../../utils/helpers/options-helper';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('date-range', DateRate, {
+ description: `Captures a start and end date.`,
+ designerNotes: `
+* Used to filter a Table of data according to a start and end date, or to set two dates which are related to each other, for example, a hotel booking.
+ `,
+ relatedComponentsNotes: `
+* Entering or picking a single date only? [Try Date Input](/components/date-input).
+ `,
hiddenProps: ["value", "startDateProps", "endDateProps"],
propTypes: {
onChange: "Function",
diff --git a/src/components/date/definition.js b/src/components/date/definition.js
index 1c5f5d078a..8a425e3cc5 100644
--- a/src/components/date/definition.js
+++ b/src/components/date/definition.js
@@ -2,6 +2,15 @@ import DateInput from './';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('date-input', DateInput, {
+ description: `Captures a single date.`,
+ designerNotes: `
+* If the date is likely to be close to today (e.g. an invoice due date), then a datepicker may be useful. If the date is likely to be far in the past (e.g. a date of birth), then it may be better to use separate inputs for day, month, and year.
+* Field focus automatically opens the datepicker, but a user can key in dates too, which many users find more convenient, especially in financial applications.
+* Carbon handles a range of formats, like dd/mm/yyyy, dd/mm/yy, dd/mm, or dd. Configuration can be regional, and copes with space, slash, full stop, or colon as separators.
+ `,
+ relatedComponentsNotes: `
+* Entering or picking a start and end date together? [Try Date Range](/components/date-range).
+ `,
type: 'form',
propTypes: {
minDate: "String",
diff --git a/src/components/decimal/definition.js b/src/components/decimal/definition.js
index 7364667445..b4faab144c 100644
--- a/src/components/decimal/definition.js
+++ b/src/components/decimal/definition.js
@@ -3,6 +3,17 @@ import Definition from './../../../demo/utils/definition';
import OptionsHelper from './../../utils/helpers/options-helper';
let definition = new Definition('decimal', Decimal, {
+ description: `Captures a number with a decimal point, or a currency value.`,
+ designerNotes: `
+* For currency values, show currency symbols outside the field rather than inserting one for the user dynamically.
+* Carbon offers a Precision configuration, so you can choose how many decimal places to show.
+* Decimals are usually right-aligned, so that the decimal places of numbers presented in rows line up for easy comparison by the user.
+* Even if the user just enters a string of numbers, consider presenting them into a format with the separators which apply in the user’s country (e.g. £12,345.67 for the UK, and €12 345,67 for France).
+* Where it’s clear a field only accepts numerals, you could disable entry of other characters - but remember to cater for a minus sign if necessary.
+ `,
+ relatedComponentsNotes: `
+* Entering whole numbers without a decimal point? [Try Number Input](/components/number-input).
+ `,
type: 'form',
propTypes: {
align: "String",
diff --git a/src/components/detail/definition.js b/src/components/detail/definition.js
index 2ce9194294..bf41238e20 100644
--- a/src/components/detail/definition.js
+++ b/src/components/detail/definition.js
@@ -3,6 +3,16 @@ import OptionsHelper from '../../utils/helpers/options-helper';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('detail', Detail, {
+ description: `Prominent text callout with optional icon and footnote.`,
+ designerNotes: `
+* Useful to present some important text with prominence, for example, a quote, instruction, or callout.
+* Optional icon and footnote.
+* Make sure that the colour of all text has a contrast ratio of at least 4.5.1, to meet the [WCAG 2.0 AA standard](https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html) for text less than 19px in size. Webaim have a good online [Contrast Checker](http://webaim.org/resources/contrastchecker/).
+ `,
+ relatedComponentsNotes: `
+* Simple text content? [Try Content](/components/content).
+* Headings and sections? [Try Heading](/components/heading).
+ `,
propOptions: {
icon: OptionsHelper.icons
},
diff --git a/src/components/dialog-full-screen/definition.js b/src/components/dialog-full-screen/definition.js
index 1de18787eb..24bfdae0fd 100644
--- a/src/components/dialog-full-screen/definition.js
+++ b/src/components/dialog-full-screen/definition.js
@@ -2,6 +2,17 @@ import DialogFullScreen from './';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('dialog-full-screen', DialogFullScreen, {
+ description: `A full-width and full-height dialog overlaid on top of any page.`,
+ designerNotes: `
+* Useful to perform an action in context without navigating the user to a separate page.
+* Whilst a standard Dialog component’s width might constrain what you can do, the full screen dialog uses the full width and height available.
+* A good example could be importing a large volume of data, and checking for errors, in the context of an underlying Table of data.
+ `,
+ relatedComponentsNotes: `
+* Simple task in context? [Try Dialog](/components/dialog).
+* Need to refer back to the underlying page? [Try Sidebar](/components/sidebar).
+
+ `,
propValues: {
title: 'Example Title for a DialogFullScreen',
children: 'This is an example of a dialog full screen.',
diff --git a/src/components/dialog/definition.js b/src/components/dialog/definition.js
index c9b1cea139..5f4d940be5 100644
--- a/src/components/dialog/definition.js
+++ b/src/components/dialog/definition.js
@@ -3,6 +3,17 @@ import OptionsHelper from '../../utils/helpers/options-helper';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('dialog', Dialog, {
+ description: `A dialog box overlaid on top of any page.`,
+ designerNotes: `
+* Useful to perform an action in context without navigating the user to a separate page.
+* Several pre-set widths are available - the height of the dialog will flex to fit the content. It’s best to avoid dialogs that are taller than the user’s viewport height. Typical user viewport heights can be as little as 650 pixels.
+* Choose whether a dark tint is applied behind the dialog which helps to focus the user on the dialog.
+* A configuration shows a close icon at the top right of the Dialog. Sometimes users are more likely to click this than a traditional ‘Cancel’ button.
+ `,
+ relatedComponentsNotes: `
+* Complex task that needs more space? [Try Dialog Full Screen](/components/dialog-full-screen).
+* Need to refer back to the underlying page? [Try Sidebar](/components/sidebar).
+ `,
propOptions: {
size: OptionsHelper.sizesFull
},
diff --git a/src/components/dropdown-filter-ajax/definition.js b/src/components/dropdown-filter-ajax/definition.js
index e5e8bba1f8..42e974d336 100644
--- a/src/components/dropdown-filter-ajax/definition.js
+++ b/src/components/dropdown-filter-ajax/definition.js
@@ -3,6 +3,11 @@ import OptionsHelper from '../../utils/helpers/options-helper';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('dropdown-filter-ajax', DropdownFilterAjax, {
+ description: `Ajax control: Selects one option from a very long list, with the ability to filter and create new items.`,
+ designerNotes: `
+* This control is the same as [Dropdown Filter](/components/dropdown-filter), but uses Ajax.
+* Ajax loads data from a specified source as needed, rather than data in the page markup.
+ `,
hiddenProps: ['path'],
toggleFunctions: ['create'],
propTypes: {
diff --git a/src/components/dropdown-filter/definition.js b/src/components/dropdown-filter/definition.js
index 254a64f1c7..84902a1b03 100644
--- a/src/components/dropdown-filter/definition.js
+++ b/src/components/dropdown-filter/definition.js
@@ -3,6 +3,22 @@ import OptionsHelper from '../../utils/helpers/options-helper';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('dropdown-filter', DropdownFilter, {
+ description: `Selects one option from a very long list, with the ability to filter and create new items.`,
+ designerNotes: `
+* The user can select an item using the mouse or keyboard, and also enter a search term to filter the list items presented - this is particularly helpful for very long lists (e.g. a list of customers or suppliers).
+* Useful to show more than about 5 options.
+* The Create configuration allows the user to add a term they enter to the list.
+* The Suggest configuration removes the menu handle, and only shows options to the user once they enter 3 characters of a search term. For example, if users need to select from a very long list of business classification terms (e.g. SIC codes), showing a menu on field focus may mean users tend to choose from the top of the list, rather than filter and select the best option. This configuration makes the component behave more like a search field.
+* Use placeholder content like ‘Please select…’ to make it clear to the user that the Dropdown is unset.
+* Consider a ‘smart default’ selection, based on what your user is likely to choose. But, users may well leave the defaults in place, so make sure any consequences are easy to undo, and not harmful.
+ `,
+ relatedComponentsNotes: `
+* Dropdown filter with Ajax? [Try Dropdown Filter Ajax](/components/dropdown-ajax).
+* Don’t need to filter or add new items? [Try Dropdown](/components/dropdown).
+* Choosing one option from a shorter list? [Try Radio Button](/components/radio-button).
+* Choosing more than one option? [Try Checkbox](/components/checkbox).
+* Choosing one option from a highly visible range? [Try Button Toggle](/components/button-toggle).
+ `,
hiddenProps: ['options'],
toggleFunctions: ['create'],
js: `function getOptions() {
diff --git a/src/components/dropdown/definition.js b/src/components/dropdown/definition.js
index aafa53c75f..88db1bc968 100644
--- a/src/components/dropdown/definition.js
+++ b/src/components/dropdown/definition.js
@@ -3,6 +3,20 @@ import OptionsHelper from '../../utils/helpers/options-helper';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('dropdown', Dropdown, {
+ description: `Selects one option from a very long list.`,
+ designerNotes: `
+* Behaves like a simple browser menu control - the user can select an item using the mouse or keyboard.
+* Useful to show more than about 5 options.
+* Use placeholder content like ‘Please select…’ to make it clear to the user that the Dropdown is unset.
+* Consider a ‘smart default’ selection, based on what your user is likely to choose. But, users may well leave the defaults in place, so make sure any consequences are easy to undo, and not harmful.
+ `,
+ relatedComponentsNotes: `
+* Filtering menu options to find the right one? [Try Dropdown Filter](/components/dropdown-filter).
+* Adding a new option within the menu? [Try Dropdown Filter](/components/dropdown-filter).
+* Choosing one option from a shorter list? [Try Radio Button](/components/radio-button).
+* Choosing more than one option? [Try Checkbox](/components/checkbox).
+* Choosing one option from a highly visible range? [Try Button Toggle](/components/button-toggle).
+ `,
hiddenProps: ['options'],
js: `function getOptions() {
return ImmutableHelper.parseJSON([{
diff --git a/src/components/fieldset/definition.js b/src/components/fieldset/definition.js
index 890ae06eca..c103f0b6bf 100644
--- a/src/components/fieldset/definition.js
+++ b/src/components/fieldset/definition.js
@@ -4,6 +4,24 @@ import Definition from './../../../demo/utils/definition';
import textboxDefinition from './../textbox/definition';
let definition = new Definition('fieldset', Fieldset, {
+ description: `Edits a set of closely related inputs that are grouped together.`,
+ designerNotes: `
+* You can nest any Carbon input into this component.
+* Useful for presenting a series of inputs that are closely related, within a wider Form or Pod (e.g. an address or contact details).
+* Configure Pod and Fieldset components to work together, or choose the pre-configured Show/Edit Pod component.
+* The [Show/Edit Pod](/components/show-edit-pod) component automatically presents content as a read-only Pod, until the user clicks an edit icon, which shows the same information in an editable Fieldset.
+* But, configuring Pod and Fieldset components manually will give you more customization options, like the following.
+* Top-aligned labels (Carbon default) or inline right-aligned labels are usually fastest for users.
+* Create a single path to completion with your inputs, and between your inputs and the primary action Button.
+* Indicate mandatory, or optional fields, whichever is the minority. Think carefully before collecting optional data - don’t collect information you don’t need! Try suffixing ‘(optional)’ after your field label.
+* More guidance is available for each of the individual inputs you might place inside this component.
+ `,
+ relatedComponentsNotes: `
+* Filling in a broad series of inputs? [Try Form](/components/form).
+* Viewing content that’s grouped together visually? [Try Pod](/components/pod).
+* Using Fieldset and Pod components together? [Try Show/Edit Pod](/components/show-edit-pod).
+* Creating a new entity that is usually presented in a pod? [Try Create](/components/create).
+ `,
propTypes: {
legend: "String"
},
diff --git a/src/components/flash/definition.js b/src/components/flash/definition.js
index 790fd4a665..31ab3db90f 100644
--- a/src/components/flash/definition.js
+++ b/src/components/flash/definition.js
@@ -3,6 +3,18 @@ import Definition from './../../../demo/utils/definition';
import OptionsHelper from './../../utils/helpers/options-helper';
let definition = new Definition('flash', Flash, {
+ description: `A simple positive or negative confirmation of an action.`,
+ designerNotes: `
+* Presents a short confirmation message to the user in a banner which can animate quickly in, and out, at the bottom of the browser window.
+* Success messages disappear after a set timeout. Error messages stay on-screen until dismissed by the user.
+* Useful for general success and failure messages that the user doesn’t need time to interpret. Try to place only a very short message in a Flash of just a few characters, e.g. ‘Changes Saved’.
+* Various types are available. ‘Error’ and ‘Success’ are by far the most useful - others are present for completeness by may not be used in practice very often, because a Flash isn’t suitable for longer messages.
+ `,
+ relatedComponentsNotes: `
+* Longer message which stays on-screen? [Try Message](/components/message).
+* Longer, time sensitive message that must be dismissed? [Try Toast](/components/toast).
+* Error or warning message that interrupts activity? [Try Alert](/components/alert).
+ `,
type: 'notification',
propOptions: {
as: OptionsHelper.colors
diff --git a/src/components/form/definition.js b/src/components/form/definition.js
index 798a088bb9..5a3ee6a323 100644
--- a/src/components/form/definition.js
+++ b/src/components/form/definition.js
@@ -4,6 +4,21 @@ import OptionsHelper from 'utils/helpers/options-helper';
import PresenceValidation from 'utils/validations/presence';
let definition = new Definition('form', Form, {
+ description: `A series of inputs to capture data.`,
+ designerNotes: `
+* You can nest any Carbon input into this component.
+* Carbon gives you standard Save and Cancel buttons with this component.
+* A great source of knowledge for creating excellent web forms comes from Luke Wroblewski.
+* Top-aligned labels (Carbon default) or inline right-aligned labels are usually fastest for users.
+* Try to create a single path to completion with your inputs, and between your inputs and the primary action Button - there’s good evidence users complete forms faster like this.
+* If an input is read-only, remove the field border so it appears as static text.
+* You can disable components in forms, but try to avoid this. If you need to, make it clear what the user needs to do, in order to activate the component.
+* Indicate mandatory, or optional fields, whichever is the minority. Think carefully before collecting optional data - don’t collect information you don’t need! Try suffixing ‘(optional)’ after your field label.
+* More guidance is available for each of the individual inputs you might place inside this component.
+ `,
+ relatedComponentsNotes: `
+* Editing a number of closely related inputs? [Try Fieldset](/components/fieldset).
+ `,
hiddenProps: ["validateOnMount", "saveButtonProps", "cancelButtonProps"],
propOptions: {
buttonAlign: OptionsHelper.alignBinary
diff --git a/src/components/heading/definition.js b/src/components/heading/definition.js
index a5e2a915e7..ee15f770d3 100644
--- a/src/components/heading/definition.js
+++ b/src/components/heading/definition.js
@@ -2,6 +2,15 @@ import Heading from './';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('heading', Heading, {
+ description: `The titles of a page and its sections.`,
+ designerNotes: `
+* A standard page or section header, with a range of options, such as a help link presented as an icon, a sub-heading, a ‘Back’ icon, and visual dividers and separators.
+* Make sure that the colour of all text has a contrast ratio of at least 4.5.1, to meet the [WCAG 2.0 AA standard](https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html) for text less than 19px in size. Webaim have a good online [Contrast Checker](http://webaim.org/resources/contrastchecker/).
+ `,
+ relatedComponentsNotes: `
+* Simple text content? [Try Content](/components/content).
+* Prominent text callout? [Try Detail](/components/detail).
+ `,
type: 'layout',
propTypes: {
title: "String",
diff --git a/src/components/help/definition.js b/src/components/help/definition.js
index 3d968bbda1..2b69ae30de 100644
--- a/src/components/help/definition.js
+++ b/src/components/help/definition.js
@@ -3,6 +3,13 @@ import OptionsHelper from '../../utils/helpers/options-helper';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('help', Help, {
+ description: `User assistance or clarification presented by hovering on a question mark icon.`,
+ designerNotes: `
+ `,
+ relatedComponentsNotes: `
+* Tooltip hovering on any Carbon icon? [Try Icon](/components/icon).
+* Tooltip hovering on any component? [Try Tooltip](/components/tooltip).
+ `,
hiddenProps: ['tooltipMessage'],
propOptions: {
tooltipPosition: OptionsHelper.positions,
diff --git a/src/components/i18n/definition.js b/src/components/i18n/definition.js
index 398521b8d4..a52b2afed3 100644
--- a/src/components/i18n/definition.js
+++ b/src/components/i18n/definition.js
@@ -2,6 +2,12 @@ import I18nComponent from './';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('i18n-component', I18nComponent, {
+ description: `Displays a translation from an i18n file.`,
+ designerNotes: `
+* Internationalization (i18n) means apps can be localized for languages and cultures easily.
+* This component displays a single text translation.
+* You can use this component with any other component that displays text.
+ `,
js: `I18n.translations.en.my = {
example: '# My __example__ translation.'
};`,
diff --git a/src/components/icon/definition.js b/src/components/icon/definition.js
index 0764a673f2..ed32d9349b 100644
--- a/src/components/icon/definition.js
+++ b/src/components/icon/definition.js
@@ -3,6 +3,18 @@ import Definition from './../../../demo/utils/definition';
import OptionsHelper from 'utils/helpers/options-helper';
let definition = new Definition('icon', Icon, {
+ description: `An eye catching icon associated with a UI element or content item.`,
+ designerNotes: `
+* Carbon comes with about 50 standard icons to choose from. See the Icons page in the Style section.
+* A tooltip option is available within this component.
+* Many other components allow you to specify one of the standard Carbon icons to associate with them, for example, the Link component.
+ `,
+ relatedComponentsNotes: `
+* Tooltip hovering on any component? [Try Tooltip](/components/tooltip).
+* Tooltip from a question mark icon? [Try Help](/components/help).
+* Moving the user to another location? [Try Link](/components/link).
+* After an image? [View Icons](/style/icons).
+ `,
propRequires: {
bgShape: "bgTheme",
bgSize: "bgTheme",
diff --git a/src/components/link/definition.js b/src/components/link/definition.js
index be19d9a33a..89952e8160 100644
--- a/src/components/link/definition.js
+++ b/src/components/link/definition.js
@@ -5,6 +5,17 @@ import linkDefinition from './../link/definition';
import tooltipDefinition from './../tooltip/definition';
let definition = new Definition('link', Link, {
+ description: `Navigates the user to another location.`,
+ designerNotes: `
+* Avoid using links for commands (performing an action like saving a form) - use them for navigating the user to a new location.
+* If you’re navigating the user away from your site, consider using an icon after the link, and open the link in a new window, so the user doesn’t lose their place.
+* To make the meaning of a link clearer, you can add an icon before it. Just name one of the Carbon icons.
+* Make your link names meaningful - for example, instead of ‘Click here’, try ‘Download Invoice 001’.
+* WCAG guidelines recommend that Color is not used as the only visual means of conveying information, indicating an action. Carbon applies bold weight, but you could also use text decoration.
+ `,
+ relatedComponentsNotes: `
+* Need an icon to go with your link? [View Icons](/style/icons).
+ `,
type: 'action',
propValues: {
children: 'I\'m a link'
diff --git a/src/components/menu-list/definition.js b/src/components/menu-list/definition.js
index 07051ffaf1..699d69dfa6 100644
--- a/src/components/menu-list/definition.js
+++ b/src/components/menu-list/definition.js
@@ -3,6 +3,16 @@ import Definition from './../../../demo/utils/definition';
import menuListItemDefinition from './menu-list-item/definition';
let definition = new Definition('menu-list', MenuList, {
+ description: `A set of related items that can be shown or hidden.`,
+ designerNotes: `
+* Children can be shown or hidden by clicking their title.
+* Useful to create simple accordion or menu patterns.
+ `,
+ relatedComponentsNotes: `
+* Navigating the hierarchy of the app? [Try Menu](/components/menu).
+* Quickly accessing useful hyperlinks? [Try Animated Menu Button](/components/animated-menu-button).
+* Choosing between variants of the same page, or filtering content? [Try Tabs](/components/tabs).
+ `,
associatedDefinitions: [menuListItemDefinition],
hiddenProps: ["filter"],
propRequires: {
diff --git a/src/components/menu/definition.js b/src/components/menu/definition.js
index c91d2756f5..43a6c918bd 100644
--- a/src/components/menu/definition.js
+++ b/src/components/menu/definition.js
@@ -5,6 +5,19 @@ import menuItemDefinition from './menu-item/definition';
import submenuBlockDefinition from './submenu-block/definition';
let definition = new Definition('menu', Menu, {
+ description: `Navigates the user in the overall hierarchy of your app.`,
+ designerNotes: `
+* Presents a 2-level navigation hierarchy to the user.
+* The user’s current location is indicated in green. Their hover location is indicated in blue.
+* Place separator rows into any menu to group items of similar meaning.
+* Carbon has Primary and Secondary styles for the menus - these are used to present primary and secondary navigation. A good example is the Sage One Accounting application.
+* More complex navigation patterns such as hamburger menus or mega menus are usually associated with poorer usability test performance, but might still be useful in some situations. Before trying more complex patterns, consider some user research techniques like Card Sorting to reduce the complexity in your information architecture.
+ `,
+ relatedComponentsNotes: `
+* Choosing between variants of the same page, or filtering content? [Try Tabs](/components/tabs).
+* Need a container for your primary navigation? [Try Navigation Bar](/components/navigation-bar).
+* Quickly accessing useful hyperlinks? [Try Animated Menu Button](/components/animated-menu-button).
+ `,
associatedDefinitions: [menuItemDefinition, submenuBlockDefinition],
propOptions: {
as: OptionsHelper.themesBinary
diff --git a/src/components/message/definition.js b/src/components/message/definition.js
index 79f2e75046..06a868c6db 100644
--- a/src/components/message/definition.js
+++ b/src/components/message/definition.js
@@ -3,6 +3,25 @@ import Definition from './../../../demo/utils/definition';
import OptionsHelper from './../../utils/helpers/options-helper';
let definition = new Definition('message', Message, {
+ description: `A longer message which stays on screen to read and interpret.`,
+ designerNotes: `
+* Presents a static message which stays on screen.
+* Useful for messages which are longer or more important, where the user needs time to interpret them, or might need to refer back to them during an activity.
+* Various types are available. ‘Error’ and ‘Success’ are by far the most useful - others are present for completeness by may not be practically used very often:
+* __Error__ - tells the user about a negative outcome that has already happened. Try to focus the message text on the action the user needs to take to be successful, rather than what went wrong.
+* __Help__ - not frequently used.
+* __Info__ - gives context or advice to the user where there’s no risk of a negative outcome.
+* __Maintenance__ - warns the user if a particular service or feature may go offline shortly.
+* __New__ - highlights a new feature to the user.
+* __Success__ - indicates that an activity was successful. A good example could also present the user with onward options, such as ‘View a list of items’ or ‘Create another’.
+* __Warning__ - warns the user about a potential negative outcome that hasn’t happened yet.
+* The Transparent configuration is useful if you’d like the message to be more visually subtle, perhaps in a Dialog.
+ `,
+ relatedComponentsNotes: `
+* Simple positive or negative confirmation? [Try Flash](/components/flash).
+* Longer, time sensitive message that must be dismissed? [Try Toast](/components/toast).
+* Error or warning message that interrupts activity? [Try Alert](/components/alert).
+ `,
type: 'notification',
toggleFunctions: ['onDismiss'],
propOptions: {
diff --git a/src/components/mount-in-app/definition.js b/src/components/mount-in-app/definition.js
index b2c77d2089..9248af0657 100644
--- a/src/components/mount-in-app/definition.js
+++ b/src/components/mount-in-app/definition.js
@@ -2,6 +2,10 @@ import MountInApp from './';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('mount-in-app', MountInApp, {
+ description: `Mounts a component at a specific target in the DOM.`,
+ designerNotes: `
+* Useful to mount any Carbon component at a specific target in the DOM.
+ `,
hiddenProps: ['children', 'targetId'],
propValues: {
children: "Content!
",
diff --git a/src/components/multi-action-button/definition.js b/src/components/multi-action-button/definition.js
index f6e5f20b94..f482f6db20 100644
--- a/src/components/multi-action-button/definition.js
+++ b/src/components/multi-action-button/definition.js
@@ -4,6 +4,20 @@ import Definition from './../../../demo/utils/definition';
import buttonDefinition from './../button/definition';
let definition = new Definition('multi-action-button', MultiActionButton, {
+ description: `Related buttons of equal importance that are shown on hover.`,
+ designerNotes: `
+* Offers related actions to the user, but without taking up valuable space by showing them separately.
+* But, users may not always discover them, and could miss out.
+* Useful to show about 5 options or less.
+* Only use this component for commands that are related (e.g. Export PDF, Export CSV).
+* Don’t use this component if one option is more generic or important than the others.
+* Carbon has a Transparent configuration, with subtle visual style, which could be useful to present less important or infrequently used options to the user, without calling attention to them.
+ `,
+ relatedComponentsNotes: `
+* Performing a single action? [Try Button](/components/button).
+* Range of buttons where one is more important? [Try Split Button](/components/split-button).
+* Choosing one option from a highly visible range? [Try Button Toggle](/components/button-toggle).
+ `,
propOptions: {
as: OptionsHelper.themesBinary,
align: OptionsHelper.alignBinary
diff --git a/src/components/navigation-bar/definition.js b/src/components/navigation-bar/definition.js
index 52e3c2bdd2..8c2e015d53 100644
--- a/src/components/navigation-bar/definition.js
+++ b/src/components/navigation-bar/definition.js
@@ -3,6 +3,16 @@ import OptionsHelper from '../../utils/helpers/options-helper';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('navigation-bar', NavigationBar, {
+ description: `Provides a container for your app's primary and secondary navigation.`,
+ designerNotes: `
+* Provides a container for [Menu](/components/menu) - together providing your app's primary and secondary navigation.
+* Everything can be contained within an [App Wrapper](/components/app-wrapper).
+ `,
+ relatedComponentsNotes: `
+* Need an overall container? [Try App Wrapper](/components/app-wrapper).
+* Navigating the hierarchy of the app? [Try Menu](/components/menu).
+* Laying out a page in columns? [Try Row](/components/row).
+ `,
propOptions: {
as: OptionsHelper.themesBinary,
},
diff --git a/src/components/number/definition.js b/src/components/number/definition.js
index 9d72a48b40..09a5c8108d 100644
--- a/src/components/number/definition.js
+++ b/src/components/number/definition.js
@@ -2,6 +2,14 @@ import NumberInput from './';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('number-input', NumberInput, {
+ description: `Captures a whole number (not a decimal or currency value).`,
+ designerNotes: `
+* Where it’s clear a field only accepts numerals, you could disable entry of other characters. But, remember than for some regions, phone numbers and postcodes might contain dashes, and remember to cater for a minus sign if necessary.
+ `,
+ relatedComponentsNotes: `
+* Entering a number including a decimal point? [Try Decimal](/components/decimal).
+* Entering numbers, symbols, and letters, or handling various formats? [Try Textbox](/components/textbox).
+ `,
type: 'form'
});
diff --git a/src/components/pager/definition.js b/src/components/pager/definition.js
index a06638d107..6e264718e4 100644
--- a/src/components/pager/definition.js
+++ b/src/components/pager/definition.js
@@ -4,6 +4,15 @@ import OptionsHelper from 'utils/helpers/options-helper';
import ComponentActions from './../../../demo/actions/component';
let definition = new Definition('pager', Pager, {
+ description: `Steps through a series of pages within a table.`,
+ designerNotes: `
+* Useful to handle larger tables of data - clicking the forward or back arrows will step the user sequentially through the data loaded into the table.
+* The 'Show Page Size Selection' configuration shows 10, 25, or 50 records on each page.
+ `,
+ relatedComponentsNotes: `
+* Table of relational data? [Try Table](/components/table).
+* Table with Ajax? [Try Table](/components/table-ajax).
+ `,
type: 'form',
hiddenProps: ['currentPage', 'pageSizeSelectionOptions'],
propOptions: {
diff --git a/src/components/pill/definition.js b/src/components/pill/definition.js
index 8093034ddd..8f6e4aa5d2 100644
--- a/src/components/pill/definition.js
+++ b/src/components/pill/definition.js
@@ -3,6 +3,12 @@ import OptionsHelper from './../../utils/helpers/options-helper';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('pill', Pill, {
+ description: `A visual indicator which helps the user visually scan for something in common.`,
+ designerNotes: `
+* An eye catching visual indicator used to help a user visually scan and identify items with something in common from a wider list.
+* A range of colours and visual styles is available.
+* Pills could work particularly well in Tables, for example, to distinguish which invoices are overdue in a long list, or which subscriptions a client has, or to indicate that a feature has ‘beta’ status.
+ `,
type: 'misc',
propOptions: {
as: OptionsHelper.colors
diff --git a/src/components/pod/definition.js b/src/components/pod/definition.js
index f4f1d2bef8..d344648b4b 100644
--- a/src/components/pod/definition.js
+++ b/src/components/pod/definition.js
@@ -3,6 +3,22 @@ import OptionsHelper from 'utils/helpers/options-helper';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('pod', Pod, {
+ description: `A set of content that’s grouped together visually.`,
+ designerNotes: `
+* Presents content grouped visually together. This can be text, or other components. A good example is a ‘tile’ showing contact information for an individual.
+* Configure Pod and Fieldset components to work together, or choose the pre-configured Show/Edit Pod component:
+* The [Show/Edit Pod](/components/show-edit-pod) component automatically presents content as a read-only Pod, until the user clicks an edit icon, which shows the same information in an editable Fieldset.
+* But, configuring Pod and Fieldset components manually will give you more customization options, like the following.
+* The On Edit property shows a standard edit icon, which can be used to show a fieldset. You can choose whether this icon appears inside or outside the pod, and whether it appears only on hover. You can also choose whether clicking only the icon triggers the On Edit property, or clicking anywhere on the pod.
+* Choose from various visual options, including padding, borders, and primary, secondary, or tertiary appearance.
+* Set the pod to flex to the width of its content, or take up the full width of its container.
+ `,
+ relatedComponentsNotes: `
+* Editing a number of closely related inputs? [Try Fieldset](/components/fieldset).
+* Filling in a broad series of inputs? [Try Form](/components/form).
+* Using Fieldset and Pod components together? [Try Show/Edit Pod](/components/pod).
+* Creating a new entity that is usually presented in a pod? [Try Create](/components/create).
+ `,
type: 'form',
toggleFunctions: ['onEdit'],
propRequires: {
diff --git a/src/components/portrait/definition.js b/src/components/portrait/definition.js
index 9e5ad6616b..69ce27d5d5 100644
--- a/src/components/portrait/definition.js
+++ b/src/components/portrait/definition.js
@@ -3,6 +3,15 @@ import Definition from './../../../demo/utils/definition';
import OptionsHelper from 'utils/helpers/options-helper';
let definition = new Definition('portrait', Portrait, {
+ description: `Represents a person with their initials or an avatar.`,
+ designerNotes: `
+* Useful to represent a person, user, or organisation.
+* Use initials rather than an avatar if you prefer.
+* Works with [Gravatar](http://en.gravatar.com/) as a source of avatars.
+ `,
+ relatedComponentsNotes: `
+* Combining Portrait with some text? [Try Profile](/components/profile).
+ `,
propOptions: {
size: OptionsHelper.sizesFull,
shape: OptionsHelper.shapesVaried
diff --git a/src/components/profile/definition.js b/src/components/profile/definition.js
index 93f3e7418f..0032e04ace 100644
--- a/src/components/profile/definition.js
+++ b/src/components/profile/definition.js
@@ -3,6 +3,17 @@ import Definition from './../../../demo/utils/definition';
import OptionsHelper from 'utils/helpers/options-helper';
let definition = new Definition('profile', Profile, {
+ description: `Represents a person with their initials or an avatar, and some text.`,
+ designerNotes: `
+* Combines the [Portrait](/components/portrait) and [Detail](/components/detail) components in a single configuration.
+* Useful to represent a person, user, or organisation.
+* Use initials rather than an avatar if you prefer.
+* Works with [Gravatar](http://en.gravatar.com/) as a source of avatars.
+ `,
+ relatedComponentsNotes: `
+* Initials or avatar without text? [Try Portrait](/components/portrait).
+* Text without initials or avatar? [Try Detail](/components/detail).
+ `,
propValues: {
name: "Andrew Tait",
email: "andrew.tait@sage.com"
diff --git a/src/components/radio-button/definition.js b/src/components/radio-button/definition.js
index 066bb8d428..d33dc8e0e6 100644
--- a/src/components/radio-button/definition.js
+++ b/src/components/radio-button/definition.js
@@ -2,6 +2,17 @@ import RadioButton from './';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('radio-button', RadioButton, {
+ description: `Selects one option from a longer list.`,
+ designerNotes: `
+* Consider ‘smart default’ selections, based on what your user is likely to choose. But, users may well leave the defaults in place, so make sure any consequences are easy to undo, and not harmful.
+* Useful to show less than about 10 options.
+* Disabled or read-only radio buttons might be difficult for a user to distinguish visually, so try to avoid this.
+ `,
+ relatedComponentsNotes: `
+* Choosing one option from a very long list? [Try Dropdown](/components/dropdown).
+* Choosing more than one option? [Try Checkbox](/components/checkbox).
+* Choosing one option from a highly visible small range? [Try Button Toggle](/components/button-toggle).
+ `,
type: 'form',
numberOfExamples: 2,
propTypes: {
diff --git a/src/components/rainbow/definition.js b/src/components/rainbow/definition.js
index 6eb2680b9e..523273febd 100644
--- a/src/components/rainbow/definition.js
+++ b/src/components/rainbow/definition.js
@@ -2,6 +2,11 @@ import Rainbow from './';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('rainbow', Rainbow, {
+ description: `Simple information visualised in a chart.`,
+ designerNotes: `
+* Helps the user visualise some data in a chart - it works best to show a relative proportion, a little like how you might use a pie chart.
+* Specify the source data, and the colours to use. Check out the Carbon Colours in the Style section.
+ `,
hiddenProps: ['config', 'data'],
js: `function getData() {
return Immutable.List([{
diff --git a/src/components/row/definition.js b/src/components/row/definition.js
index 3ad1926b4c..6de8268c7f 100644
--- a/src/components/row/definition.js
+++ b/src/components/row/definition.js
@@ -3,6 +3,16 @@ import OptionsHelper from 'utils/helpers/options-helper';
import Definition from './../../../demo/utils/definition';
let columnDefinition = new Definition('child', {}, {
+ description: `Sets up a basic column-based UI layout.`,
+ designerNotes: `
+* Useful to organise the UI of a page into a simple column-based layout.
+* Configure the number of columns, the margin between them, and any separators.
+ `,
+ relatedComponentsNotes: `
+* Need an overall container? [Try App Wrapper](/components/app-wrapper).
+* Need a container for your primary navigation? [Try Navigation Bar](/components/navigation-bar).
+* Need a layout with controls and guidance text? [Try Settings Row](/components/settings-row).
+ `,
props: ['columnOffset', 'columnSpan', 'columnAlign', 'columnClasses'],
propTypes: {
columnOffset: "String",
diff --git a/src/components/settings-row/definition.js b/src/components/settings-row/definition.js
index f8fd15be7c..ddc4a6fc2b 100644
--- a/src/components/settings-row/definition.js
+++ b/src/components/settings-row/definition.js
@@ -2,6 +2,16 @@ import SettingsRow from './';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('settings-row', SettingsRow, {
+ description: `Sets up a column-based UI layout with explanatory text and UI controls.`,
+ designerNotes: `
+* Useful to create a series of rows with a heading, explanatory text, and UI controls in each row.
+* A good example is a settings page, or step-by-step wizard.
+ `,
+ relatedComponentsNotes: `
+* Need an overall container? [Try App Wrapper](/components/app-wrapper).
+* Need a container for your primary navigation? [Try Navigation Bar](/components/navigation-bar).
+* Laying out a page in columns? [Try Row](/components/row).
+ `,
propTypes: {
children: "Node",
description: "String",
diff --git a/src/components/show-edit-pod/definition.js b/src/components/show-edit-pod/definition.js
index 7716009611..40c5488f0e 100644
--- a/src/components/show-edit-pod/definition.js
+++ b/src/components/show-edit-pod/definition.js
@@ -5,6 +5,26 @@ import formDefinition from './../form/definition';
import { assign } from 'lodash';
let definition = new Definition('show-edit-pod', ShowEditPod, {
+ description: `Presents and edits a set of content that’s grouped together visually (in one pre-configured component).`,
+ designerNotes: `
+* Nest any Carbon input into this component.
+* Configure Pod and Fieldset components to work together, or choose this pre-configured Show/Edit Pod component:
+* The Show/Edit Pod Component automatically presents content as a read-only Pod, until the user clicks an edit icon, which shows the same information in an editable Fieldset.
+* But, configuring Pod and Fieldset components manually will give you more customization options.
+* Choose whether the editable state has a disabled or enabled Save button, a Cancel button, or a Delete button, and their alignment.
+* Choose from various visual options, including borders, and primary, secondary, or tertiary appearance.
+* Set the pod to flex to the width of its content, or take up the full width of its container.
+* Top-aligned labels (Carbon default) or inline right-aligned labels are usually fastest for users.
+* Create a single path to completion with your inputs, and between your inputs and the primary action Button.
+* Indicate mandatory, or optional fields, whichever is the minority. Think carefully before collecting optional data - don’t collect information you don’t need! Try suffixing ‘(optional)’ after your field label.
+* More guidance is available for each of the individual inputs you might place inside this component.
+ `,
+ relatedComponentsNotes: `
+* Editing a number of closely related inputs? [Try Fieldset](/components/fieldset).
+* Filling in a broad series of inputs? [Try Form](/components/form).
+* Viewing content that’s grouped together visually? [Try Pod](/components/pod).
+* Creating a new entity that is usually presented in a pod? [Try Create](/components/create).
+ `,
hiddenProps: ['editing', 'validateOnMount', 'transitionName'],
toggleFunctions: ['onDelete'],
propOptions: assign({}, formDefinition.propOptions, {
diff --git a/src/components/sidebar/definition.js b/src/components/sidebar/definition.js
index fe3128d45d..178fa84f7b 100644
--- a/src/components/sidebar/definition.js
+++ b/src/components/sidebar/definition.js
@@ -4,6 +4,17 @@ import Definition from './../../../demo/utils/definition';
import sidebarHeaderDefinition from './sidebar-header/definition';
let definition = new Definition('sidebar', Sidebar, {
+ description: `A sidebar overlaid at the right or left of a page.`,
+ designerNotes: `
+* Useful to perform an action in context without navigating the user to a separate page.
+* Useful if the user might need to refer back to the page behind the sidebar. For example, the user could select from a list of clients on the page, with detailed information on the client loading in the sidebar.
+* Several pre-set widths are available, and the height is always 100%. It’s best to avoid sidebars that are taller than the user’s viewport height, as a scroll would hide some information. Typical user viewport heights can be as little as 650 pixels.
+* Choose whether a dark tint is applied behind the dialog which helps to focus the user on the sidebar, but don’t select this option if the user needs to refer back to the underlying page.
+ `,
+ relatedComponentsNotes: `
+* Simple task in context? [Try Dialog](/components/dialog).
+* Complex task that needs more space? [Try Dialog Full Screen](/components/dialog-full-screen).
+ `,
associatedDefinitions: [sidebarHeaderDefinition],
propOptions: {
position: OptionsHelper.alignBinary,
diff --git a/src/components/simple-color-picker/definition.js b/src/components/simple-color-picker/definition.js
index f8c3d3cd92..58eda2969c 100644
--- a/src/components/simple-color-picker/definition.js
+++ b/src/components/simple-color-picker/definition.js
@@ -4,6 +4,13 @@ import Definition from './../../../demo/utils/definition';
import ComponentActions from './../../../demo/actions/component';
let definition = new Definition('simple-color-picker', SimpleColorPicker, {
+ description: `A small number of pre-set colour options to select from.`,
+ designerNotes: `
+* Choose from a small palette of pre-set colours, with indication of a currently selected colour.
+ `,
+ relatedComponentsNotes: `
+* [Colors](/style/colors).
+ `,
hiddenProps: ['availableColors'],
propTypes: {
availableColors: "Array",
diff --git a/src/components/spinner/definition.js b/src/components/spinner/definition.js
index 2ef4bde37a..0a9758d84a 100644
--- a/src/components/spinner/definition.js
+++ b/src/components/spinner/definition.js
@@ -3,6 +3,13 @@ import OptionsHelper from './../../utils/helpers/options-helper';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('spinner', Spinner, {
+ description: `Represents an activity in progress.`,
+ designerNotes: `
+* Various colours and sizes are available - the colours match the states for Messages, Toasts, and other components.
+* Created with HTML and CSS rather than an animated graphic, which allows for easier customisation.
+* If the spinner is likely to appear for a long time, consider placing some dynamic messaging on-screen to reassure the user that something is in progress, and they shouldn’t re-load the page manually.
+* Carbon doesn’t feature a progress bar, as it’s often difficult to accurately calculate when many processes will complete, and many are relatively fast.
+ `,
type: 'misc',
propOptions: {
as: OptionsHelper.colors,
diff --git a/src/components/split-button/definition.js b/src/components/split-button/definition.js
index aa17fed80e..20bf4b6573 100644
--- a/src/components/split-button/definition.js
+++ b/src/components/split-button/definition.js
@@ -4,6 +4,19 @@ import Definition from './../../../demo/utils/definition';
import buttonDefinition from './../button/definition';
let definition = new Definition('split-button', SplitButton, {
+ description: `Related buttons that are shown on hover where one option is more important than the others.`,
+ designerNotes: `
+* Offers one more important action to the user, with some related actions also quickly accessible, but without taking up valuable space by showing them all separately.
+* But, users may not always discover the related items, and could miss out.
+* Useful to show about 5 options or less.
+* Only use this component for buttons that are very closely related (e.g. Save, Save and Email, Save and Print, Save and New).
+* Only use this component if one option is more generic or important than the others.
+ `,
+ relatedComponentsNotes: `
+* Taking a single positive or negative action? [Try Button](/components/button).
+* Range of buttons all of the same importance? [Try Multi Action Button](/components/multi-action-button).
+* Choosing one option from a highly visible range? [Try Button Toggle](/components/button-toggle).
+`,
propOptions: {
as: OptionsHelper.themesBinary,
},
diff --git a/src/components/table-ajax/definition.js b/src/components/table-ajax/definition.js
index 53032fa9e9..04670c463c 100644
--- a/src/components/table-ajax/definition.js
+++ b/src/components/table-ajax/definition.js
@@ -7,6 +7,11 @@ import tableHeaderDefinition from './../table/table-header/definition';
import tableSubheaderDefinition from './../table/table-subheader/definition';
let definition = new Definition('table-ajax', TableAjax, {
+ description: `Ajax control: A table of relational data to view or interact with.`,
+ designerNotes: `
+* This control is the same as [Table](/components/table), but uses Ajax.
+* Ajax loads data from a specified source as needed, rather than data in the page markup.
+ `,
associatedDefinitions: [
tableRowDefinition, tableCellDefinition, tableHeaderDefinition, tableSubheaderDefinition
],
diff --git a/src/components/table/definition.js b/src/components/table/definition.js
index 2194a797a6..3720d5bb09 100644
--- a/src/components/table/definition.js
+++ b/src/components/table/definition.js
@@ -15,6 +15,16 @@ setTimeout(() => {
}, 1000);
let definition = new Definition('table', Table, {
+ description: `A table of relational data to view or interact with.`,
+ designerNotes: `
+* Shows relational data to the user.
+* The content of rows and columns can be plain or styled text, Icons, or even inputs. Achieve this by nesting components inside a Table component.
+* Don’t add too many columns for the user’s available viewport width. Aiming for a screen width of 1366 pixels is a good target, but also consider how your table may look for tablet or mobile devices. Avoid the need for horizontal scrolling, either on the page as a whole, or within a Table component.
+* To save space, you could show multiple lines of data within a cell (e.g. the constituents of an address).
+* If there is likely to be a large number of rows, you can specify how many rows to show, and whether to add a pagination control to the bottom of the table. Consider the data load on your application and infrastructure to decide this. Some applications apply this configuration as an application-wide setting.
+* The Selectable configuration places a checkbox at the start of each row, and the ability for a user to select one or more rows. This is useful to allow the user to perform single or batch actions.
+* The Highlightable configuration allows the user to click an option, and for the option to be marked visually. This could be useful if the user can select an option which then loads in a Sidebar, for example.
+`,
associatedDefinitions: [
tableRowDefinition, tableCellDefinition, tableHeaderDefinition, tableSubheaderDefinition
],
diff --git a/src/components/tabs/definition.js b/src/components/tabs/definition.js
index 17cd58d30a..86fbfa1d53 100644
--- a/src/components/tabs/definition.js
+++ b/src/components/tabs/definition.js
@@ -4,6 +4,22 @@ import OptionsHelper from '../../utils/helpers/options-helper';
import tabDefinition from './tab/definition';
let definition = new Definition('tabs', Tabs, {
+ description: `Switches between variants of a page or different tables.`,
+ designerNotes: `
+* switch between variants of a page or different tables (e.g. separate tables showing unread and read emails).
+* There are two position options:
+* __Top - shows the tabs in a line, typically above a Table - best for short lists of tabs.
+* __Left - show the tables in a column, typically to the left of a Table - best for longer lists of tabs.
+* You can also set the left or right alignment of the tabs. This configuration:
+* __Sets the text alignment for ‘Left’ tabs.
+* __Sets left or right page position for ‘Top’ tabs.
+* Only use tabs if there’s more than one, and show the content of one tab by default. Avoid multiple rows of tabs, nested tabs, or using vertical and horizontal tabs at the same time.
+ `,
+ relatedComponentsNotes: `
+* Navigating the hierarchy of the app? [Try Menu](/components/menu).
+* Positioning your primary navigation? [Try Navigation Bar](/components/navigation-bar).
+* Quickly accessing useful hyperlinks? [Try Animated Menu Button](/components/animated-menu-button).
+`,
type: 'layout',
associatedDefinitions: [tabDefinition],
propOptions: {
diff --git a/src/components/textarea/definition.js b/src/components/textarea/definition.js
index 43d7a5937e..7d8950cba6 100644
--- a/src/components/textarea/definition.js
+++ b/src/components/textarea/definition.js
@@ -2,6 +2,16 @@ import Textarea from './';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('textarea', Textarea, {
+ description: `Captures more than one line of text.`,
+ designerNotes: `
+* Useful for collecting a significant amount of text (e.g. notes about clients, or a short email message).
+* Only handles plain text at this time - not markup or markdown, but it does handle line breaks.
+* If content in a textarea is read-only, remove the field border so it appears as static text.
+* Use placeholder text to give the user context or examples of what to write.
+ `,
+ relatedComponentsNotes: `
+* Just a single line of text? [Try Textbox](/components/textbox).
+`,
type: 'form',
propRequires: {
enforceCharacterLimit: 'characterLimit'
diff --git a/src/components/textbox/definition.js b/src/components/textbox/definition.js
index cec8c7b25c..634171d523 100644
--- a/src/components/textbox/definition.js
+++ b/src/components/textbox/definition.js
@@ -2,6 +2,17 @@ import Textbox from './';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('textbox', Textbox, {
+ description: `Captures a single line of text.`,
+ designerNotes: `
+* Use placeholder text to give the user examples of data formats (e.g. AB123456C for a UK National Insurance number).
+* Use prefixes if your data always begins with a certain sequence (e.g. a UK VAT number usually starts with ‘GB’).
+* If content in a textbox is never editable, think about removing the field border so it appears as static text.
+* You can disable a textbox, but try to avoid this. If you need to, make it clear what the user needs to do in order to activate the textbox.
+* Use wider fields for longer data (e.g. an address line), and narrower fields for shorter data (e.g. a postcode), to give the user a clue about the data expected.
+ `,
+ relatedComponentsNotes: `
+* More than a single line of text? [Try Textarea](/components/textarea).
+`,
type: 'form'
});
diff --git a/src/components/toast/definition.js b/src/components/toast/definition.js
index 725c03eedd..96bfb6dbfc 100644
--- a/src/components/toast/definition.js
+++ b/src/components/toast/definition.js
@@ -3,6 +3,25 @@ import OptionsHelper from './../../utils/helpers/options-helper';
import Definition from './../../../demo/utils/definition';
let definition = new Definition('toast', Toast, {
+ description: `A longer, timely message that the user must dismiss, but doesn’t interrupt their activity.`,
+ designerNotes: `
+* Presents a message in a dialog at the top-right of the screen that animates in. The user can manually dismiss it, and it animates out.
+* Useful for instant notifications, or information which is time sensitive (e.g. a ‘push notification’ style). If the message isn’t time sensitive, consider the Message component.
+* The message stays on-screen until dismissed, giving the user time to interpret the message.
+* Various types are available. ‘Error’ and ‘Success’ are by far the most useful - others are present for completeness by may not be practically used very often:
+* __Error__ - tells the user about a negative outcome that has already happened. Try to focus the message text on the action the user needs to take to be successful, rather than what went wrong (e.g. ‘Payment failed, please try again’).
+* __Help__ - not frequently used.
+* __Info__ - gives context or advice to the user where there’s no risk of a negative outcome (e.g. ‘Your monthly statements are ready to review’).
+* __Maintenance__ - warns the user if a particular service or feature may go offline shortly.
+* __New__ - highlights a new feature to the user (e.g. ‘You can now send batch statements in Sage One’).
+* __Success__ - indicates that an activity was successful (e.g. ‘Your subscription upgrade was successful’).
+* __Warning__ - warns the user about a potential negative outcome that hasn’t happened yet.
+ `,
+ relatedComponentsNotes: `
+* Simple positive or negative confirmation? [Try Flash](/components/flash).
+* Longer message which stays on-screen? [Try Message](/components/message).
+* Error or warning message that interrupts activity? [Try Alert](/components/alert).
+`,
type: 'notification',
toggleFunctions: ["onDismiss"],
propOptions: {
diff --git a/src/components/tooltip/definition.js b/src/components/tooltip/definition.js
index 3b89b593ab..a748418ccb 100644
--- a/src/components/tooltip/definition.js
+++ b/src/components/tooltip/definition.js
@@ -3,6 +3,15 @@ import Definition from './../../../demo/utils/definition';
import OptionsHelper from '../../utils/helpers/options-helper';
let definition = new Definition('tooltip', Tooltip, {
+ description: `Additional information presented by hovering on a component.`,
+ designerNotes: `
+* A short paragraph of plain-text information shown to the user in context when they hover on any component. For example, to define how a particular figure is calculated, or the definition of a difficult technical term.
+ `,
+ relatedComponentsNotes: `
+* Tooltip hovering on any Carbon icon? [Try Icon](/components/icon).
+* Tooltip from a question mark icon? [Try Help](/components/help).
+* Need a visual? [View Icons](/style/icons).__
+`,
type: 'miscellaneous',
propValues: {
isVisible: true,