@atlaskit/primitives 1.0.2 → 1.0.3

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.
@@ -0,0 +1,80 @@
1
+ import { ElementType, ReactNode } from 'react';
2
+
3
+ import { BasePrimitiveProps } from '../src/components/types';
4
+
5
+ type Space =
6
+ | 'space.0'
7
+ | 'space.025'
8
+ | 'space.050'
9
+ | 'space.075'
10
+ | 'space.100'
11
+ | 'space.150'
12
+ | 'space.200'
13
+ | 'space.250'
14
+ | 'space.300'
15
+ | 'space.400'
16
+ | 'space.500'
17
+ | 'space.600'
18
+ | 'space.800'
19
+ | 'space.1000';
20
+
21
+ type FlexProps<T extends ElementType = 'div'> = {
22
+ /**
23
+ * The DOM element to render as the Flex. Defaults to `div`.
24
+ */
25
+ as?: 'div' | 'span' | 'ul' | 'ol' | 'li';
26
+
27
+ /**
28
+ * Used to align children along the main axis.
29
+ */
30
+ justifyContent?:
31
+ | 'start'
32
+ | 'center'
33
+ | 'end'
34
+ | 'space-between'
35
+ | 'space-around'
36
+ | 'space-evenly'
37
+ | 'stretch';
38
+
39
+ /**
40
+ * Used to align children along the cross axis.
41
+ */
42
+ alignItems?: 'start' | 'center' | 'end' | 'baseline' | 'stretch';
43
+
44
+ /**
45
+ * Represents the space between each child.
46
+ */
47
+ columnGap?: Space;
48
+
49
+ /**
50
+ * Represents the space between each child.
51
+ */
52
+ gap?: Space;
53
+
54
+ /**
55
+ * Represents the space between each child.
56
+ */
57
+ rowGap?: Space;
58
+
59
+ /**
60
+ * Represents the flex direction property of CSS flexbox.
61
+ */
62
+ direction?: 'row' | 'column';
63
+
64
+ /**
65
+ * Represents the flex wrap property of CSS flexbox.
66
+ */
67
+ wrap?: 'wrap' | 'nowrap';
68
+
69
+ /**
70
+ * Elements to be rendered inside the Flex.
71
+ */
72
+ children: ReactNode;
73
+
74
+ /**
75
+ * Forwarded ref element
76
+ */
77
+ ref?: React.ComponentPropsWithRef<T>['ref'];
78
+ } & BasePrimitiveProps;
79
+
80
+ export default function Flex(_: FlexProps) {}
@@ -0,0 +1,102 @@
1
+ import { ElementType, ReactNode } from 'react';
2
+
3
+ import { BasePrimitiveProps } from '../src/components/types';
4
+
5
+ type Space =
6
+ | 'space.0'
7
+ | 'space.025'
8
+ | 'space.050'
9
+ | 'space.075'
10
+ | 'space.100'
11
+ | 'space.150'
12
+ | 'space.200'
13
+ | 'space.250'
14
+ | 'space.300'
15
+ | 'space.400'
16
+ | 'space.500'
17
+ | 'space.600'
18
+ | 'space.800'
19
+ | 'space.1000';
20
+
21
+ type GridProps<T extends ElementType = 'div'> = {
22
+ /**
23
+ * The DOM element to render as the Flex. Defaults to `div`.
24
+ */
25
+ as?: 'div' | 'span' | 'ul' | 'ol' | 'li';
26
+
27
+ /**
28
+ * Used to align children along the main axis.
29
+ */
30
+ justifyContent?:
31
+ | 'start'
32
+ | 'center'
33
+ | 'end'
34
+ | 'space-between'
35
+ | 'space-around'
36
+ | 'space-evenly'
37
+ | 'stretch';
38
+
39
+ /**
40
+ * Used to align children along the cross axis.
41
+ */
42
+ alignItems?: 'start' | 'center' | 'end' | 'baseline' | 'stretch';
43
+
44
+ /**
45
+ * Represents the space between each child.
46
+ */
47
+ columnGap?: Space;
48
+
49
+ /**
50
+ * Represents the space between each child.
51
+ */
52
+ gap?: Space;
53
+
54
+ /**
55
+ * Represents the space between each child.
56
+ */
57
+ rowGap?: Space;
58
+
59
+ /**
60
+ * Specifies how auto-placed items get flowed into the grid. CSS `grid-auto-flow`.
61
+ */
62
+ autoFlow?: string;
63
+
64
+ /**
65
+ * CSS `grid-template-rows`.
66
+ */
67
+ templateRows?: string;
68
+
69
+ /**
70
+ * CSS `grid-template-columns`.
71
+ */
72
+ templateColumns?: string;
73
+
74
+ /**
75
+ * CSS `grid-template-areas`.
76
+ *
77
+ * Each item in the passed array is a grid row.
78
+ */
79
+ templateAreas?: string[];
80
+
81
+ /**
82
+ * Represents the flex direction property of CSS flexbox.
83
+ */
84
+ direction?: 'row' | 'column';
85
+
86
+ /**
87
+ * Represents the flex wrap property of CSS flexbox.
88
+ */
89
+ wrap?: 'wrap' | 'nowrap';
90
+
91
+ /**
92
+ * Elements to be rendered inside the Flex.
93
+ */
94
+ children: ReactNode;
95
+
96
+ /**
97
+ * Forwarded ref element
98
+ */
99
+ ref?: React.ComponentPropsWithRef<T>['ref'];
100
+ } & BasePrimitiveProps;
101
+
102
+ export default function Grid(_: GridProps) {}
package/package.json CHANGED
@@ -1,14 +1,19 @@
1
1
  {
2
2
  "name": "@atlaskit/primitives",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Primitives are token-backed low-level building blocks.",
5
- "author": "Atlassian Pty Ltd",
6
- "license": "Apache-2.0",
7
- "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
8
- "homepage": "https://atlassian.design/components/primitives",
9
5
  "publishConfig": {
10
6
  "registry": "https://registry.npmjs.org/"
11
7
  },
8
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
9
+ "author": "Atlassian Pty Ltd",
10
+ "license": "Apache-2.0",
11
+ "main": "dist/cjs/index.js",
12
+ "module": "dist/esm/index.js",
13
+ "module:es2019": "dist/es2019/index.js",
14
+ "types": "dist/types/index.d.ts",
15
+ "sideEffects": false,
16
+ "atlaskit:src": "src/index.tsx",
12
17
  "atlassian": {
13
18
  "team": "Design System Team",
14
19
  "inPublicMirror": false,
@@ -98,30 +103,9 @@
98
103
  "scripts": {
99
104
  "codegen-styles": "ts-node -r tsconfig-paths/register ./scripts/codegen-styles.tsx"
100
105
  },
101
- "main": "dist/cjs/index.js",
102
- "module": "dist/esm/index.js",
103
- "module:es2019": "dist/es2019/index.js",
104
- "types": "dist/types/index.d.ts",
105
- "typesVersions": {
106
- ">=4.5 <4.9": {
107
- "*": [
108
- "dist/types-ts4.5/*",
109
- "dist/types-ts4.5/index.d.ts"
110
- ]
111
- }
112
- },
113
- "sideEffects": false,
114
- "atlaskit:src": "src/index.tsx",
115
- "af:exports": {
116
- ".": "./src/index.tsx",
117
- "./box": "./src/components/box.tsx",
118
- "./stack": "./src/components/stack.tsx",
119
- "./inline": "./src/components/inline.tsx",
120
- "./responsive": "./src/responsive/index.tsx"
121
- },
122
106
  "dependencies": {
123
107
  "@atlaskit/focus-ring": "^1.3.0",
124
- "@atlaskit/tokens": "^1.11.0",
108
+ "@atlaskit/tokens": "^1.13.0",
125
109
  "@babel/runtime": "^7.0.0",
126
110
  "@emotion/react": "^11.7.1",
127
111
  "@emotion/serialize": "^1.1.0",
@@ -171,5 +155,21 @@
171
155
  ]
172
156
  }
173
157
  },
