@atlaskit/ds-explorations 0.0.3 → 0.1.2

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 (114) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/cjs/components/box.partial.js +355 -185
  3. package/dist/cjs/components/inline.partial.js +124 -0
  4. package/dist/cjs/components/interaction-surface.partial.js +253 -0
  5. package/dist/cjs/components/stack.partial.js +116 -0
  6. package/dist/cjs/components/surface-provider.js +31 -0
  7. package/dist/cjs/components/text.partial.js +152 -49
  8. package/dist/cjs/components/types.js +5 -0
  9. package/dist/cjs/constants.js +3 -0
  10. package/dist/cjs/index.js +50 -3
  11. package/dist/cjs/internal/color-map.js +42 -0
  12. package/dist/cjs/internal/role-to-element.js +36 -0
  13. package/dist/cjs/version.json +1 -1
  14. package/dist/es2019/components/box.partial.js +259 -113
  15. package/dist/es2019/components/inline.partial.js +111 -0
  16. package/dist/es2019/components/interaction-surface.partial.js +243 -0
  17. package/dist/es2019/components/stack.partial.js +106 -0
  18. package/dist/es2019/components/surface-provider.js +20 -0
  19. package/dist/es2019/components/text.partial.js +122 -35
  20. package/dist/es2019/components/types.js +1 -0
  21. package/dist/es2019/constants.js +3 -0
  22. package/dist/es2019/index.js +6 -1
  23. package/dist/es2019/internal/color-map.js +34 -0
  24. package/dist/es2019/internal/role-to-element.js +28 -0
  25. package/dist/es2019/version.json +1 -1
  26. package/dist/esm/components/box.partial.js +274 -109
  27. package/dist/esm/components/inline.partial.js +110 -0
  28. package/dist/esm/components/interaction-surface.partial.js +242 -0
  29. package/dist/esm/components/stack.partial.js +105 -0
  30. package/dist/esm/components/surface-provider.js +20 -0
  31. package/dist/esm/components/text.partial.js +132 -34
  32. package/dist/esm/components/types.js +1 -0
  33. package/dist/esm/constants.js +3 -0
  34. package/dist/esm/index.js +6 -1
  35. package/dist/esm/internal/color-map.js +34 -0
  36. package/dist/esm/internal/role-to-element.js +28 -0
  37. package/dist/esm/version.json +1 -1
  38. package/dist/types/components/box.partial.d.ts +157 -76
  39. package/dist/types/components/inline.partial.d.ts +52 -0
  40. package/dist/types/components/interaction-surface.partial.d.ts +45 -0
  41. package/dist/types/components/stack.partial.d.ts +47 -0
  42. package/dist/types/components/surface-provider.d.ts +15 -0
  43. package/dist/types/components/text.partial.d.ts +100 -28
  44. package/dist/types/components/types.d.ts +13 -0
  45. package/dist/types/constants.d.ts +3 -0
  46. package/dist/types/index.d.ts +8 -2
  47. package/dist/types/internal/color-map.d.ts +34 -0
  48. package/dist/types/internal/role-to-element.d.ts +32 -0
  49. package/examples/00-basic.tsx +18 -1
  50. package/examples/01-box.tsx +126 -2
  51. package/examples/02-text.tsx +76 -2
  52. package/examples/03-stack.tsx +125 -0
  53. package/examples/04-inline.tsx +134 -0
  54. package/examples/{03-badge.tsx → 05-badge.tsx} +4 -4
  55. package/examples/{04-section-message.tsx → 06-section-message.tsx} +6 -6
  56. package/examples/{05-comment.tsx → 07-comment.tsx} +11 -9
  57. package/examples/08-lozenge.tsx +29 -0
  58. package/examples/99-interactions.tsx +175 -0
  59. package/package.json +8 -5
  60. package/report.api.md +457 -4
  61. package/scripts/__tests__/__snapshots__/codegen.test.tsx.snap +244 -50
  62. package/scripts/__tests__/codegen.test.tsx +5 -0
  63. package/scripts/codegen-styles.tsx +46 -10
  64. package/scripts/color-codegen-template.tsx +34 -12
  65. package/scripts/color-map-template.tsx +52 -0
  66. package/scripts/interaction-codegen.tsx +109 -0
  67. package/scripts/spacing-codegen-template.tsx +9 -1
  68. package/scripts/utils.tsx +5 -1
  69. package/src/components/__tests__/unit/box.test.tsx +50 -0
  70. package/src/components/__tests__/unit/inline.test.tsx +43 -0
  71. package/src/components/__tests__/unit/interaction-suface.test.tsx +70 -0
  72. package/src/components/__tests__/unit/stack.test.tsx +31 -0
  73. package/src/components/__tests__/unit/text.test.tsx +33 -0
  74. package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-basic-example-should-match-production-example-1-snap.png +3 -0
  75. package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-alignment-should-match-snapshot-1-snap.png +3 -0
  76. 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 +3 -0
  77. 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 +3 -0
  78. package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-background-and-padding-should-match-snapshot-1-snap.png +3 -0
  79. package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-background-color-should-match-snapshot-1-snap.png +3 -0
  80. package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-border-color-should-match-snapshot-1-snap.png +3 -0
  81. package/src/components/__tests__/visual-regression/__image_snapshots__/box-snapshot-test-tsx-box-example-with-border-should-match-snapshot-1-snap.png +3 -0
  82. package/src/components/__tests__/visual-regression/__image_snapshots__/inline-snapshot-test-tsx-inline-alignment-example-should-match-snapshot-1-snap.png +3 -0
  83. package/src/components/__tests__/visual-regression/__image_snapshots__/inline-snapshot-test-tsx-inline-spacing-example-should-match-snapshot-1-snap.png +3 -0
  84. package/src/components/__tests__/visual-regression/__image_snapshots__/stack-snapshot-test-tsx-stack-alignment-example-should-match-snapshot-1-snap.png +3 -0
  85. package/src/components/__tests__/visual-regression/__image_snapshots__/stack-snapshot-test-tsx-stack-spacing-example-should-match-snapshot-1-snap.png +3 -0
  86. package/src/components/__tests__/visual-regression/__image_snapshots__/text-snapshot-test-tsx-text-example-with-font-sizes-should-match-snapshot-1-snap.png +3 -0
  87. package/src/components/__tests__/visual-regression/__image_snapshots__/text-snapshot-test-tsx-text-example-with-font-weights-should-match-snapshot-1-snap.png +3 -0
  88. package/src/components/__tests__/visual-regression/__image_snapshots__/text-snapshot-test-tsx-text-example-with-line-heights-should-match-snapshot-1-snap.png +3 -0
  89. package/src/components/__tests__/visual-regression/__image_snapshots__/text-snapshot-test-tsx-text-example-with-testing-should-match-snapshot-1-snap.png +3 -0
  90. package/src/components/__tests__/visual-regression/box-snapshot-test.tsx +33 -0
  91. package/src/components/__tests__/visual-regression/inline-snapshot-test.tsx +28 -0
  92. package/src/components/__tests__/visual-regression/stack-snapshot-test.tsx +28 -0
  93. package/src/components/__tests__/visual-regression/text-snapshot-test.tsx +31 -0
  94. package/src/components/box.partial.tsx +305 -127
  95. package/src/components/inline.partial.tsx +120 -0
  96. package/src/components/interaction-surface.partial.tsx +237 -0
  97. package/src/components/stack.partial.tsx +104 -0
  98. package/src/components/surface-provider.tsx +25 -0
  99. package/src/components/text.partial.tsx +149 -38
  100. package/src/components/types.tsx +15 -0
  101. package/src/constants.tsx +3 -0
  102. package/src/index.tsx +8 -1
  103. package/src/internal/color-map.tsx +34 -0
  104. package/src/internal/role-to-element.tsx +34 -0
  105. package/dist/cjs/components/inline.js +0 -45
  106. package/dist/cjs/components/stack.js +0 -33
  107. package/dist/es2019/components/inline.js +0 -31
  108. package/dist/es2019/components/stack.js +0 -22
  109. package/dist/esm/components/inline.js +0 -30
  110. package/dist/esm/components/stack.js +0 -21
  111. package/dist/types/components/inline.d.ts +0 -19
  112. package/dist/types/components/stack.d.ts +0 -16
  113. package/src/components/inline.tsx +0 -49
  114. package/src/components/stack.tsx +0 -30
