+ Here’s some stuff that you need to know. We can make this text really long so that,
+ when viewed within a browser that’s fairly narrow, it will wrap, too.
+
+
+
+
+
+ And some other stuff on another line, just for kicks. And here’s a link.
+
+
+
+);
diff --git a/ui_framework/doc_site/src/views/call_out/call_out_example.js b/ui_framework/doc_site/src/views/call_out/call_out_example.js
new file mode 100644
index 0000000000000..dc0dd3368e1eb
--- /dev/null
+++ b/ui_framework/doc_site/src/views/call_out/call_out_example.js
@@ -0,0 +1,107 @@
+import React from 'react';
+
+import { renderToHtml } from '../../services';
+
+import {
+ GuideDemo,
+ GuidePage,
+ GuideSection,
+ GuideSectionTypes,
+ GuideText,
+} from '../../components';
+
+import CallOut from './call_out';
+const callOutSource = require('!!raw!./call_out');
+const callOutHtml = renderToHtml(CallOut);
+
+import Success from './success';
+const successSource = require('!!raw!./success');
+const successHtml = renderToHtml(Success);
+
+import Warning from './warning';
+const warningSource = require('!!raw!./warning');
+const warningHtml = renderToHtml(Warning);
+
+import Danger from './danger';
+const dangerSource = require('!!raw!./danger');
+const dangerHtml = renderToHtml(Danger);
+
+export default props => (
+
+
+
+ Use this CallOut to communicate general information to the user.
+
+
+
+
+
+
+
+
+
+ Use this CallOut to notify the user of a succesfully completed action.
+
+
+
+
+
+
+
+
+
+ Use this CallOut to warn the user against decisions they might regret.
+
+
+
+
+
+
+
+
+
+ Use this CallOut to let the user know something went wrong.
+
+
+
+
+
+
+
+);
diff --git a/ui_framework/doc_site/src/views/call_out/danger.js b/ui_framework/doc_site/src/views/call_out/danger.js
new file mode 100644
index 0000000000000..42d4583fbff85
--- /dev/null
+++ b/ui_framework/doc_site/src/views/call_out/danger.js
@@ -0,0 +1,21 @@
+import React from 'react';
+
+import {
+ KuiCallOut,
+ KuiLink,
+ KuiText,
+} from '../../../../components';
+
+export default () => (
+
+
+
+ Now you have to fix it, but maybe this link can help.
+
);
diff --git a/ui_framework/doc_site/src/views/typography/small_text.js b/ui_framework/doc_site/src/views/typography/small_text.js
new file mode 100644
index 0000000000000..81b6dedbc10ce
--- /dev/null
+++ b/ui_framework/doc_site/src/views/typography/small_text.js
@@ -0,0 +1,17 @@
+import React from 'react';
+
+import {
+ KuiText,
+} from '../../../../components';
+
+export default () => (
+
+
+ The quick brown fox jumped over the lazy dog. But the lazy dog wasn't lazy, it was {
+ // react/jsx-closing-tag-location
+ } just practicing mindfulness, so really in the long run it was much more {
+ // react/jsx-closing-tag-location
+ } satisfied with its life than that fox was.
+
This is the title of the page -- descriptive enough for ya?
-
+
And this is a section within the page
-
-
Note
+
+
A brief note on lazy dogs and quick foxes
-
+
- The quick brown fox jumped over the lazy dog.
+ Once upon a time in a land far, far away, a quick brown fox jumped over a lazy dog.
-
+
- But the dog wasn't lazy, it was just
+ But the dog wasn’t lazy, it was just
practicing mindfulness, so it had a greater sense of
- life-satisfaction than that fox with all its jumping.
+ life-satisfaction than that fox with all its silly jumping.
+
+
+
+
+
+ And from the fox’s perspective, life was full of hoops to jump through, low-hanging
+ fruit to jump for, and dead car batteries to jump-start.
+
+
+
+
+
+ So it thought the dog was making a poor life choice by focusing so much on mindfulness.
+ What if its car broke down?
diff --git a/ui_framework/doc_site/src/views/typography/typography_example.js b/ui_framework/doc_site/src/views/typography/typography_example.js
index a0c73ad360954..eea71905a7ae5 100644
--- a/ui_framework/doc_site/src/views/typography/typography_example.js
+++ b/ui_framework/doc_site/src/views/typography/typography_example.js
@@ -3,6 +3,7 @@ import React from 'react';
import { renderToHtml } from '../../services';
import {
+ GuideCode,
GuideDemo,
GuidePage,
GuideSection,
@@ -30,6 +31,10 @@ import Text from './text';
const textSource = require('!!raw!./text');
const textHtml = renderToHtml(Text);
+import SmallText from './small_text';
+const smallTextSource = require('!!raw!./small_text');
+const smallTextHtml = renderToHtml(SmallText);
+
export default props => (
(
code: typographyHtml,
}]}
>
+
+ You can set the verticalRhythm prop to automatically create vertical
+ spacing between typographic components.
+
+
@@ -128,5 +138,24 @@ export default props => (
+
+
+
+ For less-important paragraphs.
+
+
+
+
+
+
);
diff --git a/ui_framework/doc_site/src/views/vertical_rhythm/vertical_rhythm.js b/ui_framework/doc_site/src/views/vertical_rhythm/vertical_rhythm.js
new file mode 100644
index 0000000000000..a7915a47459a1
--- /dev/null
+++ b/ui_framework/doc_site/src/views/vertical_rhythm/vertical_rhythm.js
@@ -0,0 +1,65 @@
+import React from 'react';
+
+import {
+ KuiTitle,
+ KuiText,
+ KuiVerticalRhythm,
+} from '../../../../components';
+
+export default () => (
+
+
+
+
This is the title of the page -- descriptive enough for ya?
+
+
+
+
+
+
And this is a section within the page
+
+
+
+
+
+
A brief note on lazy dogs and quick foxes
+
+
+
+
+
+
+ Once upon a time in a land far, far away, a quick brown fox jumped over a lazy dog.
+
+
+
+
+
+
+
+ But the dog wasn’t lazy, it was just
+ practicing mindfulness, so it had a greater sense of
+ life-satisfaction than that fox with all its silly jumping.
+
+
+
+
+
+
+
+ And from the fox’s perspective, life was full of hoops to jump through, low-hanging
+ fruit to jump for, and dead car batteries to jump-start.
+
+
+
+
+
+
+
+ So it thought the dog was making a poor life choice by focusing so much on mindfulness.
+ What if its car broke down?
+
+
+
+
+);
diff --git a/ui_framework/doc_site/src/views/vertical_rhythm/vertical_rhythm_example.js b/ui_framework/doc_site/src/views/vertical_rhythm/vertical_rhythm_example.js
new file mode 100644
index 0000000000000..78ee3692bd054
--- /dev/null
+++ b/ui_framework/doc_site/src/views/vertical_rhythm/vertical_rhythm_example.js
@@ -0,0 +1,38 @@
+import React from 'react';
+
+import { renderToHtml } from '../../services';
+
+import {
+ GuideDemo,
+ GuidePage,
+ GuideSection,
+ GuideSectionTypes,
+ GuideText,
+} from '../../components';
+
+import VerticalRhythm from './vertical_rhythm';
+const verticalRhythmSource = require('!!raw!./vertical_rhythm');
+const verticalRhythmHtml = renderToHtml(VerticalRhythm);
+
+export default props => (
+
+
+
+ Use the VerticalRhythm component to create vertical space between typographic elements.
+
+
+
+
+
+
+
+);
diff --git a/ui_framework/src/components/button/_button.scss b/ui_framework/src/components/button/_button.scss
index f35d19501e08d..4eff8b618dac0 100644
--- a/ui_framework/src/components/button/_button.scss
+++ b/ui_framework/src/components/button/_button.scss
@@ -20,19 +20,19 @@
}
.kuiButton__icon {
- vertical-align: -2px;
fill: $kuiColorPrimary;
}
+ /**
+ * 1. Apply margin to all but last item in the flex.
+ */
.kuiButton__content {
display: flex;
- flex-direction: row;
justify-content: center;
align-items: center;
- // Apply margin to all but last item in the flex.
> * + * {
- margin-left: $kuiSizeS;
+ margin-left: $kuiSizeS; /* 1 */
}
}
@@ -61,7 +61,6 @@
}
&.kuiButton--reverse {
-
.kuiButton__content {
flex-direction: row-reverse;
// Margin gets flipped because of the row-reverse.
@@ -73,12 +72,11 @@
}
}
-
// Modifier naming and colors.
$buttonTypes: (
secondary: $kuiColorSecondary,
- danger: $kuiColorDanger,
warning: $kuiColorWarning,
+ danger: $kuiColorDanger,
disabled: tintOrShade($kuiTextColor, 70%, 80%)
);
diff --git a/ui_framework/src/components/button/button.js b/ui_framework/src/components/button/button.js
index b199f9de108b5..6390cae4ddf55 100644
--- a/ui_framework/src/components/button/button.js
+++ b/ui_framework/src/components/button/button.js
@@ -2,8 +2,13 @@ import React, {
Component,
PropTypes,
} from 'react';
+
import classNames from 'classnames';
-import { KuiIcon } from '../../components';
+
+import {
+ ICON_TYPES,
+ KuiIcon,
+} from '../icon';
const typeToClassNameMap = {
danger: 'kuiButton--danger',
@@ -12,12 +17,13 @@ const typeToClassNameMap = {
disabled: 'kuiButton--disabled',
};
+export const TYPES = Object.keys(typeToClassNameMap);
+
const sizeToClassNameMap = {
small: 'kuiButton--small',
large: 'kuiButton--large',
};
-export const TYPES = Object.keys(typeToClassNameMap);
export const SIZES = Object.keys(sizeToClassNameMap);
export class KuiButton extends Component {
@@ -29,7 +35,7 @@ export class KuiButton extends Component {
const {
children,
className,
- icon,
+ iconType,
iconReverse,
type,
size,
@@ -49,16 +55,16 @@ export class KuiButton extends Component {
);
// Add an icon to the button if one exists.
- let buttonIcon = null;
- if (icon) {
+ let buttonIcon;
+
+ if (iconType) {
buttonIcon = (
-
-
-
+
);
}
@@ -77,6 +83,7 @@ export class KuiButton extends Component {
}
KuiButton.propTypes = {
+ iconType: PropTypes.oneOf(ICON_TYPES),
iconReverse: React.PropTypes.bool,
fill: React.PropTypes.bool,
type: PropTypes.oneOf(TYPES),
diff --git a/ui_framework/src/components/call_out/__snapshots__/call_out.test.js.snap b/ui_framework/src/components/call_out/__snapshots__/call_out.test.js.snap
new file mode 100644
index 0000000000000..78d9d9b5af04b
--- /dev/null
+++ b/ui_framework/src/components/call_out/__snapshots__/call_out.test.js.snap
@@ -0,0 +1,17 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`KuiCallOut is rendered 1`] = `
+
+
+
+
+
+`;
diff --git a/ui_framework/src/components/call_out/_call_out.scss b/ui_framework/src/components/call_out/_call_out.scss
new file mode 100644
index 0000000000000..64c1948b65bc6
--- /dev/null
+++ b/ui_framework/src/components/call_out/_call_out.scss
@@ -0,0 +1,57 @@
+.kuiCallOut {
+ padding: $kuiSizeM $kuiSizeL;
+ border-left: 4px solid $kuiColorPrimary;
+ background-color: rgba($kuiColorPrimary, 0.1); /* 1 */
+}
+
+// Modifier naming and colors.
+$callOutTypes: (
+ success: $kuiColorSecondary,
+ warning: $kuiColorWarning,
+ danger: $kuiColorDanger,
+);
+
+// Create button modifiders based upon the map.
+@each $name, $color in $callOutTypes {
+ .kuiCallOut--#{$name} {
+ border-color: $color;
+ background-color: rgba($color, 0.1);
+
+ .kuiCallOutHeader__icon {
+ fill: $color;
+ }
+
+ .kuiCallOutHeader__title {
+ color: $color;
+ }
+ }
+}
+
+/**
+ * 1. Align icon with first line of title text if it wraps.
+ * 2. Apply margin to all but last item in the flex.
+ */
+.kuiCallOutHeader {
+ @include kuiVerticalRhythmS;
+ @include kuiFontSizeM;
+
+ display: flex;
+ align-items: baseline; /* 1 */
+
+ > * + * {
+ margin-left: $kuiSizeS; /* 2 */
+ }
+}
+
+ /**
+ * 1. Vertically center icon with first line of title.
+ */
+ .kuiCallOutHeader__icon {
+ fill: $kuiColorPrimary;
+ transform: translateY(2px); /* 1 */
+ }
+
+ .kuiCallOutHeader__title {
+ font-weight: $kuiFontWeightMedium;
+ color: $kuiColorPrimary;
+ }
diff --git a/ui_framework/src/components/call_out/_index.scss b/ui_framework/src/components/call_out/_index.scss
new file mode 100644
index 0000000000000..b5164642953ec
--- /dev/null
+++ b/ui_framework/src/components/call_out/_index.scss
@@ -0,0 +1 @@
+@import 'call_out';
diff --git a/ui_framework/src/components/call_out/call_out.js b/ui_framework/src/components/call_out/call_out.js
new file mode 100644
index 0000000000000..c130a2502c5eb
--- /dev/null
+++ b/ui_framework/src/components/call_out/call_out.js
@@ -0,0 +1,58 @@
+import React, {
+ PropTypes,
+} from 'react';
+
+import classNames from 'classnames';
+
+import {
+ ICON_TYPES,
+ KuiIcon,
+} from '../icon';
+
+const typeToClassNameMap = {
+ success: 'kuiCallOut--success',
+ warning: 'kuiCallOut--warning',
+ danger: 'kuiCallOut--danger',
+};
+
+export const TYPES = Object.keys(typeToClassNameMap);
+
+export const KuiCallOut = ({ title, type, iconType, children, className, ...rest }) => {
+ const classes = classNames('kuiCallOut', typeToClassNameMap[type], className);
+
+ let headerIcon;
+
+ if (iconType) {
+ headerIcon = (
+
+ );
+ }
+
+ return (
+