@atlaskit/primitives 0.2.0 → 0.2.2
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/box.js +14 -2
- package/dist/cjs/components/inline.partial.js +47 -23
- package/dist/cjs/components/internal/base-box.partial.js +99 -78
- package/dist/cjs/components/internal/types.js +8 -0
- package/dist/cjs/components/internal/utils.js +16 -0
- package/dist/cjs/components/stack.partial.js +46 -22
- package/dist/cjs/constants.js +13 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/box.js +12 -1
- package/dist/es2019/components/inline.partial.js +19 -19
- package/dist/es2019/components/internal/base-box.partial.js +75 -70
- package/dist/es2019/components/internal/types.js +1 -0
- package/dist/es2019/components/internal/utils.js +2 -0
- package/dist/es2019/components/stack.partial.js +18 -18
- package/dist/es2019/constants.js +3 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/box.js +12 -1
- package/dist/esm/components/inline.partial.js +47 -22
- package/dist/esm/components/internal/base-box.partial.js +100 -79
- package/dist/esm/components/internal/types.js +1 -0
- package/dist/esm/components/internal/utils.js +7 -0
- package/dist/esm/components/stack.partial.js +46 -21
- package/dist/esm/constants.js +3 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/components/box.d.ts +13 -6
- package/dist/types/components/inline.partial.d.ts +16 -18
- package/dist/types/components/internal/base-box.partial.d.ts +50 -51
- package/dist/types/components/internal/types.d.ts +6 -0
- package/dist/types/components/internal/utils.d.ts +3 -0
- package/dist/types/components/stack.partial.d.ts +16 -18
- package/dist/types/components/types.d.ts +49 -0
- package/dist/types/constants.d.ts +2 -0
- package/dist/types/index.d.ts +1 -1
- package/package.json +4 -2
- package/report.api.md +112 -79
- package/scripts/spacing-codegen-template.tsx +29 -24
- package/scripts/utils.tsx +4 -1
- package/tmp/api-report-tmp.d.ts +89 -78
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/primitives
|
|
2
2
|
|
|
3
|
+
## 0.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`bf90d854748`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bf90d854748) - Internal representation of Box primitive now supports some responsive styles
|
|
8
|
+
|
|
9
|
+
## 0.2.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`5b886634089`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5b886634089) - [ux] Change Box to be the default export from `@atlaskit/primitives/box`. Fix the negative value of `margin-inline` in Inline `separator` not being applied properly.
|
|
14
|
+
|
|
3
15
|
## 0.2.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.default = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -14,6 +14,17 @@ var _excluded = ["as", "children", "color", "backgroundColor", "shadow", "border
|
|
|
14
14
|
_excluded2 = ["style", "className"];
|
|
15
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
+
// TODO: Fill in the component {description} and ensure links point to the correct {packageName} location.
|
|
18
|
+
// Remove links that the component does not have (such as usage). If there are no links remove them all.
|
|
19
|
+
/**
|
|
20
|
+
* __Box__
|
|
21
|
+
*
|
|
22
|
+
* A box {description}.
|
|
23
|
+
*
|
|
24
|
+
* - [Examples](https://atlassian.design/components/{packageName}/examples)
|
|
25
|
+
* - [Code](https://atlassian.design/components/{packageName}/code)
|
|
26
|
+
* - [Usage](https://atlassian.design/components/{packageName}/usage)
|
|
27
|
+
*/
|
|
17
28
|
var Box = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
18
29
|
var as = _ref.as,
|
|
19
30
|
children = _ref.children,
|
|
@@ -84,4 +95,5 @@ var Box = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
84
95
|
ref: ref
|
|
85
96
|
}, safeHtmlAttributes), children);
|
|
86
97
|
});
|
|
87
|
-
|
|
98
|
+
var _default = Box;
|
|
99
|
+
exports.default = _default;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
7
|
var _react = require("react");
|
|
10
8
|
var _react2 = require("@emotion/react");
|
|
11
9
|
/** @jsx jsx */
|
|
@@ -52,30 +50,56 @@ var flexWrapStyles = (0, _react2.css)({
|
|
|
52
50
|
|
|
53
51
|
/**
|
|
54
52
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
55
|
-
* @codegen <<SignedSource::
|
|
53
|
+
* @codegen <<SignedSource::41d7002b7f69aa44d0d8598e07a1afc6>>
|
|
56
54
|
* @codegenId spacing
|
|
57
55
|
* @codegenCommand yarn codegen-styles
|
|
58
56
|
* @codegenParams ["space"]
|
|
59
57
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
60
58
|
*/
|
|
61
|
-
var spaceMap =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
59
|
+
var spaceMap = {
|
|
60
|
+
'0': (0, _react2.css)({
|
|
61
|
+
gap: "var(--ds-space-0, 0px)"
|
|
62
|
+
}),
|
|
63
|
+
'025': (0, _react2.css)({
|
|
64
|
+
gap: "var(--ds-space-025, 2px)"
|
|
65
|
+
}),
|
|
66
|
+
'050': (0, _react2.css)({
|
|
67
|
+
gap: "var(--ds-space-050, 4px)"
|
|
68
|
+
}),
|
|
69
|
+
'075': (0, _react2.css)({
|
|
70
|
+
gap: "var(--ds-space-075, 6px)"
|
|
71
|
+
}),
|
|
72
|
+
'100': (0, _react2.css)({
|
|
73
|
+
gap: "var(--ds-space-100, 8px)"
|
|
74
|
+
}),
|
|
75
|
+
'150': (0, _react2.css)({
|
|
76
|
+
gap: "var(--ds-space-150, 12px)"
|
|
77
|
+
}),
|
|
78
|
+
'200': (0, _react2.css)({
|
|
79
|
+
gap: "var(--ds-space-200, 16px)"
|
|
80
|
+
}),
|
|
81
|
+
'250': (0, _react2.css)({
|
|
82
|
+
gap: "var(--ds-space-250, 20px)"
|
|
83
|
+
}),
|
|
84
|
+
'300': (0, _react2.css)({
|
|
85
|
+
gap: "var(--ds-space-300, 24px)"
|
|
86
|
+
}),
|
|
87
|
+
'400': (0, _react2.css)({
|
|
88
|
+
gap: "var(--ds-space-400, 32px)"
|
|
89
|
+
}),
|
|
90
|
+
'500': (0, _react2.css)({
|
|
91
|
+
gap: "var(--ds-space-500, 40px)"
|
|
92
|
+
}),
|
|
93
|
+
'600': (0, _react2.css)({
|
|
94
|
+
gap: "var(--ds-space-600, 48px)"
|
|
95
|
+
}),
|
|
96
|
+
'800': (0, _react2.css)({
|
|
97
|
+
gap: "var(--ds-space-800, 64px)"
|
|
98
|
+
}),
|
|
99
|
+
'1000': (0, _react2.css)({
|
|
100
|
+
gap: "var(--ds-space-1000, 80px)"
|
|
101
|
+
})
|
|
102
|
+
};
|
|
79
103
|
/**
|
|
80
104
|
* @codegenEnd
|
|
81
105
|
*/
|
|
@@ -88,7 +112,7 @@ var baseStyles = (0, _react2.css)({
|
|
|
88
112
|
var separatorStyles = (0, _react2.css)({
|
|
89
113
|
color: "var(--ds-text-subtle, #42526E)",
|
|
90
114
|
marginBlock: "var(--ds-space-0, 0px)",
|
|
91
|
-
marginInline: "-".concat("var(--ds-space-025, 2px)"),
|
|
115
|
+
marginInline: "calc(-1 * ".concat("var(--ds-space-025, 2px)", ")"),
|
|
92
116
|
pointerEvents: 'none',
|
|
93
117
|
userSelect: 'none'
|
|
94
118
|
});
|
|
@@ -133,7 +157,7 @@ var Inline = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
133
157
|
}) : rawChildren;
|
|
134
158
|
var justifyContent = spread || alignInline;
|
|
135
159
|
return (0, _react2.jsx)("div", {
|
|
136
|
-
css: [baseStyles, space && spaceMap
|
|
160
|
+
css: [baseStyles, space && spaceMap[space], justifyContent && justifyContentMap[justifyContent], grow && flexGrowMap[grow], alignItems && alignItemsMap[alignItems], shouldWrap && flexWrapStyles],
|
|
137
161
|
"data-testid": testId,
|
|
138
162
|
ref: ref
|
|
139
163
|
}, children);
|
|
@@ -5,13 +5,48 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.BaseBox = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _react = require("react");
|
|
12
12
|
var _react2 = require("@emotion/react");
|
|
13
|
+
var _tinyInvariant = _interopRequireDefault(require("tiny-invariant"));
|
|
13
14
|
var _constants = require("../../constants");
|
|
15
|
+
var _types = require("./types");
|
|
16
|
+
var _utils = require("./utils");
|
|
14
17
|
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", "UNSAFE_style", "testId"];
|
|
18
|
+
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; }
|
|
19
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
20
|
+
var responsiveRules = _types.BOX_RESPONSIVE_PROPS.reduce(function (mapping, cssProperty) {
|
|
21
|
+
return Object.assign(mapping, (0, _defineProperty2.default)({}, cssProperty, _constants.BREAKPOINTS_LIST.reduce(function (configs, breakpoint) {
|
|
22
|
+
var config = _constants.BREAKPOINTS_CONFIG[breakpoint];
|
|
23
|
+
return Object.assign(configs, (0, _defineProperty2.default)({}, breakpoint, (0, _react2.css)((0, _defineProperty2.default)({}, "@media (min-width: ".concat(config.min, "px)"), (0, _defineProperty2.default)({}, cssProperty, "var(--ds-box-responsive-".concat(cssProperty, "-").concat(breakpoint, ")"))))));
|
|
24
|
+
}, {
|
|
25
|
+
static: (0, _react2.css)((0, _defineProperty2.default)({}, cssProperty, "var(--ds-box-static-".concat(cssProperty, ")")))
|
|
26
|
+
})));
|
|
27
|
+
}, {});
|
|
28
|
+
var getResponsiveVars = function getResponsiveVars(propertyName, propertyValue, mapping) {
|
|
29
|
+
if ((0, _utils.isResponsiveStyleProp)(propertyValue)) {
|
|
30
|
+
return Object.keys(propertyValue).reduce(function (vars, breakpoint) {
|
|
31
|
+
return _objectSpread(_objectSpread({}, vars), {}, (0, _defineProperty2.default)({}, "--ds-box-responsive-".concat(propertyName, "-").concat(breakpoint), mapping[propertyValue[breakpoint]]));
|
|
32
|
+
}, {});
|
|
33
|
+
} else if ((0, _utils.isStaticStyleProp)(propertyValue)) {
|
|
34
|
+
return (0, _defineProperty2.default)({}, "--ds-box-static-".concat(propertyName), mapping[propertyValue]);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var getResponsiveStyles = function getResponsiveStyles(propertyName, propertyValue) {
|
|
38
|
+
(0, _tinyInvariant.default)(typeof responsiveRules[propertyName] !== 'undefined', "Responsive rules for \"".concat(propertyName, "\" have not been statically defined."));
|
|
39
|
+
if ((0, _utils.isResponsiveStyleProp)(propertyValue)) {
|
|
40
|
+
return Object.keys(propertyValue).map(function (responsiveProp) {
|
|
41
|
+
return responsiveRules[propertyName][responsiveProp];
|
|
42
|
+
});
|
|
43
|
+
} else if ((0, _utils.isStaticStyleProp)(propertyValue)) {
|
|
44
|
+
return responsiveRules[propertyName].static;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// Without this type annotation on Box we don't get autocomplete for props due to forwardRef types
|
|
49
|
+
|
|
15
50
|
/**
|
|
16
51
|
* __Box__
|
|
17
52
|
*
|
|
@@ -20,49 +55,50 @@ var _excluded = ["as", "className", "children", "color", "backgroundColor", "sha
|
|
|
20
55
|
*
|
|
21
56
|
* @internal
|
|
22
57
|
*/
|
|
23
|
-
var BaseBox = /*#__PURE__*/(0, _react.forwardRef)(function (
|
|
24
|
-
var as =
|
|
25
|
-
className =
|
|
26
|
-
children =
|
|
27
|
-
color =
|
|
28
|
-
backgroundColor =
|
|
29
|
-
shadow =
|
|
30
|
-
borderStyle =
|
|
31
|
-
borderWidth =
|
|
32
|
-
borderRadius =
|
|
33
|
-
borderColor =
|
|
34
|
-
layer =
|
|
35
|
-
flex =
|
|
36
|
-
flexGrow =
|
|
37
|
-
flexShrink =
|
|
38
|
-
alignSelf =
|
|
39
|
-
overflow =
|
|
40
|
-
overflowInline =
|
|
41
|
-
overflowBlock =
|
|
42
|
-
padding =
|
|
43
|
-
paddingBlock =
|
|
44
|
-
paddingBlockStart =
|
|
45
|
-
paddingBlockEnd =
|
|
46
|
-
paddingInline =
|
|
47
|
-
paddingInlineStart =
|
|
48
|
-
paddingInlineEnd =
|
|
49
|
-
height =
|
|
50
|
-
width =
|
|
51
|
-
|
|
52
|
-
display =
|
|
53
|
-
|
|
54
|
-
position =
|
|
55
|
-
UNSAFE_style =
|
|
56
|
-
testId =
|
|
57
|
-
htmlAttributes = (0, _objectWithoutProperties2.default)(
|
|
58
|
+
var BaseBox = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
59
|
+
var as = _ref2.as,
|
|
60
|
+
className = _ref2.className,
|
|
61
|
+
children = _ref2.children,
|
|
62
|
+
color = _ref2.color,
|
|
63
|
+
backgroundColor = _ref2.backgroundColor,
|
|
64
|
+
shadow = _ref2.shadow,
|
|
65
|
+
borderStyle = _ref2.borderStyle,
|
|
66
|
+
borderWidth = _ref2.borderWidth,
|
|
67
|
+
borderRadius = _ref2.borderRadius,
|
|
68
|
+
borderColor = _ref2.borderColor,
|
|
69
|
+
layer = _ref2.layer,
|
|
70
|
+
flex = _ref2.flex,
|
|
71
|
+
flexGrow = _ref2.flexGrow,
|
|
72
|
+
flexShrink = _ref2.flexShrink,
|
|
73
|
+
alignSelf = _ref2.alignSelf,
|
|
74
|
+
overflow = _ref2.overflow,
|
|
75
|
+
overflowInline = _ref2.overflowInline,
|
|
76
|
+
overflowBlock = _ref2.overflowBlock,
|
|
77
|
+
padding = _ref2.padding,
|
|
78
|
+
paddingBlock = _ref2.paddingBlock,
|
|
79
|
+
paddingBlockStart = _ref2.paddingBlockStart,
|
|
80
|
+
paddingBlockEnd = _ref2.paddingBlockEnd,
|
|
81
|
+
paddingInline = _ref2.paddingInline,
|
|
82
|
+
paddingInlineStart = _ref2.paddingInlineStart,
|
|
83
|
+
paddingInlineEnd = _ref2.paddingInlineEnd,
|
|
84
|
+
height = _ref2.height,
|
|
85
|
+
width = _ref2.width,
|
|
86
|
+
_ref2$display = _ref2.display,
|
|
87
|
+
display = _ref2$display === void 0 ? displayMap.block : _ref2$display,
|
|
88
|
+
_ref2$position = _ref2.position,
|
|
89
|
+
position = _ref2$position === void 0 ? 'static' : _ref2$position,
|
|
90
|
+
UNSAFE_style = _ref2.UNSAFE_style,
|
|
91
|
+
testId = _ref2.testId,
|
|
92
|
+
htmlAttributes = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
|
|
58
93
|
var Component = as || 'div';
|
|
94
|
+
var inlineStyles = Object.assign({}, UNSAFE_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));
|
|
59
95
|
var node = (0, _react2.jsx)(Component, (0, _extends2.default)({
|
|
60
|
-
style:
|
|
96
|
+
style: inlineStyles,
|
|
61
97
|
ref: ref
|
|
62
98
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
63
99
|
}, htmlAttributes, {
|
|
64
100
|
className: className,
|
|
65
|
-
css: [baseStyles, display
|
|
101
|
+
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]]),
|
|
66
102
|
"data-testid": testId
|
|
67
103
|
}), children);
|
|
68
104
|
return node;
|
|
@@ -80,12 +116,9 @@ var borderStyleMap = {
|
|
|
80
116
|
})
|
|
81
117
|
};
|
|
82
118
|
var borderWidthMap = {
|
|
83
|
-
'size.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
'size.100': (0, _react2.css)({
|
|
87
|
-
borderWidth: "var(--ds-width-100, 2px)"
|
|
88
|
-
})
|
|
119
|
+
'size.0': "var(--ds-width-0, 0)",
|
|
120
|
+
'size.050': "var(--ds-width-050, 1px)",
|
|
121
|
+
'size.100': "var(--ds-width-100, 2px)"
|
|
89
122
|
};
|
|
90
123
|
var borderRadiusMap = {
|
|
91
124
|
'radius.100': (0, _react2.css)({
|
|
@@ -143,21 +176,11 @@ var alignSelfMap = {
|
|
|
143
176
|
})
|
|
144
177
|
};
|
|
145
178
|
var displayMap = {
|
|
146
|
-
block:
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
inline:
|
|
150
|
-
|
|
151
|
-
}),
|
|
152
|
-
flex: (0, _react2.css)({
|
|
153
|
-
display: 'flex'
|
|
154
|
-
}),
|
|
155
|
-
'inline-flex': (0, _react2.css)({
|
|
156
|
-
display: 'inline-flex'
|
|
157
|
-
}),
|
|
158
|
-
'inline-block': (0, _react2.css)({
|
|
159
|
-
display: 'inline-block'
|
|
160
|
-
})
|
|
179
|
+
block: 'block',
|
|
180
|
+
inline: 'inline',
|
|
181
|
+
flex: 'flex',
|
|
182
|
+
'inline-flex': 'inline-flex',
|
|
183
|
+
'inline-block': 'inline-block'
|
|
161
184
|
};
|
|
162
185
|
var positionMap = {
|
|
163
186
|
absolute: (0, _react2.css)({
|
|
@@ -372,30 +395,28 @@ var maxHeightMap = {
|
|
|
372
395
|
|
|
373
396
|
/**
|
|
374
397
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
375
|
-
* @codegen <<SignedSource::
|
|
398
|
+
* @codegen <<SignedSource::84fd352b0e6509d380a0dcf8ad023ca2>>
|
|
376
399
|
* @codegenId spacing
|
|
377
400
|
* @codegenCommand yarn codegen-styles
|
|
378
401
|
* @codegenParams ["padding"]
|
|
379
402
|
* @codegenDependency ../../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
380
403
|
*/
|
|
381
|
-
var paddingMap =
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
}];
|
|
398
|
-
}));
|
|
404
|
+
var paddingMap = {
|
|
405
|
+
'space.0': "var(--ds-space-0, 0px)",
|
|
406
|
+
'space.025': "var(--ds-space-025, 2px)",
|
|
407
|
+
'space.050': "var(--ds-space-050, 4px)",
|
|
408
|
+
'space.075': "var(--ds-space-075, 6px)",
|
|
409
|
+
'space.100': "var(--ds-space-100, 8px)",
|
|
410
|
+
'space.150': "var(--ds-space-150, 12px)",
|
|
411
|
+
'space.200': "var(--ds-space-200, 16px)",
|
|
412
|
+
'space.250': "var(--ds-space-250, 20px)",
|
|
413
|
+
'space.300': "var(--ds-space-300, 24px)",
|
|
414
|
+
'space.400': "var(--ds-space-400, 32px)",
|
|
415
|
+
'space.500': "var(--ds-space-500, 40px)",
|
|
416
|
+
'space.600': "var(--ds-space-600, 48px)",
|
|
417
|
+
'space.800': "var(--ds-space-800, 64px)",
|
|
418
|
+
'space.1000': "var(--ds-space-1000, 80px)"
|
|
419
|
+
};
|
|
399
420
|
/**
|
|
400
421
|
* @codegenEnd
|
|
401
422
|
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BOX_RESPONSIVE_PROPS = void 0;
|
|
7
|
+
var BOX_RESPONSIVE_PROPS = ['borderWidth', 'display', 'padding', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd'];
|
|
8
|
+
exports.BOX_RESPONSIVE_PROPS = BOX_RESPONSIVE_PROPS;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.isStaticStyleProp = exports.isResponsiveStyleProp = void 0;
|
|
8
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
|
+
var isResponsiveStyleProp = function isResponsiveStyleProp(propertyValue) {
|
|
10
|
+
return (0, _typeof2.default)(propertyValue) === 'object';
|
|
11
|
+
};
|
|
12
|
+
exports.isResponsiveStyleProp = isResponsiveStyleProp;
|
|
13
|
+
var isStaticStyleProp = function isStaticStyleProp(propertyValue) {
|
|
14
|
+
return typeof propertyValue === 'string';
|
|
15
|
+
};
|
|
16
|
+
exports.isStaticStyleProp = isStaticStyleProp;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
7
|
var _react = require("react");
|
|
10
8
|
var _react2 = require("@emotion/react");
|
|
11
9
|
/** @jsx jsx */
|
|
@@ -46,30 +44,56 @@ var flexGrowMap = {
|
|
|
46
44
|
|
|
47
45
|
/**
|
|
48
46
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
49
|
-
* @codegen <<SignedSource::
|
|
47
|
+
* @codegen <<SignedSource::41d7002b7f69aa44d0d8598e07a1afc6>>
|
|
50
48
|
* @codegenId spacing
|
|
51
49
|
* @codegenCommand yarn codegen-styles
|
|
52
50
|
* @codegenParams ["space"]
|
|
53
51
|
* @codegenDependency ../../../tokens/src/artifacts/tokens-raw/atlassian-spacing.tsx <<SignedSource::167d3b69b159ae33e74d4ea5ab7eade6>>
|
|
54
52
|
*/
|
|
55
|
-
var spaceMap =
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
53
|
+
var spaceMap = {
|
|
54
|
+
'0': (0, _react2.css)({
|
|
55
|
+
gap: "var(--ds-space-0, 0px)"
|
|
56
|
+
}),
|
|
57
|
+
'025': (0, _react2.css)({
|
|
58
|
+
gap: "var(--ds-space-025, 2px)"
|
|
59
|
+
}),
|
|
60
|
+
'050': (0, _react2.css)({
|
|
61
|
+
gap: "var(--ds-space-050, 4px)"
|
|
62
|
+
}),
|
|
63
|
+
'075': (0, _react2.css)({
|
|
64
|
+
gap: "var(--ds-space-075, 6px)"
|
|
65
|
+
}),
|
|
66
|
+
'100': (0, _react2.css)({
|
|
67
|
+
gap: "var(--ds-space-100, 8px)"
|
|
68
|
+
}),
|
|
69
|
+
'150': (0, _react2.css)({
|
|
70
|
+
gap: "var(--ds-space-150, 12px)"
|
|
71
|
+
}),
|
|
72
|
+
'200': (0, _react2.css)({
|
|
73
|
+
gap: "var(--ds-space-200, 16px)"
|
|
74
|
+
}),
|
|
75
|
+
'250': (0, _react2.css)({
|
|
76
|
+
gap: "var(--ds-space-250, 20px)"
|
|
77
|
+
}),
|
|
78
|
+
'300': (0, _react2.css)({
|
|
79
|
+
gap: "var(--ds-space-300, 24px)"
|
|
80
|
+
}),
|
|
81
|
+
'400': (0, _react2.css)({
|
|
82
|
+
gap: "var(--ds-space-400, 32px)"
|
|
83
|
+
}),
|
|
84
|
+
'500': (0, _react2.css)({
|
|
85
|
+
gap: "var(--ds-space-500, 40px)"
|
|
86
|
+
}),
|
|
87
|
+
'600': (0, _react2.css)({
|
|
88
|
+
gap: "var(--ds-space-600, 48px)"
|
|
89
|
+
}),
|
|
90
|
+
'800': (0, _react2.css)({
|
|
91
|
+
gap: "var(--ds-space-800, 64px)"
|
|
92
|
+
}),
|
|
93
|
+
'1000': (0, _react2.css)({
|
|
94
|
+
gap: "var(--ds-space-1000, 80px)"
|
|
95
|
+
})
|
|
96
|
+
};
|
|
73
97
|
/**
|
|
74
98
|
* @codegenEnd
|
|
75
99
|
*/
|
|
@@ -104,7 +128,7 @@ var Stack = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(f
|
|
|
104
128
|
testId = _ref.testId;
|
|
105
129
|
var justifyContent = spread || alignBlock;
|
|
106
130
|
return (0, _react2.jsx)("div", {
|
|
107
|
-
css: [baseStyles, space && spaceMap
|
|
131
|
+
css: [baseStyles, space && spaceMap[space], alignItems && alignItemsMap[alignItems], grow && flexGrowMap[grow], justifyContent && justifyContentMap[justifyContent]],
|
|
108
132
|
"data-testid": testId,
|
|
109
133
|
ref: ref
|
|
110
134
|
}, children);
|
package/dist/cjs/constants.js
CHANGED
|
@@ -3,7 +3,20 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "BREAKPOINTS_CONFIG", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _dsExplorations.UNSAFE_BREAKPOINTS_CONFIG;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "BREAKPOINTS_LIST", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _dsExplorations.UNSAFE_BREAKPOINTS_LIST;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
6
18
|
exports.LAYERS = void 0;
|
|
19
|
+
var _dsExplorations = require("@atlaskit/ds-explorations");
|
|
7
20
|
var LAYERS = {
|
|
8
21
|
card: 100,
|
|
9
22
|
navigation: 200,
|
package/dist/cjs/index.js
CHANGED
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
Object.defineProperty(exports, "Box", {
|
|
8
8
|
enumerable: true,
|
|
9
9
|
get: function get() {
|
|
10
|
-
return _box.
|
|
10
|
+
return _box.default;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "Inline", {
|
|
@@ -22,6 +22,6 @@ Object.defineProperty(exports, "Stack", {
|
|
|
22
22
|
return _stack.default;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
|
-
var _box = require("./components/box");
|
|
25
|
+
var _box = _interopRequireDefault(require("./components/box"));
|
|
26
26
|
var _inline = _interopRequireDefault(require("./components/inline.partial"));
|
|
27
27
|
var _stack = _interopRequireDefault(require("./components/stack.partial"));
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
import { BaseBox } from './internal/base-box.partial';
|
|
4
|
+
// TODO: Fill in the component {description} and ensure links point to the correct {packageName} location.
|
|
5
|
+
// Remove links that the component does not have (such as usage). If there are no links remove them all.
|
|
6
|
+
/**
|
|
7
|
+
* __Box__
|
|
8
|
+
*
|
|
9
|
+
* A box {description}.
|
|
10
|
+
*
|
|
11
|
+
* - [Examples](https://atlassian.design/components/{packageName}/examples)
|
|
12
|
+
* - [Code](https://atlassian.design/components/{packageName}/code)
|
|
13
|
+
* - [Usage](https://atlassian.design/components/{packageName}/usage)
|
|
14
|
+
*/
|
|
4
15
|
const Box = /*#__PURE__*/forwardRef(({
|
|
5
16
|
as,
|
|
6
17
|
children,
|
|
@@ -72,4 +83,4 @@ const Box = /*#__PURE__*/forwardRef(({
|
|
|
72
83
|
ref: ref
|
|
73
84
|
}, safeHtmlAttributes), children);
|
|
74
85
|
});
|
|
75
|
-
export
|
|
86
|
+
export default Box;
|