diff --git a/src/core/client/ui/components/Button/Button.mdx b/src/core/client/ui/components/Button/Button.mdx
index 5be82c540..398aff282 100644
--- a/src/core/client/ui/components/Button/Button.mdx
+++ b/src/core/client/ui/components/Button/Button.mdx
@@ -5,23 +5,26 @@ menu: UI Kit
import { Playground } from 'docz'
import Button from './Button'
+import Flex from '../Flex'
# Button
## Basic usage
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/core/client/ui/components/Flex/Flex.css b/src/core/client/ui/components/Flex/Flex.css
index 13cb05be5..b28d3aa0f 100644
--- a/src/core/client/ui/components/Flex/Flex.css
+++ b/src/core/client/ui/components/Flex/Flex.css
@@ -1,5 +1,8 @@
.root {
display: flex;
+ & > * {
+ flex-shrink: 0;
+ }
}
.halfItemGutter {
@@ -50,6 +53,51 @@
}
}
+.wrap {
+ flex-wrap: wrap;
+}
+
+.wrapReverse {
+ flex-wrap: wrap-reverse;
+}
+
+.wrap,
+.wrapReverse {
+ &.itemGutter {
+ &:not(:empty) {
+ margin-top: calc(-1 * var(--spacing-unit));
+ }
+ & > * {
+ margin-top: var(--spacing-unit);
+ }
+ }
+ &.directionColumn.itemGutter {
+ &:not(:empty) {
+ margin-left: calc(-1 * var(--spacing-unit));
+ }
+ &.itemGutter > * {
+ margin-left: var(--spacing-unit);
+ }
+ }
+
+ &.halfItemGutter {
+ &:not(:empty) {
+ margin-top: calc(-0.5 * var(--spacing-unit));
+ }
+ & > * {
+ margin-top: calc(0.5 * var(--spacing-unit));
+ }
+ }
+ &.directionColumn.halfItemGutter {
+ &:not(:empty) {
+ margin-left: calc(-0.5 * var(--spacing-unit));
+ }
+ &.halfItemGutter > * {
+ margin-left: calc(0.5 * var(--spacing-unit));
+ }
+ }
+}
+
.justifyFlexStart {
justify-content: flex-start;
}
diff --git a/src/core/client/ui/components/Flex/Flex.tsx b/src/core/client/ui/components/Flex/Flex.tsx
index bfba06d05..8ffd9c231 100644
--- a/src/core/client/ui/components/Flex/Flex.tsx
+++ b/src/core/client/ui/components/Flex/Flex.tsx
@@ -20,6 +20,7 @@ interface InnerProps {
direction?: "row" | "column" | "row-reverse" | "column-reverse";
itemGutter?: boolean | "half";
className?: string;
+ wrap?: boolean | "reverse";
}
const Flex: StatelessComponent = props => {
@@ -29,12 +30,15 @@ const Flex: StatelessComponent = props => {
alignItems,
direction,
itemGutter,
+ wrap,
...rest
} = props;
const classObject: Record = {
[styles.itemGutter]: itemGutter === true,
[styles.halfItemGutter]: itemGutter === "half",
+ [styles.wrap]: wrap === true,
+ [styles.wrapReverse]: wrap === "reverse",
};
if (justifyContent) {