@@ -0,0 +1,109 @@
1
+ import prettier from 'prettier';
2
+ import parserTypeScript from 'prettier/parser-typescript';
3
+
4
+ // eslint-disable-next-line @atlassian/tangerine/import/entry-points
5
+ import tokens from '@atlaskit/tokens/src/artifacts/tokens-raw/atlassian-light';
6
+
7
+ import {
8
+ capitalize,
9
+ compose,
10
+ isAccent,
11
+ isHovered,
12
+ isPressed,
13
+ or,
14
+ pick,
15
+ } from './utils';
16
+
17
+ type Token = {
18
+ token: string;
19
+ fallback: string;
20
+ };
21
+
22
+ // NB: Fallback CSS variables can be deleted when tokens are no longer behind a feature flag
23
+ const colors = {
24
+ text: {
25
+ prefix: 'color.text.',
26
+ cssProperty: 'color',
27
+ filterFn: <T extends Token>(t: T) => t.token.startsWith(colors.text.prefix),
28
+ },
29
+ background: {
30
+ prefix: 'color.background.',
31
+ cssProperty: 'backgroundColor',
32
+ filterFn: <T extends Token>(t: T) =>
33
+ t.token.startsWith(colors.background.prefix) ||
34
+ t.token.startsWith('elevation.surface') ||
35
+ t.token.startsWith('color.blanket'),
36
+ },
37
+ border: {
38
+ prefix: 'color.border.',
39
+ cssProperty: 'borderColor',
40
+ filterFn: <T extends Token>(t: T) =>
41
+ t.token.startsWith(colors.border.prefix),
42
+ },
43
+ } as const;
44
+
45
+ const activeTokens = tokens
46
+ .filter(
47
+ (t) =>
48
+ t.attributes.state !== 'deleted' && t.attributes.state !== 'deprecated',
49
+ )
50
+ .map(
51
+ (t): Token => ({
52
+ token: t.name,
53
+ fallback: t.value as string,
54
+ }),
55
+ )
56
+ .filter(compose(pick('token'), or(isAccent, isPressed, isHovered)));
57
+
58
+ const pressedTokens = activeTokens.filter(compose(pick('token'), isPressed));
59
+ const hoveredTokens = activeTokens.filter(compose(pick('token'), isHovered));
60
+
61
+ export const createInteractionStylesFromTemplate = (
62
+ colorProperty: keyof typeof colors,
63
+ ) => {
64
+ if (!colors[colorProperty]) {
65
+ throw new Error(`[codegen] Unknown option found "${colorProperty}"`);
66
+ }
67
+
68
+ const { prefix, cssProperty, filterFn } = colors[colorProperty];
69
+
70
+ return (
71
+ prettier.format(
72
+ `
73
+ const ${colorProperty}ActiveColorMap = {
74
+ ${pressedTokens
75
+ .filter(filterFn)
76
+ // @ts-ignore
77
+ .map((t) => ({ ...t, token: t.token.replaceAll('.[default]', '') }))
78
+ .map((t) => {
79
+ // handle the default case eg color.border or color.text
80
+ const propName = t.token.replace(prefix, '').replace('.pressed', '');
81
+ return `'${propName}': css({\n\t':active': { ${cssProperty}: token('${t.token}') }\n})`;
82
+ })
83
+ .join(',\n\t')}
84
+ };
85
+
86
+ const ${colorProperty}HoverColorMap = {
87
+ ${hoveredTokens
88
+ .filter(filterFn)
89
+ // @ts-ignore
90
+ .map((t) => ({ ...t, token: t.token.replaceAll('.[default]', '') }))
91
+ .map((t) => {
92
+ // handle the default case eg color.border or color.text
93
+ const propName = t.token.replace(prefix, '').replace('.hovered', '');
94
+ return `'${propName}': css({\n\t':hover': { ${cssProperty}: token('${t.token}') }\n})`;
95
+ })
96
+ .join(',\n\t')}
97
+ };`,
98
+ {
99
+ singleQuote: true,
100
+ parser: 'typescript',
101
+ trailingComma: 'all',
102
+ plugins: [parserTypeScript],
103
+ },
104
+ ) +
105
+ `\ntype Interaction${capitalize(
106
+ colorProperty,
107
+ )}Color = keyof typeof ${colorProperty}HoverColorMap;\n`
108
+ );
109
+ };
@@ -10,6 +10,9 @@ const spacingProperties = {
10
10
  height: {
11
11
  cssProperty: 'height',
12
12
  },
13
+ padding: {
14
+ cssProperty: 'padding',
15
+ },
13
16
  paddingBlock: {
14
17
  cssProperty: 'paddingBlock',
15
18
  },
@@ -39,6 +42,11 @@ const ${spacingProperty}Map = {
39
42
  })
