|
1 | 1 | import React from 'react';
|
2 | 2 | import PropTypes from 'prop-types';
|
3 | 3 | import styled from '@emotion/styled';
|
4 |
| -import { Spacings, Text } from 'ui-kit'; |
| 4 | +import { Spacings, Text, Constraints } from 'ui-kit'; |
5 | 5 | import { Suite, Spec } from '../../../test/percy';
|
6 | 6 |
|
7 | 7 | export const routePath = '/spacings';
|
@@ -105,7 +105,7 @@ const insetSquishSizes = [
|
105 | 105 | { name: 'l', pixels: '16px x 32px' },
|
106 | 106 | ];
|
107 | 107 |
|
108 |
| -const flexProps = ['stretch', 'flexStart', 'flexEnd', 'center']; |
| 108 | +const flexProps = ['stretch', 'flex-start', 'flex-end', 'center']; |
109 | 109 | const exampleHeights = ['50px', '60px', '76px', '40px', '66px'];
|
110 | 110 |
|
111 | 111 | const StackExample = ({ alignItems }) => (
|
@@ -223,5 +223,35 @@ export const component = () => (
|
223 | 223 | <StackExample alignItems={prop} />
|
224 | 224 | </Spec>
|
225 | 225 | ))}
|
| 226 | + {[ |
| 227 | + 'flex-start', |
| 228 | + 'flex-end', |
| 229 | + 'center', |
| 230 | + 'space-between', |
| 231 | + 'space-around', |
| 232 | + 'space-evenly', |
| 233 | + ].map(prop => ( |
| 234 | + <Spec |
| 235 | + key={`inline-justify-${prop}`} |
| 236 | + label={`Inline - when justifyContent is ${prop}`} |
| 237 | + > |
| 238 | + <View> |
| 239 | + <Constraints.Horizontal constraint="scale"> |
| 240 | + <Spacings.Inline |
| 241 | + scale="s" |
| 242 | + alignItems="center" |
| 243 | + justifyContent={prop} |
| 244 | + > |
| 245 | + <div> |
| 246 | + <Text.Body>{'Text on the left'}</Text.Body> |
| 247 | + </div> |
| 248 | + <div> |
| 249 | + <Text.Body>{'Text on the right'}</Text.Body> |
| 250 | + </div> |
| 251 | + </Spacings.Inline> |
| 252 | + </Constraints.Horizontal> |
| 253 | + </View> |
| 254 | + </Spec> |
| 255 | + ))} |
226 | 256 | </Suite>
|
227 | 257 | );
|
0 commit comments