diff --git a/src/alert/src/Alert.js b/src/alert/src/Alert.js index 53404f818..15df14d73 100644 --- a/src/alert/src/Alert.js +++ b/src/alert/src/Alert.js @@ -25,7 +25,7 @@ class Alert extends PureComponent { /** * The intent of the alert. */ - intent: PropTypes.oneOf(['none', 'success', 'warning', 'danger', 'info']) + intent: PropTypes.oneOf(['none', 'success', 'warning', 'danger']) .isRequired, /** @@ -115,18 +115,17 @@ class Alert extends PureComponent { {...themeProps} {...props} > - {hasIcon && - intent !== 'none' && ( - - {this.getIconForIntent(intent)} - - )} + {hasIcon && ( + + {this.getIconForIntent(intent)} + + )} - {hasIcon && - intent !== 'none' && ( - - {this.getIconForIntent(intent)} - - )} + {hasIcon && ( + + {this.getIconForIntent(intent)} + + )} {children} diff --git a/src/alert/stories/index.stories.js b/src/alert/stories/index.stories.js index cb55bd4fa..18bfd94b7 100644 --- a/src/alert/stories/index.stories.js +++ b/src/alert/stories/index.stories.js @@ -38,12 +38,6 @@ storiesOf('alert', module) intent="danger" title="We weren’t able to save your changes." /> - ))} @@ -86,15 +80,6 @@ storiesOf('alert', module) Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. - - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do - eiusmod tempor incididunt ut labore et dolore magna aliqua. - ))} @@ -120,7 +105,7 @@ storiesOf('alert', module) We weren’t able to save your changes. - + There are over 200 integrations available. diff --git a/src/buttons/src/Button.js b/src/buttons/src/Button.js index c482f2d6d..2534d13c2 100644 --- a/src/buttons/src/Button.js +++ b/src/buttons/src/Button.js @@ -29,6 +29,12 @@ class Button extends PureComponent { */ ...layout.propTypes, + /** + * The intent of the button. + */ + intent: PropTypes.oneOf(['none', 'success', 'warning', 'danger']) + .isRequired, + /** * The appearance of the button. */ diff --git a/src/constants/src/Intent.js b/src/constants/src/Intent.js index ec82289f1..facde7bae 100644 --- a/src/constants/src/Intent.js +++ b/src/constants/src/Intent.js @@ -2,6 +2,5 @@ export default { NONE: 'none', SUCCESS: 'success', WARNING: 'warning', - DANGER: 'danger', - INFO: 'info' + DANGER: 'danger' } diff --git a/src/corner-dialog/src/CornerDialog.js b/src/corner-dialog/src/CornerDialog.js index 6eb5070d2..8458c4bbd 100644 --- a/src/corner-dialog/src/CornerDialog.js +++ b/src/corner-dialog/src/CornerDialog.js @@ -57,7 +57,7 @@ export default class CornerDialog extends PureComponent { /** * The intent of the CornerDialog. Used for the button. */ - intent: PropTypes.oneOf(['none', 'success', 'warning', 'danger', 'info']) + intent: PropTypes.oneOf(['none', 'success', 'warning', 'danger']) .isRequired, /** diff --git a/src/dialog/src/Dialog.js b/src/dialog/src/Dialog.js index 187ecb0c9..2c42fd9f4 100644 --- a/src/dialog/src/Dialog.js +++ b/src/dialog/src/Dialog.js @@ -60,7 +60,7 @@ class Dialog extends React.Component { /** * The intent of the Dialog. Used for the button. */ - intent: PropTypes.oneOf(['none', 'success', 'warning', 'danger', 'info']) + intent: PropTypes.oneOf(['none', 'success', 'warning', 'danger']) .isRequired, /** diff --git a/src/menu/src/MenuItem.js b/src/menu/src/MenuItem.js index 954d2b3b3..8faf993f6 100644 --- a/src/menu/src/MenuItem.js +++ b/src/menu/src/MenuItem.js @@ -35,7 +35,7 @@ class MenuItem extends React.PureComponent { /** * The intent of the menu item. */ - intent: PropTypes.oneOf(['none', 'success', 'warning', 'danger', 'info']) + intent: PropTypes.oneOf(['none', 'success', 'warning', 'danger']) .isRequired, /** diff --git a/src/table/docs/examples/TableRow.example b/src/table/docs/examples/TableRow.example index c820c3021..fc62865fc 100644 --- a/src/table/docs/examples/TableRow.example +++ b/src/table/docs/examples/TableRow.example @@ -1,5 +1,5 @@
- {['none', 'danger', 'warning', 'info', 'success'].map(intent => { + {['none', 'danger', 'warning', 'success'].map(intent => { return ( { + {['none', 'danger', 'warning', 'success'].map(intent => { return ( {intent} diff --git a/src/theme/src/default-theme/component-specific/getButtonClassName.js b/src/theme/src/default-theme/component-specific/getButtonClassName.js index f6edf71ef..920316c54 100644 --- a/src/theme/src/default-theme/component-specific/getButtonClassName.js +++ b/src/theme/src/default-theme/component-specific/getButtonClassName.js @@ -51,7 +51,7 @@ const getButtonAppearance = (appearance, intent) => { }) } case 'minimal': { - const intentTextColor = getTextColorForIntent(intent) + const intentTextColor = getTextColorForIntent(intent, scales.blue.B9) return Themer.createButtonAppearance({ disabled, base: { diff --git a/src/theme/src/default-theme/component-specific/getRowClassName.js b/src/theme/src/default-theme/component-specific/getRowClassName.js index 7b3af47a5..d5ddcf1fe 100644 --- a/src/theme/src/default-theme/component-specific/getRowClassName.js +++ b/src/theme/src/default-theme/component-specific/getRowClassName.js @@ -76,32 +76,6 @@ Appearances.warning = Themer.createRowAppearance({ current: {} }) -Appearances.info = Themer.createRowAppearance({ - base: { - backgroundColor: palette.blue.lightest - }, - - hover: { - backgroundColor: tinycolor(palette.blue.lightest) - .darken(1) - .toString() - }, - - focus: { - backgroundColor: tinycolor(palette.blue.lightest) - .darken(1.5) - .toString() - }, - - active: { - backgroundColor: tinycolor(palette.blue.lightest) - .darken(2.5) - .toString() - }, - - current: {} -}) - Appearances.success = Themer.createRowAppearance({ base: { backgroundColor: palette.green.lightest @@ -140,8 +114,6 @@ const getRowAppearance = (appearance, intent) => { return Appearances.danger case 'warning': return Appearances.warning - case 'info': - return Appearances.info case 'success': return Appearances.success case 'none': diff --git a/src/theme/src/default-theme/foundational-styles/colors.js b/src/theme/src/default-theme/foundational-styles/colors.js index 9ea20bfdc..39f8ea057 100644 --- a/src/theme/src/default-theme/foundational-styles/colors.js +++ b/src/theme/src/default-theme/foundational-styles/colors.js @@ -77,13 +77,13 @@ export default { /** * Used for Alerts and other (future) componentes that express intent. - * @property {string} intent.info - Required property. + * @property {string} intent.none - Required property. * @property {string} intent.success - Required property. * @property {string} intent.danger - Required property. * @property {string} intent.warning - Required property. */ intent: { - info: palette.blue.base, + none: palette.blue.base, success: palette.green.base, danger: palette.red.base, warning: palette.orange.base diff --git a/src/theme/src/default-theme/helpers.js b/src/theme/src/default-theme/helpers.js index ec2224938..a8e79a14b 100644 --- a/src/theme/src/default-theme/helpers.js +++ b/src/theme/src/default-theme/helpers.js @@ -15,7 +15,7 @@ const linearGradient = (top, bottom) => { * @param {Intent} intent * @return {String} color */ -const getTextColorForIntent = intent => { +const getTextColorForIntent = (intent, defaultColor) => { switch (intent) { case Intent.SUCCESS: return colors.text.success @@ -24,7 +24,7 @@ const getTextColorForIntent = intent => { case Intent.WARNING: return colors.text.warning default: - return colors.text.default + return defaultColor || colors.text.default } } diff --git a/src/theme/src/default-theme/theme-helpers/index.js b/src/theme/src/default-theme/theme-helpers/index.js index c5f9d217e..dd623f152 100644 --- a/src/theme/src/default-theme/theme-helpers/index.js +++ b/src/theme/src/default-theme/theme-helpers/index.js @@ -111,7 +111,7 @@ const getIconForIntent = intent => { return { icon: 'error', color: 'danger' } case Intent.WARNING: return { icon: 'warning-sign', color: 'warning' } - case Intent.INFO: + case Intent.NONE: default: return { icon: 'info-sign', color: 'info' } } diff --git a/src/toaster/src/Toast.js b/src/toaster/src/Toast.js index c6cfa534d..9c8ba50ec 100644 --- a/src/toaster/src/Toast.js +++ b/src/toaster/src/Toast.js @@ -69,7 +69,7 @@ export default class Toast extends React.PureComponent { /** * The type of the alert. */ - intent: PropTypes.oneOf(['none', 'success', 'warning', 'danger', 'info']) + intent: PropTypes.oneOf(['none', 'success', 'warning', 'danger']) .isRequired, /** diff --git a/src/toaster/src/Toaster.js b/src/toaster/src/Toaster.js index 18662f35d..4a5bacc40 100644 --- a/src/toaster/src/Toaster.js +++ b/src/toaster/src/Toaster.js @@ -70,8 +70,4 @@ export default class Toaster { danger = (title, settings = {}) => { return this.notifyHandler(title, { ...settings, intent: 'danger' }) } - - info = (title, settings = {}) => { - return this.notifyHandler(title, { ...settings, intent: 'info' }) - } } diff --git a/src/toaster/stories/index.stories.js b/src/toaster/stories/index.stories.js index 342faa41d..9e02f3a28 100644 --- a/src/toaster/stories/index.stories.js +++ b/src/toaster/stories/index.stories.js @@ -18,7 +18,6 @@ storiesOf('toaster', module).add('examples', () => (
  • success
  • warning
  • danger
  • -
  • info
  • closeAll — useful for page transitions when you want to close all toasts. @@ -111,27 +110,6 @@ storiesOf('toaster', module).add('examples', () => ( Danger with Text - - - - - ))