@atlaskit/primitives 0.0.2 → 0.1.1

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.
@@ -1,3 +1,3 @@
1
- export { Stack } from './components/stack.partial';
1
+ export { default as Stack } from './components/stack.partial';
2
2
  export { Box } from './components/box';
3
- export { Inline } from './components/inline.partial';
3
+ export { default as Inline } from './components/inline.partial';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/primitives",
3
- "version": "0.0.2",
3
+ "version": "0.1.1",
4
4
  "description": "Primitives are token-backed low-level building blocks.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@atlaskit/ds-explorations": "^2.0.1",
41
- "@atlaskit/tokens": "^1.1.0",
41
+ "@atlaskit/tokens": "^1.2.0",
42
42
  "@babel/runtime": "^7.0.0",
43
43
  "@emotion/react": "^11.7.1"
44
44
  },
@@ -49,6 +49,7 @@
49
49
  "@af/codegen": "*",
50
50
  "@atlaskit/docs": "*",
51
51
  "@atlaskit/ds-lib": "*",
52
+ "@atlaskit/heading": "*",
52
53
  "@atlaskit/ssr": "*",
53
54
  "@atlaskit/visual-regression": "*",
54
55
  "@atlaskit/webdriver-runner": "*",
@@ -86,4 +87,4 @@
86
87
  }
87
88
  },
88
89
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
89
- }
90
+ }
package/report.api.md CHANGED
@@ -16,14 +16,113 @@
16
16
 
17
17
  ```ts
18
18
  import { default as Box } from '@atlaskit/ds-explorations/box';
19
- import { default as Inline } from '@atlaskit/ds-explorations/inline';
20
- import { default as Stack } from '@atlaskit/ds-explorations/stack';
19
+ import { ForwardRefExoticComponent } from 'react';
20
+ import { MemoExoticComponent } from 'react';
21
+ import { ReactNode } from 'react';
22
+ import { RefAttributes } from 'react';
23
+ import { SerializedStyles } from '@emotion/react';
24
+
25
+ // @public (undocumented)
26
+ type AlignBlock = 'center' | 'end' | 'start';
27
+
28
+ // @public (undocumented)
29
+ type AlignBlock_2 = 'baseline' | 'center' | 'end' | 'start';
30
+
31
+ // @public (undocumented)
32
+ type AlignInline = 'center' | 'end' | 'start';
33
+
34
+ // @public (undocumented)
35
+ type AlignInline_2 = 'center' | 'end' | 'start';
21
36
 
22
37
  export { Box };
23
38
 
24
- export { Inline };
39
+ // @public (undocumented)
40
+ type Grow = 'fill' | 'hug';
41
+
42
+ // @public (undocumented)
43
+ type Grow_2 = 'fill' | 'hug';
44
+
45
+ // @public
46
+ export const Inline: MemoExoticComponent<
47
+ ForwardRefExoticComponent<InlineProps & RefAttributes<HTMLDivElement>>
48
+ >;
49
+
50
+ // @public (undocumented)
51
+ interface InlineProps {
52
+ alignBlock?: AlignBlock_2;
53
+ alignInline?: AlignInline_2;
54
+ children: ReactNode;
55
+ grow?: Grow_2;
56
+ separator?: string;
57
+ shouldWrap?: boolean;
58
+ space?: Space_2;
59
+ spread?: Spread_2;
60
+ testId?: string;
61
+ }
25
62
 
26
- export { Stack };
63
+ // @public (undocumented)
64
+ type Space = keyof typeof spaceMap;
65
+
66
+ // @public (undocumented)
67
+ type Space_2 = keyof typeof spaceMap_2;
68
+
69
+ // @public
70
+ const spaceMap: {
71
+ '0': SerializedStyles;
72
+ '025': SerializedStyles;
73
+ '050': SerializedStyles;
74
+ '075': SerializedStyles;
75
+ '100': SerializedStyles;
76
+ '1000': SerializedStyles;
77
+ '150': SerializedStyles;
78
+ '200': SerializedStyles;
79
+ '250': SerializedStyles;
80
+ '300': SerializedStyles;
81
+ '400': SerializedStyles;
82
+ '500': SerializedStyles;
83
+ '600': SerializedStyles;
84
+ '800': SerializedStyles;
85
+ };
86
+
87
+ // @public
88
+ const spaceMap_2: {
89
+ '0': SerializedStyles;
90
+ '025': SerializedStyles;
91
+ '050': SerializedStyles;
92
+ '075': SerializedStyles;
93
+ '100': SerializedStyles;
94
+ '1000': SerializedStyles;
95
+ '150': SerializedStyles;
96
+ '200': SerializedStyles;
97
+ '250': SerializedStyles;
98
+ '300': SerializedStyles;
99
+ '400': SerializedStyles;
100
+ '500': SerializedStyles;
101
+ '600': SerializedStyles;
102
+ '800': SerializedStyles;
103
+ };
104
+
105
+ // @public (undocumented)
106
+ type Spread = 'space-between';
107
+
108
+ // @public (undocumented)
109
+ type Spread_2 = 'space-between';
110
+
111
+ // @public
112
+ export const Stack: MemoExoticComponent<
113
+ ForwardRefExoticComponent<StackProps & RefAttributes<HTMLDivElement>>
114
+ >;
115
+
116
+ // @public (undocumented)
117
+ interface StackProps {
118
+ alignBlock?: AlignBlock;
119
+ alignInline?: AlignInline;
120
+ children: ReactNode;
121
+ grow?: Grow;
122
+ space?: Space;
123
+ spread?: Spread;
124
+ testId?: string;
125
+ }
27
126
 
28
127
  // (No @packageDocumentation comment for this package)
29
128
  ```
