@atlaskit/primitives 1.10.0 → 1.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/primitives
|
|
2
2
|
|
|
3
|
+
## 1.10.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#43018](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43018) [`3cb6a290654`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3cb6a290654) - Text component now has `margin: 0` to ensure no margins are inherited (for example from the CSS reset).
|
|
8
|
+
|
|
3
9
|
## 1.10.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -16,6 +16,12 @@ var _excluded = ["children"];
|
|
|
16
16
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
17
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /** @jsx jsx */
|
|
18
18
|
var asAllowlist = ['span', 'p', 'strong', 'em'];
|
|
19
|
+
// We're doing this because our CSS reset can add top margins to elements such as `p` which is totally insane.
|
|
20
|
+
// Long term we should remove those instances from the reset - it should be a reset to 0.
|
|
21
|
+
// For now, at least we know <Text> will be unaffected by this.
|
|
22
|
+
var resetStyles = (0, _react2.css)({
|
|
23
|
+
margin: 0
|
|
24
|
+
});
|
|
19
25
|
var variantStyles = _objectSpread(_objectSpread({}, _styleMaps.bodyTextStylesMap), _styleMaps.uiTextStylesMap);
|
|
20
26
|
var strongStyles = (0, _react2.css)({
|
|
21
27
|
fontWeight: "var(--ds-font-weight-bold, bold)"
|
|
@@ -101,7 +107,7 @@ var Text = function Text(_ref) {
|
|
|
101
107
|
return (0, _react2.jsx)(_react.Fragment, null, children);
|
|
102
108
|
}
|
|
103
109
|
var component = (0, _react2.jsx)(Component, {
|
|
104
|
-
css: [variant && variantStyles[variant], color && _styleMaps.textColorStylesMap[color], shouldTruncate && truncateStyles, textAlign && textAlignMap[textAlign], asElement === 'em' && emStyles, asElement === 'strong' && strongStyles],
|
|
110
|
+
css: [resetStyles, variant && variantStyles[variant], color && _styleMaps.textColorStylesMap[color], shouldTruncate && truncateStyles, textAlign && textAlignMap[textAlign], asElement === 'em' && emStyles, asElement === 'strong' && strongStyles],
|
|
105
111
|
"data-testid": testId,
|
|
106
112
|
id: id
|
|
107
113
|
}, children);
|
package/dist/cjs/xcss/xcss.js
CHANGED
|
@@ -13,6 +13,8 @@ var _react = require("@emotion/react");
|
|
|
13
13
|
var _styleMaps = require("./style-maps.partial");
|
|
14
14
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
15
15
|
|
|
16
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
17
|
+
|
|
16
18
|
var tokensMap = {
|
|
17
19
|
backgroundColor: _styleMaps.backgroundColorMap,
|
|
18
20
|
blockSize: _styleMaps.dimensionMap,
|
|
@@ -5,6 +5,12 @@ import invariant from 'tiny-invariant';
|
|
|
5
5
|
import { bodyTextStylesMap, inverseColorMap, textColorStylesMap, uiTextStylesMap } from '../xcss/style-maps.partial';
|
|
6
6
|
import { useSurface } from './internal/surface-provider';
|
|
7
7
|
const asAllowlist = ['span', 'p', 'strong', 'em'];
|
|
8
|
+
// We're doing this because our CSS reset can add top margins to elements such as `p` which is totally insane.
|
|
9
|
+
// Long term we should remove those instances from the reset - it should be a reset to 0.
|
|
10
|
+
// For now, at least we know <Text> will be unaffected by this.
|
|
11
|
+
const resetStyles = css({
|
|
12
|
+
margin: 0
|
|
13
|
+
});
|
|
8
14
|
const variantStyles = {
|
|
9
15
|
...bodyTextStylesMap,
|
|
10
16
|
...uiTextStylesMap
|
|
@@ -92,7 +98,7 @@ const Text = ({
|
|
|
92
98
|
return jsx(Fragment, null, children);
|
|
93
99
|
}
|
|
94
100
|
const component = jsx(Component, {
|
|
95
|
-
css: [variant && variantStyles[variant], color && textColorStylesMap[color], shouldTruncate && truncateStyles, textAlign && textAlignMap[textAlign], asElement === 'em' && emStyles, asElement === 'strong' && strongStyles],
|
|
101
|
+
css: [resetStyles, variant && variantStyles[variant], color && textColorStylesMap[color], shouldTruncate && truncateStyles, textAlign && textAlignMap[textAlign], asElement === 'em' && emStyles, asElement === 'strong' && strongStyles],
|
|
96
102
|
"data-testid": testId,
|
|
97
103
|
id: id
|
|
98
104
|
}, children);
|
package/dist/es2019/xcss/xcss.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
2
2
|
import { css as cssEmotion } from '@emotion/react';
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
5
|
+
|
|
3
6
|
import { backgroundColorMap, borderColorMap, borderRadiusMap, borderWidthMap, dimensionMap, layerMap, shadowMap, spaceMap, textColorMap } from './style-maps.partial';
|
|
4
7
|
const tokensMap = {
|
|
5
8
|
backgroundColor: backgroundColorMap,
|
|
@@ -10,6 +10,12 @@ import invariant from 'tiny-invariant';
|
|
|
10
10
|
import { bodyTextStylesMap, inverseColorMap, textColorStylesMap, uiTextStylesMap } from '../xcss/style-maps.partial';
|
|
11
11
|
import { useSurface } from './internal/surface-provider';
|
|
12
12
|
var asAllowlist = ['span', 'p', 'strong', 'em'];
|
|
13
|
+
// We're doing this because our CSS reset can add top margins to elements such as `p` which is totally insane.
|
|
14
|
+
// Long term we should remove those instances from the reset - it should be a reset to 0.
|
|
15
|
+
// For now, at least we know <Text> will be unaffected by this.
|
|
16
|
+
var resetStyles = css({
|
|
17
|
+
margin: 0
|
|
18
|
+
});
|
|
13
19
|
var variantStyles = _objectSpread(_objectSpread({}, bodyTextStylesMap), uiTextStylesMap);
|
|
14
20
|
var strongStyles = css({
|
|
15
21
|
fontWeight: "var(--ds-font-weight-bold, bold)"
|
|
@@ -95,7 +101,7 @@ var Text = function Text(_ref) {
|
|
|
95
101
|
return jsx(Fragment, null, children);
|
|
96
102
|
}
|
|
97
103
|
var component = jsx(Component, {
|
|
98
|
-
css: [variant && variantStyles[variant], color && textColorStylesMap[color], shouldTruncate && truncateStyles, textAlign && textAlignMap[textAlign], asElement === 'em' && emStyles, asElement === 'strong' && strongStyles],
|
|
104
|
+
css: [resetStyles, variant && variantStyles[variant], color && textColorStylesMap[color], shouldTruncate && truncateStyles, textAlign && textAlignMap[textAlign], asElement === 'em' && emStyles, asElement === 'strong' && strongStyles],
|
|
99
105
|
"data-testid": testId,
|
|
100
106
|
id: id
|
|
101
107
|
}, children);
|
package/dist/esm/xcss/xcss.js
CHANGED
|
@@ -3,6 +3,9 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
3
3
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
4
4
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
5
5
|
import { css as cssEmotion } from '@emotion/react';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
8
|
+
|
|
6
9
|
import { backgroundColorMap, borderColorMap, borderRadiusMap, borderWidthMap, dimensionMap, layerMap, shadowMap, spaceMap, textColorMap } from './style-maps.partial';
|
|
7
10
|
var tokensMap = {
|
|
8
11
|
backgroundColor: backgroundColorMap,
|