@atlaskit/primitives 0.8.7 → 0.8.9

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/primitives
2
2
 
3
+ ## 0.8.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [`da1727baf77`](https://bitbucket.org/atlassian/atlassian-frontend/commits/da1727baf77) - Allow non tokenised values to be passed through for tokenisable properties like `padding`. Adds type hinting for zIndex CSS property.
8
+
9
+ ## 0.8.8
10
+
11
+ ### Patch Changes
12
+
13
+ - [`5a134a5128a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5a134a5128a) - Adds type hinting for boxShadow CSS property. Fixes bug with token to CSS custom property transformation for gap, rowGap, columnGap.
14
+
3
15
  ## 0.8.7
4
16
 
5
17
  ### Patch Changes
@@ -1,7 +1,38 @@
1
1
  ---
2
2
  title: Box
3
- description: Box primitive...
3
+ description: Box is a primitive component that leverages the foundations of the Atlassian Design System.
4
4
  order: 0
5
5
  ---
6
6
 
7
- *Coming soon*
7
+ import BoxBasic from '../../examples/constellation/box/basic';
8
+ import BoxPadding from '../../examples/constellation/box/padding';
9
+ import BoxBackgroundColor from '../../examples/constellation/box/background-color';
10
+ import BoxXcss from '../../examples/constellation/box/xcss';
11
+
12
+ ## Basic
13
+
14
+ Box is a general-purpose container with controlled use of design tokens. Use the given props to configure display behaviour using scalable recommendations from the Atlassian Design System.
15
+
16
+ <Example Component={BoxBasic} packageName="@atlaskit/primitives/box" />
17
+
18
+ ## Padding
19
+
20
+ Padding props can be used to access spacing design token and control internal layout. The following example demonstrates how each prop works individually:
21
+
22
+ <Example Component={BoxPadding} packageName="@atlaskit/primitives/box" />
23
+
24
+ *Note*: The nomenclature used by these props follows [logical properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties). It might be less intuitive at first but they are adequate to properly support different [writing modes](https://developer.mozilla.org/en-US/docs/Web/CSS/writing-mode) in our products.
25
+
26
+ ## Background color
27
+
28
+ `Box` accepts a wide variety of background colors, referenced as semantic design tokens.
29
+
30
+ <Example Component={BoxBackgroundColor} packageName="@atlaskit/primitives/box" />
31
+
32
+ ## xCSS
33
+
34
+ Box also exposes an `xcss` prop. This prop can take `xcss` function calls that contain a subset of permitted styles. When used with `Box`, xCSS takes most CSS properties, and when a token exists, the rule accepts that token as a value.
35
+
36
+ <Example Component={BoxXcss} packageName="@atlaskit/primitives/box" />
37
+
38
+ For more information on xCSS, see the dedicated [xCSS](/components/primitives/xcss) documentation.
@@ -4,16 +4,16 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.textColorMap = exports.spaceStylesMap = exports.spaceMap = exports.shadowMap = exports.positionMap = exports.paddingStylesMap = exports.paddingMap = exports.overflowMap = exports.overflowInlineMap = exports.overflowBlockMap = exports.layerMap = exports.flexShrinkMap = exports.flexMap = exports.flexGrowMap = exports.flexDirectionMap = exports.dimensionMap = exports.borderWidthMap = exports.borderStyleMap = exports.borderRadiusMap = exports.borderColorMap = exports.backgroundColorStylesMap = exports.backgroundColorMap = exports.alignSelfMap = void 0;
7
+ exports.textColorMap = exports.spaceStylesMap = exports.spaceMap = exports.shadowMap = exports.positionMap = exports.paddingStylesMap = exports.paddingMap = exports.overflowMap = exports.overflowInlineMap = exports.overflowBlockMap = exports.layerMap = exports.insetMap = exports.flexShrinkMap = exports.flexMap = exports.flexGrowMap = exports.flexDirectionMap = exports.displayMap = exports.dimensionMap = exports.borderWidthMap = exports.borderStyleMap = exports.borderRadiusMap = exports.borderColorMap = exports.backgroundColorStylesMap = exports.backgroundColorMap = exports.alignSelfMap = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _react = require("@emotion/react");
10
10
  /**
11
11
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
12
- * @codegen <<SignedSource::1e44ed8fcd11d2f3864437fa047845a9>>
12
+ * @codegen <<SignedSource::fc517b480964965a9d7e6e5c8d921c19>>
13
13
  * @codegenId dimensions
14
14
  * @codegenCommand yarn codegen-styles
15
15
  * @codegenParams ["dimensions"]
16
- * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::89d19ca3937408eb7de5d72f4476a0f9>>
16
+ * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::9e8ad113b10e9429c514c69bd362f479>>
17
17
  */
18
18
  var dimensionMap = {
19
19
  '100%': '100%',
@@ -32,10 +32,10 @@ exports.dimensionMap = dimensionMap;
32
32
 
33
33
  /**
34
34
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
35
- * @codegen <<SignedSource::06b49ea9175072486628ad5a39dd0c4b>>
35
+ * @codegen <<SignedSource::8ce817b8abf862e7945a9c9792a1255e>>
36
36
  * @codegenId spacing
37
37
  * @codegenCommand yarn codegen-styles
38
- * @codegenParams ["padding", "space"]
38
+ * @codegenParams ["padding", "space", "inset"]
39
39
  * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
40
40
  */
41
41
  var paddingMap = {
@@ -72,6 +72,23 @@ var spaceMap = {
72
72
  'space.1000': "var(--ds-space-1000, 80px)"
73
73
  };
74
74
  exports.spaceMap = spaceMap;
75
+ var insetMap = {
76
+ 'space.0': "var(--ds-space-0, 0px)",
77
+ 'space.025': "var(--ds-space-025, 2px)",
78
+ 'space.050': "var(--ds-space-050, 4px)",
79
+ 'space.075': "var(--ds-space-075, 6px)",
80
+ 'space.100': "var(--ds-space-100, 8px)",
81
+ 'space.150': "var(--ds-space-150, 12px)",
82
+ 'space.200': "var(--ds-space-200, 16px)",
83
+ 'space.250': "var(--ds-space-250, 20px)",
84
+ 'space.300': "var(--ds-space-300, 24px)",
85
+ 'space.400': "var(--ds-space-400, 32px)",
86
+ 'space.500': "var(--ds-space-500, 40px)",
87
+ 'space.600': "var(--ds-space-600, 48px)",
88
+ 'space.800': "var(--ds-space-800, 64px)",
89
+ 'space.1000': "var(--ds-space-1000, 80px)"
90
+ };
91
+ exports.insetMap = insetMap;
75
92
  /**
76
93
  * @codegenEnd
77
94
  */
@@ -264,14 +281,14 @@ exports.textColorMap = textColorMap;
264
281
 
265
282
  /**
266
283
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
267
- * @codegen <<SignedSource::8ab54fc337c6a02f403dad852dd626a0>>
284
+ * @codegen <<SignedSource::8838ca696c1fa533db0eb127be15d81e>>
268
285
  * @codegenId misc
269
286
  * @codegenCommand yarn codegen-styles
270
287
  * @codegenParams ["align-self", "border-style", "display", "flex-direction", "flex-grow", "flex-shrink", "flex", "layer", "overflow", "position"]
271
288
  * @codegenDependency ../../scripts/codegen-file-templates/align-self.tsx <<SignedSource::074079802534462de54bf882bb2073e5>>
272
289
  * @codegenDependency ../../scripts/codegen-file-templates/border-style.tsx <<SignedSource::87e7e289ffeaac901997c4af98084a5f>>
273
- * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::89d19ca3937408eb7de5d72f4476a0f9>>
274
- * @codegenDependency ../../scripts/codegen-file-templates/display.tsx <<SignedSource::e6e390f80609060bfd12a55a489d5f54>>
290
+ * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::9e8ad113b10e9429c514c69bd362f479>>
291
+ * @codegenDependency ../../scripts/codegen-file-templates/display.tsx <<SignedSource::04ea30fcb3c02f2545af7fdc0206e645>>
275
292
  * @codegenDependency ../../scripts/codegen-file-templates/flex-direction.tsx <<SignedSource::19809ba11675679c188b0d98fb651dc1>>
276
293
  * @codegenDependency ../../scripts/codegen-file-templates/flex-grow.tsx <<SignedSource::b8a06b122cb609170f1f42778a6c270e>>
277
294
  * @codegenDependency ../../scripts/codegen-file-templates/flex-shrink.tsx <<SignedSource::bf6626972898bf22d2eeee2130693d47>>
@@ -293,6 +310,14 @@ var borderStyleMap = {
293
310
  solid: 'solid'
294
311
  };
295
312
  exports.borderStyleMap = borderStyleMap;
313
+ var displayMap = {
314
+ flex: 'flex',
315
+ block: 'block',
316
+ inline: 'inline',
317
+ inlineBlock: 'inline-block',
318
+ inlineFlex: 'inline-flex'
319
+ };
320
+ exports.displayMap = displayMap;
296
321
  var flexDirectionMap = {
297
322
  row: 'row',
298
323
  column: 'column'
@@ -377,7 +402,7 @@ var borderRadiusMap = {
377
402
  * @codegenEnd
378
403
  */
379
404
  exports.borderRadiusMap = borderRadiusMap;
380
- var spacingProperties = ['padding', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd', 'gap', 'rowGap'];
405
+ var spacingProperties = ['padding', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd', 'gap', 'rowGap', 'columnGap'];
381
406
  var getSerializedStylesMap = function getSerializedStylesMap(cssProperty, tokenMap) {
382
407
  return Object.keys(tokenMap).reduce(function (emotionSpacingMap, token) {
383
408
  emotionSpacingMap[token] = (0, _react.css)((0, _defineProperty2.default)({}, cssProperty, tokenMap[token]));
@@ -14,25 +14,61 @@ var _styleMaps = require("./style-maps.partial");
14
14
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
15
15
 
16
16
  var tokensMap = {
17
+ alignSelf: _styleMaps.alignSelfMap,
17
18
  backgroundColor: _styleMaps.backgroundColorMap,
19
+ blockSize: _styleMaps.dimensionMap,
18
20
  borderColor: _styleMaps.borderColorMap,
19
21
  borderRadius: _styleMaps.borderRadiusMap,
22
+ borderStyle: _styleMaps.borderStyleMap,
20
23
  borderWidth: _styleMaps.borderWidthMap,
24
+ bottom: _styleMaps.dimensionMap,
25
+ boxShadow: _styleMaps.shadowMap,
21
26
  color: _styleMaps.textColorMap,
27
+ columnGap: _styleMaps.spaceMap,
28
+ display: _styleMaps.displayMap,
29
+ flex: _styleMaps.flexMap,
30
+ flexDirection: _styleMaps.flexDirectionMap,
31
+ flexGrow: _styleMaps.flexGrowMap,
32
+ flexShrink: _styleMaps.flexShrinkMap,
33
+ gap: _styleMaps.spaceMap,
22
34
  height: _styleMaps.dimensionMap,
35
+ inlineSize: _styleMaps.dimensionMap,
36
+ inset: _styleMaps.insetMap,
37
+ insetBlock: _styleMaps.insetMap,
38
+ insetBlockEnd: _styleMaps.insetMap,
39
+ insetBlockStart: _styleMaps.insetMap,
40
+ insetInline: _styleMaps.insetMap,
41
+ insetInlineEnd: _styleMaps.insetMap,
42
+ insetInlineStart: _styleMaps.insetMap,
43
+ left: _styleMaps.dimensionMap,
44
+ maxBlockSize: _styleMaps.dimensionMap,
23
45
  maxHeight: _styleMaps.dimensionMap,
46
+ maxInlineSize: _styleMaps.dimensionMap,
24
47
  maxWidth: _styleMaps.dimensionMap,
48
+ minBlockSize: _styleMaps.dimensionMap,
25
49
  minHeight: _styleMaps.dimensionMap,
50
+ minInlineSize: _styleMaps.dimensionMap,
26
51
  minWidth: _styleMaps.dimensionMap,
52
+ overflow: _styleMaps.overflowMap,
53
+ overflowBlock: _styleMaps.overflowBlockMap,
54
+ overflowInline: _styleMaps.overflowInlineMap,
27
55
  padding: _styleMaps.paddingMap,
28
56
  paddingBlock: _styleMaps.paddingMap,
29
57
  paddingBlockEnd: _styleMaps.paddingMap,
30
58
  paddingBlockStart: _styleMaps.paddingMap,
59
+ paddingBottom: _styleMaps.paddingMap,
31
60
  paddingInline: _styleMaps.paddingMap,
32
61
  paddingInlineEnd: _styleMaps.paddingMap,
33
62
  paddingInlineStart: _styleMaps.paddingMap,
34
- boxShadow: _styleMaps.shadowMap,
35
- width: _styleMaps.dimensionMap
63
+ paddingLeft: _styleMaps.paddingMap,
64
+ paddingRight: _styleMaps.paddingMap,
65
+ paddingTop: _styleMaps.paddingMap,
66
+ position: _styleMaps.positionMap,
67
+ right: _styleMaps.dimensionMap,
68
+ rowGap: _styleMaps.spaceMap,
69
+ top: _styleMaps.dimensionMap,
70
+ width: _styleMaps.dimensionMap,
71
+ zIndex: _styleMaps.layerMap
36
72
  };
37
73
  var uniqueSymbol = Symbol('Internal symbol to verify xcss function is called safely');
38
74
  var isSafeEnvToThrow = function isSafeEnvToThrow() {
@@ -81,11 +117,8 @@ var transformStyles = function transformStyles(styleObj) {
81
117
  if (!tokenValue) {
82
118
  var message = "Invalid token alias: ".concat(value);
83
119
  (0, _warnOnce.default)(message);
84
- if (isSafeEnvToThrow()) {
85
- throw new Error(message);
86
- }
87
120
  }
88
- styleObj[key] = tokenValue;
121
+ styleObj[key] = tokenValue !== null && tokenValue !== void 0 ? tokenValue : value;
89
122
  });
90
123
  return styleObj;
91
124
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/primitives",
3
- "version": "0.8.7",
3
+ "version": "0.8.9",
4
4
  "sideEffects": false
5
5
  }
@@ -1,11 +1,11 @@
1
1
  import { css } from '@emotion/react';
2
2
  /**
3
3
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
4
- * @codegen <<SignedSource::1e44ed8fcd11d2f3864437fa047845a9>>
4
+ * @codegen <<SignedSource::fc517b480964965a9d7e6e5c8d921c19>>
5
5
  * @codegenId dimensions
6
6
  * @codegenCommand yarn codegen-styles
7
7
  * @codegenParams ["dimensions"]
8
- * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::89d19ca3937408eb7de5d72f4476a0f9>>
8
+ * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::9e8ad113b10e9429c514c69bd362f479>>
9
9
  */
10
10
  export const dimensionMap = {
11
11
  '100%': '100%',
@@ -22,10 +22,10 @@ export const dimensionMap = {
22
22
  */
23
23
  /**
24
24
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
25
- * @codegen <<SignedSource::06b49ea9175072486628ad5a39dd0c4b>>
25
+ * @codegen <<SignedSource::8ce817b8abf862e7945a9c9792a1255e>>
26
26
  * @codegenId spacing
27
27
  * @codegenCommand yarn codegen-styles
28
- * @codegenParams ["padding", "space"]
28
+ * @codegenParams ["padding", "space", "inset"]
29
29
  * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
30
30
  */
31
31
  export const paddingMap = {
@@ -60,6 +60,22 @@ export const spaceMap = {
60
60
  'space.800': "var(--ds-space-800, 64px)",
61
61
  'space.1000': "var(--ds-space-1000, 80px)"
62
62
  };
63
+ export const insetMap = {
64
+ 'space.0': "var(--ds-space-0, 0px)",
65
+ 'space.025': "var(--ds-space-025, 2px)",
66
+ 'space.050': "var(--ds-space-050, 4px)",
67
+ 'space.075': "var(--ds-space-075, 6px)",
68
+ 'space.100': "var(--ds-space-100, 8px)",
69
+ 'space.150': "var(--ds-space-150, 12px)",
70
+ 'space.200': "var(--ds-space-200, 16px)",
71
+ 'space.250': "var(--ds-space-250, 20px)",
72
+ 'space.300': "var(--ds-space-300, 24px)",
73
+ 'space.400': "var(--ds-space-400, 32px)",
74
+ 'space.500': "var(--ds-space-500, 40px)",
75
+ 'space.600': "var(--ds-space-600, 48px)",
76
+ 'space.800': "var(--ds-space-800, 64px)",
77
+ 'space.1000': "var(--ds-space-1000, 80px)"
78
+ };
63
79
  /**
64
80
  * @codegenEnd
65
81
  */
@@ -246,14 +262,14 @@ export const textColorMap = {
246
262
  */
247
263
  /**
248
264
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
249
- * @codegen <<SignedSource::8ab54fc337c6a02f403dad852dd626a0>>
265
+ * @codegen <<SignedSource::8838ca696c1fa533db0eb127be15d81e>>
250
266
  * @codegenId misc
251
267
  * @codegenCommand yarn codegen-styles
252
268
  * @codegenParams ["align-self", "border-style", "display", "flex-direction", "flex-grow", "flex-shrink", "flex", "layer", "overflow", "position"]
253
269
  * @codegenDependency ../../scripts/codegen-file-templates/align-self.tsx <<SignedSource::074079802534462de54bf882bb2073e5>>
254
270
  * @codegenDependency ../../scripts/codegen-file-templates/border-style.tsx <<SignedSource::87e7e289ffeaac901997c4af98084a5f>>
255
- * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::89d19ca3937408eb7de5d72f4476a0f9>>
256
- * @codegenDependency ../../scripts/codegen-file-templates/display.tsx <<SignedSource::e6e390f80609060bfd12a55a489d5f54>>
271
+ * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::9e8ad113b10e9429c514c69bd362f479>>
272
+ * @codegenDependency ../../scripts/codegen-file-templates/display.tsx <<SignedSource::04ea30fcb3c02f2545af7fdc0206e645>>
257
273
  * @codegenDependency ../../scripts/codegen-file-templates/flex-direction.tsx <<SignedSource::19809ba11675679c188b0d98fb651dc1>>
258
274
  * @codegenDependency ../../scripts/codegen-file-templates/flex-grow.tsx <<SignedSource::b8a06b122cb609170f1f42778a6c270e>>
259
275
  * @codegenDependency ../../scripts/codegen-file-templates/flex-shrink.tsx <<SignedSource::bf6626972898bf22d2eeee2130693d47>>
@@ -273,6 +289,13 @@ export const borderStyleMap = {
273
289
  none: 'none',
274
290
  solid: 'solid'
275
291
  };
292
+ export const displayMap = {
293
+ flex: 'flex',
294
+ block: 'block',
295
+ inline: 'inline',
296
+ inlineBlock: 'inline-block',
297
+ inlineFlex: 'inline-flex'
298
+ };
276
299
  export const flexDirectionMap = {
277
300
  row: 'row',
278
301
  column: 'column'
@@ -346,7 +369,7 @@ export const borderRadiusMap = {
346
369
  * @codegenEnd
347
370
  */
348
371
 
349
- const spacingProperties = ['padding', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd', 'gap', 'rowGap'];
372
+ const spacingProperties = ['padding', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd', 'gap', 'rowGap', 'columnGap'];
350
373
  const getSerializedStylesMap = (cssProperty, tokenMap) => {
351
374
  return Object.keys(tokenMap).reduce((emotionSpacingMap, token) => {
352
375
  emotionSpacingMap[token] = css({
@@ -1,27 +1,63 @@
1
1
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
2
2
  import { css as cssEmotion } from '@emotion/react';
3
3
  import warnOnce from '@atlaskit/ds-lib/warn-once';
4
- import { backgroundColorMap, borderColorMap, borderRadiusMap, borderWidthMap, dimensionMap, paddingMap, shadowMap, textColorMap } from './style-maps.partial';
4
+ import { alignSelfMap, backgroundColorMap, borderColorMap, borderRadiusMap, borderStyleMap, borderWidthMap, dimensionMap, displayMap, flexDirectionMap, flexGrowMap, flexMap, flexShrinkMap, insetMap, layerMap, overflowBlockMap, overflowInlineMap, overflowMap, paddingMap, positionMap, shadowMap, spaceMap, textColorMap } from './style-maps.partial';
5
5
  const tokensMap = {
6
+ alignSelf: alignSelfMap,
6
7
  backgroundColor: backgroundColorMap,
8
+ blockSize: dimensionMap,
7
9
  borderColor: borderColorMap,
8
10
  borderRadius: borderRadiusMap,
11
+ borderStyle: borderStyleMap,
9
12
  borderWidth: borderWidthMap,
13
+ bottom: dimensionMap,
14
+ boxShadow: shadowMap,
10
15
  color: textColorMap,
16
+ columnGap: spaceMap,
17
+ display: displayMap,
18
+ flex: flexMap,
19
+ flexDirection: flexDirectionMap,
20
+ flexGrow: flexGrowMap,
21
+ flexShrink: flexShrinkMap,
22
+ gap: spaceMap,
11
23
  height: dimensionMap,
24
+ inlineSize: dimensionMap,
25
+ inset: insetMap,
26
+ insetBlock: insetMap,
27
+ insetBlockEnd: insetMap,
28
+ insetBlockStart: insetMap,
29
+ insetInline: insetMap,
30
+ insetInlineEnd: insetMap,
31
+ insetInlineStart: insetMap,
32
+ left: dimensionMap,
33
+ maxBlockSize: dimensionMap,
12
34
  maxHeight: dimensionMap,
35
+ maxInlineSize: dimensionMap,
13
36
  maxWidth: dimensionMap,
37
+ minBlockSize: dimensionMap,
14
38
  minHeight: dimensionMap,
39
+ minInlineSize: dimensionMap,
15
40
  minWidth: dimensionMap,
41
+ overflow: overflowMap,
42
+ overflowBlock: overflowBlockMap,
43
+ overflowInline: overflowInlineMap,
16
44
  padding: paddingMap,
17
45
  paddingBlock: paddingMap,
18
46
  paddingBlockEnd: paddingMap,
19
47
  paddingBlockStart: paddingMap,
48
+ paddingBottom: paddingMap,
20
49
  paddingInline: paddingMap,
21
50
  paddingInlineEnd: paddingMap,
22
51
  paddingInlineStart: paddingMap,
23
- boxShadow: shadowMap,
24
- width: dimensionMap
52
+ paddingLeft: paddingMap,
53
+ paddingRight: paddingMap,
54
+ paddingTop: paddingMap,
55
+ position: positionMap,
56
+ right: dimensionMap,
57
+ rowGap: spaceMap,
58
+ top: dimensionMap,
59
+ width: dimensionMap,
60
+ zIndex: layerMap
25
61
  };
26
62
  const uniqueSymbol = Symbol('Internal symbol to verify xcss function is called safely');
27
63
  const isSafeEnvToThrow = () => typeof process === 'object' && typeof process.env === 'object' && process.env.NODE_ENV !== 'production';
@@ -65,11 +101,8 @@ const transformStyles = styleObj => {
65
101
  if (!tokenValue) {
66
102
  const message = `Invalid token alias: ${value}`;
67
103
  warnOnce(message);
68
- if (isSafeEnvToThrow()) {
69
- throw new Error(message);
70
- }
71
104
  }
72
- styleObj[key] = tokenValue;
105
+ styleObj[key] = tokenValue !== null && tokenValue !== void 0 ? tokenValue : value;
73
106
  });
74
107
  return styleObj;
75
108
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/primitives",
3
- "version": "0.8.7",
3
+ "version": "0.8.9",
4
4
  "sideEffects": false
5
5
  }
@@ -2,11 +2,11 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import { css } from '@emotion/react';
3
3
  /**
4
4
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
5
- * @codegen <<SignedSource::1e44ed8fcd11d2f3864437fa047845a9>>
5
+ * @codegen <<SignedSource::fc517b480964965a9d7e6e5c8d921c19>>
6
6
  * @codegenId dimensions
7
7
  * @codegenCommand yarn codegen-styles
8
8
  * @codegenParams ["dimensions"]
9
- * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::89d19ca3937408eb7de5d72f4476a0f9>>
9
+ * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::9e8ad113b10e9429c514c69bd362f479>>
10
10
  */
11
11
  export var dimensionMap = {
12
12
  '100%': '100%',
@@ -23,10 +23,10 @@ export var dimensionMap = {
23
23
  */
24
24
  /**
25
25
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
26
- * @codegen <<SignedSource::06b49ea9175072486628ad5a39dd0c4b>>
26
+ * @codegen <<SignedSource::8ce817b8abf862e7945a9c9792a1255e>>
27
27
  * @codegenId spacing
28
28
  * @codegenCommand yarn codegen-styles
29
- * @codegenParams ["padding", "space"]
29
+ * @codegenParams ["padding", "space", "inset"]
30
30
  * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
31
31
  */
32
32
  export var paddingMap = {
@@ -61,6 +61,22 @@ export var spaceMap = {
61
61
  'space.800': "var(--ds-space-800, 64px)",
62
62
  'space.1000': "var(--ds-space-1000, 80px)"
63
63
  };
64
+ export var insetMap = {
65
+ 'space.0': "var(--ds-space-0, 0px)",
66
+ 'space.025': "var(--ds-space-025, 2px)",
67
+ 'space.050': "var(--ds-space-050, 4px)",
68
+ 'space.075': "var(--ds-space-075, 6px)",
69
+ 'space.100': "var(--ds-space-100, 8px)",
70
+ 'space.150': "var(--ds-space-150, 12px)",
71
+ 'space.200': "var(--ds-space-200, 16px)",
72
+ 'space.250': "var(--ds-space-250, 20px)",
73
+ 'space.300': "var(--ds-space-300, 24px)",
74
+ 'space.400': "var(--ds-space-400, 32px)",
75
+ 'space.500': "var(--ds-space-500, 40px)",
76
+ 'space.600': "var(--ds-space-600, 48px)",
77
+ 'space.800': "var(--ds-space-800, 64px)",
78
+ 'space.1000': "var(--ds-space-1000, 80px)"
79
+ };
64
80
  /**
65
81
  * @codegenEnd
66
82
  */
@@ -247,14 +263,14 @@ export var textColorMap = {
247
263
  */
248
264
  /**
249
265
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
250
- * @codegen <<SignedSource::8ab54fc337c6a02f403dad852dd626a0>>
266
+ * @codegen <<SignedSource::8838ca696c1fa533db0eb127be15d81e>>
251
267
  * @codegenId misc
252
268
  * @codegenCommand yarn codegen-styles
253
269
  * @codegenParams ["align-self", "border-style", "display", "flex-direction", "flex-grow", "flex-shrink", "flex", "layer", "overflow", "position"]
254
270
  * @codegenDependency ../../scripts/codegen-file-templates/align-self.tsx <<SignedSource::074079802534462de54bf882bb2073e5>>
255
271
  * @codegenDependency ../../scripts/codegen-file-templates/border-style.tsx <<SignedSource::87e7e289ffeaac901997c4af98084a5f>>
256
- * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::89d19ca3937408eb7de5d72f4476a0f9>>
257
- * @codegenDependency ../../scripts/codegen-file-templates/display.tsx <<SignedSource::e6e390f80609060bfd12a55a489d5f54>>
272
+ * @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::9e8ad113b10e9429c514c69bd362f479>>
273
+ * @codegenDependency ../../scripts/codegen-file-templates/display.tsx <<SignedSource::04ea30fcb3c02f2545af7fdc0206e645>>
258
274
  * @codegenDependency ../../scripts/codegen-file-templates/flex-direction.tsx <<SignedSource::19809ba11675679c188b0d98fb651dc1>>
259
275
  * @codegenDependency ../../scripts/codegen-file-templates/flex-grow.tsx <<SignedSource::b8a06b122cb609170f1f42778a6c270e>>
260
276
  * @codegenDependency ../../scripts/codegen-file-templates/flex-shrink.tsx <<SignedSource::bf6626972898bf22d2eeee2130693d47>>
@@ -274,6 +290,13 @@ export var borderStyleMap = {
274
290
  none: 'none',
275
291
  solid: 'solid'
276
292
  };
293
+ export var displayMap = {
294
+ flex: 'flex',
295
+ block: 'block',
296
+ inline: 'inline',
297
+ inlineBlock: 'inline-block',
298
+ inlineFlex: 'inline-flex'
299
+ };
277
300
  export var flexDirectionMap = {
278
301
  row: 'row',
279
302
  column: 'column'
@@ -347,7 +370,7 @@ export var borderRadiusMap = {
347
370
  * @codegenEnd
348
371
  */
349
372
 
350
- var spacingProperties = ['padding', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd', 'gap', 'rowGap'];
373
+ var spacingProperties = ['padding', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd', 'gap', 'rowGap', 'columnGap'];
351
374
  var getSerializedStylesMap = function getSerializedStylesMap(cssProperty, tokenMap) {
352
375
  return Object.keys(tokenMap).reduce(function (emotionSpacingMap, token) {
353
376
  emotionSpacingMap[token] = css(_defineProperty({}, cssProperty, tokenMap[token]));
@@ -3,27 +3,63 @@ import _typeof from "@babel/runtime/helpers/typeof";
3
3
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
4
4
  import { css as cssEmotion } from '@emotion/react';
5
5
  import warnOnce from '@atlaskit/ds-lib/warn-once';
6
- import { backgroundColorMap, borderColorMap, borderRadiusMap, borderWidthMap, dimensionMap, paddingMap, shadowMap, textColorMap } from './style-maps.partial';
6
+ import { alignSelfMap, backgroundColorMap, borderColorMap, borderRadiusMap, borderStyleMap, borderWidthMap, dimensionMap, displayMap, flexDirectionMap, flexGrowMap, flexMap, flexShrinkMap, insetMap, layerMap, overflowBlockMap, overflowInlineMap, overflowMap, paddingMap, positionMap, shadowMap, spaceMap, textColorMap } from './style-maps.partial';
7
7
  var tokensMap = {
8
+ alignSelf: alignSelfMap,
8
9
  backgroundColor: backgroundColorMap,
10
+ blockSize: dimensionMap,
9
11
  borderColor: borderColorMap,
10
12
  borderRadius: borderRadiusMap,
13
+ borderStyle: borderStyleMap,
11
14
  borderWidth: borderWidthMap,
15
+ bottom: dimensionMap,
16
+ boxShadow: shadowMap,
12
17
  color: textColorMap,
18
+ columnGap: spaceMap,
19
+ display: displayMap,
20
+ flex: flexMap,
21
+ flexDirection: flexDirectionMap,
22
+ flexGrow: flexGrowMap,
23
+ flexShrink: flexShrinkMap,
24
+ gap: spaceMap,
13
25
  height: dimensionMap,
26
+ inlineSize: dimensionMap,
27
+ inset: insetMap,
28
+ insetBlock: insetMap,
29
+ insetBlockEnd: insetMap,
30
+ insetBlockStart: insetMap,
31
+ insetInline: insetMap,
32
+ insetInlineEnd: insetMap,
33
+ insetInlineStart: insetMap,
34
+ left: dimensionMap,
35
+ maxBlockSize: dimensionMap,
14
36
  maxHeight: dimensionMap,
37
+ maxInlineSize: dimensionMap,
15
38
  maxWidth: dimensionMap,
39
+ minBlockSize: dimensionMap,
16
40
  minHeight: dimensionMap,
41
+ minInlineSize: dimensionMap,
17
42
  minWidth: dimensionMap,
43
+ overflow: overflowMap,
44
+ overflowBlock: overflowBlockMap,
45
+ overflowInline: overflowInlineMap,
18
46
  padding: paddingMap,
19
47
  paddingBlock: paddingMap,
20
48
  paddingBlockEnd: paddingMap,
21
49
  paddingBlockStart: paddingMap,
50
+ paddingBottom: paddingMap,
22
51
  paddingInline: paddingMap,
23
52
  paddingInlineEnd: paddingMap,
24
53
  paddingInlineStart: paddingMap,
25
- boxShadow: shadowMap,
26
- width: dimensionMap
54
+ paddingLeft: paddingMap,
55
+ paddingRight: paddingMap,
56
+ paddingTop: paddingMap,
57
+ position: positionMap,
58
+ right: dimensionMap,
59
+ rowGap: spaceMap,
60
+ top: dimensionMap,
61
+ width: dimensionMap,
62
+ zIndex: layerMap
27
63
  };
28
64
  var uniqueSymbol = Symbol('Internal symbol to verify xcss function is called safely');
29
65
  var isSafeEnvToThrow = function isSafeEnvToThrow() {
@@ -72,11 +108,8 @@ var transformStyles = function transformStyles(styleObj) {
72
108
  if (!tokenValue) {
73
109
  var message = "Invalid token alias: ".concat(value);
74
110
  warnOnce(message);
75
- if (isSafeEnvToThrow()) {
76
- throw new Error(message);
77
- }
78
111
  }
79
- styleObj[key] = tokenValue;
112
+ styleObj[key] = tokenValue !== null && tokenValue !== void 0 ? tokenValue : value;
80
113
  });
81
114
  return styleObj;
82
115
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/primitives",
3
- "version": "0.8.7",
3
+ "version": "0.8.9",
4
4
  "sideEffects": false
5
5
  }