40
43
  .join(',\n\t')}
41
44
  };`,
42
- { singleQuote: true, parser: 'typescript', plugins: [parserTypeScript] },
45
+ {
46
+ singleQuote: true,
47
+ trailingComma: 'all',
48
+ parser: 'typescript',
49
+ plugins: [parserTypeScript],
50
+ },
43
51
  );
44
52
  };
package/scripts/utils.tsx CHANGED
@@ -10,13 +10,17 @@ export const tokenToStyle = (
10
10
  })\n})`;
11
11
  };
12
12
 
13
+ type BooleanCallback<T> = (args: T) => boolean;
14
+
13
15
  export const compose = (...fns: ((...any: any[]) => any)[]) => (x: any) =>
14
16
  fns.reduce((res, fn) => fn(res), x);
15
17
  export const pick = <T extends any>(key: keyof T) => (obj: T) => obj[key];
16
18
  export const isAccent = (str: string) => str.includes('accent');
17
19
  export const isPressed = (str: string) => str.includes('pressed');
18
20
  export const isHovered = (str: string) => str.includes('hovered');
19
- export const not = <T extends any>(cb: (args: T) => boolean) => (val: T) =>
21
+ export const not = <T extends any>(cb: BooleanCallback<T>) => (val: T) =>
20
22
  !cb(val);
