diff --git a/web/packages/design/src/Button/Button.jsx b/web/packages/design/src/Button/Button.jsx index afc7db608f13d..c19fbfd2e7c92 100644 --- a/web/packages/design/src/Button/Button.jsx +++ b/web/packages/design/src/Button/Button.jsx @@ -18,7 +18,7 @@ import React from 'react'; import styled from 'styled-components'; import { bool, string } from 'prop-types'; -import { space, width, height, alignSelf } from 'design/system'; +import { space, width, height, alignSelf, gap } from 'design/system'; const Button = ({ children, setRef, ...props }) => { return ( @@ -86,6 +86,9 @@ const themedStyles = props => { ...height(props), ...textTransform(props), ...alignSelf(props), + // Since a Button has `display: inline-flex`, we want to be able to set gap within it in case we + // need to use an icon. + ...gap(props), }; }; diff --git a/web/packages/design/src/buttons.story.jsx b/web/packages/design/src/buttons.story.jsx index ffed2dea89b79..f456a46de877c 100644 --- a/web/packages/design/src/buttons.story.jsx +++ b/web/packages/design/src/buttons.story.jsx @@ -33,32 +33,40 @@ export default { }; export const Buttons = () => ( - <> - Primary - Secondary - Border - Warning -
- - - - - - -
- Button Link - Button Text - + + + Primary + Secondary + Border + Warning + + + + + + + + + + + + + + + + + + + Add users + + + + + Button Link + Button Text + + + @@ -69,7 +77,8 @@ export const Buttons = () => ( - + + @@ -80,7 +89,8 @@ export const Buttons = () => ( - + + @@ -91,5 +101,5 @@ export const Buttons = () => ( - + );