@atlaskit/primitives 0.4.2 → 0.6.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 (34) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/components/inline.partial.js +23 -91
  3. package/dist/cjs/components/internal/base-box.partial.js +81 -99
  4. package/dist/cjs/components/stack.partial.js +23 -47
  5. package/dist/cjs/internal/xcss.js +16 -4
  6. package/dist/cjs/version.json +1 -1
  7. package/dist/es2019/components/inline.partial.js +19 -63
  8. package/dist/es2019/components/internal/base-box.partial.js +72 -68
  9. package/dist/es2019/components/stack.partial.js +19 -19
  10. package/dist/es2019/internal/xcss.js +9 -2
  11. package/dist/es2019/version.json +1 -1
  12. package/dist/esm/components/inline.partial.js +22 -91
  13. package/dist/esm/components/internal/base-box.partial.js +81 -99
  14. package/dist/esm/components/stack.partial.js +22 -47
  15. package/dist/esm/internal/xcss.js +13 -2
  16. package/dist/esm/version.json +1 -1
  17. package/dist/types/components/box.d.ts +1 -2
  18. package/dist/types/components/inline.partial.d.ts +28 -39
  19. package/dist/types/components/internal/base-box.partial.d.ts +42 -43
  20. package/dist/types/components/stack.partial.d.ts +25 -20
  21. package/dist/types/components/types.d.ts +2 -48
  22. package/dist/types/internal/xcss.d.ts +37 -8
  23. package/package.json +2 -3
  24. package/report.api.md +160 -144
  25. package/scripts/spacing-codegen-template.tsx +30 -30
  26. package/tmp/api-report-tmp.d.ts +124 -130
  27. package/dist/cjs/components/internal/types.js +0 -8
  28. package/dist/cjs/components/internal/utils.js +0 -16
  29. package/dist/es2019/components/internal/types.js +0 -1
  30. package/dist/es2019/components/internal/utils.js +0 -2
  31. package/dist/esm/components/internal/types.js +0 -1
  32. package/dist/esm/components/internal/utils.js +0 -7
  33. package/dist/types/components/internal/types.d.ts +0 -8
  34. package/dist/types/components/internal/utils.d.ts +0 -3
@@ -1,46 +1,11 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
2
  import _extends from "@babel/runtime/helpers/extends";
2
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  var _excluded = ["as", "className", "children", "color", "backgroundColor", "shadow", "borderStyle", "borderWidth", "borderRadius", "borderColor", "layer", "flex", "flexGrow", "flexShrink", "alignSelf", "overflow", "overflowInline", "overflowBlock", "padding", "paddingBlock", "paddingBlockStart", "paddingBlockEnd", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "height", "width", "display", "position", "style", "testId"];
5
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
5
  /** @jsx jsx */
8
6
  import { forwardRef } from 'react';
9
7
  import { css, jsx } from '@emotion/react';
10
- import invariant from 'tiny-invariant';
11
8
  import { LAYERS } from '../../constants';
12
- import { UNSAFE_buildAboveMediaQueryCSS } from '../../helpers/responsive';
13
- import { BOX_RESPONSIVE_PROPS } from './types';
14
- import { isResponsiveStyleProp, isStaticStyleProp } from './utils';
15
- var responsiveRules = BOX_RESPONSIVE_PROPS.reduce(function (mapping, cssProperty) {
16
- return Object.assign(mapping, _defineProperty({}, cssProperty, _objectSpread({
17
- static: css(_defineProperty({}, cssProperty, "var(--ds-box-static-".concat(cssProperty, ")")))
18
- }, UNSAFE_buildAboveMediaQueryCSS(function (breakpoint) {
19
- return _defineProperty({}, cssProperty, "var(--ds-box-responsive-".concat(cssProperty, "-").concat(breakpoint, ")"));
20
- }))));
21
- }, {});
22
- var getResponsiveVars = function getResponsiveVars(propertyName, propertyValue, mapping) {
23
- if (isResponsiveStyleProp(propertyValue)) {
24
- return Object.keys(propertyValue).reduce(function (vars, breakpoint) {
25
- return _objectSpread(_objectSpread({}, vars), {}, _defineProperty({}, "--ds-box-responsive-".concat(propertyName, "-").concat(breakpoint), mapping[propertyValue[breakpoint]]));
26
- }, {});
27
- } else if (isStaticStyleProp(propertyValue)) {
28
- return _defineProperty({}, "--ds-box-static-".concat(propertyName), mapping[propertyValue]);
29
- }
30
- };
31
- var getResponsiveStyles = function getResponsiveStyles(propertyName, propertyValue) {
32
- invariant(typeof responsiveRules[propertyName] !== 'undefined', "Responsive rules for \"".concat(propertyName, "\" have not been statically defined."));
33
- if (isResponsiveStyleProp(propertyValue)) {
34
- return Object.keys(propertyValue).map(function (breakpoint) {
35
- return responsiveRules[propertyName][breakpoint];
36
- });
37
- } else if (isStaticStyleProp(propertyValue)) {
38
- return responsiveRules[propertyName].static;
39
- }
40
- };
41
-
42
- // Without this type annotation on Box we don't get autocomplete for props due to forwardRef types
43
-
44
9
  /**
45
10
  * __Box__
46
11
  *
@@ -49,50 +14,49 @@ var getResponsiveStyles = function getResponsiveStyles(propertyName, propertyVal
49
14
  *
50
15
  * @internal
51
16
  */
