@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.
Files changed (58) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cjs/components/box.partial.js +43 -43
  3. package/dist/cjs/components/inline.partial.js +15 -15
  4. package/dist/cjs/components/stack.partial.js +15 -15
  5. package/dist/cjs/components/text.partial.js +86 -56
  6. package/dist/cjs/internal/spacing-scale.js +2 -2
  7. package/dist/cjs/version.json +1 -1
  8. package/dist/es2019/components/box.partial.js +43 -43
  9. package/dist/es2019/components/inline.partial.js +15 -15
  10. package/dist/es2019/components/stack.partial.js +15 -15
  11. package/dist/es2019/components/text.partial.js +85 -55
  12. package/dist/es2019/internal/spacing-scale.js +2 -2
  13. package/dist/es2019/version.json +1 -1
  14. package/dist/esm/components/box.partial.js +43 -43
  15. package/dist/esm/components/inline.partial.js +15 -15
  16. package/dist/esm/components/stack.partial.js +15 -15
  17. package/dist/esm/components/text.partial.js +85 -55
  18. package/dist/esm/internal/spacing-scale.js +2 -2
  19. package/dist/esm/version.json +1 -1
  20. package/dist/types/components/box.partial.d.ts +43 -43
  21. package/dist/types/components/inline.partial.d.ts +15 -15
  22. package/dist/types/components/stack.partial.d.ts +15 -15
  23. package/dist/types/components/text.partial.d.ts +43 -23
  24. package/dist/types/internal/spacing-scale.d.ts +2 -2
  25. package/examples/00-basic.tsx +3 -3
  26. package/examples/01-box.tsx +18 -18
  27. package/examples/02-text-advanced.tsx +9 -9
  28. package/examples/02-text.tsx +36 -16
  29. package/examples/03-stack.tsx +26 -26
  30. package/examples/04-inline.tsx +26 -26
  31. package/examples/05-badge.tsx +2 -2
  32. package/examples/06-section-message.tsx +6 -6
  33. package/examples/07-comment.tsx +5 -5
  34. package/examples/08-lozenge.tsx +4 -4
  35. package/examples/99-interactions.tsx +16 -16
  36. package/package.json +1 -1
  37. package/report.api.md +89 -85
  38. package/scripts/codegen-styles.tsx +27 -0
  39. package/scripts/spacing-codegen-template.tsx +3 -4
  40. package/scripts/spacing-scale-template.tsx +3 -5
  41. package/scripts/typography-codegen-template.tsx +80 -0
  42. package/src/components/__tests__/unit/inline.test.tsx +3 -3
  43. package/src/components/__tests__/unit/stack.test.tsx +2 -2
  44. package/src/components/__tests__/unit/text.test.tsx +3 -3
  45. 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
  46. 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
  47. 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
  48. package/src/components/__tests__/visual-regression/__image_snapshots__/inline-snapshot-test-tsx-inline-spacing-example-should-match-snapshot-1-snap.png +2 -2
  49. package/src/components/__tests__/visual-regression/__image_snapshots__/stack-snapshot-test-tsx-stack-spacing-example-should-match-snapshot-1-snap.png +2 -2
  50. 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
  51. 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
  52. 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
  53. package/src/components/box.partial.tsx +43 -43
  54. package/src/components/inline.partial.tsx +15 -15
  55. package/src/components/stack.partial.tsx +15 -15
  56. package/src/components/text.partial.tsx +101 -32
  57. package/src/internal/spacing-scale.tsx +15 -15
  58. package/tmp/api-report-tmp.d.ts +89 -85
@@ -18,48 +18,48 @@ const flexWrap = ['wrap'] as const;
18
18
  */
