@atlaskit/primitives 3.1.0 → 4.0.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 +16 -0
- package/constellation/text/code.mdx +1 -1
- package/constellation/text/examples.mdx +3 -3
- package/constellation/text/usage.mdx +2 -4
- package/dist/cjs/components/anchor.js +4 -2
- package/dist/cjs/components/bleed.js +3 -2
- package/dist/cjs/components/box.js +5 -5
- package/dist/cjs/components/flex.js +3 -2
- package/dist/cjs/components/grid.js +3 -2
- package/dist/cjs/components/inline.js +8 -3
- package/dist/cjs/components/pressable.js +5 -1
- package/dist/cjs/components/stack.js +8 -3
- package/dist/cjs/components/text.js +2 -5
- package/dist/cjs/xcss/style-maps.partial.js +8 -39
- package/dist/cjs/xcss/xcss.js +52 -14
- package/dist/es2019/components/anchor.js +4 -2
- package/dist/es2019/components/bleed.js +3 -2
- package/dist/es2019/components/box.js +5 -5
- package/dist/es2019/components/flex.js +3 -2
- package/dist/es2019/components/grid.js +3 -2
- package/dist/es2019/components/inline.js +8 -3
- package/dist/es2019/components/pressable.js +5 -1
- package/dist/es2019/components/stack.js +8 -3
- package/dist/es2019/components/text.js +2 -6
- package/dist/es2019/xcss/style-maps.partial.js +7 -38
- package/dist/es2019/xcss/xcss.js +38 -8
- package/dist/esm/components/anchor.js +4 -2
- package/dist/esm/components/bleed.js +3 -2
- package/dist/esm/components/box.js +5 -5
- package/dist/esm/components/flex.js +3 -2
- package/dist/esm/components/grid.js +3 -2
- package/dist/esm/components/inline.js +8 -3
- package/dist/esm/components/pressable.js +5 -1
- package/dist/esm/components/stack.js +8 -3
- package/dist/esm/components/text.js +2 -6
- package/dist/esm/xcss/style-maps.partial.js +7 -38
- package/dist/esm/xcss/xcss.js +52 -10
- package/dist/types/components/flex.d.ts +2 -2
- package/dist/types/components/grid.d.ts +3 -3
- package/dist/types/components/pressable.d.ts +1 -1
- package/dist/types/components/stack.d.ts +1 -1
- package/dist/types/components/text.d.ts +12 -23
- package/dist/types/components/types.d.ts +3 -2
- package/dist/types/xcss/style-maps.partial.d.ts +9 -49
- package/dist/types/xcss/xcss.d.ts +11 -5
- package/dist/types-ts4.5/components/flex.d.ts +2 -2
- package/dist/types-ts4.5/components/grid.d.ts +3 -3
- package/dist/types-ts4.5/components/pressable.d.ts +1 -1
- package/dist/types-ts4.5/components/stack.d.ts +1 -1
- package/dist/types-ts4.5/components/text.d.ts +12 -23
- package/dist/types-ts4.5/components/types.d.ts +3 -2
- package/dist/types-ts4.5/xcss/style-maps.partial.d.ts +9 -49
- package/dist/types-ts4.5/xcss/xcss.d.ts +11 -5
- package/package.json +3 -2
- package/scripts/codegen-styles.tsx +1 -1
- package/scripts/typography-codegen-template.tsx +34 -56
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/primitives
|
|
2
2
|
|
|
3
|
+
## 4.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#77148](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/77148) [`473df43e816b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/473df43e816b) - Removed `ui` variant from Text component. The `body` variant should be used for all non-heading typography.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 3.2.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- [#77488](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/77488) [`9e119dcbfd60`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9e119dcbfd60) - The `xcss` prop on select components have had its type expanded to support styles being passed from Compiled CSS-in-JS. This is still experimental and something we'll be iterating on.
|
|
18
|
+
|
|
3
19
|
## 3.1.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Text
|
|
3
|
-
description: Text is a token-backed typography component to display body
|
|
3
|
+
description: Text is a token-backed typography component to display body text.
|
|
4
4
|
order: 0
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ import AsElement from '../../examples/constellation/text/as-element';
|
|
|
11
11
|
|
|
12
12
|
## Basic
|
|
13
13
|
|
|
14
|
-
Implements the [Atlassian typography system](/foundations/typography/) as a component, scoped to body
|
|
14
|
+
Implements the [Atlassian typography system](/foundations/typography/) as a component, scoped to body text usages.
|
|
15
15
|
|
|
16
16
|
The `variant` prop expresses the visual appearance of the text element.
|
|
17
17
|
|
|
@@ -25,7 +25,7 @@ Set `color` to change the text color, defaults to `text.color` if not nested in
|
|
|
25
25
|
|
|
26
26
|
## Weight
|
|
27
27
|
|
|
28
|
-
Set `weight` to change the
|
|
28
|
+
Set `weight` to change the font weight.
|
|
29
29
|
|
|
30
30
|
<Example Component={Weight} pacckageName="@atlaskit/primitives" />
|
|
31
31
|
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Text
|
|
3
|
-
description: Text is a token-backed typography component to display body
|
|
3
|
+
description: Text is a token-backed typography component to display body text.
|
|
4
4
|
order: 2
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
## Usage
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Body text variants should be used for multi-line text. For each variant, we have coupled a line height which fits the variant's font size, ensuring that it is compliant with accessibility standards.
|
|
9
|
+
Use body text for main content, such as detailed descriptions or for text in components. For each variant, we have coupled a line height which fits the variant's font size, ensuring that it is compliant with accessibility standards.
|
|
@@ -76,13 +76,15 @@ var Anchor = function Anchor(_ref, ref) {
|
|
|
76
76
|
action: 'clicked',
|
|
77
77
|
componentName: componentName || 'Anchor',
|
|
78
78
|
packageName: "@atlaskit/primitives",
|
|
79
|
-
packageVersion: "
|
|
79
|
+
packageVersion: "4.0.0",
|
|
80
80
|
analyticsData: analyticsContext,
|
|
81
81
|
actionSubject: 'link'
|
|
82
82
|
});
|
|
83
83
|
var RouterLink = (0, _appProvider.useRouterLink)();
|
|
84
84
|
|
|
85
|
-
//
|
|
85
|
+
// We're type coercing this as Compiled styles in an array isn't supported by the types
|
|
86
|
+
// But the runtime accepts it none-the-wiser. We can remove this entire block and replace
|
|
87
|
+
// it with cx(defaultStyles, focusRingStyles, xcssStyles) when we've moved away from Emotion.
|
|
86
88
|
var styles = Array.isArray(xcssStyles) ? [defaultStyles, focusRingStyles].concat((0, _toConsumableArray2.default)(xcssStyles)) : [defaultStyles, focusRingStyles, xcssStyles];
|
|
87
89
|
var isExternal = typeof href === 'string' && IS_EXTERNAL_LINK_REGEX.test(href);
|
|
88
90
|
var isNonHttpBased = typeof href === 'string' && IS_NON_HTTP_BASED.test(href);
|
|
@@ -66,11 +66,12 @@ var Bleed = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
66
66
|
block = _ref.block,
|
|
67
67
|
all = _ref.all,
|
|
68
68
|
xcss = _ref.xcss;
|
|
69
|
-
var
|
|
69
|
+
var resolvedStyles = (0, _xcss.parseXcss)(xcss);
|
|
70
70
|
return (0, _react2.jsx)("div", {
|
|
71
|
+
className: resolvedStyles.static,
|
|
71
72
|
css: [baseStyles, (inline || all) && inlineBleedMap[inline || all], (block || all) && blockBleedMap[block || all],
|
|
72
73
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
73
|
-
|
|
74
|
+
resolvedStyles.emotion],
|
|
74
75
|
"data-testid": testId
|
|
75
76
|
}, children);
|
|
76
77
|
});
|
|
@@ -32,7 +32,7 @@ var _excluded = ["as", "children", "backgroundColor", "padding", "paddingBlock",
|
|
|
32
32
|
*/
|
|
33
33
|
var Box = exports.Box = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
34
34
|
var _ref$as = _ref.as,
|
|
35
|
-
|
|
35
|
+
Component = _ref$as === void 0 ? 'div' : _ref$as,
|
|
36
36
|
children = _ref.children,
|
|
37
37
|
backgroundColor = _ref.backgroundColor,
|
|
38
38
|
padding = _ref.padding,
|
|
@@ -46,24 +46,24 @@ var Box = exports.Box = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
|
|
|
46
46
|
testId = _ref.testId,
|
|
47
47
|
xcss = _ref.xcss,
|
|
48
48
|
htmlAttributes = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
49
|
-
var Component = as;
|
|
50
49
|
// This is to remove className from safeHtmlAttributes
|
|
51
50
|
// @ts-expect-error className doesn't exist in the prop definition but we want to ensure it cannot be applied even if types are bypassed
|
|
52
51
|
var _spreadClass = htmlAttributes.className,
|
|
53
52
|
safeHtmlAttributes = (0, _objectWithoutProperties2.default)(htmlAttributes, _excluded2);
|
|
54
|
-
var
|
|
53
|
+
var resolvedStyles = (0, _xcss.parseXcss)(xcss);
|
|
55
54
|
var node =
|
|
56
55
|
// @ts-expect-error Expression produces a union type that is too complex to represent. I think this is unavoidable
|
|
57
56
|
(0, _react2.jsx)(Component, (0, _extends2.default)({
|
|
58
57
|
style: style
|
|
59
58
|
// @ts-expect-error Expression produces a union type that is too complex to represent. We may be able to narrow the type here but unsure.
|
|
60
59
|
,
|
|
61
|
-
ref: ref
|
|
60
|
+
ref: ref,
|
|
61
|
+
className: resolvedStyles.static
|
|
62
62
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
63
63
|
}, safeHtmlAttributes, {
|
|
64
64
|
css: [baseStyles, backgroundColor && _styleMaps.backgroundColorStylesMap[backgroundColor], (0, _styleMaps.isSurfaceColorToken)(backgroundColor) && _styleMaps.surfaceColorStylesMap[backgroundColor], padding && _styleMaps.paddingStylesMap.padding[padding], paddingBlock && _styleMaps.paddingStylesMap.paddingBlock[paddingBlock], paddingBlockStart && _styleMaps.paddingStylesMap.paddingBlockStart[paddingBlockStart], paddingBlockEnd && _styleMaps.paddingStylesMap.paddingBlockEnd[paddingBlockEnd], paddingInline && _styleMaps.paddingStylesMap.paddingInline[paddingInline], paddingInlineStart && _styleMaps.paddingStylesMap.paddingInlineStart[paddingInlineStart], paddingInlineEnd && _styleMaps.paddingStylesMap.paddingInlineEnd[paddingInlineEnd],
|
|
65
65
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
66
|
-
|
|
66
|
+
resolvedStyles.emotion],
|
|
67
67
|
"data-testid": testId
|
|
68
68
|
}), children);
|
|
69
69
|
return backgroundColor ? (0, _react2.jsx)(_surfaceProvider.SurfaceContext.Provider, {
|
|
@@ -105,12 +105,13 @@ var Flex = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
105
105
|
direction = _ref.direction,
|
|
106
106
|
wrap = _ref.wrap,
|
|
107
107
|
xcss = _ref.xcss;
|
|
108
|
-
var
|
|
108
|
+
var resolvedStyles = (0, _xcss.parseXcss)(xcss);
|
|
109
109
|
return (0, _react2.jsx)(Component, {
|
|
110
110
|
role: role,
|
|
111
|
+
className: resolvedStyles.static,
|
|
111
112
|
css: [baseStyles, gap && _styleMaps.spaceStylesMap.gap[gap], columnGap && _styleMaps.spaceStylesMap.columnGap[columnGap], rowGap && _styleMaps.spaceStylesMap.rowGap[rowGap], alignItems && alignItemsMap[alignItems], direction && flexDirectionMap[direction], justifyContent && justifyContentMap[justifyContent], wrap && flexWrapMap[wrap],
|
|
112
113
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
113
|
-
|
|
114
|
+
resolvedStyles.emotion],
|
|
114
115
|
"data-testid": testId,
|
|
115
116
|
ref: ref
|
|
116
117
|
}, children);
|
|
@@ -152,7 +152,7 @@ var Grid = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
152
152
|
gridTemplateColumns = _ref.templateColumns,
|
|
153
153
|
xcss = _ref.xcss;
|
|
154
154
|
var Component = as || 'div';
|
|
155
|
-
var
|
|
155
|
+
var resolvedStyles = (0, _xcss.parseXcss)(xcss);
|
|
156
156
|
|
|
157
157
|
/**
|
|
158
158
|
* We use CSS variables to allow for dynamic grid templates instead of dynamically setting to `props.style`
|
|
@@ -172,9 +172,10 @@ var Grid = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
172
172
|
id: id,
|
|
173
173
|
role: role,
|
|
174
174
|
style: style,
|
|
175
|
+
className: resolvedStyles.static,
|
|
175
176
|
css: [baseStyles, gap && _styleMaps.spaceStylesMap.gap[gap], columnGap && _styleMaps.spaceStylesMap.columnGap[columnGap], rowGap && _styleMaps.spaceStylesMap.rowGap[rowGap], alignItems && alignItemsMap[alignItems], alignContent && alignContentMap[alignContent], justifyContent && justifyContentMap[justifyContent], autoFlow && gridAutoFlowMap[autoFlow],
|
|
176
177
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
177
|
-
|
|
178
|
+
resolvedStyles.emotion],
|
|
178
179
|
"data-testid": testId,
|
|
179
180
|
ref: ref
|
|
180
181
|
}, children);
|
|
@@ -73,6 +73,11 @@ var Inline = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
73
73
|
}, separator && index > 0 ? separatorComponent : null, child);
|
|
74
74
|
}) : rawChildren;
|
|
75
75
|
var justifyContent = spread || alignInline;
|
|
76
|
+
|
|
77
|
+
// We're type coercing this as Compiled styles in an array isn't supported by the types
|
|
78
|
+
// But the runtime accepts it none-the-wiser. We can remove this entire block and replace
|
|
79
|
+
// it with cx(defaultStyles, focusRingStyles, xcssStyles) when we've moved away from Emotion.
|
|
80
|
+
var styles = grow ? [flexGrowMap[grow]].concat((0, _toConsumableArray2.default)(Array.isArray(xcss) ? xcss : [xcss])) : xcss;
|
|
76
81
|
return (0, _react2.jsx)(_flex.default, {
|
|
77
82
|
as: as,
|
|
78
83
|
role: role,
|
|
@@ -81,10 +86,10 @@ var Inline = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
81
86
|
direction: "row",
|
|
82
87
|
gap: space,
|
|
83
88
|
rowGap: rowSpace,
|
|
84
|
-
wrap: shouldWrap ? 'wrap' : undefined
|
|
85
|
-
xcss: grow ? [flexGrowMap[grow]].concat((0, _toConsumableArray2.default)(Array.isArray(xcss) ? xcss : [xcss])) :
|
|
89
|
+
wrap: shouldWrap ? 'wrap' : undefined
|
|
86
90
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
87
|
-
|
|
91
|
+
,
|
|
92
|
+
xcss: styles,
|
|
88
93
|
testId: testId,
|
|
89
94
|
ref: ref
|
|
90
95
|
}, children);
|
|
@@ -80,7 +80,7 @@ var UNSAFE_PRESSABLE = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
|
|
|
80
80
|
action: 'clicked',
|
|
81
81
|
componentName: componentName || 'Pressable',
|
|
82
82
|
packageName: "@atlaskit/primitives",
|
|
83
|
-
packageVersion: "
|
|
83
|
+
packageVersion: "4.0.0",
|
|
84
84
|
analyticsData: analyticsContext,
|
|
85
85
|
actionSubject: 'button'
|
|
86
86
|
});
|
|
@@ -89,6 +89,10 @@ var UNSAFE_PRESSABLE = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
|
|
|
89
89
|
var styles = [(0, _xcss.xcss)({
|
|
90
90
|
cursor: isDisabled ? 'not-allowed' : 'pointer'
|
|
91
91
|
}), focusRingStyles];
|
|
92
|
+
|
|
93
|
+
// We're type coercing this as Compiled styles in an array isn't supported by the types
|
|
94
|
+
// But the runtime accepts it none-the-wiser. We can remove this entire block and replace
|
|
95
|
+
// it with cx(defaultStyles, focusRingStyles, xcssStyles) when we've moved away from Emotion.
|
|
92
96
|
styles = Array.isArray(xcssStyles) ? [].concat((0, _toConsumableArray2.default)(styles), (0, _toConsumableArray2.default)(xcssStyles)) : [].concat((0, _toConsumableArray2.default)(styles), [xcssStyles]);
|
|
93
97
|
return /*#__PURE__*/_react.default.createElement(_box.default, (0, _extends2.default)({}, htmlAttributes, {
|
|
94
98
|
as: "button",
|
|
@@ -50,16 +50,21 @@ var Stack = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(f
|
|
|
50
50
|
xcss = _ref.xcss,
|
|
51
51
|
role = _ref.role;
|
|
52
52
|
var justifyContent = spread || alignBlock;
|
|
53
|
+
|
|
54
|
+
// We're type coercing this as Compiled styles in an array isn't supported by the types
|
|
55
|
+
// But the runtime accepts it none-the-wiser. We can remove this entire block and replace
|
|
56
|
+
// it with cx(defaultStyles, focusRingStyles, xcssStyles) when we've moved away from Emotion.
|
|
57
|
+
var styles = grow ? [flexGrowMap[grow]].concat((0, _toConsumableArray2.default)(Array.isArray(xcss) ? xcss : [xcss])) : xcss;
|
|
53
58
|
return (0, _react2.jsx)(_flex.default, {
|
|
54
59
|
as: as,
|
|
55
60
|
role: role,
|
|
56
61
|
gap: space,
|
|
57
62
|
direction: "column",
|
|
58
63
|
alignItems: alignItems,
|
|
59
|
-
justifyContent: justifyContent
|
|
60
|
-
xcss: grow ? [flexGrowMap[grow]].concat((0, _toConsumableArray2.default)(Array.isArray(xcss) ? xcss : [xcss])) :
|
|
64
|
+
justifyContent: justifyContent
|
|
61
65
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
62
|
-
|
|
66
|
+
,
|
|
67
|
+
xcss: styles,
|
|
63
68
|
testId: testId,
|
|
64
69
|
ref: ref
|
|
65
70
|
}, children);
|
|
@@ -6,15 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
9
|
var _react = require("react");
|
|
11
10
|
var _react2 = require("@emotion/react");
|
|
12
11
|
var _tinyInvariant = _interopRequireDefault(require("tiny-invariant"));
|
|
13
12
|
var _styleMaps = require("../xcss/style-maps.partial");
|
|
14
13
|
var _surfaceProvider = require("./internal/surface-provider");
|
|
15
14
|
var _excluded = ["children"];
|
|
16
|
-
|
|
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 */
|
|
15
|
+
/** @jsx jsx */
|
|
18
16
|
var asAllowlist = ['span', 'p', 'strong', 'em'];
|
|
19
17
|
// We're doing this because our CSS reset can add top margins to elements such as `p` which is totally insane.
|
|
20
18
|
// Long term we should remove those instances from the reset - it should be a reset to 0.
|
|
@@ -22,7 +20,6 @@ var asAllowlist = ['span', 'p', 'strong', 'em'];
|
|
|
22
20
|
var resetStyles = (0, _react2.css)({
|
|
23
21
|
margin: 0
|
|
24
22
|
});
|
|
25
|
-
var variantStyles = _objectSpread(_objectSpread({}, _styleMaps.bodyTextStylesMap), _styleMaps.uiTextStylesMap);
|
|
26
23
|
var strongStyles = (0, _react2.css)({
|
|
27
24
|
fontWeight: 'bold'
|
|
28
25
|
});
|
|
@@ -108,7 +105,7 @@ var Text = function Text(_ref) {
|
|
|
108
105
|
var hasTextAncestor = useHasTextAncestor();
|
|
109
106
|
var color = useColor(colorProp, hasTextAncestor);
|
|
110
107
|
var component = (0, _react2.jsx)(Component, {
|
|
111
|
-
css: [resetStyles,
|
|
108
|
+
css: [resetStyles, _styleMaps.fontStylesMap[variant], color && _styleMaps.textColorStylesMap[color], maxLines && truncationStyles, maxLines === 1 && wordBreakMap.breakAll, textAlign && textAlignMap[textAlign], weight && _styleMaps.fontWeightStylesMap[weight], Component === 'em' && emStyles, Component === 'strong' && strongStyles],
|
|
112
109
|
style: {
|
|
113
110
|
WebkitLineClamp: maxLines
|
|
114
111
|
},
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.textColorStylesMap = exports.textColorMap = exports.surfaceColorStylesMap = exports.surfaceColorMap = exports.spaceStylesMap = exports.shadowMap = exports.positiveSpaceMap = exports.paddingStylesMap = exports.opacityMap = exports.negativeSpaceMap = exports.layerMap = exports.isSurfaceColorToken = exports.inverseColorMap = exports.fontWeightStylesMap = exports.fontWeightMap = exports.fontStylesMap = exports.fontFamilyStylesMap = exports.fontFamilyMap = exports.fillMap = exports.dimensionMap = exports.borderWidthMap = exports.borderRadiusMap = exports.borderColorMap = exports.bodyFontMap = exports.backgroundColorStylesMap = exports.backgroundColorMap = exports.allSpaceMap = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _tokens = require("@atlaskit/tokens");
|
|
@@ -496,22 +496,17 @@ var borderRadiusMap = exports.borderRadiusMap = {
|
|
|
496
496
|
|
|
497
497
|
/**
|
|
498
498
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
499
|
-
* @codegen <<SignedSource::
|
|
499
|
+
* @codegen <<SignedSource::76c411b57ce0b5e8faa09cb692065229>>
|
|
500
500
|
* @codegenId typography
|
|
501
501
|
* @codegenCommand yarn workspace @atlaskit/primitives codegen-styles
|
|
502
502
|
* @codegenParams ["fontSize", "fontWeight", "fontFamily", "lineHeight", "body", "ui"]
|
|
503
503
|
* @codegenDependency ../../scripts/codegen-file-templates/dimensions.tsx <<SignedSource::0cd422575c3f2a3784eeef767abe71f4>>
|
|
504
504
|
* @codegenDependency ../../scripts/codegen-file-templates/layer.tsx <<SignedSource::79d24a1e558f12d671c06a7609f90dc1>>
|
|
505
505
|
*/
|
|
506
|
-
var
|
|
507
|
-
|
|
508
|
-
'
|
|
509
|
-
'
|
|
510
|
-
'font.size.200': "var(--ds-font-size-200, 16px)",
|
|
511
|
-
'font.size.300': "var(--ds-font-size-300, 20px)",
|
|
512
|
-
'font.size.400': "var(--ds-font-size-400, 24px)",
|
|
513
|
-
'font.size.500': "var(--ds-font-size-500, 29px)",
|
|
514
|
-
'font.size.600': "var(--ds-font-size-600, 35px)"
|
|
506
|
+
var bodyFontMap = exports.bodyFontMap = {
|
|
507
|
+
body: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
508
|
+
'body.large': "var(--ds-font-body-large, normal 400 16px/24px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
509
|
+
'body.small': "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
515
510
|
};
|
|
516
511
|
var fontWeightMap = exports.fontWeightMap = {
|
|
517
512
|
bold: "var(--ds-font-weight-bold, 700)",
|
|
@@ -520,31 +515,8 @@ var fontWeightMap = exports.fontWeightMap = {
|
|
|
520
515
|
semibold: "var(--ds-font-weight-semibold, 600)"
|
|
521
516
|
};
|
|
522
517
|
var fontFamilyMap = exports.fontFamilyMap = {
|
|
523
|
-
'font.family.body': "var(--ds-font-family-body, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
524
518
|
'font.family.brand.body': "var(--ds-font-family-brand-body, \"Charlie Text\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
525
|
-
'font.family.brand.heading': "var(--ds-font-family-brand-heading, \"Charlie Display\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
526
|
-
'font.family.code': "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
527
|
-
'font.family.heading': "var(--ds-font-family-heading, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
528
|
-
'font.family.monospace': "var(--ds-font-family-monospace, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
529
|
-
'font.family.sans': "var(--ds-font-family-sans, -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\", \"Ubuntu\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\", sans-serif)"
|
|
530
|
-
};
|
|
531
|
-
var lineHeightMap = exports.lineHeightMap = {
|
|
532
|
-
'font.lineHeight.1': "var(--ds-font-lineHeight-1, 1)",
|
|
533
|
-
'font.lineHeight.100': "var(--ds-font-lineHeight-100, 16px)",
|
|
534
|
-
'font.lineHeight.200': "var(--ds-font-lineHeight-200, 20px)",
|
|
535
|
-
'font.lineHeight.300': "var(--ds-font-lineHeight-300, 24px)",
|
|
536
|
-
'font.lineHeight.400': "var(--ds-font-lineHeight-400, 28px)",
|
|
537
|
-
'font.lineHeight.500': "var(--ds-font-lineHeight-500, 32px)",
|
|
538
|
-
'font.lineHeight.600': "var(--ds-font-lineHeight-600, 40px)"
|
|
539
|
-
};
|
|
540
|
-
var bodyTextMap = exports.bodyTextMap = {
|
|
541
|
-
body: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
542
|
-
'body.large': "var(--ds-font-body-large, normal 400 16px/24px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
543
|
-
'body.small': "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
544
|
-
};
|
|
545
|
-
var uiTextMap = exports.uiTextMap = {
|
|
546
|
-
ui: "var(--ds-font-ui, normal 500 14px/1 ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
547
|
-
'ui.small': "var(--ds-font-ui-small, normal 400 11px/1 ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
519
|
+
'font.family.brand.heading': "var(--ds-font-family-brand-heading, \"Charlie Display\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
548
520
|
};
|
|
549
521
|
|
|
550
522
|
/**
|
|
@@ -573,12 +545,9 @@ var spaceStylesMap = exports.spaceStylesMap = spacingProperties.reduce(function
|
|
|
573
545
|
}, {});
|
|
574
546
|
var backgroundColorStylesMap = exports.backgroundColorStylesMap = getSerializedStylesMap('backgroundColor', backgroundColorMap);
|
|
575
547
|
var textColorStylesMap = exports.textColorStylesMap = getSerializedStylesMap('color', textColorMap);
|
|
576
|
-
var fontSizeStylesMap = exports.fontSizeStylesMap = getSerializedStylesMap('fontSize', fontSizeMap);
|
|
577
548
|
var fontWeightStylesMap = exports.fontWeightStylesMap = getSerializedStylesMap('fontWeight', fontWeightMap);
|
|
578
549
|
var fontFamilyStylesMap = exports.fontFamilyStylesMap = getSerializedStylesMap('fontFamily', fontFamilyMap);
|
|
579
|
-
var
|
|
580
|
-
var bodyTextStylesMap = exports.bodyTextStylesMap = getSerializedStylesMap('font', bodyTextMap);
|
|
581
|
-
var uiTextStylesMap = exports.uiTextStylesMap = getSerializedStylesMap('font', uiTextMap);
|
|
550
|
+
var fontStylesMap = exports.fontStylesMap = getSerializedStylesMap('font', bodyFontMap);
|
|
582
551
|
var surfaceColorStylesMap = exports.surfaceColorStylesMap = getSerializedStylesMap(_tokens.CURRENT_SURFACE_CSS_VAR, surfaceColorMap);
|
|
583
552
|
var isSurfaceColorToken = exports.isSurfaceColorToken = function isSurfaceColorToken(color) {
|
|
584
553
|
return surfaceColorMap[color] !== undefined;
|
package/dist/cjs/xcss/xcss.js
CHANGED
|
@@ -6,15 +6,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.tokensMap = exports.parseXcss = void 0;
|
|
8
8
|
exports.xcss = xcss;
|
|
9
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
12
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
12
13
|
var _react = require("@emotion/react");
|
|
13
14
|
var _styleMaps = require("./style-maps.partial");
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
17
|
-
|
|
15
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
16
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */ // eslint-disable-next-line import/no-extraneous-dependencies
|
|
18
18
|
var tokensMap = exports.tokensMap = {
|
|
19
19
|
backgroundColor: _styleMaps.backgroundColorMap,
|
|
20
20
|
blockSize: _styleMaps.dimensionMap,
|
|
@@ -155,21 +155,59 @@ var baseXcss = function baseXcss(style) {
|
|
|
155
155
|
};
|
|
156
156
|
|
|
157
157
|
/**
|
|
158
|
-
*
|
|
159
|
-
*
|
|
158
|
+
* Picks out runtime XCSS objects and build-time XCSS strings. This is needed
|
|
159
|
+
* to supported both Emotion and Compiled styles until we've fully migrated
|
|
160
|
+
* to Compiled.
|
|
161
|
+
*
|
|
162
|
+
* @private
|
|
163
|
+
* @deprecated
|
|
160
164
|
*/
|
|
161
|
-
|
|
162
165
|
var parseXcss = exports.parseXcss = function parseXcss(args) {
|
|
163
166
|
if (Array.isArray(args)) {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
+
var emotion = [];
|
|
168
|
+
var staticArr = [];
|
|
169
|
+
var _iterator = _createForOfIteratorHelper(args),
|
|
170
|
+
_step;
|
|
171
|
+
try {
|
|
172
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
173
|
+
var arg = _step.value;
|
|
174
|
+
var result = parseXcss(arg);
|
|
175
|
+
if (result.emotion) {
|
|
176
|
+
emotion.push.apply(emotion, (0, _toConsumableArray2.default)(result.emotion));
|
|
177
|
+
}
|
|
178
|
+
if (result.static) {
|
|
179
|
+
staticArr.push(result.static);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
} catch (err) {
|
|
183
|
+
_iterator.e(err);
|
|
184
|
+
} finally {
|
|
185
|
+
_iterator.f();
|
|
186
|
+
}
|
|
187
|
+
return {
|
|
188
|
+
emotion: emotion,
|
|
189
|
+
static: staticArr.join(' ')
|
|
190
|
+
};
|
|
167
191
|
}
|
|
168
|
-
var
|
|
169
|
-
|
|
170
|
-
|
|
192
|
+
var objArgs = args;
|
|
193
|
+
var _ref4 = objArgs || {},
|
|
194
|
+
styles = _ref4[uniqueSymbol];
|
|
195
|
+
if (styles) {
|
|
196
|
+
return {
|
|
197
|
+
emotion: [styles]
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
if (args) {
|
|
201
|
+
// We use string interpolation here instead of .toString() just
|
|
202
|
+
// in case the resulting object doesn't have the method available.
|
|
203
|
+
var stringifiedArgs = "".concat(args);
|
|
204
|
+
if (stringifiedArgs) {
|
|
205
|
+
return {
|
|
206
|
+
static: stringifiedArgs
|
|
207
|
+
};
|
|
208
|
+
}
|
|
171
209
|
}
|
|
172
|
-
return
|
|
210
|
+
return {};
|
|
173
211
|
};
|
|
174
212
|
|
|
175
213
|
// Media queries should not contain nested media queries
|
|
@@ -62,13 +62,15 @@ const Anchor = ({
|
|
|
62
62
|
action: 'clicked',
|
|
63
63
|
componentName: componentName || 'Anchor',
|
|
64
64
|
packageName: "@atlaskit/primitives",
|
|
65
|
-
packageVersion: "
|
|
65
|
+
packageVersion: "4.0.0",
|
|
66
66
|
analyticsData: analyticsContext,
|
|
67
67
|
actionSubject: 'link'
|
|
68
68
|
});
|
|
69
69
|
const RouterLink = useRouterLink();
|
|
70
70
|
|
|
71
|
-
//
|
|
71
|
+
// We're type coercing this as Compiled styles in an array isn't supported by the types
|
|
72
|
+
// But the runtime accepts it none-the-wiser. We can remove this entire block and replace
|
|
73
|
+
// it with cx(defaultStyles, focusRingStyles, xcssStyles) when we've moved away from Emotion.
|
|
72
74
|
const styles = Array.isArray(xcssStyles) ? [defaultStyles, focusRingStyles, ...xcssStyles] : [defaultStyles, focusRingStyles, xcssStyles];
|
|
73
75
|
const isExternal = typeof href === 'string' && IS_EXTERNAL_LINK_REGEX.test(href);
|
|
74
76
|
const isNonHttpBased = typeof href === 'string' && IS_NON_HTTP_BASED.test(href);
|
|
@@ -59,11 +59,12 @@ const Bleed = /*#__PURE__*/React.memo(({
|
|
|
59
59
|
all,
|
|
60
60
|
xcss
|
|
61
61
|
}) => {
|
|
62
|
-
const
|
|
62
|
+
const resolvedStyles = parseXcss(xcss);
|
|
63
63
|
return jsx("div", {
|
|
64
|
+
className: resolvedStyles.static,
|
|
64
65
|
css: [baseStyles, (inline || all) && inlineBleedMap[inline || all], (block || all) && blockBleedMap[block || all],
|
|
65
66
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
66
|
-
|
|
67
|
+
resolvedStyles.emotion],
|
|
67
68
|
"data-testid": testId
|
|
68
69
|
}, children);
|
|
69
70
|
});
|
|
@@ -21,7 +21,7 @@ import { SurfaceContext } from './internal/surface-provider';
|
|
|
21
21
|
* - [Usage](https://atlassian.design/components/primitives/box/usage)
|
|
22
22
|
*/
|
|
23
23
|
export const Box = /*#__PURE__*/forwardRef(({
|
|
24
|
-
as = 'div',
|
|
24
|
+
as: Component = 'div',
|
|
25
25
|
children,
|
|
26
26
|
backgroundColor,
|
|
27
27
|
padding,
|
|
@@ -36,26 +36,26 @@ export const Box = /*#__PURE__*/forwardRef(({
|
|
|
36
36
|
xcss,
|
|
37
37
|
...htmlAttributes
|
|
38
38
|
}, ref) => {
|
|
39
|
-
const Component = as;
|
|
40
39
|
// This is to remove className from safeHtmlAttributes
|
|
41
40
|
// @ts-expect-error className doesn't exist in the prop definition but we want to ensure it cannot be applied even if types are bypassed
|
|
42
41
|
const {
|
|
43
42
|
className: _spreadClass,
|
|
44
43
|
...safeHtmlAttributes
|
|
45
44
|
} = htmlAttributes;
|
|
46
|
-
const
|
|
45
|
+
const resolvedStyles = parseXcss(xcss);
|
|
47
46
|
const node =
|
|
48
47
|
// @ts-expect-error Expression produces a union type that is too complex to represent. I think this is unavoidable
|
|
49
48
|
jsx(Component, _extends({
|
|
50
49
|
style: style
|
|
51
50
|
// @ts-expect-error Expression produces a union type that is too complex to represent. We may be able to narrow the type here but unsure.
|
|
52
51
|
,
|
|
53
|
-
ref: ref
|
|
52
|
+
ref: ref,
|
|
53
|
+
className: resolvedStyles.static
|
|
54
54
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
55
55
|
}, safeHtmlAttributes, {
|
|
56
56
|
css: [baseStyles, backgroundColor && backgroundColorStylesMap[backgroundColor], isSurfaceColorToken(backgroundColor) && surfaceColorStylesMap[backgroundColor], padding && paddingStylesMap.padding[padding], paddingBlock && paddingStylesMap.paddingBlock[paddingBlock], paddingBlockStart && paddingStylesMap.paddingBlockStart[paddingBlockStart], paddingBlockEnd && paddingStylesMap.paddingBlockEnd[paddingBlockEnd], paddingInline && paddingStylesMap.paddingInline[paddingInline], paddingInlineStart && paddingStylesMap.paddingInlineStart[paddingInlineStart], paddingInlineEnd && paddingStylesMap.paddingInlineEnd[paddingInlineEnd],
|
|
57
57
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
58
|
-
|
|
58
|
+
resolvedStyles.emotion],
|
|
59
59
|
"data-testid": testId
|
|
60
60
|
}), children);
|
|
61
61
|
return backgroundColor ? jsx(SurfaceContext.Provider, {
|
|
@@ -98,12 +98,13 @@ const Flex = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
98
98
|
wrap,
|
|
99
99
|
xcss
|
|
100
100
|
}, ref) => {
|
|
101
|
-
const
|
|
101
|
+
const resolvedStyles = parseXcss(xcss);
|
|
102
102
|
return jsx(Component, {
|
|
103
103
|
role: role,
|
|
104
|
+
className: resolvedStyles.static,
|
|
104
105
|
css: [baseStyles, gap && spaceStylesMap.gap[gap], columnGap && spaceStylesMap.columnGap[columnGap], rowGap && spaceStylesMap.rowGap[rowGap], alignItems && alignItemsMap[alignItems], direction && flexDirectionMap[direction], justifyContent && justifyContentMap[justifyContent], wrap && flexWrapMap[wrap],
|
|
105
106
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
106
|
-
|
|
107
|
+
resolvedStyles.emotion],
|
|
107
108
|
"data-testid": testId,
|
|
108
109
|
ref: ref
|
|
109
110
|
}, children);
|
|
@@ -144,7 +144,7 @@ const Grid = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
144
144
|
xcss
|
|
145
145
|
}, ref) => {
|
|
146
146
|
const Component = as || 'div';
|
|
147
|
-
const
|
|
147
|
+
const resolvedStyles = parseXcss(xcss);
|
|
148
148
|
|
|
149
149
|
/**
|
|
150
150
|
* We use CSS variables to allow for dynamic grid templates instead of dynamically setting to `props.style`
|
|
@@ -163,9 +163,10 @@ const Grid = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
163
163
|
id: id,
|
|
164
164
|
role: role,
|
|
165
165
|
style: style,
|
|
166
|
+
className: resolvedStyles.static,
|
|
166
167
|
css: [baseStyles, gap && spaceStylesMap.gap[gap], columnGap && spaceStylesMap.columnGap[columnGap], rowGap && spaceStylesMap.rowGap[rowGap], alignItems && alignItemsMap[alignItems], alignContent && alignContentMap[alignContent], justifyContent && justifyContentMap[justifyContent], autoFlow && gridAutoFlowMap[autoFlow],
|
|
167
168
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
168
|
-
|
|
169
|
+
resolvedStyles.emotion],
|
|
169
170
|
"data-testid": testId,
|
|
170
171
|
ref: ref
|
|
171
172
|
}, children);
|
|
@@ -62,6 +62,11 @@ const Inline = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
62
62
|
}, separator && index > 0 ? separatorComponent : null, child);
|
|
63
63
|
}) : rawChildren;
|
|
64
64
|
const justifyContent = spread || alignInline;
|
|
65
|
+
|
|
66
|
+
// We're type coercing this as Compiled styles in an array isn't supported by the types
|
|
67
|
+
// But the runtime accepts it none-the-wiser. We can remove this entire block and replace
|
|
68
|
+
// it with cx(defaultStyles, focusRingStyles, xcssStyles) when we've moved away from Emotion.
|
|
69
|
+
const styles = grow ? [flexGrowMap[grow], ...(Array.isArray(xcss) ? xcss : [xcss])] : xcss;
|
|
65
70
|
return jsx(Flex, {
|
|
66
71
|
as: as,
|
|
67
72
|
role: role,
|
|
@@ -70,10 +75,10 @@ const Inline = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
70
75
|
direction: "row",
|
|
71
76
|
gap: space,
|
|
72
77
|
rowGap: rowSpace,
|
|
73
|
-
wrap: shouldWrap ? 'wrap' : undefined
|
|
74
|
-
xcss: grow ? [flexGrowMap[grow], ...(Array.isArray(xcss) ? xcss : [xcss])] :
|
|
78
|
+
wrap: shouldWrap ? 'wrap' : undefined
|
|
75
79
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
76
|
-
|
|
80
|
+
,
|
|
81
|
+
xcss: styles,
|
|
77
82
|
testId: testId,
|
|
78
83
|
ref: ref
|
|
79
84
|
}, children);
|