158
+ "homepage": "https://atlassian.design/components/primitives",
159
+ "typesVersions": {
160
+ ">=4.5 <4.9": {
161
+ "*": [
162
+ "dist/types-ts4.5/*",
163
+ "dist/types-ts4.5/index.d.ts"
164
+ ]
165
+ }
166
+ },
167
+ "af:exports": {
168
+ ".": "./src/index.tsx",
169
+ "./box": "./src/components/box.tsx",
170
+ "./stack": "./src/components/stack.tsx",
171
+ "./inline": "./src/components/inline.tsx",
172
+ "./responsive": "./src/responsive/index.tsx"
173
+ },
174
174
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
175
175
  }
package/report.api.md CHANGED
@@ -160,9 +160,15 @@ const backgroundColorMap: {
160
160
  readonly 'color.background.selected.bold': 'var(--ds-background-selected-bold)';
161
161
  readonly 'color.background.selected.bold.hovered': 'var(--ds-background-selected-bold-hovered)';
162
162
  readonly 'color.background.selected.bold.pressed': 'var(--ds-background-selected-bold-pressed)';
163
+ readonly 'color.background.brand.subtlest': 'var(--ds-background-brand-subtlest)';
164
+ readonly 'color.background.brand.subtlest.hovered': 'var(--ds-background-brand-subtlest-hovered)';
165
+ readonly 'color.background.brand.subtlest.pressed': 'var(--ds-background-brand-subtlest-pressed)';
163
166
  readonly 'color.background.brand.bold': 'var(--ds-background-brand-bold)';
164
167
  readonly 'color.background.brand.bold.hovered': 'var(--ds-background-brand-bold-hovered)';
165
168
  readonly 'color.background.brand.bold.pressed': 'var(--ds-background-brand-bold-pressed)';
169
+ readonly 'color.background.brand.boldest': 'var(--ds-background-brand-boldest)';
170
+ readonly 'color.background.brand.boldest.hovered': 'var(--ds-background-brand-boldest-hovered)';
171
+ readonly 'color.background.brand.boldest.pressed': 'var(--ds-background-brand-boldest-pressed)';
166
172
  readonly 'color.background.danger': 'var(--ds-background-danger)';
167
173
  readonly 'color.background.danger.hovered': 'var(--ds-background-danger-hovered)';
168
174
  readonly 'color.background.danger.pressed': 'var(--ds-background-danger-pressed)';
@@ -238,6 +238,18 @@ exports[`@atlaskit/primitives bg styles are generated correctly 1`] = `
238
238
  'color.background.selected.bold.pressed',
239
239
  '#0052CC',
240
240
  ),
241
+ 'color.background.brand.subtlest': token(
242
+ 'color.background.brand.subtlest',
243
+ '#B3D4FF',
244
+ ),
245
+ 'color.background.brand.subtlest.hovered': token(
246
+ 'color.background.brand.subtlest.hovered',
247
+ '#DEEBFF',
248
+ ),
249
+ 'color.background.brand.subtlest.pressed': token(
250
+ 'color.background.brand.subtlest.pressed',
251
+ '#4C9AFF',
252
+ ),
241
253
  'color.background.brand.bold': token(
242
254
  'color.background.brand.bold',
243
255
  '#0052CC',
@@ -250,6 +262,18 @@ exports[`@atlaskit/primitives bg styles are generated correctly 1`] = `
250
262
  'color.background.brand.bold.pressed',
251
263
  '#0747A6',
252
264
  ),
265
+ 'color.background.brand.boldest': token(
266
+ 'color.background.brand.boldest',
267
+ '#0747A6',
268
+ ),
269
+ 'color.background.brand.boldest.hovered': token(
270
+ 'color.background.brand.boldest.hovered',
271
+ '#0052CC',
272
+ ),
273
+ 'color.background.brand.boldest.pressed': token(
274
+ 'color.background.brand.boldest.pressed',
275
+ '#0747A6',
276
+ ),
253
277
  'color.background.danger': token('color.background.danger', '#FFEBE6'),
254
278
  'color.background.danger.hovered': token(
255
279
  'color.background.danger.hovered',