@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.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/components/inline.partial.js +23 -91
- package/dist/cjs/components/internal/base-box.partial.js +81 -99
- package/dist/cjs/components/stack.partial.js +23 -47
- package/dist/cjs/internal/xcss.js +16 -4
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/inline.partial.js +19 -63
- package/dist/es2019/components/internal/base-box.partial.js +72 -68
- package/dist/es2019/components/stack.partial.js +19 -19
- package/dist/es2019/internal/xcss.js +9 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/inline.partial.js +22 -91
- package/dist/esm/components/internal/base-box.partial.js +81 -99
- package/dist/esm/components/stack.partial.js +22 -47
- package/dist/esm/internal/xcss.js +13 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/components/box.d.ts +1 -2
- package/dist/types/components/inline.partial.d.ts +28 -39
- package/dist/types/components/internal/base-box.partial.d.ts +42 -43
- package/dist/types/components/stack.partial.d.ts +25 -20
- package/dist/types/components/types.d.ts +2 -48
- package/dist/types/internal/xcss.d.ts +37 -8
- package/package.json +2 -3
- package/report.api.md +160 -144
- package/scripts/spacing-codegen-template.tsx +30 -30
- package/tmp/api-report-tmp.d.ts +124 -130
- package/dist/cjs/components/internal/types.js +0 -8
- package/dist/cjs/components/internal/utils.js +0 -16
- package/dist/es2019/components/internal/types.js +0 -1
- package/dist/es2019/components/internal/utils.js +0 -2
- package/dist/esm/components/internal/types.js +0 -1
- package/dist/esm/components/internal/utils.js +0 -7
- package/dist/types/components/internal/types.d.ts +0 -8
- 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 (
|
|
53
|
-
var as =
|
|
54
|
-
className =
|
|
55
|
-
children =
|
|
56
|
-
color =
|
|
57
|
-
backgroundColor =
|
|
58
|
-
shadow =
|
|
59
|
-
borderStyle =
|
|
60
|
-
borderWidth =
|
|
61
|
-
borderRadius =
|
|
62
|
-
borderColor =
|
|
63
|
-
layer =
|
|
64
|
-
flex =
|
|
65
|
-
flexGrow =
|
|
66
|
-
flexShrink =
|
|
67
|
-
alignSelf =
|
|
68
|
-
overflow =
|
|
69
|
-
overflowInline =
|
|
70
|
-
overflowBlock =
|
|
71
|
-
padding =
|
|
72
|
-
paddingBlock =
|
|
73
|
-
paddingBlockStart =
|
|
74
|
-
paddingBlockEnd =
|
|
75
|
-
paddingInline =
|
|
76
|
-
paddingInlineStart =
|
|
77
|
-
paddingInlineEnd =
|
|
78
|
-
height =
|
|
79
|
-
width =
|
|
80
|
-
|
|
81
|
-
display =
|
|
82
|
-
|
|
83
|
-
position =
|
|
84
|
-
style =
|
|
85
|
-
testId =
|
|
86
|
-
htmlAttributes = _objectWithoutProperties(
|
|
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:
|
|
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
|
|
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':
|
|
115
|
-
|
|
116
|
-
|
|
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:
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
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::
|
|
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
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
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::
|
|
42
|
+
* @codegen <<SignedSource::4eb2c996d6ce5791acad51e2b226635f>>
|
|
42
43
|
* @codegenId spacing
|
|
43
44
|
* @codegenCommand yarn codegen-styles
|
|
44
|
-
* @codegenParams ["
|
|
45
|
+
* @codegenParams ["stackSpace"]
|
|
45
46
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
46
47
|
*/
|
|
47
|
-
var
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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 &&
|
|
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
|
-
|
|
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
|
+
}
|
package/dist/esm/version.json
CHANGED
|
@@ -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'
|
|
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?:
|
|
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?:
|
|
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
|
|
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::
|
|
60
|
+
* @codegen <<SignedSource::fb7587b114753ed19425e2b07b5deb0d>>
|
|
58
61
|
* @codegenId spacing
|
|
59
62
|
* @codegenCommand yarn codegen-styles
|
|
60
|
-
* @codegenParams ["
|
|
63
|
+
* @codegenParams ["inlineSpace"]
|
|
61
64
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
62
65
|
*/
|
|
63
|
-
declare const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
|
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>>, "
|
|
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;
|