19
19
  export default () => {
20
20
  return (
21
- <Stack gap="scale.300">
22
- <Stack gap="scale.300" testId="inline-spacing">
21
+ <Stack gap="space.300">
22
+ <Stack gap="space.300" testId="inline-spacing">
23
23
  <Heading level="h700">Spacing</Heading>
24
- <Stack gap="scale.400">
24
+ <Stack gap="space.400">
25
25
  {spacingScale.map((space) => (
26
- <Inline key={space} gap="scale.300">
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="scale.100" backgroundColor="success.bold" />
34
- <Box padding="scale.100" backgroundColor="success.bold" />
35
- <Box padding="scale.100" backgroundColor="success.bold" />
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="scale.300" testId="inline-alignment">
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="scale.400">
45
+ <Inline gap="space.400">
46
46
  {flexAlignItems.map((alignItemsValue) => (
47
- <Stack key={alignItemsValue} gap="scale.300">
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="scale.200" alignItems={alignItemsValue}>
51
- <Box padding="scale.100" backgroundColor="success.bold" />
52
- <Box padding="scale.100" backgroundColor="success.bold" />
53
- <Box padding="scale.100" backgroundColor="success.bold" />
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="scale.400">
60
+ <Inline gap="space.400">
61
61
  {flexJustifyContent.map((justifyContentValue) => (
62
- <Stack key={justifyContentValue} gap="scale.300">
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="scale.200" justifyContent={justifyContentValue}>
71
- <Box padding="scale.100" backgroundColor="success.bold" />
72
- <Box padding="scale.100" backgroundColor="success.bold" />
73
- <Box padding="scale.100" backgroundColor="success.bold" />
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="scale.400">
82
+ <Inline gap="space.400">
83
83
  {flexWrap.map((flexWrapValue) => (
84
- <Stack key={flexWrapValue} gap="scale.300">
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="scale.200" flexWrap={flexWrapValue as any}>
88
- <Box padding="scale.100" backgroundColor="success.bold" />
89
- <Box padding="scale.100" backgroundColor="success.bold" />
90
- <Box padding="scale.100" backgroundColor="success.bold" />
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>
@@ -13,10 +13,10 @@ export default () => {
13
13
  borderRadius="badge"
14
14
  backgroundColor="neutral"
15
15
  display="inlineFlex"
16
- paddingInline="scale.075"
16
+ paddingInline="space.075"
17
17
  UNSAFE_style={{ lineHeight: '16px' }}
18
18
  >
19
- <Text fontSize="12px">8</Text>
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="scale.100">
21
+ <Stack gap="space.100">
22
22
  <Box
23
- paddingBlock="scale.200"
24
- paddingInline="scale.200"
23
+ paddingBlock="space.200"
24
+ paddingInline="space.200"
25
25
  backgroundColor="information"
26
26
  >
27
- <Inline gap="scale.200">
27
+ <Inline gap="space.200">
28
28
  <InfoIcon
29
29
  primaryColor={token('color.icon.information')}
30
30
  label="info"
31
31
  />
32
- <Stack gap="scale.100">
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="scale.075">
43
+ <Inline divider="·" gap="space.075">
44
44
  <Button
45
45
  appearance="link"
46
46
  spacing="none"
@@ -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="500">{children}</Text>;
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="500">{children}</Text>;
24
+ return <Text fontWeight="medium">{children}</Text>;
25
25
  };
26
26
 
27
27
  export default () => {
28
28
  return (
29
29
  <Box>
30
- <Stack gap="scale.050">
31
- <Inline gap="scale.100" alignItems="center">
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="scale.100" divider="·">
44
+ <Inline gap="space.100" divider="·">
45
45
  <CommentAction>Reply</CommentAction>
46
46
  <CommentAction>Edit</CommentAction>
47
47
  <CommentAction>Like</CommentAction>
@@ -11,18 +11,18 @@ import {
11
11
 
12
12
  export default () => {
13
13
  return (
14
- <Inline gap="scale.200">
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="scale.050"
20
+ paddingInline="space.050"
21
21
  >
22
22
  <Text
23
23
  color="color.text"
24
- fontSize="11px"
25
- fontWeight="700"
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="scale.100" testId="all">
39
- <Stack gap="scale.200">
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="scale.200">
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="scale.200" testId="buttons">
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="scale.150"
57
+ paddingInline="space.150"
58
58
  backgroundColor={app}
59
59
  >
60
60
  <InteractionSurface>
61
61
  <Text
62
62
  textAlign="center"
63
- fontSize="14px"
64
- lineHeight="32px"
65
- fontWeight="500"
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="scale.200" testId="icon-buttons">
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="scale.050"
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="scale.050"
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="scale.050"
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="scale.200" testId="progress-indicators">
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="scale.050"
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="scale.200">
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="scale.100"
159
+ padding="space.100"
160
160
  tabIndex={-1}
161
161
  borderColor="color.border"
162
162
  backgroundColor="input"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/ds-explorations",
3
- "version": "1.7.0",
3
+ "version": "2.0.0",
4
4
  "description": "An experimental package for exploration and validation of spacing / typography foundations.",
5
5
  "license": "Apache-2.0",
6
6
  "atlassian": {
package/report.api.md CHANGED
@@ -189,20 +189,20 @@ type ColumnGap = keyof typeof columnGapMap;
189
189
 
190
190
  // @public
191
191
  const columnGapMap: {
192
- 'scale.0': SerializedStyles;
193
- 'scale.025': SerializedStyles;
194
- 'scale.050': SerializedStyles;
195
- 'scale.075': SerializedStyles;
196
- 'scale.100': SerializedStyles;
197
- 'scale.1000': SerializedStyles;
198
- 'scale.150': SerializedStyles;
199
- 'scale.200': SerializedStyles;
200
- 'scale.250': SerializedStyles;
201
- 'scale.300': SerializedStyles;
202
- 'scale.400': SerializedStyles;
203
- 'scale.500': SerializedStyles;
204
- 'scale.600': SerializedStyles;
205
- 'scale.800': SerializedStyles;
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 (undocumented)
325
+ // @public
326
326
  const fontSizeMap: {
327
- '11px': SerializedStyles;
328
- '12px': SerializedStyles;
329
- '14px': SerializedStyles;
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
- '400': SerializedStyles;
338
- '500': SerializedStyles;
339
- '600': SerializedStyles;
340
- '700': SerializedStyles;
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
- '12px': SerializedStyles;
391
- '16px': SerializedStyles;
392
- '20px': SerializedStyles;
393
- '24px': SerializedStyles;
394
- '28px': SerializedStyles;
395
- '32px': SerializedStyles;
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
- 'scale.0': SerializedStyles;
417
- 'scale.025': SerializedStyles;
418
- 'scale.050': SerializedStyles;
419
- 'scale.075': SerializedStyles;
420
- 'scale.100': SerializedStyles;
421
- 'scale.1000': SerializedStyles;
422
- 'scale.150': SerializedStyles;
423
- 'scale.200': SerializedStyles;
424
- 'scale.250': SerializedStyles;
425
- 'scale.300': SerializedStyles;
426
- 'scale.400': SerializedStyles;
427
- 'scale.500': SerializedStyles;
428
- 'scale.600': SerializedStyles;
429
- 'scale.800': SerializedStyles;
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
- 'scale.0': SerializedStyles;
438
- 'scale.025': SerializedStyles;
439
- 'scale.050': SerializedStyles;
440
- 'scale.075': SerializedStyles;
441
- 'scale.100': SerializedStyles;
442
- 'scale.1000': SerializedStyles;
443
- 'scale.150': SerializedStyles;
444
- 'scale.200': SerializedStyles;
445
- 'scale.250': SerializedStyles;
446
- 'scale.300': SerializedStyles;
447
- 'scale.400': SerializedStyles;
448
- 'scale.500': SerializedStyles;
449
- 'scale.600': SerializedStyles;
450
- 'scale.800': SerializedStyles;
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
- 'scale.0': SerializedStyles;
456
- 'scale.025': SerializedStyles;
457
- 'scale.050': SerializedStyles;
458
- 'scale.075': SerializedStyles;
459
- 'scale.100': SerializedStyles;
460
- 'scale.1000': SerializedStyles;
461
- 'scale.150': SerializedStyles;
462
- 'scale.200': SerializedStyles;
463
- 'scale.250': SerializedStyles;
464
- 'scale.300': SerializedStyles;
465
- 'scale.400': SerializedStyles;
466
- 'scale.500': SerializedStyles;
467
- 'scale.600': SerializedStyles;
468
- 'scale.800': SerializedStyles;
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
- 'scale.0': SerializedStyles;
488
- 'scale.025': SerializedStyles;
489
- 'scale.050': SerializedStyles;
490
- 'scale.075': SerializedStyles;
491
- 'scale.100': SerializedStyles;
492
- 'scale.1000': SerializedStyles;
493
- 'scale.150': SerializedStyles;
494
- 'scale.200': SerializedStyles;
495
- 'scale.250': SerializedStyles;
496
- 'scale.300': SerializedStyles;
497
- 'scale.400': SerializedStyles;
498
- 'scale.500': SerializedStyles;
499
- 'scale.600': SerializedStyles;
500
- 'scale.800': SerializedStyles;
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 onlyScaleTokens = tokens.filter((token) =>
29
+ const onlySpaceTokens = tokens.filter((token) =>
30
30
  token.name.startsWith('space.'),
31
31
  );
32
32
 
33
- const activeTokens = onlyScaleTokens.map((t) => ({
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
- // TODO change this when we want to cut a major on the package
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 onlyScaleTokens = tokens.filter((token) =>
7
- token.name.startsWith('spacing.scale.'),
6
+ const onlySpaceTokens = tokens.filter((token) =>
7
+ token.name.startsWith('space.'),
8
8
  );
9
9
 
10
- const activeTokens = onlyScaleTokens.map(
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(