@atlaskit/primitives 0.5.0 → 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 +6 -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/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/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/version.json +1 -1
- package/dist/types/components/box.d.ts +1 -2
- package/dist/types/components/inline.partial.d.ts +23 -37
- package/dist/types/components/internal/base-box.partial.d.ts +42 -43
- package/dist/types/components/stack.partial.d.ts +21 -19
- package/dist/types/components/types.d.ts +0 -46
- package/package.json +2 -3
- package/report.api.md +91 -136
- package/scripts/spacing-codegen-template.tsx +30 -30
- package/tmp/api-report-tmp.d.ts +91 -124
- 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);
|
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
|
*/
|
|
@@ -57,46 +57,32 @@ export declare type Spread = 'space-between';
|
|
|
57
57
|
export declare type Grow = 'hug' | 'fill';
|
|
58
58
|
/**
|
|
59
59
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
60
|
-
* @codegen <<SignedSource::
|
|
60
|
+
* @codegen <<SignedSource::fb7587b114753ed19425e2b07b5deb0d>>
|
|
61
61
|
* @codegenId spacing
|
|
62
62
|
* @codegenCommand yarn codegen-styles
|
|
63
|
-
* @codegenParams ["
|
|
63
|
+
* @codegenParams ["inlineSpace"]
|
|
64
64
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
65
65
|
*/
|
|
66
|
-
declare const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
+
};
|
|
81
83
|
};
|
|
82
|
-
export declare type
|
|
83
|
-
declare
|
|
84
|
-
readonly '0': import("@emotion/react").SerializedStyles;
|
|
85
|
-
readonly '025': import("@emotion/react").SerializedStyles;
|
|
86
|
-
readonly '050': import("@emotion/react").SerializedStyles;
|
|
87
|
-
readonly '075': import("@emotion/react").SerializedStyles;
|
|
88
|
-
readonly '100': import("@emotion/react").SerializedStyles;
|
|
89
|
-
readonly '150': import("@emotion/react").SerializedStyles;
|
|
90
|
-
readonly '200': import("@emotion/react").SerializedStyles;
|
|
91
|
-
readonly '250': import("@emotion/react").SerializedStyles;
|
|
92
|
-
readonly '300': import("@emotion/react").SerializedStyles;
|
|
93
|
-
readonly '400': import("@emotion/react").SerializedStyles;
|
|
94
|
-
readonly '500': import("@emotion/react").SerializedStyles;
|
|
95
|
-
readonly '600': import("@emotion/react").SerializedStyles;
|
|
96
|
-
readonly '800': import("@emotion/react").SerializedStyles;
|
|
97
|
-
readonly '1000': import("@emotion/react").SerializedStyles;
|
|
98
|
-
};
|
|
99
|
-
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;
|
|
100
86
|
/**
|
|
101
87
|
* __Inline__
|
|
102
88
|
*
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { ComponentPropsWithoutRef, ComponentPropsWithRef, ElementType, FC, ReactElement, ReactNode } from 'react';
|
|
3
3
|
import { Layer } from '../../constants';
|
|
4
|
-
import { ResponsiveObject } from '../../helpers/responsive';
|
|
5
4
|
import type { BasePrimitiveProps } from '../types';
|
|
6
5
|
export declare type BaseBoxProps<T extends ElementType = 'div'> = Omit<ComponentPropsWithoutRef<T>, 'as' | 'className'> & BasePrimitiveProps & BaseBoxPropsFoundation<T>;
|
|
7
6
|
declare type BaseBoxPropsFoundation<T extends ElementType> = {
|
|
@@ -32,9 +31,7 @@ declare type BaseBoxPropsFoundation<T extends ElementType> = {
|
|
|
32
31
|
*/
|
|
33
32
|
color?: TextColor;
|
|
34
33
|
/**
|
|
35
|
-
*
|
|
36
|
-
* @deprecated Use `xcss` to achieve this functionality.
|
|
37
|
-
* Token representing background color with a fallback.
|
|
34
|
+
* Token representing background color with a built-in fallback value.
|
|
38
35
|
*/
|
|
39
36
|
backgroundColor?: BackgroundColor;
|
|
40
37
|
/**
|
|
@@ -54,7 +51,7 @@ declare type BaseBoxPropsFoundation<T extends ElementType> = {
|
|
|
54
51
|
* @deprecated Use `xcss` to achieve this functionality.
|
|
55
52
|
* Defines border width.
|
|
56
53
|
*/
|
|
57
|
-
borderWidth?: BorderWidth
|
|
54
|
+
borderWidth?: BorderWidth;
|
|
58
55
|
/**
|
|
59
56
|
* @private
|
|
60
57
|
* @deprecated Use `xcss` to achieve this functionality.
|
|
@@ -125,37 +122,37 @@ declare type BaseBoxPropsFoundation<T extends ElementType> = {
|
|
|
125
122
|
* @see paddingBlock
|
|
126
123
|
* @see paddingInline
|
|
127
124
|
*/
|
|
128
|
-
padding?: Padding
|
|
125
|
+
padding?: Padding;
|
|
129
126
|
/**
|
|
130
127
|
* Tokens representing CSS shorthand `paddingBlock`.
|
|
131
128
|
*
|
|
132
129
|
* @see paddingBlockStart
|
|
133
130
|
* @see paddingBlockEnd
|
|
134
131
|
*/
|
|
135
|
-
paddingBlock?: PaddingBlock
|
|
132
|
+
paddingBlock?: PaddingBlock;
|
|
136
133
|
/**
|
|
137
134
|
* Tokens representing CSS `paddingBlockStart`.
|
|
138
135
|
*/
|
|
139
|
-
paddingBlockStart?: PaddingBlockStart
|
|
136
|
+
paddingBlockStart?: PaddingBlockStart;
|
|
140
137
|
/**
|
|
141
138
|
* Tokens representing CSS `paddingBlockEnd`.
|
|
142
139
|
*/
|
|
143
|
-
paddingBlockEnd?: PaddingBlockEnd
|
|
140
|
+
paddingBlockEnd?: PaddingBlockEnd;
|
|
144
141
|
/**
|
|
145
142
|
* Tokens representing CSS shorthand `paddingInline`.
|
|
146
143
|
*
|
|
147
144
|
* @see paddingInlineStart
|
|
148
145
|
* @see paddingInlineEnd
|
|
149
146
|
*/
|
|
150
|
-
paddingInline?: PaddingInline
|
|
147
|
+
paddingInline?: PaddingInline;
|
|
151
148
|
/**
|
|
152
149
|
* Tokens representing CSS `paddingInlineStart`.
|
|
153
150
|
*/
|
|
154
|
-
paddingInlineStart?: PaddingInlineStart
|
|
151
|
+
paddingInlineStart?: PaddingInlineStart;
|
|
155
152
|
/**
|
|
156
153
|
* Tokens representing CSS `paddingInlineEnd`.
|
|
157
154
|
*/
|
|
158
|
-
paddingInlineEnd?: PaddingInlineEnd
|
|
155
|
+
paddingInlineEnd?: PaddingInlineEnd;
|
|
159
156
|
/**
|
|
160
157
|
* @private
|
|
161
158
|
* @deprecated Use `xcss` to achieve this functionality.
|
|
@@ -173,7 +170,7 @@ declare type BaseBoxPropsFoundation<T extends ElementType> = {
|
|
|
173
170
|
* @deprecated Use `xcss` to achieve this functionality.
|
|
174
171
|
* Defines display type and layout. Defaults to `block`.
|
|
175
172
|
*/
|
|
176
|
-
display?: Display
|
|
173
|
+
display?: Display;
|
|
177
174
|
/**
|
|
178
175
|
* @private
|
|
179
176
|
* @deprecated Use `xcss` to achieve this functionality.
|
|
@@ -203,9 +200,9 @@ declare const borderStyleMap: {
|
|
|
203
200
|
};
|
|
204
201
|
export declare type BorderWidth = keyof typeof borderWidthMap;
|
|
205
202
|
declare const borderWidthMap: {
|
|
206
|
-
readonly 'size.0': "
|
|
207
|
-
readonly 'size.050': "
|
|
208
|
-
readonly 'size.100': "
|
|
203
|
+
readonly 'size.0': import("@emotion/react").SerializedStyles;
|
|
204
|
+
readonly 'size.050': import("@emotion/react").SerializedStyles;
|
|
205
|
+
readonly 'size.100': import("@emotion/react").SerializedStyles;
|
|
209
206
|
};
|
|
210
207
|
declare type BorderRadius = keyof typeof borderRadiusMap;
|
|
211
208
|
declare const borderRadiusMap: {
|
|
@@ -239,11 +236,11 @@ declare const alignSelfMap: {
|
|
|
239
236
|
};
|
|
240
237
|
export declare type Display = keyof typeof displayMap;
|
|
241
238
|
declare const displayMap: {
|
|
242
|
-
readonly block: "
|
|
243
|
-
readonly inline: "
|
|
244
|
-
readonly flex: "
|
|
245
|
-
readonly 'inline-flex': "
|
|
246
|
-
readonly 'inline-block': "
|
|
239
|
+
readonly block: import("@emotion/react").SerializedStyles;
|
|
240
|
+
readonly inline: import("@emotion/react").SerializedStyles;
|
|
241
|
+
readonly flex: import("@emotion/react").SerializedStyles;
|
|
242
|
+
readonly 'inline-flex': import("@emotion/react").SerializedStyles;
|
|
243
|
+
readonly 'inline-block': import("@emotion/react").SerializedStyles;
|
|
247
244
|
};
|
|
248
245
|
declare type Position = keyof typeof positionMap;
|
|
249
246
|
declare const positionMap: {
|
|
@@ -345,35 +342,37 @@ export declare type MaxHeight = keyof typeof maxHeightMap;
|
|
|
345
342
|
*/
|
|
346
343
|
/**
|
|
347
344
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
348
|
-
* @codegen <<SignedSource::
|
|
345
|
+
* @codegen <<SignedSource::6da0ceaa2c227230e3a93bc724ff8648>>
|
|
349
346
|
* @codegenId spacing
|
|
350
347
|
* @codegenCommand yarn codegen-styles
|
|
351
348
|
* @codegenParams ["padding"]
|
|
352
349
|
* @codegenDependency ../../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
353
350
|
*/
|
|
354
351
|
declare const paddingMap: {
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
352
|
+
[k: string]: {
|
|
353
|
+
readonly 'space.0': import("@emotion/react").SerializedStyles;
|
|
354
|
+
readonly 'space.025': import("@emotion/react").SerializedStyles;
|
|
355
|
+
readonly 'space.050': import("@emotion/react").SerializedStyles;
|
|
356
|
+
readonly 'space.075': import("@emotion/react").SerializedStyles;
|
|
357
|
+
readonly 'space.100': import("@emotion/react").SerializedStyles;
|
|
358
|
+
readonly 'space.150': import("@emotion/react").SerializedStyles;
|
|
359
|
+
readonly 'space.200': import("@emotion/react").SerializedStyles;
|
|
360
|
+
readonly 'space.250': import("@emotion/react").SerializedStyles;
|
|
361
|
+
readonly 'space.300': import("@emotion/react").SerializedStyles;
|
|
362
|
+
readonly 'space.400': import("@emotion/react").SerializedStyles;
|
|
363
|
+
readonly 'space.500': import("@emotion/react").SerializedStyles;
|
|
364
|
+
readonly 'space.600': import("@emotion/react").SerializedStyles;
|
|
365
|
+
readonly 'space.800': import("@emotion/react").SerializedStyles;
|
|
366
|
+
readonly 'space.1000': import("@emotion/react").SerializedStyles;
|
|
367
|
+
};
|
|
369
368
|
};
|
|
370
|
-
export declare type Padding = keyof typeof paddingMap;
|
|
371
|
-
export declare type PaddingBlock = keyof typeof paddingMap;
|
|
372
|
-
export declare type PaddingBlockStart = keyof typeof paddingMap;
|
|
373
|
-
export declare type PaddingBlockEnd = keyof typeof paddingMap;
|
|
374
|
-
export declare type PaddingInline = keyof typeof paddingMap;
|
|
375
|
-
export declare type PaddingInlineStart = keyof typeof paddingMap;
|
|
376
|
-
export declare type PaddingInlineEnd = keyof typeof paddingMap;
|
|
369
|
+
export declare type Padding = keyof typeof paddingMap.padding;
|
|
370
|
+
export declare type PaddingBlock = keyof typeof paddingMap.paddingBlock;
|
|
371
|
+
export declare type PaddingBlockStart = keyof typeof paddingMap.paddingBlockStart;
|
|
372
|
+
export declare type PaddingBlockEnd = keyof typeof paddingMap.paddingBlockEnd;
|
|
373
|
+
export declare type PaddingInline = keyof typeof paddingMap.paddingInline;
|
|
374
|
+
export declare type PaddingInlineStart = keyof typeof paddingMap.paddingInlineStart;
|
|
375
|
+
export declare type PaddingInlineEnd = keyof typeof paddingMap.paddingInlineEnd;
|
|
377
376
|
/**
|
|
378
377
|
* @codegenEnd
|
|
379
378
|
*/
|