@atlaskit/ds-explorations 2.3.1 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +70 -58
- package/box/package.json +15 -0
- package/dist/cjs/components/box.partial.js +620 -0
- package/dist/cjs/components/inline.partial.js +182 -0
- package/dist/cjs/components/interaction-surface.partial.js +1 -2
- package/dist/cjs/components/stack.partial.js +148 -0
- package/dist/cjs/components/surface-provider.js +2 -4
- package/dist/cjs/components/text.partial.js +5 -6
- package/dist/cjs/constants.js +2 -3
- package/dist/cjs/index.js +21 -0
- package/dist/cjs/internal/color-map.js +2 -3
- package/dist/cjs/internal/role-to-element.js +1 -2
- package/dist/cjs/internal/spacing-scale.js +1 -2
- package/dist/es2019/components/box.partial.js +614 -0
- package/dist/es2019/components/inline.partial.js +177 -0
- package/dist/es2019/components/stack.partial.js +144 -0
- package/dist/es2019/components/text.partial.js +4 -4
- package/dist/es2019/index.js +3 -0
- package/dist/esm/components/box.partial.js +617 -0
- package/dist/esm/components/inline.partial.js +177 -0
- package/dist/esm/components/stack.partial.js +143 -0
- package/dist/esm/components/text.partial.js +4 -4
- package/dist/esm/index.js +3 -0
- package/dist/types/components/box.partial.d.ts +357 -0
- package/dist/types/components/inline.partial.d.ts +108 -0
- package/dist/types/components/stack.partial.d.ts +92 -0
- package/dist/types/components/surface-provider.d.ts +2 -2
- package/dist/types/components/text.partial.d.ts +2 -2
- package/dist/types/index.d.ts +6 -0
- package/dist/types-ts4.5/components/box.partial.d.ts +357 -0
- package/dist/types-ts4.5/components/inline.partial.d.ts +108 -0
- package/dist/types-ts4.5/components/stack.partial.d.ts +92 -0
- package/dist/types-ts4.5/components/surface-provider.d.ts +2 -2
- package/dist/types-ts4.5/components/text.partial.d.ts +2 -2
- package/dist/types-ts4.5/index.d.ts +6 -0
- package/examples/00-basic.tsx +22 -0
- package/examples/01-box.tsx +171 -0
- package/examples/02-text-advanced.tsx +20 -11
- package/examples/02-text.tsx +10 -15
- package/examples/03-stack.tsx +99 -0
- package/examples/04-inline.tsx +99 -0
- package/examples/05-badge.tsx +5 -9
- package/examples/06-section-message.tsx +4 -2
- package/examples/07-comment.tsx +3 -1
- package/examples/08-lozenge.tsx +4 -8
- package/examples/99-interactions.tsx +33 -49
- package/inline/package.json +15 -0
- package/package.json +6 -4
- package/report.api.md +465 -0
- package/scripts/codegen-styles.tsx +89 -16
- package/src/components/__tests__/unit/box.test.tsx +55 -0
- package/src/components/__tests__/unit/inline.test.tsx +43 -0
- package/src/components/__tests__/unit/interaction-suface.test.tsx +2 -2
- package/src/components/__tests__/unit/stack.test.tsx +31 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/inline-snapshot-test-tsx-inline-alignment-example-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/inline-snapshot-test-tsx-inline-spacing-example-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/stack-snapshot-test-tsx-stack-alignment-example-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/__image_snapshots__/stack-snapshot-test-tsx-stack-spacing-example-should-match-snapshot-1-snap.png +3 -0
- package/src/components/__tests__/visual-regression/inline-snapshot-test.tsx +28 -0
- package/src/components/__tests__/visual-regression/stack-snapshot-test.tsx +28 -0
- package/src/components/__tests__/vr-tests/__snapshots__/box--default.png +0 -0
- package/src/components/__tests__/vr-tests/box-snapshot-test.vr.tsx +6 -0
- package/src/components/box.partial.tsx +706 -0
- package/src/components/inline.partial.tsx +218 -0
- package/src/components/stack.partial.tsx +174 -0
- package/src/components/surface-provider.tsx +1 -1
- package/src/components/text.partial.tsx +4 -4
- package/src/index.tsx +6 -0
- package/stack/package.json +15 -0
- package/tmp/api-report-tmp.d.ts +451 -0
- package/tsconfig.app.json +0 -3
- package/tsconfig.dev.json +6 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import Box from '../src/components/box.partial';
|
|
4
|
+
import Text from '../src/components/text.partial';
|
|
5
|
+
|
|
6
|
+
export default () => {
|
|
7
|
+
return (
|
|
8
|
+
<Box>
|
|
9
|
+
<Box
|
|
10
|
+
paddingBlock="space.400"
|
|
11
|
+
paddingInline="space.400"
|
|
12
|
+
alignItems="center"
|
|
13
|
+
backgroundColor="brand.bold"
|
|
14
|
+
UNSAFE_style={{ aspectRatio: '1/1' }}
|
|
15
|
+
>
|
|
16
|
+
<Text fontWeight="medium" color="inverse">
|
|
17
|
+
A basic box
|
|
18
|
+
</Text>
|
|
19
|
+
</Box>
|
|
20
|
+
</Box>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import Heading from '@atlaskit/heading';
|
|
4
|
+
import Inline from '@atlaskit/primitives/inline';
|
|
5
|
+
import Stack from '@atlaskit/primitives/stack';
|
|
6
|
+
|
|
7
|
+
import { UNSAFE_Box as Box, UNSAFE_Text as Text } from '../src';
|
|
8
|
+
import { spacingScale } from '../src/internal/spacing-scale';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Box permutations
|
|
12
|
+
*/
|
|
13
|
+
export default () => {
|
|
14
|
+
return (
|
|
15
|
+
<Stack space="space.400" alignInline="start">
|
|
16
|
+
<Stack space="space.200" testId="box-with-background-and-paddingBlock">
|
|
17
|
+
<Heading level="h600">paddingBlock</Heading>
|
|
18
|
+
<Inline space="space.200" alignBlock="center">
|
|
19
|
+
{spacingScale.map((space) => (
|
|
20
|
+
<Box
|
|
21
|
+
key={space}
|
|
22
|
+
backgroundColor="discovery.bold"
|
|
23
|
+
paddingBlock={space}
|
|
24
|
+
>
|
|
25
|
+
<Box backgroundColor="elevation.surface" justifyContent="center">
|
|
26
|
+
<Text>{space}</Text>
|
|
27
|
+
</Box>
|
|
28
|
+
</Box>
|
|
29
|
+
))}
|
|
30
|
+
</Inline>
|
|
31
|
+
</Stack>
|
|
32
|
+
|
|
33
|
+
<Stack space="space.200" testId="box-with-background-and-paddingInline">
|
|
34
|
+
<Heading level="h600">paddingInline</Heading>
|
|
35
|
+
<Stack space="space.200" alignInline="center">
|
|
36
|
+
{spacingScale.map((space) => (
|
|
37
|
+
<Box
|
|
38
|
+
key={space}
|
|
39
|
+
backgroundColor="discovery.bold"
|
|
40
|
+
paddingInline={space}
|
|
41
|
+
>
|
|
42
|
+
<Box backgroundColor="elevation.surface" justifyContent="center">
|
|
43
|
+
<Text>{space}</Text>
|
|
44
|
+
</Box>
|
|
45
|
+
</Box>
|
|
46
|
+
))}
|
|
47
|
+
</Stack>
|
|
48
|
+
</Stack>
|
|
49
|
+
|
|
50
|
+
<Stack space="space.200" testId="box-with-background-and-padding">
|
|
51
|
+
<Heading level="h600">padding</Heading>
|
|
52
|
+
<Inline space="space.200" alignBlock="center">
|
|
53
|
+
{spacingScale.map((space) => (
|
|
54
|
+
<Box key={space} backgroundColor="discovery.bold" padding={space}>
|
|
55
|
+
<Box backgroundColor="elevation.surface" justifyContent="center">
|
|
56
|
+
<Text>{space}</Text>
|
|
57
|
+
</Box>
|
|
58
|
+
</Box>
|
|
59
|
+
))}
|
|
60
|
+
</Inline>
|
|
61
|
+
</Stack>
|
|
62
|
+
|
|
63
|
+
<Stack space="space.200" testId="box-with-backgroundColor">
|
|
64
|
+
<Heading level="h600">backgroundColor</Heading>
|
|
65
|
+
<Inline space="space.200" alignBlock="center">
|
|
66
|
+
{(
|
|
67
|
+
[
|
|
68
|
+
'discovery.bold',
|
|
69
|
+
'success.bold',
|
|
70
|
+
'warning.bold',
|
|
71
|
+
'danger.bold',
|
|
72
|
+
'information.bold',
|
|
73
|
+
'brand.bold',
|
|
74
|
+
] as const
|
|
75
|
+
).map((bgColor) => (
|
|
76
|
+
<Box key={bgColor} backgroundColor={bgColor} padding="space.400">
|
|
77
|
+
<Box justifyContent="center">
|
|
78
|
+
<Text>{bgColor}</Text>
|
|
79
|
+
</Box>
|
|
80
|
+
</Box>
|
|
81
|
+
))}
|
|
82
|
+
</Inline>
|
|
83
|
+
</Stack>
|
|
84
|
+
|
|
85
|
+
<Stack space="space.200" testId="box-with-borderColor">
|
|
86
|
+
<Heading level="h600">borderColor</Heading>
|
|
87
|
+
<Inline space="space.200" alignBlock="center">
|
|
88
|
+
{(
|
|
89
|
+
[
|
|
90
|
+
'discovery',
|
|
91
|
+
'success',
|
|
92
|
+
'warning',
|
|
93
|
+
'danger',
|
|
94
|
+
'information',
|
|
95
|
+
'brand',
|
|
96
|
+
] as const
|
|
97
|
+
).map((borderColor) => (
|
|
98
|
+
<Box
|
|
99
|
+
key={borderColor}
|
|
100
|
+
backgroundColor="neutral"
|
|
101
|
+
borderColor={borderColor}
|
|
102
|
+
borderStyle="solid"
|
|
103
|
+
borderWidth="2px"
|
|
104
|
+
padding="space.400"
|
|
105
|
+
>
|
|
106
|
+
<Box justifyContent="center">
|
|
107
|
+
<Text color="color.text">{borderColor}</Text>
|
|
108
|
+
</Box>
|
|
109
|
+
</Box>
|
|
110
|
+
))}
|
|
111
|
+
</Inline>
|
|
112
|
+
</Stack>
|
|
113
|
+
|
|
114
|
+
<Stack space="space.200" testId="box-with-shadow">
|
|
115
|
+
<Heading level="h600">shadow</Heading>
|
|
116
|
+
<Inline space="space.200" alignBlock="center">
|
|
117
|
+
{(['raised', 'overflow', 'overlay'] as const).map((shadow) => (
|
|
118
|
+
<Box
|
|
119
|
+
key={shadow}
|
|
120
|
+
backgroundColor="elevation.surface"
|
|
121
|
+
shadow={shadow}
|
|
122
|
+
padding="space.400"
|
|
123
|
+
>
|
|
124
|
+
<Box justifyContent="center">
|
|
125
|
+
<Text color="color.text">{shadow}</Text>
|
|
126
|
+
</Box>
|
|
127
|
+
</Box>
|
|
128
|
+
))}
|
|
129
|
+
</Inline>
|
|
130
|
+
</Stack>
|
|
131
|
+
|
|
132
|
+
<Stack space="space.200" testId="box-with-layer">
|
|
133
|
+
<Heading level="h600">layer</Heading>
|
|
134
|
+
<Box alignItems="center" UNSAFE_style={{ width: 800, height: 650 }}>
|
|
135
|
+
{(
|
|
136
|
+
[
|
|
137
|
+
'card',
|
|
138
|
+
'navigation',
|
|
139
|
+
'dialog',
|
|
140
|
+
'layer',
|
|
141
|
+
'blanket',
|
|
142
|
+
'modal',
|
|
143
|
+
'flag',
|
|
144
|
+
'spotlight',
|
|
145
|
+
'tooltip',
|
|
146
|
+
] as const
|
|
147
|
+
).map((layer, index) => (
|
|
148
|
+
<Box
|
|
149
|
+
key={layer}
|
|
150
|
+
backgroundColor="elevation.surface"
|
|
151
|
+
layer={layer}
|
|
152
|
+
shadow="overlay"
|
|
153
|
+
padding="space.400"
|
|
154
|
+
position="absolute"
|
|
155
|
+
UNSAFE_style={{
|
|
156
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
157
|
+
top: index * 64,
|
|
158
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
159
|
+
left: index * 64,
|
|
160
|
+
}}
|
|
161
|
+
>
|
|
162
|
+
<Box justifyContent="center">
|
|
163
|
+
<Text color="color.text">{layer}</Text>
|
|
164
|
+
</Box>
|
|
165
|
+
</Box>
|
|
166
|
+
))}
|
|
167
|
+
</Box>
|
|
168
|
+
</Stack>
|
|
169
|
+
</Stack>
|
|
170
|
+
);
|
|
171
|
+
};
|
|
@@ -1,28 +1,37 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import Inline from '@atlaskit/primitives/inline';
|
|
4
4
|
|
|
5
|
+
import Box from '../src/components/box.partial';
|
|
5
6
|
import Text from '../src/components/text.partial';
|
|
6
7
|
|
|
7
|
-
const boxStyles = xcss({
|
|
8
|
-
display: 'flex',
|
|
9
|
-
paddingBlock: 'space.400',
|
|
10
|
-
paddingInline: 'space.400',
|
|
11
|
-
alignItems: 'center',
|
|
12
|
-
});
|
|
13
|
-
|
|
14
8
|
export default () => {
|
|
15
9
|
return (
|
|
16
10
|
<Inline space="space.100">
|
|
17
|
-
<Box
|
|
11
|
+
<Box
|
|
12
|
+
paddingBlock="space.400"
|
|
13
|
+
paddingInline="space.400"
|
|
14
|
+
alignItems="center"
|
|
15
|
+
backgroundColor="information"
|
|
16
|
+
>
|
|
18
17
|
<Text>
|
|
19
18
|
<Text>Text that deletes its redundant wrapping</Text>
|
|
20
19
|
</Text>
|
|
21
20
|
</Box>
|
|
22
|
-
<Box
|
|
21
|
+
<Box
|
|
22
|
+
paddingBlock="space.400"
|
|
23
|
+
paddingInline="space.400"
|
|
24
|
+
alignItems="center"
|
|
25
|
+
backgroundColor="information"
|
|
26
|
+
>
|
|
23
27
|
<Text fontWeight="semibold">Text on information</Text>
|
|
24
28
|
</Box>
|
|
25
|
-
<Box
|
|
29
|
+
<Box
|
|
30
|
+
paddingBlock="space.400"
|
|
31
|
+
paddingInline="space.400"
|
|
32
|
+
alignItems="center"
|
|
33
|
+
backgroundColor="brand.bold"
|
|
34
|
+
>
|
|
26
35
|
<Text fontWeight="semibold">Text on brand bold</Text>
|
|
27
36
|
</Box>
|
|
28
37
|
</Inline>
|
package/examples/02-text.tsx
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import Heading from '@atlaskit/heading';
|
|
4
|
-
import
|
|
4
|
+
import Inline from '@atlaskit/primitives/inline';
|
|
5
|
+
import Stack from '@atlaskit/primitives/stack';
|
|
5
6
|
|
|
6
|
-
import { UNSAFE_Text as Text } from '../src';
|
|
7
|
-
|
|
8
|
-
const fixedWidthStyles = xcss({ display: 'flex', width: '200px' });
|
|
9
|
-
|
|
10
|
-
const lineHeightContainerStyles = xcss({
|
|
11
|
-
display: 'inline-flex',
|
|
12
|
-
});
|
|
7
|
+
import { UNSAFE_Box as Box, UNSAFE_Text as Text } from '../src';
|
|
13
8
|
|
|
14
9
|
export default () => {
|
|
15
10
|
return (
|
|
@@ -18,7 +13,7 @@ export default () => {
|
|
|
18
13
|
Text examples
|
|
19
14
|
</Heading>
|
|
20
15
|
<Stack space="space.200">
|
|
21
|
-
<Box>
|
|
16
|
+
<Box display="block">
|
|
22
17
|
<Heading level="h300">Font size</Heading>
|
|
23
18
|
<Inline space="space.200" testId="font-sizes">
|
|
24
19
|
{(
|
|
@@ -39,7 +34,7 @@ export default () => {
|
|
|
39
34
|
))}
|
|
40
35
|
</Inline>
|
|
41
36
|
</Box>
|
|
42
|
-
<Box>
|
|
37
|
+
<Box display="block">
|
|
43
38
|
<Heading level="h300" as="h4">
|
|
44
39
|
Font weight
|
|
45
40
|
</Heading>
|
|
@@ -53,7 +48,7 @@ export default () => {
|
|
|
53
48
|
)}
|
|
54
49
|
</Inline>
|
|
55
50
|
</Box>
|
|
56
|
-
<Box>
|
|
51
|
+
<Box display="block">
|
|
57
52
|
<Heading level="h300" as="h4">
|
|
58
53
|
Line height
|
|
59
54
|
</Heading>
|
|
@@ -70,15 +65,15 @@ export default () => {
|
|
|
70
65
|
).map((lineHeight) => (
|
|
71
66
|
<Box
|
|
72
67
|
key={lineHeight}
|
|
73
|
-
|
|
74
|
-
backgroundColor="
|
|
68
|
+
display="inlineFlex"
|
|
69
|
+
backgroundColor="neutral"
|
|
75
70
|
>
|
|
76
71
|
<Text lineHeight={lineHeight}>lineHeight {lineHeight}</Text>
|
|
77
72
|
</Box>
|
|
78
73
|
))}
|
|
79
74
|
</Inline>
|
|
80
75
|
</Box>
|
|
81
|
-
<Box>
|
|
76
|
+
<Box display="block">
|
|
82
77
|
<Heading level="h300" as="h4">
|
|
83
78
|
Testing
|
|
84
79
|
</Heading>
|
|
@@ -97,7 +92,7 @@ export default () => {
|
|
|
97
92
|
>
|
|
98
93
|
Text with various props
|
|
99
94
|
</Text>
|
|
100
|
-
<Box
|
|
95
|
+
<Box UNSAFE_style={{ width: '200px' }}>
|
|
101
96
|
<Text shouldTruncate>Long truncated text that is cut off.</Text>
|
|
102
97
|
</Box>
|
|
103
98
|
</Stack>
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import Heading from '@atlaskit/heading';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
UNSAFE_Box as Box,
|
|
7
|
+
UNSAFE_Inline as Inline,
|
|
8
|
+
UNSAFE_Stack as Stack,
|
|
9
|
+
} from '../src';
|
|
10
|
+
import { spacingScale } from '../src/internal/spacing-scale';
|
|
11
|
+
|
|
12
|
+
const flexAlignItems = ['center', 'baseline', 'flexStart', 'flexEnd'];
|
|
13
|
+
const flexJustifyContent = ['center', 'flexStart', 'flexEnd'];
|
|
14
|
+
const flexWrap = ['wrap'];
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Stack permutations
|
|
18
|
+
*/
|
|
19
|
+
export default () => {
|
|
20
|
+
return (
|
|
21
|
+
<Stack gap="space.300">
|
|
22
|
+
<Stack gap="space.300" testId="stack-spacing">
|
|
23
|
+
<Heading level="h700">Spacing</Heading>
|
|
24
|
+
<Inline gap="space.400">
|
|
25
|
+
{spacingScale.map((space) => (
|
|
26
|
+
<Stack key={space} gap="space.300">
|
|
27
|
+
<Heading level="h500">{space}</Heading>
|
|
28
|
+
|
|
29
|
+
<Box backgroundColor="neutral">
|
|
30
|
+
<Stack gap={space} alignItems="center">
|
|
31
|
+
<Box padding="space.100" backgroundColor="success.bold" />
|
|
32
|
+
<Box padding="space.100" backgroundColor="success.bold" />
|
|
33
|
+
<Box padding="space.100" backgroundColor="success.bold" />
|
|
34
|
+
</Stack>
|
|
35
|
+
</Box>
|
|
36
|
+
</Stack>
|
|
37
|
+
))}
|
|
38
|
+
</Inline>
|
|
39
|
+
</Stack>
|
|
40
|
+
<Stack gap="space.300" testId="stack-alignment">
|
|
41
|
+
<Heading level="h700">Alignment</Heading>
|
|
42
|
+
<Heading level="h600">alignItems</Heading>
|
|
43
|
+
<Inline gap="space.400">
|
|
44
|
+
{flexAlignItems.map((alignItemsValue) => (
|
|
45
|
+
<Stack key={alignItemsValue} gap="space.300">
|
|
46
|
+
<Heading level="h500">{alignItemsValue}</Heading>
|
|
47
|
+
|
|
48
|
+
<Box backgroundColor="neutral" display="block">
|
|
49
|
+
<Stack gap="space.200" alignItems={alignItemsValue as any}>
|
|
50
|
+
<Box padding="space.100" backgroundColor="success.bold" />
|
|
51
|
+
<Box padding="space.100" backgroundColor="success.bold" />
|
|
52
|
+
<Box padding="space.100" backgroundColor="success.bold" />
|
|
53
|
+
</Stack>
|
|
54
|
+
</Box>
|
|
55
|
+
</Stack>
|
|
56
|
+
))}
|
|
57
|
+
</Inline>
|
|
58
|
+
|
|
59
|
+
<Heading level="h600">justifyContent</Heading>
|
|
60
|
+
<Inline gap="space.400">
|
|
61
|
+
{flexJustifyContent.map((justifyContentValue) => (
|
|
62
|
+
<Stack key={justifyContentValue} gap="space.300">
|
|
63
|
+
<Heading level="h500">{justifyContentValue}</Heading>
|
|
64
|
+
|
|
65
|
+
<Box backgroundColor="neutral" UNSAFE_style={{ height: '200px' }}>
|
|
66
|
+
<Stack
|
|
67
|
+
gap="space.200"
|
|
68
|
+
justifyContent={justifyContentValue as any}
|
|
69
|
+
>
|
|
70
|
+
<Box padding="space.100" backgroundColor="success.bold" />
|
|
71
|
+
<Box padding="space.100" backgroundColor="success.bold" />
|
|
72
|
+
<Box padding="space.100" backgroundColor="success.bold" />
|
|
73
|
+
</Stack>
|
|
74
|
+
</Box>
|
|
75
|
+
</Stack>
|
|
76
|
+
))}
|
|
77
|
+
</Inline>
|
|
78
|
+
|
|
79
|
+
<Heading level="h700">Overflow</Heading>
|
|
80
|
+
<Heading level="h600">flexWrap</Heading>
|
|
81
|
+
<Inline gap="space.400">
|
|
82
|
+
{flexWrap.map((flexWrapValue) => (
|
|
83
|
+
<Stack key={flexWrapValue} gap="space.300">
|
|
84
|
+
<Heading level="h500">{flexWrapValue}</Heading>
|
|
85
|
+
|
|
86
|
+
<Box backgroundColor="neutral" UNSAFE_style={{ height: '50px' }}>
|
|
87
|
+
<Stack gap="space.200" flexWrap={flexWrapValue as any}>
|
|
88
|
+
<Box padding="space.100" backgroundColor="success.bold" />
|
|
89
|
+
<Box padding="space.100" backgroundColor="success.bold" />
|
|
90
|
+
<Box padding="space.100" backgroundColor="success.bold" />
|
|
91
|
+
</Stack>
|
|
92
|
+
</Box>
|
|
93
|
+
</Stack>
|
|
94
|
+
))}
|
|
95
|
+
</Inline>
|
|
96
|
+
</Stack>
|
|
97
|
+
</Stack>
|
|
98
|
+
);
|
|
99
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import Heading from '@atlaskit/heading';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
UNSAFE_Box as Box,
|
|
7
|
+
UNSAFE_Inline as Inline,
|
|
8
|
+
UNSAFE_Stack as Stack,
|
|
9
|
+
} from '../src';
|
|
10
|
+
import { spacingScale } from '../src/internal/spacing-scale';
|
|
11
|
+
|
|
12
|
+
const flexAlignItems = ['center', 'baseline', 'flexStart', 'flexEnd'] as const;
|
|
13
|
+
const flexJustifyContent = ['center', 'flexStart', 'flexEnd'] as const;
|
|
14
|
+
const flexWrap = ['wrap'] as const;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Inline permutations
|
|
18
|
+
*/
|
|
19
|
+
export default () => {
|
|
20
|
+
return (
|
|
21
|
+
<Stack gap="space.300">
|
|
22
|
+
<Stack gap="space.300" testId="inline-spacing">
|
|
23
|
+
<Heading level="h700">Spacing</Heading>
|
|
24
|
+
<Stack gap="space.400">
|
|
25
|
+
{spacingScale.map((space) => (
|
|
26
|
+
<Inline key={space} gap="space.300">
|
|
27
|
+
<Box UNSAFE_style={{ width: 140 }}>
|
|
28
|
+
<Heading level="h500">{space}</Heading>
|
|
29
|
+
</Box>
|
|
30
|
+
|
|
31
|
+
<Box backgroundColor="neutral">
|
|
32
|
+
<Inline gap={space} alignItems="center">
|
|
33
|
+
<Box padding="space.100" backgroundColor="success.bold" />
|
|
34
|
+
<Box padding="space.100" backgroundColor="success.bold" />
|
|
35
|
+
<Box padding="space.100" backgroundColor="success.bold" />
|
|
36
|
+
</Inline>
|
|
37
|
+
</Box>
|
|
38
|
+
</Inline>
|
|
39
|
+
))}
|
|
40
|
+
</Stack>
|
|
41
|
+
</Stack>
|
|
42
|
+
<Stack gap="space.300" testId="inline-alignment">
|
|
43
|
+
<Heading level="h700">Alignment</Heading>
|
|
44
|
+
<Heading level="h600">alignItems</Heading>
|
|
45
|
+
<Inline gap="space.400">
|
|
46
|
+
{flexAlignItems.map((alignItemsValue) => (
|
|
47
|
+
<Stack key={alignItemsValue} gap="space.300">
|
|
48
|
+
<Heading level="h500">{alignItemsValue}</Heading>
|
|
49
|
+
<Box backgroundColor="neutral" UNSAFE_style={{ height: '100px' }}>
|
|
50
|
+
<Inline gap="space.200" alignItems={alignItemsValue}>
|
|
51
|
+
<Box padding="space.100" backgroundColor="success.bold" />
|
|
52
|
+
<Box padding="space.100" backgroundColor="success.bold" />
|
|
53
|
+
<Box padding="space.100" backgroundColor="success.bold" />
|
|
54
|
+
</Inline>
|
|
55
|
+
</Box>
|
|
56
|
+
</Stack>
|
|
57
|
+
))}
|
|
58
|
+
</Inline>
|
|
59
|
+
<Heading level="h600">justifyContent</Heading>
|
|
60
|
+
<Inline gap="space.400">
|
|
61
|
+
{flexJustifyContent.map((justifyContentValue) => (
|
|
62
|
+
<Stack key={justifyContentValue} gap="space.300">
|
|
63
|
+
<Heading level="h500">{justifyContentValue}</Heading>
|
|
64
|
+
|
|
65
|
+
<Box
|
|
66
|
+
display="block"
|
|
67
|
+
backgroundColor="neutral"
|
|
68
|
+
UNSAFE_style={{ width: '140px' }}
|
|
69
|
+
>
|
|
70
|
+
<Inline gap="space.200" justifyContent={justifyContentValue}>
|
|
71
|
+
<Box padding="space.100" backgroundColor="success.bold" />
|
|
72
|
+
<Box padding="space.100" backgroundColor="success.bold" />
|
|
73
|
+
<Box padding="space.100" backgroundColor="success.bold" />
|
|
74
|
+
</Inline>
|
|
75
|
+
</Box>
|
|
76
|
+
</Stack>
|
|
77
|
+
))}
|
|
78
|
+
</Inline>
|
|
79
|
+
|
|
80
|
+
<Heading level="h700">Overflow</Heading>
|
|
81
|
+
<Heading level="h600">flexWrap</Heading>
|
|
82
|
+
<Inline gap="space.400">
|
|
83
|
+
{flexWrap.map((flexWrapValue) => (
|
|
84
|
+
<Stack key={flexWrapValue} gap="space.300">
|
|
85
|
+
<Heading level="h500">{flexWrapValue}</Heading>
|
|
86
|
+
<Box backgroundColor="neutral" UNSAFE_style={{ width: '50px' }}>
|
|
87
|
+
<Inline gap="space.200" flexWrap={flexWrapValue as any}>
|
|
88
|
+
<Box padding="space.100" backgroundColor="success.bold" />
|
|
89
|
+
<Box padding="space.100" backgroundColor="success.bold" />
|
|
90
|
+
<Box padding="space.100" backgroundColor="success.bold" />
|
|
91
|
+
</Inline>
|
|
92
|
+
</Box>
|
|
93
|
+
</Stack>
|
|
94
|
+
))}
|
|
95
|
+
</Inline>
|
|
96
|
+
</Stack>
|
|
97
|
+
</Stack>
|
|
98
|
+
);
|
|
99
|
+
};
|
package/examples/05-badge.tsx
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import Badge from '@atlaskit/badge';
|
|
4
|
-
import { Box, xcss } from '@atlaskit/primitives';
|
|
5
4
|
|
|
5
|
+
import { UNSAFE_Box as Box } from '../src';
|
|
6
6
|
import Text from '../src/components/text.partial';
|
|
7
7
|
|
|
8
|
-
const containerStyles = xcss({
|
|
9
|
-
borderRadius: 'border.radius.200',
|
|
10
|
-
display: 'inlineFlex',
|
|
11
|
-
lineHeight: '16px',
|
|
12
|
-
});
|
|
13
|
-
|
|
14
8
|
export default () => {
|
|
15
9
|
return (
|
|
16
10
|
<>
|
|
17
11
|
<Badge>{8}</Badge>
|
|
18
12
|
<Box
|
|
19
|
-
|
|
20
|
-
backgroundColor="
|
|
13
|
+
borderRadius="badge"
|
|
14
|
+
backgroundColor="neutral"
|
|
15
|
+
display="inlineFlex"
|
|
21
16
|
paddingInline="space.075"
|
|
17
|
+
UNSAFE_style={{ lineHeight: '16px' }}
|
|
22
18
|
>
|
|
23
19
|
<Text fontSize="size.075">8</Text>
|
|
24
20
|
</Box>
|
|
@@ -6,12 +6,14 @@ import Button from '@atlaskit/button';
|
|
|
6
6
|
import __noop from '@atlaskit/ds-lib/noop';
|
|
7
7
|
import Heading from '@atlaskit/heading';
|
|
8
8
|
import InfoIcon from '@atlaskit/icon/glyph/info';
|
|
9
|
-
import
|
|
9
|
+
import Inline from '@atlaskit/primitives/inline';
|
|
10
|
+
import Stack from '@atlaskit/primitives/stack';
|
|
10
11
|
import SectionMessage, {
|
|
11
12
|
SectionMessageAction,
|
|
12
13
|
} from '@atlaskit/section-message';
|
|
13
14
|
import { token } from '@atlaskit/tokens';
|
|
14
15
|
|
|
16
|
+
import { UNSAFE_Box as Box } from '../src';
|
|
15
17
|
import Text from '../src/components/text.partial';
|
|
16
18
|
|
|
17
19
|
export default () => {
|
|
@@ -20,7 +22,7 @@ export default () => {
|
|
|
20
22
|
<Box
|
|
21
23
|
paddingBlock="space.200"
|
|
22
24
|
paddingInline="space.200"
|
|
23
|
-
backgroundColor="
|
|
25
|
+
backgroundColor="information"
|
|
24
26
|
>
|
|
25
27
|
<Inline space="space.200">
|
|
26
28
|
<InfoIcon
|
package/examples/07-comment.tsx
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
|
|
4
4
|
import Lozenge from '@atlaskit/lozenge';
|
|
5
|
-
import
|
|
5
|
+
import Inline from '@atlaskit/primitives/inline';
|
|
6
|
+
import Stack from '@atlaskit/primitives/stack';
|
|
6
7
|
|
|
8
|
+
import { UNSAFE_Box as Box } from '../src';
|
|
7
9
|
import Text from '../src/components/text.partial';
|
|
8
10
|
|
|
9
11
|
const Author = ({ children }: any) => {
|
package/examples/08-lozenge.tsx
CHANGED
|
@@ -2,22 +2,18 @@
|
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
|
|
4
4
|
import Lozenge from '@atlaskit/lozenge';
|
|
5
|
-
import
|
|
5
|
+
import Inline from '@atlaskit/primitives/inline';
|
|
6
6
|
|
|
7
|
-
import { UNSAFE_Text as Text } from '../src';
|
|
8
|
-
|
|
9
|
-
const boxStyles = xcss({
|
|
10
|
-
borderRadius: 'border.radius',
|
|
11
|
-
});
|
|
7
|
+
import { UNSAFE_Box as Box, UNSAFE_Text as Text } from '../src';
|
|
12
8
|
|
|
13
9
|
export default () => {
|
|
14
10
|
return (
|
|
15
11
|
<Inline space="space.200">
|
|
16
12
|
<Lozenge>Default</Lozenge>
|
|
17
13
|
<Box
|
|
14
|
+
backgroundColor="neutral"
|
|
15
|
+
borderRadius="normal"
|
|
18
16
|
as="span"
|
|
19
|
-
xcss={boxStyles}
|
|
20
|
-
backgroundColor="color.background.neutral"
|
|
21
17
|
paddingInline="space.050"
|
|
22
18
|
>
|
|
23
19
|
<Text
|