52
- export var BaseBox = /*#__PURE__*/forwardRef(function (_ref3, ref) {
53
- var as = _ref3.as,
54
- className = _ref3.className,
55
- children = _ref3.children,
56
- color = _ref3.color,
57
- backgroundColor = _ref3.backgroundColor,
58
- shadow = _ref3.shadow,
59
- borderStyle = _ref3.borderStyle,
60
- borderWidth = _ref3.borderWidth,
61
- borderRadius = _ref3.borderRadius,
62
- borderColor = _ref3.borderColor,
63
- layer = _ref3.layer,
64
- flex = _ref3.flex,
65
- flexGrow = _ref3.flexGrow,
66
- flexShrink = _ref3.flexShrink,
67
- alignSelf = _ref3.alignSelf,
68
- overflow = _ref3.overflow,
69
- overflowInline = _ref3.overflowInline,
70
- overflowBlock = _ref3.overflowBlock,
71
- padding = _ref3.padding,
72
- paddingBlock = _ref3.paddingBlock,
73
- paddingBlockStart = _ref3.paddingBlockStart,
74
- paddingBlockEnd = _ref3.paddingBlockEnd,
75
- paddingInline = _ref3.paddingInline,
76
- paddingInlineStart = _ref3.paddingInlineStart,
77
- paddingInlineEnd = _ref3.paddingInlineEnd,
78
- height = _ref3.height,
79
- width = _ref3.width,
80
- _ref3$display = _ref3.display,
81
- display = _ref3$display === void 0 ? displayMap.block : _ref3$display,
82
- _ref3$position = _ref3.position,
83
- position = _ref3$position === void 0 ? 'static' : _ref3$position,
84
- style = _ref3.style,
85
- testId = _ref3.testId,
86
- htmlAttributes = _objectWithoutProperties(_ref3, _excluded);
17
+ export var BaseBox = /*#__PURE__*/forwardRef(function (_ref, ref) {
18
+ var as = _ref.as,
19
+ className = _ref.className,
20
+ children = _ref.children,
21
+ color = _ref.color,
22
+ backgroundColor = _ref.backgroundColor,
23
+ shadow = _ref.shadow,
24
+ borderStyle = _ref.borderStyle,
25
+ borderWidth = _ref.borderWidth,
26
+ borderRadius = _ref.borderRadius,
27
+ borderColor = _ref.borderColor,
28
+ layer = _ref.layer,
29
+ flex = _ref.flex,
30
+ flexGrow = _ref.flexGrow,
31
+ flexShrink = _ref.flexShrink,
32
+ alignSelf = _ref.alignSelf,
33
+ overflow = _ref.overflow,
34
+ overflowInline = _ref.overflowInline,
35
+ overflowBlock = _ref.overflowBlock,
36
+ padding = _ref.padding,
37
+ paddingBlock = _ref.paddingBlock,
38
+ paddingBlockStart = _ref.paddingBlockStart,
39
+ paddingBlockEnd = _ref.paddingBlockEnd,
40
+ paddingInline = _ref.paddingInline,
41
+ paddingInlineStart = _ref.paddingInlineStart,
42
+ paddingInlineEnd = _ref.paddingInlineEnd,
43
+ height = _ref.height,
44
+ width = _ref.width,
45
+ _ref$display = _ref.display,
46
+ display = _ref$display === void 0 ? 'block' : _ref$display,
47
+ _ref$position = _ref.position,
48
+ position = _ref$position === void 0 ? 'static' : _ref$position,
49
+ style = _ref.style,
50
+ testId = _ref.testId,
51
+ htmlAttributes = _objectWithoutProperties(_ref, _excluded);
87
52
  var Component = as || 'div';
88
- var inlineStyles = Object.assign({}, style, getResponsiveVars('borderWidth', borderWidth, borderWidthMap), getResponsiveVars('display', display, displayMap), getResponsiveVars('padding', padding, paddingMap), getResponsiveVars('paddingBlock', paddingBlock, paddingMap), getResponsiveVars('paddingBlockStart', paddingBlockStart, paddingMap), getResponsiveVars('paddingBlockEnd', paddingBlockEnd, paddingMap), getResponsiveVars('paddingInline', paddingInline, paddingMap), getResponsiveVars('paddingInlineStart', paddingInlineStart, paddingMap), getResponsiveVars('paddingInlineEnd', paddingInlineEnd, paddingMap));
89
53
  var node = jsx(Component, _extends({
90
- style: inlineStyles,
54
+ style: style,
91
55
  ref: ref
92
56
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
93
57
  }, htmlAttributes, {
94
58
  className: className,
95
- css: [baseStyles].concat([getResponsiveStyles('borderWidth', borderWidth), getResponsiveStyles('display', display), getResponsiveStyles('padding', padding), getResponsiveStyles('paddingBlock', paddingBlock), getResponsiveStyles('paddingBlockStart', paddingBlockStart), getResponsiveStyles('paddingBlockEnd', paddingBlockEnd), getResponsiveStyles('paddingInline', paddingInline), getResponsiveStyles('paddingInlineStart', paddingInlineStart), getResponsiveStyles('paddingInlineEnd', paddingInlineEnd)], [backgroundColor && backgroundColorMap[backgroundColor], borderColor && borderColorMap[borderColor], color && textColorMap[color], flex && flexMap[flex], flexGrow && flexGrowMap[flexGrow], flexShrink && flexShrinkMap[flexShrink], alignSelf && alignSelfMap[alignSelf], overflow && overflowMap[overflow], overflowInline && overflowInlineMap[overflowInline], overflowBlock && overflowBlockMap[overflowBlock], position && positionMap[position], borderStyle && borderStyleMap[borderStyle], borderRadius && borderRadiusMap[borderRadius], shadow && shadowMap[shadow], layer && layerMap[layer], overflow && overflowMap[overflow], width && widthMap[width], height && heightMap[height]]),
59
+ css: [baseStyles, alignSelf && alignSelfMap[alignSelf], backgroundColor && backgroundColorMap[backgroundColor], borderColor && borderColorMap[borderColor], borderRadius && borderRadiusMap[borderRadius], borderStyle && borderStyleMap[borderStyle], borderWidth && borderWidthMap[borderWidth], color && textColorMap[color], display && displayMap[display], flex && flexMap[flex], flexGrow && flexGrowMap[flexGrow], flexShrink && flexShrinkMap[flexShrink], height && heightMap[height], layer && layerMap[layer], overflow && overflowMap[overflow], overflow && overflowMap[overflow], overflowBlock && overflowBlockMap[overflowBlock], overflowInline && overflowInlineMap[overflowInline], padding && paddingMap.padding[padding], paddingBlock && paddingMap.paddingBlock[paddingBlock], paddingBlockStart && paddingMap.paddingBlockStart[paddingBlockStart], paddingBlockEnd && paddingMap.paddingBlockEnd[paddingBlockEnd], paddingInline && paddingMap.paddingInline[paddingInline], paddingInlineStart && paddingMap.paddingInlineStart[paddingInlineStart], paddingInlineEnd && paddingMap.paddingInlineEnd[paddingInlineEnd], padding && paddingMap.padding[padding], position && positionMap[position], shadow && shadowMap[shadow], width && widthMap[width]],
96
60
  "data-testid": testId
97
61
  }), children);
98
62
  return node;
@@ -111,9 +75,15 @@ var borderStyleMap = {
111
75
  })
112
76
  };
113
77
  var borderWidthMap = {
114
- 'size.0': "var(--ds-width-0, 0)",
115
- 'size.050': "var(--ds-width-050, 1px)",
116
- 'size.100': "var(--ds-width-100, 2px)"
78
+ 'size.0': css({
79
+ borderWidth: "var(--ds-width-0, 0)"
80
+ }),
81
+ 'size.050': css({
82
+ borderWidth: "var(--ds-width-050, 1px)"
83
+ }),
84
+ 'size.100': css({
85
+ borderWidth: "var(--ds-width-100, 2px)"
86
+ })
117
87
  };
118
88
  var borderRadiusMap = {
119
89
  'radius.100': css({
@@ -171,11 +141,21 @@ var alignSelfMap = {
171
141
  })
172
142
  };
173
143
  var displayMap = {
174
- block: 'block',
175
- inline: 'inline',
176
- flex: 'flex',
177
- 'inline-flex': 'inline-flex',
178
- 'inline-block': 'inline-block'
144
+ block: css({
145
+ display: 'block'
146
+ }),
147
+ inline: css({
148
+ display: 'inline'
149
+ }),
150
+ flex: css({
151
+ display: 'flex'
152
+ }),
153
+ 'inline-flex': css({
154
+ display: 'inline-flex'
155
+ }),
156
+ 'inline-block': css({
157
+ display: 'inline-block'
158
+ })
179
159
  };
180
160
  var positionMap = {
181
161
  absolute: css({
@@ -390,28 +370,30 @@ var maxHeightMap = {
390
370
 
391
371
  /**
392
372
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
393
- * @codegen <<SignedSource::84fd352b0e6509d380a0dcf8ad023ca2>>
373
+ * @codegen <<SignedSource::6da0ceaa2c227230e3a93bc724ff8648>>
394
374
  * @codegenId spacing
395
375
  * @codegenCommand yarn codegen-styles
396
376
  * @codegenParams ["padding"]
397
377
  * @codegenDependency ../../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
398
378
  */
399
- var paddingMap = {
400
- 'space.0': "var(--ds-space-0, 0px)",
401
- 'space.025': "var(--ds-space-025, 2px)",
402
- 'space.050': "var(--ds-space-050, 4px)",
403
- 'space.075': "var(--ds-space-075, 6px)",
404
- 'space.100': "var(--ds-space-100, 8px)",
405
- 'space.150': "var(--ds-space-150, 12px)",
406
- 'space.200': "var(--ds-space-200, 16px)",
407
- 'space.250': "var(--ds-space-250, 20px)",
408
- 'space.300': "var(--ds-space-300, 24px)",
409
- 'space.400': "var(--ds-space-400, 32px)",
410
- 'space.500': "var(--ds-space-500, 40px)",
411
- 'space.600': "var(--ds-space-600, 48px)",
412
- 'space.800': "var(--ds-space-800, 64px)",
413
- 'space.1000': "var(--ds-space-1000, 80px)"
414
- };
379
+ var paddingMap = Object.fromEntries(['padding', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd'].map(function (property) {
380
+ return [property, {
381
+ 'space.0': css(_defineProperty({}, property, "var(--ds-space-0, 0px)")),
382
+ 'space.025': css(_defineProperty({}, property, "var(--ds-space-025, 2px)")),
383
+ 'space.050': css(_defineProperty({}, property, "var(--ds-space-050, 4px)")),
384
+ 'space.075': css(_defineProperty({}, property, "var(--ds-space-075, 6px)")),
385
+ 'space.100': css(_defineProperty({}, property, "var(--ds-space-100, 8px)")),
386
+ 'space.150': css(_defineProperty({}, property, "var(--ds-space-150, 12px)")),
387
+ 'space.200': css(_defineProperty({}, property, "var(--ds-space-200, 16px)")),
388
+ 'space.250': css(_defineProperty({}, property, "var(--ds-space-250, 20px)")),
389
+ 'space.300': css(_defineProperty({}, property, "var(--ds-space-300, 24px)")),
390
+ 'space.400': css(_defineProperty({}, property, "var(--ds-space-400, 32px)")),
391
+ 'space.500': css(_defineProperty({}, property, "var(--ds-space-500, 40px)")),
392
+ 'space.600': css(_defineProperty({}, property, "var(--ds-space-600, 48px)")),
393
+ 'space.800': css(_defineProperty({}, property, "var(--ds-space-800, 64px)")),
394
+ 'space.1000': css(_defineProperty({}, property, "var(--ds-space-1000, 80px)"))
395
+ }];
396
+ }));
415
397
  /**
416
398
  * @codegenEnd
417
399
  */
@@ -1,3 +1,4 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
2
  /** @jsx jsx */
2
3
  import { forwardRef, memo } from 'react';
3
4
  import { css, jsx } from '@emotion/react';
@@ -38,56 +39,30 @@ var flexGrowMap = {
38
39
 
39
40
  /**
40
41
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
41
- * @codegen <<SignedSource::41d7002b7f69aa44d0d8598e07a1afc6>>
42
+ * @codegen <<SignedSource::4eb2c996d6ce5791acad51e2b226635f>>
42
43
  * @codegenId spacing
43
44
  * @codegenCommand yarn codegen-styles
44
- * @codegenParams ["space"]
45
+ * @codegenParams ["stackSpace"]
45
46
  * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
46
47
  */
47
- var spaceMap = {
48
- '0': css({
49
- gap: "var(--ds-space-0, 0px)"
50
- }),
51
- '025': css({
52
- gap: "var(--ds-space-025, 2px)"
53
- }),
54
- '050': css({
55
- gap: "var(--ds-space-050, 4px)"
56
- }),
57
- '075': css({
58
- gap: "var(--ds-space-075, 6px)"
59
- }),
60
- '100': css({
61
- gap: "var(--ds-space-100, 8px)"
62
- }),
63
- '150': css({
64
- gap: "var(--ds-space-150, 12px)"
65
- }),
66
- '200': css({
67
- gap: "var(--ds-space-200, 16px)"
68
- }),
69
- '250': css({
70
- gap: "var(--ds-space-250, 20px)"
71
- }),
72
- '300': css({
73
- gap: "var(--ds-space-300, 24px)"
74
- }),
75
- '400': css({
76
- gap: "var(--ds-space-400, 32px)"
77
- }),
78
- '500': css({
79
- gap: "var(--ds-space-500, 40px)"
80
- }),
81
- '600': css({
82
- gap: "var(--ds-space-600, 48px)"
83
- }),
84
- '800': css({
85
- gap: "var(--ds-space-800, 64px)"
86
- }),
87
- '1000': css({
88
- gap: "var(--ds-space-1000, 80px)"
89
- })
90
- };
48
+ var stackSpaceMap = Object.fromEntries(['gap'].map(function (property) {
49
+ return [property, {
50
+ '0': css(_defineProperty({}, property, "var(--ds-space-0, 0px)")),
51
+ '025': css(_defineProperty({}, property, "var(--ds-space-025, 2px)")),
52
+ '050': css(_defineProperty({}, property, "var(--ds-space-050, 4px)")),
53
+ '075': css(_defineProperty({}, property, "var(--ds-space-075, 6px)")),
54
+ '100': css(_defineProperty({}, property, "var(--ds-space-100, 8px)")),
55
+ '150': css(_defineProperty({}, property, "var(--ds-space-150, 12px)")),
56
+ '200': css(_defineProperty({}, property, "var(--ds-space-200, 16px)")),
57
+ '250': css(_defineProperty({}, property, "var(--ds-space-250, 20px)")),
58
+ '300': css(_defineProperty({}, property, "var(--ds-space-300, 24px)")),
59
+ '400': css(_defineProperty({}, property, "var(--ds-space-400, 32px)")),
60
+ '500': css(_defineProperty({}, property, "var(--ds-space-500, 40px)")),
61
+ '600': css(_defineProperty({}, property, "var(--ds-space-600, 48px)")),
62
+ '800': css(_defineProperty({}, property, "var(--ds-space-800, 64px)")),
63
+ '1000': css(_defineProperty({}, property, "var(--ds-space-1000, 80px)"))
64
+ }];
65
+ }));
91
66
  /**
92
67
  * @codegenEnd
93
68
  */
@@ -124,7 +99,7 @@ var Stack = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref) {
124
99
  var Component = as || 'div';
125
100
  var justifyContent = spread || alignBlock;
126
101
  return jsx(Component, {
127
- css: [baseStyles, space && spaceMap[space], alignItems && alignItemsMap[alignItems], grow && flexGrowMap[grow], justifyContent && justifyContentMap[justifyContent]],
102
+ css: [baseStyles, space && stackSpaceMap.gap[space], alignItems && alignItemsMap[alignItems], grow && flexGrowMap[grow], justifyContent && justifyContentMap[justifyContent]],
128
103
  "data-testid": testId,
129
104
  ref: ref
130
105
  }, children);
@@ -1,5 +1,6 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import _typeof from "@babel/runtime/helpers/typeof";
3
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
3
4
  import { css as cssEmotion } from '@emotion/react';
4
5
  import { backgroundColorMap, borderColorMap, borderRadiusMap, borderWidthMap, dimensionMap, paddingMap, textColorMap } from './style-maps';
5
6
  var tokensMap = {
@@ -74,7 +75,7 @@ export var transformStyles = function transformStyles(styleObj) {
74
75
  });
75
76
  return styleObj;
76
77
  };
77
- export var xcss = function xcss(style) {
78
+ var baseXcss = function baseXcss(style) {
78
79
  var transformedStyles = transformStyles(style);
79
80
  return {
80
81
  symbol: uniqueSymbol,
@@ -97,4 +98,14 @@ export var parseXcss = function parseXcss(args) {
97
98
  throw new Error('Styles generated from unsafe source, use the `xcss` export from `@atlaskit/primitives`.');
98
99
  }
99
100
  return styles;
100
- };
101
+ };
102
+ // unused private functions only so we can extract the return type from a generic function
103
+ var boxWrapper = function boxWrapper(style) {
104
+ return xcss(style);
105
+ };
106
+ var inlineWrapper = function inlineWrapper(style) {
107
+ return xcss(style);
108
+ };
109
+ export function xcss(style) {
110
+ return baseXcss(style);
111
+ }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/primitives",
3
- "version": "0.4.2",
3
+ "version": "0.6.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,9 +1,8 @@
1
1
  /** @jsx jsx */
2
2
  import { ElementType, FC, ReactElement } from 'react';
3
3
  import { BaseBoxProps } from './internal/base-box.partial';
4
- import type { BoxResponsiveProp } from './internal/types';
5
4
  import type { PublicBoxPropsBase } from './types';
6
- export declare type BoxProps<T extends ElementType = 'div'> = Omit<BaseBoxProps<T>, 'className' | BoxResponsiveProp> & PublicBoxPropsBase;
5
+ export declare type BoxProps<T extends ElementType = 'div'> = Omit<BaseBoxProps<T>, 'className'> & PublicBoxPropsBase;
7
6
  declare type BoxComponent<T extends ElementType = 'div'> = (<T extends ElementType = 'div'>(props: BoxProps<T>) => ReactElement | null) & FC<BoxProps<T>>;
8
7
  /**
9
8
  * __Box__
@@ -28,12 +28,12 @@ export interface InlineProps<T extends ElementType = 'div'> {
28
28
  /**
29
29
  * Represents the space between each child.
30
30
  */
31
- space?: Space;
31
+ space?: Gap;
32
32
  /**
33
33
  * Represents the space between rows when content wraps.
34
34
  * Used to override the `space` value in between rows.
35
35
  */
36
- rowSpace?: RowSpace;
36
+ rowSpace?: RowGap;
37
37
  /**
38
38
  * Renders a separator string between each child.
39
39
  */
@@ -43,9 +43,12 @@ export interface InlineProps<T extends ElementType = 'div'> {
43
43
  */
44
44
  testId?: string;
45
45
  /**
46
- * Elements to be rendered inside the Stack.
46
+ * Elements to be rendered inside the Inline.
47
47
  */
48
48
  children: ReactNode;
49
+ /**
50
+ * Forwarded ref element
51
+ */
49
52
  ref?: ComponentPropsWithRef<T>['ref'];
50
53
  }
51
54
  export declare type AlignInline = 'start' | 'center' | 'end';
@@ -54,46 +57,32 @@ export declare type Spread = 'space-between';
54
57
  export declare type Grow = 'hug' | 'fill';
55
58
  /**
56
59
  * THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
57
- * @codegen <<SignedSource::44cacef18982a4b0e43102900c42bdcf>>
60
+ * @codegen <<SignedSource::fb7587b114753ed19425e2b07b5deb0d>>
58
61
  * @codegenId spacing
59
62
  * @codegenCommand yarn codegen-styles
60
- * @codegenParams ["space", "rowSpace"]
63
+ * @codegenParams ["inlineSpace"]
61
64
  * @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
62
65
  */
63
- declare const spaceMap: {
64
- readonly '0': import("@emotion/react").SerializedStyles;
65
- readonly '025': import("@emotion/react").SerializedStyles;
66
- readonly '050': import("@emotion/react").SerializedStyles;
67
- readonly '075': import("@emotion/react").SerializedStyles;
68
- readonly '100': import("@emotion/react").SerializedStyles;
69
- readonly '150': import("@emotion/react").SerializedStyles;
70
- readonly '200': import("@emotion/react").SerializedStyles;
71
- readonly '250': import("@emotion/react").SerializedStyles;
72
- readonly '300': import("@emotion/react").SerializedStyles;
73
- readonly '400': import("@emotion/react").SerializedStyles;
74
- readonly '500': import("@emotion/react").SerializedStyles;
75
- readonly '600': import("@emotion/react").SerializedStyles;
76
- readonly '800': import("@emotion/react").SerializedStyles;
77
- readonly '1000': import("@emotion/react").SerializedStyles;
78
- };
79
- export declare type Space = keyof typeof spaceMap;
80
- declare const rowSpaceMap: {
81
- readonly '0': import("@emotion/react").SerializedStyles;
82
- readonly '025': import("@emotion/react").SerializedStyles;
83
- readonly '050': import("@emotion/react").SerializedStyles;
84
- readonly '075': import("@emotion/react").SerializedStyles;
85
- readonly '100': import("@emotion/react").SerializedStyles;
86
- readonly '150': import("@emotion/react").SerializedStyles;
87
- readonly '200': import("@emotion/react").SerializedStyles;
88
- readonly '250': import("@emotion/react").SerializedStyles;
89
- readonly '300': import("@emotion/react").SerializedStyles;
90
- readonly '400': import("@emotion/react").SerializedStyles;
91
- readonly '500': import("@emotion/react").SerializedStyles;
92
- readonly '600': import("@emotion/react").SerializedStyles;
93
- readonly '800': import("@emotion/react").SerializedStyles;
94
- readonly '1000': import("@emotion/react").SerializedStyles;
66
+ declare const inlineSpaceMap: {
67
+ [k: string]: {
68
+ readonly '0': import("@emotion/react").SerializedStyles;
69
+ readonly '025': import("@emotion/react").SerializedStyles;
70
+ readonly '050': import("@emotion/react").SerializedStyles;
71
+ readonly '075': import("@emotion/react").SerializedStyles;
72
+ readonly '100': import("@emotion/react").SerializedStyles;
73
+ readonly '150': import("@emotion/react").SerializedStyles;
74
+ readonly '200': import("@emotion/react").SerializedStyles;
75
+ readonly '250': import("@emotion/react").SerializedStyles;
76
+ readonly '300': import("@emotion/react").SerializedStyles;
77
+ readonly '400': import("@emotion/react").SerializedStyles;
78
+ readonly '500': import("@emotion/react").SerializedStyles;
79
+ readonly '600': import("@emotion/react").SerializedStyles;
80
+ readonly '800': import("@emotion/react").SerializedStyles;
81
+ readonly '1000': import("@emotion/react").SerializedStyles;
82
+ };
95
83
  };
96
- export declare type RowSpace = keyof typeof rowSpaceMap;
84
+ export declare type Gap = keyof typeof inlineSpaceMap.gap;
85
+ export declare type RowGap = keyof typeof inlineSpaceMap.rowGap;
97
86
  /**
98
87
  * __Inline__
99
88
  *
@@ -109,5 +98,5 @@ export declare type RowSpace = keyof typeof rowSpaceMap;
109
98
  * ```
110
99
  *
111
100
  */
112
- declare const Inline: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<InlineProps<ElementType<any>>, "space" | "separator" | "as" | "children" | "testId" | "alignInline" | "alignBlock" | "shouldWrap" | "spread" | "grow" | "rowSpace"> & import("react").RefAttributes<any>>>;
101
+ declare const Inline: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Pick<InlineProps<ElementType<any>>, "as" | "children" | "testId" | "alignInline" | "alignBlock" | "shouldWrap" | "spread" | "grow" | "space" | "rowSpace" | "separator"> & import("react").RefAttributes<any>>>;
113
102
  export default Inline;