@atlaskit/ds-explorations 1.7.0 → 2.0.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 +18 -0
- package/dist/cjs/components/box.partial.js +43 -43
- package/dist/cjs/components/inline.partial.js +15 -15
- package/dist/cjs/components/stack.partial.js +15 -15
- package/dist/cjs/components/text.partial.js +86 -56
- package/dist/cjs/internal/spacing-scale.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/box.partial.js +43 -43
- package/dist/es2019/components/inline.partial.js +15 -15
- package/dist/es2019/components/stack.partial.js +15 -15
- package/dist/es2019/components/text.partial.js +85 -55
- package/dist/es2019/internal/spacing-scale.js +2 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/box.partial.js +43 -43
- package/dist/esm/components/inline.partial.js +15 -15
- package/dist/esm/components/stack.partial.js +15 -15
- package/dist/esm/components/text.partial.js +85 -55
- package/dist/esm/internal/spacing-scale.js +2 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/components/box.partial.d.ts +43 -43
- package/dist/types/components/inline.partial.d.ts +15 -15
- package/dist/types/components/stack.partial.d.ts +15 -15
- package/dist/types/components/text.partial.d.ts +43 -23
- package/dist/types/internal/spacing-scale.d.ts +2 -2
- package/examples/00-basic.tsx +3 -3
- package/examples/01-box.tsx +18 -18
- package/examples/02-text-advanced.tsx +9 -9
- package/examples/02-text.tsx +36 -16
- package/examples/03-stack.tsx +26 -26
- package/examples/04-inline.tsx +26 -26
- package/examples/05-badge.tsx +2 -2
- package/examples/06-section-message.tsx +6 -6
- package/examples/07-comment.tsx +5 -5
- package/examples/08-lozenge.tsx +4 -4
- package/examples/99-interactions.tsx +16 -16
- package/package.json +1 -1
- package/report.api.md +89 -85
- package/scripts/codegen-styles.tsx +27 -0
- package/scripts/spacing-codegen-template.tsx +3 -4
- package/scripts/spacing-scale-template.tsx +3 -5
- package/scripts/typography-codegen-template.tsx +80 -0
- package/src/components/__tests__/unit/inline.test.tsx +3 -3
- package/src/components/__tests__/unit/stack.test.tsx +2 -2
- package/src/components/__tests__/unit/text.test.tsx +3 -3
- package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-background-and-padding-block-should-match-snapshot-1-snap.png +2 -2
- package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-background-and-padding-inline-should-match-snapshot-1-snap.png +2 -2
- package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-background-and-padding-should-match-snapshot-1-snap.png +2 -2
- package/src/components/__tests__/visual-regression/__image_snapshots__/inline-snapshot-test-tsx-inline-spacing-example-should-match-snapshot-1-snap.png +2 -2
- package/src/components/__tests__/visual-regression/__image_snapshots__/stack-snapshot-test-tsx-stack-spacing-example-should-match-snapshot-1-snap.png +2 -2
- package/src/components/__tests__/visual-regression/__image_snapshots__/text-snapshot-test-tsx-text-example-with-font-sizes-should-match-snapshot-1-snap.png +2 -2
- package/src/components/__tests__/visual-regression/__image_snapshots__/text-snapshot-test-tsx-text-example-with-font-weights-should-match-snapshot-1-snap.png +2 -2
- package/src/components/__tests__/visual-regression/__image_snapshots__/text-snapshot-test-tsx-text-example-with-line-heights-should-match-snapshot-1-snap.png +2 -2
- package/src/components/box.partial.tsx +43 -43
- package/src/components/inline.partial.tsx +15 -15
- package/src/components/stack.partial.tsx +15 -15
- package/src/components/text.partial.tsx +101 -32
- package/src/internal/spacing-scale.tsx +15 -15
- package/tmp/api-report-tmp.d.ts +89 -85
package/examples/04-inline.tsx
CHANGED
|
@@ -18,48 +18,48 @@ const flexWrap = ['wrap'] as const;
|
|
|
18
18
|
*/
|
|
19
19
|
export default () => {
|
|
20
20
|
return (
|
|
21
|
-
<Stack gap="
|
|
22
|
-
<Stack gap="
|
|
21
|
+
<Stack gap="space.300">
|
|
22
|
+
<Stack gap="space.300" testId="inline-spacing">
|
|
23
23
|
<Heading level="h700">Spacing</Heading>
|
|
24
|
-
<Stack gap="
|
|
24
|
+
<Stack gap="space.400">
|
|
25
25
|
{spacingScale.map((space) => (
|
|
26
|
-
<Inline key={space} gap="
|
|
26
|
+
<Inline key={space} gap="space.300">
|
|
27
27
|
<Box UNSAFE_style={{ width: 140 }}>
|
|
28
28
|
<Heading level="h500">{space}</Heading>
|
|
29
29
|
</Box>
|
|
30
30
|
|
|
31
31
|
<Box backgroundColor="neutral">
|
|
32
32
|
<Inline gap={space} alignItems="center">
|
|
33
|
-
<Box padding="
|
|
34
|
-
<Box padding="
|
|
35
|
-
<Box padding="
|
|
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
36
|
</Inline>
|
|
37
37
|
</Box>
|
|
38
38
|
</Inline>
|
|
39
39
|
))}
|
|
40
40
|
</Stack>
|
|
41
41
|
</Stack>
|
|
42
|
-
<Stack gap="
|
|
42
|
+
<Stack gap="space.300" testId="inline-alignment">
|
|
43
43
|
<Heading level="h700">Alignment</Heading>
|
|
44
44
|
<Heading level="h600">alignItems</Heading>
|
|
45
|
-
<Inline gap="
|
|
45
|
+
<Inline gap="space.400">
|
|
46
46
|
{flexAlignItems.map((alignItemsValue) => (
|
|
47
|
-
<Stack key={alignItemsValue} gap="
|
|
47
|
+
<Stack key={alignItemsValue} gap="space.300">
|
|
48
48
|
<Heading level="h500">{alignItemsValue}</Heading>
|
|
49
49
|
<Box backgroundColor="neutral" UNSAFE_style={{ height: '100px' }}>
|
|
50
|
-
<Inline gap="
|
|
51
|
-
<Box padding="
|
|
52
|
-
<Box padding="
|
|
53
|
-
<Box padding="
|
|
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
54
|
</Inline>
|
|
55
55
|
</Box>
|
|
56
56
|
</Stack>
|
|
57
57
|
))}
|
|
58
58
|
</Inline>
|
|
59
59
|
<Heading level="h600">justifyContent</Heading>
|
|
60
|
-
<Inline gap="
|
|
60
|
+
<Inline gap="space.400">
|
|
61
61
|
{flexJustifyContent.map((justifyContentValue) => (
|
|
62
|
-
<Stack key={justifyContentValue} gap="
|
|
62
|
+
<Stack key={justifyContentValue} gap="space.300">
|
|
63
63
|
<Heading level="h500">{justifyContentValue}</Heading>
|
|
64
64
|
|
|
65
65
|
<Box
|
|
@@ -67,10 +67,10 @@ export default () => {
|
|
|
67
67
|
backgroundColor="neutral"
|
|
68
68
|
UNSAFE_style={{ width: '140px' }}
|
|
69
69
|
>
|
|
70
|
-
<Inline gap="
|
|
71
|
-
<Box padding="
|
|
72
|
-
<Box padding="
|
|
73
|
-
<Box padding="
|
|
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
74
|
</Inline>
|
|
75
75
|
</Box>
|
|
76
76
|
</Stack>
|
|
@@ -79,15 +79,15 @@ export default () => {
|
|
|
79
79
|
|
|
80
80
|
<Heading level="h700">Overflow</Heading>
|
|
81
81
|
<Heading level="h600">flexWrap</Heading>
|
|
82
|
-
<Inline gap="
|
|
82
|
+
<Inline gap="space.400">
|
|
83
83
|
{flexWrap.map((flexWrapValue) => (
|
|
84
|
-
<Stack key={flexWrapValue} gap="
|
|
84
|
+
<Stack key={flexWrapValue} gap="space.300">
|
|
85
85
|
<Heading level="h500">{flexWrapValue}</Heading>
|
|
86
86
|
<Box backgroundColor="neutral" UNSAFE_style={{ width: '50px' }}>
|
|
87
|
-
<Inline gap="
|
|
88
|
-
<Box padding="
|
|
89
|
-
<Box padding="
|
|
90
|
-
<Box padding="
|
|
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
91
|
</Inline>
|
|
92
92
|
</Box>
|
|
93
93
|
</Stack>
|
package/examples/05-badge.tsx
CHANGED
|
@@ -13,10 +13,10 @@ export default () => {
|
|
|
13
13
|
borderRadius="badge"
|
|
14
14
|
backgroundColor="neutral"
|
|
15
15
|
display="inlineFlex"
|
|
16
|
-
paddingInline="
|
|
16
|
+
paddingInline="space.075"
|
|
17
17
|
UNSAFE_style={{ lineHeight: '16px' }}
|
|
18
18
|
>
|
|
19
|
-
<Text fontSize="
|
|
19
|
+
<Text fontSize="size.075">8</Text>
|
|
20
20
|
</Box>
|
|
21
21
|
</>
|
|
22
22
|
);
|
|
@@ -18,18 +18,18 @@ import Text from '../src/components/text.partial';
|
|
|
18
18
|
|
|
19
19
|
export default () => {
|
|
20
20
|
return (
|
|
21
|
-
<Stack gap="
|
|
21
|
+
<Stack gap="space.100">
|
|
22
22
|
<Box
|
|
23
|
-
paddingBlock="
|
|
24
|
-
paddingInline="
|
|
23
|
+
paddingBlock="space.200"
|
|
24
|
+
paddingInline="space.200"
|
|
25
25
|
backgroundColor="information"
|
|
26
26
|
>
|
|
27
|
-
<Inline gap="
|
|
27
|
+
<Inline gap="space.200">
|
|
28
28
|
<InfoIcon
|
|
29
29
|
primaryColor={token('color.icon.information')}
|
|
30
30
|
label="info"
|
|
31
31
|
/>
|
|
32
|
-
<Stack gap="
|
|
32
|
+
<Stack gap="space.100">
|
|
33
33
|
<Heading as="h1" level="h500">
|
|
34
34
|
The Modern Prometheus
|
|
35
35
|
</Heading>
|
|
@@ -40,7 +40,7 @@ export default () => {
|
|
|
40
40
|
to assure my dear sister of my welfare and increasing confidence
|
|
41
41
|
in the success of my undertaking.
|
|
42
42
|
</Text>
|
|
43
|
-
<Inline divider="·" gap="
|
|
43
|
+
<Inline divider="·" gap="space.075">
|
|
44
44
|
<Button
|
|
45
45
|
appearance="link"
|
|
46
46
|
spacing="none"
|
package/examples/07-comment.tsx
CHANGED
|
@@ -9,7 +9,7 @@ import Stack from '../src/components/stack.partial';
|
|
|
9
9
|
import Text from '../src/components/text.partial';
|
|
10
10
|
|
|
11
11
|
const Author = ({ children }: any) => {
|
|
12
|
-
return <Text fontWeight="
|
|
12
|
+
return <Text fontWeight="medium">{children}</Text>;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
const Date = ({ children }: any) => {
|
|
@@ -21,14 +21,14 @@ const EditIndicator = ({ hasBeenEdited }: any) => {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
const CommentAction = ({ children }: any) => {
|
|
24
|
-
return <Text fontWeight="
|
|
24
|
+
return <Text fontWeight="medium">{children}</Text>;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
export default () => {
|
|
28
28
|
return (
|
|
29
29
|
<Box>
|
|
30
|
-
<Stack gap="
|
|
31
|
-
<Inline gap="
|
|
30
|
+
<Stack gap="space.050">
|
|
31
|
+
<Inline gap="space.100" alignItems="center">
|
|
32
32
|
<Author>Jane Citizen</Author>
|
|
33
33
|
<Lozenge>Author</Lozenge>
|
|
34
34
|
<Date>Jun 15, 2022</Date>
|
|
@@ -41,7 +41,7 @@ export default () => {
|
|
|
41
41
|
aliquip ex ea commodo consequat.
|
|
42
42
|
</Text>
|
|
43
43
|
<Box color="subtle">
|
|
44
|
-
<Inline gap="
|
|
44
|
+
<Inline gap="space.100" divider="·">
|
|
45
45
|
<CommentAction>Reply</CommentAction>
|
|
46
46
|
<CommentAction>Edit</CommentAction>
|
|
47
47
|
<CommentAction>Like</CommentAction>
|
package/examples/08-lozenge.tsx
CHANGED
|
@@ -11,18 +11,18 @@ import {
|
|
|
11
11
|
|
|
12
12
|
export default () => {
|
|
13
13
|
return (
|
|
14
|
-
<Inline gap="
|
|
14
|
+
<Inline gap="space.200">
|
|
15
15
|
<Lozenge>Default</Lozenge>
|
|
16
16
|
<Box
|
|
17
17
|
backgroundColor="neutral"
|
|
18
18
|
borderRadius="normal"
|
|
19
19
|
as="span"
|
|
20
|
-
paddingInline="
|
|
20
|
+
paddingInline="space.050"
|
|
21
21
|
>
|
|
22
22
|
<Text
|
|
23
23
|
color="color.text"
|
|
24
|
-
fontSize="
|
|
25
|
-
fontWeight="
|
|
24
|
+
fontSize="size.050"
|
|
25
|
+
fontWeight="bold"
|
|
26
26
|
textTransform="uppercase"
|
|
27
27
|
>
|
|
28
28
|
Default
|
|
@@ -35,10 +35,10 @@ const fieldsetStyles = css({
|
|
|
35
35
|
|
|
36
36
|
export default () => {
|
|
37
37
|
return (
|
|
38
|
-
<Box width="size.500" padding="
|
|
39
|
-
<Stack gap="
|
|
38
|
+
<Box width="size.500" padding="space.100" testId="all">
|
|
39
|
+
<Stack gap="space.200">
|
|
40
40
|
<Heading level="h400">Current ADS Buttons</Heading>
|
|
41
|
-
<Inline gap="
|
|
41
|
+
<Inline gap="space.200">
|
|
42
42
|
<Button appearance="primary">brand.bold</Button>
|
|
43
43
|
<Button appearance="default">neutral</Button>
|
|
44
44
|
<Button appearance="warning">warning.bold</Button>
|
|
@@ -46,7 +46,7 @@ export default () => {
|
|
|
46
46
|
<Heading level="h400">
|
|
47
47
|
Buttons with <Code>InteractionSurface</Code>
|
|
48
48
|
</Heading>
|
|
49
|
-
<Inline gap="
|
|
49
|
+
<Inline gap="space.200" testId="buttons">
|
|
50
50
|
{(['brand.bold', 'neutral', 'warning.bold'] as const).map((app) => (
|
|
51
51
|
<FocusRing key={app}>
|
|
52
52
|
<Box
|
|
@@ -54,15 +54,15 @@ export default () => {
|
|
|
54
54
|
onClick={() => console.log('hello')}
|
|
55
55
|
borderRadius="normal"
|
|
56
56
|
position="relative"
|
|
57
|
-
paddingInline="
|
|
57
|
+
paddingInline="space.150"
|
|
58
58
|
backgroundColor={app}
|
|
59
59
|
>
|
|
60
60
|
<InteractionSurface>
|
|
61
61
|
<Text
|
|
62
62
|
textAlign="center"
|
|
63
|
-
fontSize="
|
|
64
|
-
lineHeight="
|
|
65
|
-
fontWeight="
|
|
63
|
+
fontSize="size.100"
|
|
64
|
+
lineHeight="lineHeight.500"
|
|
65
|
+
fontWeight="medium"
|
|
66
66
|
>
|
|
67
67
|
{app}
|
|
68
68
|
</Text>
|
|
@@ -74,7 +74,7 @@ export default () => {
|
|
|
74
74
|
<Heading level="h400">
|
|
75
75
|
Icon Buttons with <Code>InteractionSurface</Code>
|
|
76
76
|
</Heading>
|
|
77
|
-
<Inline gap="
|
|
77
|
+
<Inline gap="space.200" testId="icon-buttons">
|
|
78
78
|
<FocusRing>
|
|
79
79
|
<Box
|
|
80
80
|
as="button"
|
|
@@ -82,7 +82,7 @@ export default () => {
|
|
|
82
82
|
onClick={() => console.log('hello')}
|
|
83
83
|
borderRadius="normal"
|
|
84
84
|
position="relative"
|
|
85
|
-
padding="
|
|
85
|
+
padding="space.050"
|
|
86
86
|
>
|
|
87
87
|
<InteractionSurface>
|
|
88
88
|
<WarningIcon
|
|
@@ -100,7 +100,7 @@ export default () => {
|
|
|
100
100
|
onClick={() => console.log('hello')}
|
|
101
101
|
borderRadius="normal"
|
|
102
102
|
position="relative"
|
|
103
|
-
padding="
|
|
103
|
+
padding="space.050"
|
|
104
104
|
>
|
|
105
105
|
<InteractionSurface>
|
|
106
106
|
<WarningIcon label="icon button" />
|
|
@@ -114,7 +114,7 @@ export default () => {
|
|
|
114
114
|
onClick={() => console.log('hello')}
|
|
115
115
|
borderRadius="normal"
|
|
116
116
|
position="relative"
|
|
117
|
-
padding="
|
|
117
|
+
padding="space.050"
|
|
118
118
|
>
|
|
119
119
|
<InteractionSurface>
|
|
120
120
|
<WarningIcon
|
|
@@ -129,7 +129,7 @@ export default () => {
|
|
|
129
129
|
<Heading level="h400">
|
|
130
130
|
Progress Indicator with <Code>InteractionSurface</Code>
|
|
131
131
|
</Heading>
|
|
132
|
-
<Inline gap="
|
|
132
|
+
<Inline gap="space.200" testId="progress-indicators">
|
|
133
133
|
{(['brand.bold', 'neutral', 'warning.bold'] as const).map((app) => (
|
|
134
134
|
<FocusRing>
|
|
135
135
|
<Box
|
|
@@ -139,7 +139,7 @@ export default () => {
|
|
|
139
139
|
onClick={() => console.log('hello')}
|
|
140
140
|
borderRadius="rounded"
|
|
141
141
|
position="relative"
|
|
142
|
-
padding="
|
|
142
|
+
padding="space.050"
|
|
143
143
|
>
|
|
144
144
|
<InteractionSurface>
|
|
145
145
|
<Fragment />
|
|
@@ -149,14 +149,14 @@ export default () => {
|
|
|
149
149
|
))}
|
|
150
150
|
</Inline>
|
|
151
151
|
<Heading level="h400">Textfield / input spikes</Heading>
|
|
152
|
-
<Inline gap="
|
|
152
|
+
<Inline gap="space.200">
|
|
153
153
|
<Textfield />
|
|
154
154
|
<Box
|
|
155
155
|
as="fieldset"
|
|
156
156
|
borderRadius="normal"
|
|
157
157
|
borderStyle="solid"
|
|
158
158
|
borderWidth="2px"
|
|
159
|
-
padding="
|
|
159
|
+
padding="space.100"
|
|
160
160
|
tabIndex={-1}
|
|
161
161
|
borderColor="color.border"
|
|
162
162
|
backgroundColor="input"
|
package/package.json
CHANGED
package/report.api.md
CHANGED
|
@@ -189,20 +189,20 @@ type ColumnGap = keyof typeof columnGapMap;
|
|
|
189
189
|
|
|
190
190
|
// @public
|
|
191
191
|
const columnGapMap: {
|
|
192
|
-
'
|
|
193
|
-
'
|
|
194
|
-
'
|
|
195
|
-
'
|
|
196
|
-
'
|
|
197
|
-
'
|
|
198
|
-
'
|
|
199
|
-
'
|
|
200
|
-
'
|
|
201
|
-
'
|
|
202
|
-
'
|
|
203
|
-
'
|
|
204
|
-
'
|
|
205
|
-
'
|
|
192
|
+
'space.0': SerializedStyles;
|
|
193
|
+
'space.025': SerializedStyles;
|
|
194
|
+
'space.050': SerializedStyles;
|
|
195
|
+
'space.075': SerializedStyles;
|
|
196
|
+
'space.100': SerializedStyles;
|
|
197
|
+
'space.1000': SerializedStyles;
|
|
198
|
+
'space.150': SerializedStyles;
|
|
199
|
+
'space.200': SerializedStyles;
|
|
200
|
+
'space.250': SerializedStyles;
|
|
201
|
+
'space.300': SerializedStyles;
|
|
202
|
+
'space.400': SerializedStyles;
|
|
203
|
+
'space.500': SerializedStyles;
|
|
204
|
+
'space.600': SerializedStyles;
|
|
205
|
+
'space.800': SerializedStyles;
|
|
206
206
|
};
|
|
207
207
|
|
|
208
208
|
// @public (undocumented)
|
|
@@ -322,11 +322,16 @@ const flexWrapMap_2: {
|
|
|
322
322
|
// @public (undocumented)
|
|
323
323
|
type FontSize = keyof typeof fontSizeMap;
|
|
324
324
|
|
|
325
|
-
// @public
|
|
325
|
+
// @public
|
|
326
326
|
const fontSizeMap: {
|
|
327
|
-
'
|
|
328
|
-
'
|
|
329
|
-
'
|
|
327
|
+
'size.050': SerializedStyles;
|
|
328
|
+
'size.075': SerializedStyles;
|
|
329
|
+
'size.100': SerializedStyles;
|
|
330
|
+
'size.200': SerializedStyles;
|
|
331
|
+
'size.300': SerializedStyles;
|
|
332
|
+
'size.400': SerializedStyles;
|
|
333
|
+
'size.500': SerializedStyles;
|
|
334
|
+
'size.600': SerializedStyles;
|
|
330
335
|
};
|
|
331
336
|
|
|
332
337
|
// @public (undocumented)
|
|
@@ -334,10 +339,10 @@ type FontWeight = keyof typeof fontWeightMap;
|
|
|
334
339
|
|
|
335
340
|
// @public (undocumented)
|
|
336
341
|
const fontWeightMap: {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
342
|
+
bold: SerializedStyles;
|
|
343
|
+
medium: SerializedStyles;
|
|
344
|
+
regular: SerializedStyles;
|
|
345
|
+
semibold: SerializedStyles;
|
|
341
346
|
};
|
|
342
347
|
|
|
343
348
|
// @public (undocumented)
|
|
@@ -387,13 +392,12 @@ type LineHeight = keyof typeof lineHeightMap;
|
|
|
387
392
|
|
|
388
393
|
// @public (undocumented)
|
|
389
394
|
const lineHeightMap: {
|
|
390
|
-
'
|
|
391
|
-
'
|
|
392
|
-
'
|
|
393
|
-
'
|
|
394
|
-
'
|
|
395
|
-
'
|
|
396
|
-
'40px': SerializedStyles;
|
|
395
|
+
'lineHeight.100': SerializedStyles;
|
|
396
|
+
'lineHeight.200': SerializedStyles;
|
|
397
|
+
'lineHeight.300': SerializedStyles;
|
|
398
|
+
'lineHeight.400': SerializedStyles;
|
|
399
|
+
'lineHeight.500': SerializedStyles;
|
|
400
|
+
'lineHeight.600': SerializedStyles;
|
|
397
401
|
};
|
|
398
402
|
|
|
399
403
|
// @public (undocumented)
|
|
@@ -413,20 +417,20 @@ type PaddingBlock = keyof typeof paddingBlockMap;
|
|
|
413
417
|
|
|
414
418
|
// @public (undocumented)
|
|
415
419
|
const paddingBlockMap: {
|
|
416
|
-
'
|
|
417
|
-
'
|
|
418
|
-
'
|
|
419
|
-
'
|
|
420
|
-
'
|
|
421
|
-
'
|
|
422
|
-
'
|
|
423
|
-
'
|
|
424
|
-
'
|
|
425
|
-
'
|
|
426
|
-
'
|
|
427
|
-
'
|
|
428
|
-
'
|
|
429
|
-
'
|
|
420
|
+
'space.0': SerializedStyles;
|
|
421
|
+
'space.025': SerializedStyles;
|
|
422
|
+
'space.050': SerializedStyles;
|
|
423
|
+
'space.075': SerializedStyles;
|
|
424
|
+
'space.100': SerializedStyles;
|
|
425
|
+
'space.1000': SerializedStyles;
|
|
426
|
+
'space.150': SerializedStyles;
|
|
427
|
+
'space.200': SerializedStyles;
|
|
428
|
+
'space.250': SerializedStyles;
|
|
429
|
+
'space.300': SerializedStyles;
|
|
430
|
+
'space.400': SerializedStyles;
|
|
431
|
+
'space.500': SerializedStyles;
|
|
432
|
+
'space.600': SerializedStyles;
|
|
433
|
+
'space.800': SerializedStyles;
|
|
430
434
|
};
|
|
431
435
|
|
|
432
436
|
// @public (undocumented)
|
|
@@ -434,38 +438,38 @@ type PaddingInline = keyof typeof paddingInlineMap;
|
|
|
434
438
|
|
|
435
439
|
// @public (undocumented)
|
|
436
440
|
const paddingInlineMap: {
|
|
437
|
-
'
|
|
438
|
-
'
|
|
439
|
-
'
|
|
440
|
-
'
|
|
441
|
-
'
|
|
442
|
-
'
|
|
443
|
-
'
|
|
444
|
-
'
|
|
445
|
-
'
|
|
446
|
-
'
|
|
447
|
-
'
|
|
448
|
-
'
|
|
449
|
-
'
|
|
450
|
-
'
|
|
441
|
+
'space.0': SerializedStyles;
|
|
442
|
+
'space.025': SerializedStyles;
|
|
443
|
+
'space.050': SerializedStyles;
|
|
444
|
+
'space.075': SerializedStyles;
|
|
445
|
+
'space.100': SerializedStyles;
|
|
446
|
+
'space.1000': SerializedStyles;
|
|
447
|
+
'space.150': SerializedStyles;
|
|
448
|
+
'space.200': SerializedStyles;
|
|
449
|
+
'space.250': SerializedStyles;
|
|
450
|
+
'space.300': SerializedStyles;
|
|
451
|
+
'space.400': SerializedStyles;
|
|
452
|
+
'space.500': SerializedStyles;
|
|
453
|
+
'space.600': SerializedStyles;
|
|
454
|
+
'space.800': SerializedStyles;
|
|
451
455
|
};
|
|
452
456
|
|
|
453
457
|
// @public
|
|
454
458
|
const paddingMap: {
|
|
455
|
-
'
|
|
456
|
-
'
|
|
457
|
-
'
|
|
458
|
-
'
|
|
459
|
-
'
|
|
460
|
-
'
|
|
461
|
-
'
|
|
462
|
-
'
|
|
463
|
-
'
|
|
464
|
-
'
|
|
465
|
-
'
|
|
466
|
-
'
|
|
467
|
-
'
|
|
468
|
-
'
|
|
459
|
+
'space.0': SerializedStyles;
|
|
460
|
+
'space.025': SerializedStyles;
|
|
461
|
+
'space.050': SerializedStyles;
|
|
462
|
+
'space.075': SerializedStyles;
|
|
463
|
+
'space.100': SerializedStyles;
|
|
464
|
+
'space.1000': SerializedStyles;
|
|
465
|
+
'space.150': SerializedStyles;
|
|
466
|
+
'space.200': SerializedStyles;
|
|
467
|
+
'space.250': SerializedStyles;
|
|
468
|
+
'space.300': SerializedStyles;
|
|
469
|
+
'space.400': SerializedStyles;
|
|
470
|
+
'space.500': SerializedStyles;
|
|
471
|
+
'space.600': SerializedStyles;
|
|
472
|
+
'space.800': SerializedStyles;
|
|
469
473
|
};
|
|
470
474
|
|
|
471
475
|
// @public (undocumented)
|
|
@@ -484,20 +488,20 @@ type RowGap = keyof typeof rowGapMap;
|
|
|
484
488
|
|
|
485
489
|
// @public
|
|
486
490
|
const rowGapMap: {
|
|
487
|
-
'
|
|
488
|
-
'
|
|
489
|
-
'
|
|
490
|
-
'
|
|
491
|
-
'
|
|
492
|
-
'
|
|
493
|
-
'
|
|
494
|
-
'
|
|
495
|
-
'
|
|
496
|
-
'
|
|
497
|
-
'
|
|
498
|
-
'
|
|
499
|
-
'
|
|
500
|
-
'
|
|
491
|
+
'space.0': SerializedStyles;
|
|
492
|
+
'space.025': SerializedStyles;
|
|
493
|
+
'space.050': SerializedStyles;
|
|
494
|
+
'space.075': SerializedStyles;
|
|
495
|
+
'space.100': SerializedStyles;
|
|
496
|
+
'space.1000': SerializedStyles;
|
|
497
|
+
'space.150': SerializedStyles;
|
|
498
|
+
'space.200': SerializedStyles;
|
|
499
|
+
'space.250': SerializedStyles;
|
|
500
|
+
'space.300': SerializedStyles;
|
|
501
|
+
'space.400': SerializedStyles;
|
|
502
|
+
'space.500': SerializedStyles;
|
|
503
|
+
'space.600': SerializedStyles;
|
|
504
|
+
'space.800': SerializedStyles;
|
|
501
505
|
};
|
|
502
506
|
|
|
503
507
|
// @public (undocumented)
|
|
@@ -11,6 +11,7 @@ import { createInteractionStylesFromTemplate } from './interaction-codegen';
|
|
|
11
11
|
import { createStylesFromTemplate } from './misc-codegen-template';
|
|
12
12
|
import { createSpacingStylesFromTemplate } from './spacing-codegen-template';
|
|
13
13
|
import { createSpacingScaleTemplate } from './spacing-scale-template';
|
|
14
|
+
import { createTypographyStylesFromTemplate } from './typography-codegen-template';
|
|
14
15
|
|
|
15
16
|
const colorMapOutputFolder = join(__dirname, '../', 'src', 'internal');
|
|
16
17
|
const colorTokensDependencyPath = require.resolve(
|
|
@@ -19,6 +20,9 @@ const colorTokensDependencyPath = require.resolve(
|
|
|
19
20
|
const spacingTokensDependencyPath = require.resolve(
|
|
20
21
|
'../../tokens/src/artifacts/tokens-raw/atlassian-spacing',
|
|
21
22
|
);
|
|
23
|
+
const typographyTokensDependencyPath = require.resolve(
|
|
24
|
+
'../../tokens/src/artifacts/tokens-raw/atlassian-typography',
|
|
25
|
+
);
|
|
22
26
|
|
|
23
27
|
writeFile(
|
|
24
28
|
join(colorMapOutputFolder, 'color-map.tsx'),
|
|
@@ -87,6 +91,29 @@ Promise.all(
|
|
|
87
91
|
}),
|
|
88
92
|
);
|
|
89
93
|
})
|
|
94
|
+
.then(() => {
|
|
95
|
+
// generate typography values
|
|
96
|
+
return Promise.all(
|
|
97
|
+
[{ target: 'text.partial.tsx' }].map(({ target }) => {
|
|
98
|
+
const targetPath = join(__dirname, '../', 'src', 'components', target);
|
|
99
|
+
|
|
100
|
+
const source = createPartialSignedArtifact(
|
|
101
|
+
(options) =>
|
|
102
|
+
options.map(createTypographyStylesFromTemplate).join('\n'),
|
|
103
|
+
'yarn codegen-styles',
|
|
104
|
+
{
|
|
105
|
+
id: 'typography',
|
|
106
|
+
absoluteFilePath: targetPath,
|
|
107
|
+
dependencies: [typographyTokensDependencyPath],
|
|
108
|
+
},
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
return writeFile(targetPath, source).then(() =>
|
|
112
|
+
console.log(`${targetPath} written!`),
|
|
113
|
+
);
|
|
114
|
+
}),
|
|
115
|
+
);
|
|
116
|
+
})
|
|
90
117
|
.then(() => {
|
|
91
118
|
// generate other values
|
|
92
119
|
return Promise.all(
|
|
@@ -26,11 +26,11 @@ const spacingProperties = {
|
|
|
26
26
|
},
|
|
27
27
|
} as const;
|
|
28
28
|
|
|
29
|
-
const
|
|
29
|
+
const onlySpaceTokens = tokens.filter((token) =>
|
|
30
30
|
token.name.startsWith('space.'),
|
|
31
31
|
);
|
|
32
32
|
|
|
33
|
-
const activeTokens =
|
|
33
|
+
const activeTokens = onlySpaceTokens.map((t) => ({
|
|
34
34
|
name: t.name,
|
|
35
35
|
fallback: t.attributes.pixelValue!,
|
|
36
36
|
}));
|
|
@@ -51,8 +51,7 @@ const ${spacingProperty}Map = {
|
|
|
51
51
|
${activeTokens
|
|
52
52
|
.sort((a, b) => (a.name < b.name ? -1 : 1))
|
|
53
53
|
.map((token) => {
|
|
54
|
-
|
|
55
|
-
const propName = token.name.replace('space.', 'scale.');
|
|
54
|
+
const propName = token.name;
|
|
56
55
|
return `'${propName}': ${tokenToStyle(
|
|
57
56
|
cssProperty,
|
|
58
57
|
token.name,
|
|
@@ -3,13 +3,11 @@ import parserTypeScript from 'prettier/parser-typescript';
|
|
|
3
3
|
|
|
4
4
|
import { spacing as tokens } from '@atlaskit/tokens/tokens-raw';
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
token.name.startsWith('
|
|
6
|
+
const onlySpaceTokens = tokens.filter((token) =>
|
|
7
|
+
token.name.startsWith('space.'),
|
|
8
8
|
);
|
|
9
9
|
|
|
10
|
-
const activeTokens =
|
|
11
|
-
(t) => `'${t.name.replace('spacing.', '')}'`,
|
|
12
|
-
);
|
|
10
|
+
const activeTokens = onlySpaceTokens.map((t) => `'${t.name}'`);
|
|
13
11
|
|
|
14
12
|
export const createSpacingScaleTemplate = () => {
|
|
15
13
|
return prettier.format(
|