23
+ export const or = <T extends any>(...fns: BooleanCallback<T>[]) => (val: T) =>
24
+ fns.some((fn) => fn(val));
21
25
  export const capitalize = (str: string) =>
22
26
  str.charAt(0).toUpperCase() + str.slice(1);
@@ -0,0 +1,50 @@
1
+ import React from 'react';
2
+
3
+ import { render } from '@testing-library/react';
4
+
5
+ import { token } from '@atlaskit/tokens';
6
+
7
+ import { UNSAFE_Box as Box, UNSAFE_Text as Text } from '../../../index';
8
+
9
+ describe('Box component', () => {
10
+ const testId = 'test';
11
+
12
+ it('should render box', () => {
13
+ const { getByText } = render(<Box>Box</Box>);
14
+ expect(getByText('Box')).toBeInTheDocument();
15
+ });
16
+
17
+ describe('with SurfaceContext', () => {
18
+ it('should invert text color when box sets background', () => {
19
+ const { getByText } = render(
20
+ <Box backgroundColor={['brand.bold', '']}>
21
+ <Text>Text</Text>
22
+ </Box>,
23
+ );
24
+ const element = getByText('Text');
25
+ expect(element).toHaveStyleDeclaration(
26
+ 'color',
27
+ token('color.text.inverse', 'var(--ds-co-fb)'),
28
+ );
29
+ });
30
+
31
+ it('should respect text color when text sets its own color', () => {
32
+ const { getByText } = render(
33
+ <Box backgroundColor={['brand.bold', '']}>
34
+ <Text color={['disabled', '']}>Text</Text>
35
+ </Box>,
36
+ );
37
+ const element = getByText('Text');
38
+ expect(element).toHaveStyleDeclaration(
39
+ 'color',
40
+ token('color.text.disabled', 'var(--ds-co-fb)'),
41
+ );
42
+ });
43
+ });
44
+
45
+ it('should render with a given test id', () => {
46
+ const { getByTestId } = render(<Box testId={testId}>Box with testid</Box>);
47
+ const element = getByTestId(testId);
48
+ expect(element).toBeInTheDocument();
49
+ });
50
+ });
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+
3
+ import { render } from '@testing-library/react';
4
+
5
+ import { UNSAFE_Box as Box, UNSAFE_Inline as Inline } from '../../../index';
6
+
7
+ describe('Inline component', () => {
8
+ const testId = 'test';
9
+
10
+ it('should render inline', () => {
11
+ const { getByText } = render(
12
+ <Inline gap="sp-50">
13
+ <Box>1</Box>
14
+ <Box>2</Box>
15
+ </Inline>,
16
+ );
17
+ expect(getByText('1')).toBeInTheDocument();
18
+ expect(getByText('2')).toBeInTheDocument();
19
+ });
20
+
21
+ it('should render inline with dividers', () => {
22
+ const { getByText } = render(
23
+ <Inline gap="sp-50" divider="/">
24
+ <Box>1</Box>
25
+ <Box>2</Box>
26
+ </Inline>,
27
+ );
28
+ expect(getByText('1')).toBeInTheDocument();
29
+ expect(getByText('2')).toBeInTheDocument();
30
+ expect(getByText('/')).toBeInTheDocument();
31
+ });
32
+
33
+ it('should render with a given test id', () => {
34
+ const { getByTestId } = render(
35
+ <Inline gap="sp-50" testId={testId}>
36
+ <Box>1</Box>
37
+ <Box>2</Box>
38
+ </Inline>,
39
+ );
40
+ const element = getByTestId(testId);
41
+ expect(element).toBeInTheDocument();
42
+ });
43
+ });
@@ -0,0 +1,70 @@
1
+ import React from 'react';
2
+
3
+ import { act, fireEvent, render } from '@testing-library/react';
4
+
5
+ import { token } from '@atlaskit/tokens';
6
+
7
+ import {
8
+ UNSAFE_Box as Box,
9
+ UNSAFE_InteractionSurface as InteractionSurface,
10
+ } from '../../../index';
11
+
12
+ describe('InteractionSurface component', () => {
13
+ it('should render by itself', () => {
14
+ const { getByTestId } = render(<InteractionSurface testId="basic" />);
15
+ expect(getByTestId('basic')).toBeInTheDocument();
16
+ });
17
+ it('should render given a neutral hover interaction by default', () => {
18
+ const { getByTestId } = render(
19
+ <div style={{ position: 'relative' }}>
20
+ <InteractionSurface testId="surface" />
21
+ hello
22
+ </div>,
23
+ );
24
+
25
+ const surfaceElement = getByTestId('surface');
26
+ expect(getComputedStyle(surfaceElement).backgroundColor).toBe('');
27
+ act(() => {
28
+ fireEvent.mouseOver(surfaceElement);
29
+ expect(surfaceElement).toHaveStyle(
30
+ `background-color: ${token('color.background.neutral.bold.hovered')}`,
31
+ );
32
+ });
33
+ });
34
+
35
+ it('should render given a brand hover interaction by if set as brand', () => {
36
+ const { getByTestId } = render(
37
+ <div style={{ position: 'relative' }}>
38
+ <InteractionSurface appearance="brand.bold" testId="surface" />
39
+ hello
40
+ </div>,
41
+ );
42
+
43
+ const surfaceElement = getByTestId('surface');
44
+ expect(getComputedStyle(surfaceElement).backgroundColor).toBe('');
45
+ act(() => {
46
+ fireEvent.mouseOver(surfaceElement);
47
+ expect(surfaceElement).toHaveStyle(
48
+ `background-color: ${token('color.background.brand.bold.hovered')}`,
49
+ );
50
+ });
51
+ });
52
+
53
+ it('should render an inherited hover state if a Box context is present', () => {
54
+ const { getByTestId } = render(
55
+ <Box backgroundColor={['brand.bold', '']}>
56
+ <InteractionSurface testId="surface" />
57
+ hello
58
+ </Box>,
59
+ );
60
+
61
+ const surfaceElement = getByTestId('surface');
62
+ expect(getComputedStyle(surfaceElement).backgroundColor).toBe('');
63
+ act(() => {
64
+ fireEvent.mouseOver(surfaceElement);
65
+ expect(surfaceElement).toHaveStyle(
66
+ `background-color: ${token('color.background.brand.bold.hovered')}`,
67
+ );
68
+ });
69
+ });
70
+ });
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+
3
+ import { render } from '@testing-library/react';
4
+
5
+ import { UNSAFE_Box as Box, UNSAFE_Stack as Stack } from '../../../index';
6
+
7
+ describe('Stack component', () => {
8
+ const testId = 'test';
9
+
10
+ it('should render stack', () => {
11
+ const { getByText } = render(
12
+ <Stack gap="sp-50">
13
+ <Box>1</Box>
14
+ <Box>2</Box>
15
+ </Stack>,
16
+ );
17
+ expect(getByText('1')).toBeInTheDocument();
18
+ expect(getByText('2')).toBeInTheDocument();
19
+ });
20
+
21
+ it('should render with a given test id', () => {
22
+ const { getByTestId } = render(
23
+ <Stack gap="sp-50" testId={testId}>
24
+ <Box>1</Box>
25
+ <Box>2</Box>
26
+ </Stack>,
27
+ );
28
+ const element = getByTestId(testId);
29
+ expect(element).toBeInTheDocument();
30
+ });
31
+ });
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+
3
+ import { render } from '@testing-library/react';
4
+
5
+ import { UNSAFE_Text as Text } from '../../../index';
6
+
7
+ describe('Text component', () => {
8
+ it('should render given text', () => {
9
+ const { getByText } = render(<Text>Text</Text>);
10
+ expect(getByText('Text')).toBeInTheDocument();
11
+ });
12
+
13
+ it('should render with given test id', () => {
14
+ const { getByTestId } = render(<Text testId="test">Text</Text>);
15
+ expect(getByTestId('test')).toBeInTheDocument();
16
+ });
17
+
18
+ describe('"as" prop behaviour', () => {
19
+ it('renders without errors when a valid "as" value is given', () => {
20
+ const { getByText } = render(<Text as="div">Text</Text>);
21
+ expect(getByText('Text')).toBeInTheDocument();
22
+ });
23
+
24
+ it('throws when an invalid "as" value is given', () => {
25
+ // @ts-ignore purposefully providing an invalid value to test invariant behaviour
26
+ expect(() => render(<Text as="label">Text</Text>)).toThrow(
27
+ new Error(
28
+ 'Invariant failed: @atlaskit/ds-explorations: Text received an invalid "as" value of "label"',
29
+ ),
30
+ );
31
+ });
32
+ });
33
+ });
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9dc77caab80c92fd4e4a3251b12e93d5675d26d92c25888f41ec308f1d346b92
3
+ size 7638
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c91cd68525bb247c17f8e6ece9324c83fda08b958bdef5be4e6b57993de2f6d9
3
+ size 11589
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:128e94d1e1102408446d7da401262174ba358d7845685816eacbc5bfa81470b8
3
+ size 9214
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e9b0acd38c6a7294dc348444056c418163109c55301142e211efa5aed1946396
3
+ size 10172
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d6542ccf064ba3d1c211921ea0445982b9dea19e8b700c3b8e580461c760b3d6
3
+ size 9271
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:39025ea617812518eeffc2c42e1b9420a84f759fd9cbca270db083a9767651c0
3
+ size 10914
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:38967c8e61f927fbb4f1590e03777ac9d7818196ba05340f78f324633fc25bf3
3
+ size 8299
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e09ad68fe694bac155e1fd60568b123a3906b0def131e1973dbd24da6324c7ab
3
+ size 20620
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eb39d049b365eb764d234de27fd8c49646213232ae31347dc846a23924f10776
3
+ size 16922
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b917c7cbd8e7318669a2607ecd124ca41aa94bdefda21a74761965f4ef895ec1
3
+ size 23413
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3f907bdcd1449e0444850ddeb4301d6fa1fad478b4c8743d6aec32ceadf2f544
3
+ size 19305
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2d8ca380f60df6cfb09884b42f92306011c857d9a9af51220b26c881fce73ae4
3
+ size 12394
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8ec560d6acfc02bfcd334754d3d77aa5967861c50da704db4624429489bfca62
3
+ size 4669
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4acd1b4517c70c46c956a077485e56ae98848f260f15a1510d47a816269dda60
3
+ size 2899
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c21a4c9458932bbc35ccc0ca3c56ed2cabf5b1b5f4051421af85b685f9e570e6
3
+ size 6402
@@ -0,0 +1,3 @@
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4598b121017d92ae045300814d425ee546fd2bf792ee01d7632268abc5592a5d
3
+ size 9219
@@ -0,0 +1,33 @@
1
+ import {
2
+ getExampleUrl,
3
+ loadPage,
4
+ takeElementScreenShot,
5
+ } from '@atlaskit/visual-regression/helper';
6
+
7
+ describe('Box', () => {
8
+ [
9
+ 'borderColor',
10
+ 'backgroundColor',
11
+ 'background-and-padding',
12
+ 'background-and-paddingBlock',
13
+ 'background-and-paddingInline',
14
+ ].forEach((selector) => {
15
+ it(`example with ${selector} should match snapshot`, async () => {
16
+ const url = getExampleUrl(
17
+ 'design-system',
18
+ 'ds-explorations',
19
+ 'box',
20
+ global.__BASEURL__,
21
+ );
22
+ const { page } = global;
23
+
24
+ await loadPage(page, url);
25
+
26
+ const image = await takeElementScreenShot(
27
+ page,
28
+ `[data-testid="box-with-${selector}"]`,
29
+ );
30
+ expect(image).toMatchProdImageSnapshot();
31
+ });
32
+ });
33
+ });
@@ -0,0 +1,28 @@
1
+ import {
2
+ getExampleUrl,
3
+ loadPage,
4
+ takeElementScreenShot,
5
+ } from '@atlaskit/visual-regression/helper';
6
+
7
+ describe('Inline', () => {
8
+ it.each(['spacing', 'alignment'])(
9
+ `%s example should match snapshot`,
10
+ async (selector) => {
11
+ const url = getExampleUrl(
12
+ 'design-system',
13
+ 'ds-explorations',
14
+ 'inline',
15
+ global.__BASEURL__,
16
+ );
17
+ const { page } = global;
18
+
19
+ await loadPage(page, url);
20
+
21
+ const image = await takeElementScreenShot(
22
+ page,
23
+ `[data-testid="inline-${selector}"]`,
24
+ );
25
+ expect(image).toMatchProdImageSnapshot();
26
+ },
27
+ );
28
+ });
@@ -0,0 +1,28 @@
1
+ import {
2
+ getExampleUrl,
3
+ loadPage,
4
+ takeElementScreenShot,
5
+ } from '@atlaskit/visual-regression/helper';
6
+
7
+ describe('Stack', () => {
8
+ it.each(['spacing', 'alignment'])(
9
+ `%s example should match snapshot`,
10
+ async (selector) => {
11
+ const url = getExampleUrl(
12
+ 'design-system',
13
+ 'ds-explorations',
14
+ 'stack',
15
+ global.__BASEURL__,
16
+ );
17
+ const { page } = global;
18
+
19
+ await loadPage(page, url);
20
+
21
+ const image = await takeElementScreenShot(
22
+ page,
23
+ `[data-testid="stack-${selector}"]`,
24
+ );
25
+ expect(image).toMatchProdImageSnapshot();
26
+ },
27
+ );
28
+ });
@@ -0,0 +1,31 @@
1
+ import __noop from '@atlaskit/ds-lib/noop';
2
+ import {
3
+ getExampleUrl,
4
+ loadPage,
5
+ takeElementScreenShot,
6
+ } from '@atlaskit/visual-regression/helper';
7
+
8
+ describe('Text', () => {
9
+ ['font-sizes', 'font-weights', 'line-heights', 'testing'].forEach(
10
+ (testId) => {
11
+ it(`example with ${testId} should match snapshot`, async () => {
12
+ const url = getExampleUrl(
13
+ 'design-system',
14
+ 'ds-explorations',
15
+ 'text',
16
+ global.__BASEURL__,
17
+ );
18
+ const { page } = global;
19
+
20
+ await loadPage(page, url);
21
+
22
+ const image = await takeElementScreenShot(
23
+ page,
24
+ `[data-testid="${testId}"]`,
25
+ );
26
+
27
+ expect(image).toMatchProdImageSnapshot();
28
+ });
29
+ },
30
+ );
31
+ });