@@ -60,8 +60,8 @@ Promise.all(
60
60
  return Promise.all(
61
61
  [
62
62
  { path: ['internal', 'box.partial.tsx'] },
63
- // { target: 'stack.partial.tsx' },
64
- // { target: 'inline.partial.tsx' },
63
+ { path: ['inline.partial.tsx'] },
64
+ { path: ['stack.partial.tsx'] },
65
65
  ].map(({ path }) => {
66
66
  const targetPath = join(__dirname, '../', 'src', 'components', ...path);
67
67
 
@@ -30,6 +30,9 @@ const spacingProperties = {
30
30
  gap: {
31
31
  cssProperty: 'gap',
32
32
  },
33
+ space: {
34
+ cssProperty: 'gap',
35
+ },
33
36
  columnGap: {
34
37
  cssProperty: 'columnGap',
35
38
  },
@@ -38,7 +41,10 @@ const spacingProperties = {
38
41
  },
39
42
  } as const;
40
43
 
41
- const onlySpaceTokens = tokens.filter(token => token.name.startsWith('space.'));
44
+ const spacingTokenPrefix = 'space.';
45
+ const onlySpaceTokens = tokens.filter(token =>
46
+ token.name.startsWith(spacingTokenPrefix),
47
+ );
42
48
 
43
49
  const activeTokens = onlySpaceTokens.map(t => ({
44
50
  name: t.name,
@@ -61,7 +67,10 @@ const ${spacingProperty}Map = {
61
67
  ${activeTokens
62
68
  .sort((a, b) => (a.name < b.name ? -1 : 1))
63
69
  .map(token => {
64
- const propName = token.name;
70
+ const propName =
71
+ spacingProperty === 'space'
72
+ ? token.name.replace(spacingTokenPrefix, '')
73
+ : token.name;
65
74
  return `'${propName}': ${tokenToStyle(
66
75
  cssProperty,
67
76
  token.name,
@@ -5,14 +5,109 @@
5
5
  ```ts
6
6
 
7
7
  import { default as Box } from '@atlaskit/ds-explorations/box';
8
- import { default as Inline } from '@atlaskit/ds-explorations/inline';
9
- import { default as Stack } from '@atlaskit/ds-explorations/stack';
8
+ import { ForwardRefExoticComponent } from 'react';
9
+ import { MemoExoticComponent } from 'react';
10
+ import { ReactNode } from 'react';
11
+ import { RefAttributes } from 'react';
12
+ import { SerializedStyles } from '@emotion/react';
13
+
14
+ // @public (undocumented)
15
+ type AlignBlock = 'center' | 'end' | 'start';
16
+
17
+ // @public (undocumented)
18
+ type AlignBlock_2 = 'baseline' | 'center' | 'end' | 'start';
19
+
20
+ // @public (undocumented)
21
+ type AlignInline = 'center' | 'end' | 'start';
22
+
23
+ // @public (undocumented)
24
+ type AlignInline_2 = 'center' | 'end' | 'start';
10
25
 
11
26
  export { Box }
12
27
 
13
- export { Inline }
28
+ // @public (undocumented)
29
+ type Grow = 'fill' | 'hug';
30
+
31
+ // @public (undocumented)
32
+ type Grow_2 = 'fill' | 'hug';
33
+
34
+ // @public
35
+ export const Inline: MemoExoticComponent<ForwardRefExoticComponent<InlineProps & RefAttributes<HTMLDivElement>>>;
36
+
37
+ // @public (undocumented)
38
+ interface InlineProps {
39
+ alignBlock?: AlignBlock_2;
40
+ alignInline?: AlignInline_2;
41
+ children: ReactNode;
42
+ grow?: Grow_2;
43
+ separator?: string;
44
+ shouldWrap?: boolean;
45
+ space?: Space_2;
46
+ spread?: Spread_2;
47
+ testId?: string;
48
+ }
49
+
50
+ // @public (undocumented)
51
+ type Space = keyof typeof spaceMap;
52
+
53
+ // @public (undocumented)
54
+ type Space_2 = keyof typeof spaceMap_2;
55
+
56
+ // @public
57
+ const spaceMap: {
58
+ '0': SerializedStyles;
59
+ '025': SerializedStyles;
60
+ '050': SerializedStyles;
61
+ '075': SerializedStyles;
62
+ '100': SerializedStyles;
63
+ '1000': SerializedStyles;
64
+ '150': SerializedStyles;
65
+ '200': SerializedStyles;
66
+ '250': SerializedStyles;
67
+ '300': SerializedStyles;
68
+ '400': SerializedStyles;
69
+ '500': SerializedStyles;
70
+ '600': SerializedStyles;
71
+ '800': SerializedStyles;
72
+ };
73
+
74
+ // @public
75
+ const spaceMap_2: {
76
+ '0': SerializedStyles;
77
+ '025': SerializedStyles;
78
+ '050': SerializedStyles;
79
+ '075': SerializedStyles;
80
+ '100': SerializedStyles;
81
+ '1000': SerializedStyles;
82
+ '150': SerializedStyles;
83
+ '200': SerializedStyles;
84
+ '250': SerializedStyles;
85
+ '300': SerializedStyles;
86
+ '400': SerializedStyles;
87
+ '500': SerializedStyles;
88
+ '600': SerializedStyles;
89
+ '800': SerializedStyles;
90
+ };
91
+
92
+ // @public (undocumented)
93
+ type Spread = 'space-between';
94
+
95
+ // @public (undocumented)
96
+ type Spread_2 = 'space-between';
97
+
98
+ // @public
99
+ export const Stack: MemoExoticComponent<ForwardRefExoticComponent<StackProps & RefAttributes<HTMLDivElement>>>;
14
100
 
15
- export { Stack }
101
+ // @public (undocumented)
102
+ interface StackProps {
103
+ alignBlock?: AlignBlock;
104
+ alignInline?: AlignInline;
105
+ children: ReactNode;
106
+ grow?: Grow;
107
+ space?: Space;
108
+ spread?: Spread;
109
+ testId?: string;
110
+ }
16
111
 
17
112
  // (No @packageDocumentation comment for this package)
18
113