@atlaskit/primitives 14.3.3 → 14.5.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 +19 -0
- package/constellation/anchor/examples.mdx +1 -0
- package/dist/cjs/compiled/components/anchor.js +1 -1
- package/dist/cjs/compiled/components/box.js +0 -1
- package/dist/cjs/compiled/components/pressable.js +1 -3
- package/dist/cjs/compiled/components/text.js +9 -29
- package/dist/cjs/components/anchor.js +2 -4
- package/dist/cjs/components/bleed.js +1 -3
- package/dist/cjs/components/box.js +1 -4
- package/dist/cjs/components/flex.js +1 -3
- package/dist/cjs/components/grid.js +1 -3
- package/dist/cjs/components/inline.js +0 -1
- package/dist/cjs/components/pressable.js +32 -38
- package/dist/cjs/components/stack.js +0 -1
- package/dist/cjs/components/text.js +8 -26
- package/dist/cjs/xcss/xcss.js +1 -2
- package/dist/es2019/compiled/components/anchor.js +1 -1
- package/dist/es2019/compiled/components/box.js +0 -1
- package/dist/es2019/compiled/components/pressable.js +1 -3
- package/dist/es2019/compiled/components/text.js +9 -29
- package/dist/es2019/components/anchor.js +2 -4
- package/dist/es2019/components/bleed.js +1 -3
- package/dist/es2019/components/box.js +1 -4
- package/dist/es2019/components/flex.js +1 -3
- package/dist/es2019/components/grid.js +1 -3
- package/dist/es2019/components/inline.js +0 -1
- package/dist/es2019/components/pressable.js +32 -38
- package/dist/es2019/components/stack.js +0 -1
- package/dist/es2019/components/text.js +8 -26
- package/dist/es2019/responsive/build-media-query-css.js +1 -1
- package/dist/es2019/xcss/xcss.js +0 -4
- package/dist/esm/compiled/components/anchor.js +1 -1
- package/dist/esm/compiled/components/box.js +0 -1
- package/dist/esm/compiled/components/pressable.js +1 -3
- package/dist/esm/compiled/components/text.js +9 -29
- package/dist/esm/components/anchor.js +2 -4
- package/dist/esm/components/bleed.js +1 -3
- package/dist/esm/components/box.js +1 -4
- package/dist/esm/components/flex.js +1 -3
- package/dist/esm/components/grid.js +1 -3
- package/dist/esm/components/inline.js +0 -1
- package/dist/esm/components/pressable.js +32 -38
- package/dist/esm/components/stack.js +0 -1
- package/dist/esm/components/text.js +8 -26
- package/dist/esm/xcss/xcss.js +0 -4
- package/dist/types/compiled/components/box.d.ts +8 -4
- package/dist/types/components/box.d.ts +5 -1
- package/dist/types-ts4.5/compiled/components/box.d.ts +8 -4
- package/dist/types-ts4.5/components/box.d.ts +5 -1
- package/package.json +13 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/primitives
|
|
2
2
|
|
|
3
|
+
## 14.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#148288](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/148288)
|
|
8
|
+
[`c31c2fb751ae5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c31c2fb751ae5) -
|
|
9
|
+
Add `backgroundColor` back to `props.style` and `props.xcss` for `Box` from
|
|
10
|
+
`@atlaskit/primitives/compiled` to have a more iterative migration, but we still prefer the
|
|
11
|
+
`props.backgroundColor` value.
|
|
12
|
+
|
|
13
|
+
## 14.4.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- [#138526](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/138526)
|
|
18
|
+
[`1c66b8e32f30a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1c66b8e32f30a) -
|
|
19
|
+
[ux] Removed feature flag `platform-typography-improved-color-control` resulting in automatic
|
|
20
|
+
color inversion based on bold surfaces will only affect the default color.
|
|
21
|
+
|
|
3
22
|
## 14.3.3
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -98,6 +98,7 @@ Anchor will only render a router link if:
|
|
|
98
98
|
Component={AnchorRouterLinkConfiguration}
|
|
99
99
|
packageName="@atlaskit/primitives/anchor"
|
|
100
100
|
appearance="source-only"
|
|
101
|
+
isCodeSandboxDisabled
|
|
101
102
|
/>
|
|
102
103
|
|
|
103
104
|
<Snippet name="primitives-event-tracking-header" variables={{ componentName: 'anchor' }} />
|
|
@@ -70,7 +70,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
70
70
|
action: 'clicked',
|
|
71
71
|
componentName: componentName || 'Anchor',
|
|
72
72
|
packageName: "@atlaskit/primitives",
|
|
73
|
-
packageVersion: "14.
|
|
73
|
+
packageVersion: "14.5.0",
|
|
74
74
|
analyticsData: analyticsContext,
|
|
75
75
|
actionSubject: 'link'
|
|
76
76
|
});
|
|
@@ -345,7 +345,6 @@ var Box = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
345
345
|
,
|
|
346
346
|
ref: ref,
|
|
347
347
|
className: (0, _runtime.ax)(["_19itglyw _vchhusvi _r06hglyw", backgroundColor && backgroundColorMap[backgroundColor], backgroundColor && isSurfaceToken(backgroundColor) && setSurfaceTokenMap[backgroundColor], paddingBlockStart && paddingBlockStartMap[paddingBlockStart], paddingBlockEnd && paddingBlockEndMap[paddingBlockEnd], paddingInlineStart && paddingInlineStartMap[paddingInlineStart], paddingInlineEnd && paddingInlineEndMap[paddingInlineEnd], xcss])
|
|
348
|
-
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
349
348
|
}, safeHtmlAttributes, {
|
|
350
349
|
"data-testid": testId
|
|
351
350
|
}), children);
|
|
@@ -60,7 +60,7 @@ var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
60
60
|
action: 'clicked',
|
|
61
61
|
componentName: componentName || 'Pressable',
|
|
62
62
|
packageName: "@atlaskit/primitives",
|
|
63
|
-
packageVersion: "14.
|
|
63
|
+
packageVersion: "14.5.0",
|
|
64
64
|
analyticsData: analyticsContext,
|
|
65
65
|
actionSubject: 'button'
|
|
66
66
|
});
|
|
@@ -76,9 +76,7 @@ var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
76
76
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- TODO: Properly type this and allow pass-through if we can determine the type
|
|
77
77
|
,
|
|
78
78
|
style: style
|
|
79
|
-
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
80
79
|
}, safeHtmlAttributes, {
|
|
81
|
-
// eslint-disable-next-line react/button-has-type
|
|
82
80
|
type: type,
|
|
83
81
|
onClick: onClick,
|
|
84
82
|
disabled: isDisabled,
|
|
@@ -12,7 +12,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var React = _react;
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
14
|
var _tinyInvariant = _interopRequireDefault(require("tiny-invariant"));
|
|
15
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
15
|
var _hasTextAncestorContext = require("../../utils/has-text-ancestor-context");
|
|
17
16
|
var _surfaceProvider = require("../../utils/surface-provider");
|
|
18
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -23,36 +22,19 @@ var asAllowlist = ['span', 'p', 'strong', 'em'];
|
|
|
23
22
|
*/
|
|
24
23
|
var useColor = function useColor(colorProp, hasTextAncestor) {
|
|
25
24
|
var surface = (0, _surfaceProvider.useSurface)();
|
|
26
|
-
if ((0, _platformFeatureFlags.fg)('platform-typography-improved-color-control')) {
|
|
27
|
-
if (colorProp === 'inherit') {
|
|
28
|
-
return undefined;
|
|
29
|
-
}
|
|
30
|
-
if (colorProp) {
|
|
31
|
-
return colorProp;
|
|
32
|
-
}
|
|
33
|
-
if (hasTextAncestor) {
|
|
34
|
-
return undefined;
|
|
35
|
-
}
|
|
36
|
-
if (inverseColorMap.hasOwnProperty(surface)) {
|
|
37
|
-
return inverseColorMap[surface];
|
|
38
|
-
}
|
|
39
|
-
return 'color.text';
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/*
|
|
43
|
-
* Where the color of the surface is inverted we always override the color
|
|
44
|
-
* as there is no valid choice that is not covered by the override.
|
|
45
|
-
*/
|
|
46
|
-
if (surface in inverseColorMap) {
|
|
47
|
-
return inverseColorMap[surface];
|
|
48
|
-
}
|
|
49
25
|
if (colorProp === 'inherit') {
|
|
50
26
|
return undefined;
|
|
51
27
|
}
|
|
52
|
-
if (
|
|
28
|
+
if (colorProp) {
|
|
29
|
+
return colorProp;
|
|
30
|
+
}
|
|
31
|
+
if (hasTextAncestor) {
|
|
53
32
|
return undefined;
|
|
54
33
|
}
|
|
55
|
-
|
|
34
|
+
if (inverseColorMap.hasOwnProperty(surface)) {
|
|
35
|
+
return inverseColorMap[surface];
|
|
36
|
+
}
|
|
37
|
+
return 'color.text';
|
|
56
38
|
};
|
|
57
39
|
var styles = {
|
|
58
40
|
root: "_19pkidpf _2hwxidpf _otyridpf _18u0idpf _1i4qfg65",
|
|
@@ -173,9 +155,7 @@ var Text = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
173
155
|
size = 'medium';
|
|
174
156
|
}
|
|
175
157
|
var component = /*#__PURE__*/React.createElement(Component, {
|
|
176
|
-
id: id
|
|
177
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
178
|
-
,
|
|
158
|
+
id: id,
|
|
179
159
|
className: (0, _runtime.ax)([styles.root, size && fontSizeMap[size], color && textColorMap[color], maxLines && styles.truncation, maxLines === 1 && styles.breakAll, align && styles["textAlign.".concat(align)], weight && fontWeightMap[weight], Component === 'em' && styles['as.em'], Component === 'strong' && styles['as.strong'], xcss]),
|
|
180
160
|
style: {
|
|
181
161
|
WebkitLineClamp: maxLines
|
|
@@ -100,7 +100,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
100
100
|
action: 'clicked',
|
|
101
101
|
componentName: componentName || 'Anchor',
|
|
102
102
|
packageName: "@atlaskit/primitives",
|
|
103
|
-
packageVersion: "14.
|
|
103
|
+
packageVersion: "14.5.0",
|
|
104
104
|
analyticsData: analyticsContext,
|
|
105
105
|
actionSubject: 'link'
|
|
106
106
|
});
|
|
@@ -158,9 +158,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
158
158
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
159
159
|
paddingInlineStart && _styleMaps.paddingStylesMap.paddingInlineStart[paddingInlineStart],
|
|
160
160
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
161
|
-
paddingInlineEnd && _styleMaps.paddingStylesMap.paddingInlineEnd[paddingInlineEnd],
|
|
162
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
163
|
-
resolvedStyles.emotion],
|
|
161
|
+
paddingInlineEnd && _styleMaps.paddingStylesMap.paddingInlineEnd[paddingInlineEnd], resolvedStyles.emotion],
|
|
164
162
|
"data-testid": testId,
|
|
165
163
|
"data-is-router-link": testId ? isRouterLink ? 'true' : 'false' : undefined
|
|
166
164
|
}), children, target === '_blank' && (children && !ariaLabel && !ariaLabelledBy || ariaLabelledBy) && (0, _react2.jsx)(_visuallyHidden.default, {
|
|
@@ -72,9 +72,7 @@ var Bleed = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
72
72
|
return (0, _react2.jsx)("div", {
|
|
73
73
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
74
74
|
className: resolvedStyles.static,
|
|
75
|
-
css: [baseStyles, (inline || all) && inlineBleedMap[inline || all], (block || all) && blockBleedMap[block || all],
|
|
76
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
77
|
-
resolvedStyles.emotion],
|
|
75
|
+
css: [baseStyles, (inline || all) && inlineBleedMap[inline || all], (block || all) && blockBleedMap[block || all], resolvedStyles.emotion],
|
|
78
76
|
"data-testid": testId
|
|
79
77
|
}, children);
|
|
80
78
|
});
|
|
@@ -67,7 +67,6 @@ var Box = exports.Box = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
|
|
|
67
67
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
68
68
|
,
|
|
69
69
|
className: resolvedStyles.static
|
|
70
|
-
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
71
70
|
}, safeHtmlAttributes, {
|
|
72
71
|
css: [baseStyles,
|
|
73
72
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
@@ -87,9 +86,7 @@ var Box = exports.Box = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
|
|
|
87
86
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
88
87
|
paddingInlineStart && _styleMaps.paddingStylesMap.paddingInlineStart[paddingInlineStart],
|
|
89
88
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
90
|
-
paddingInlineEnd && _styleMaps.paddingStylesMap.paddingInlineEnd[paddingInlineEnd],
|
|
91
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
92
|
-
resolvedStyles.emotion],
|
|
89
|
+
paddingInlineEnd && _styleMaps.paddingStylesMap.paddingInlineEnd[paddingInlineEnd], resolvedStyles.emotion],
|
|
93
90
|
"data-testid": testId
|
|
94
91
|
}), children);
|
|
95
92
|
return backgroundColor ? (0, _react2.jsx)(_surfaceProvider.SurfaceContext.Provider, {
|
|
@@ -122,9 +122,7 @@ var Flex = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
122
122
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
123
123
|
columnGap && _styleMaps.spaceStylesMap.columnGap[columnGap],
|
|
124
124
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
125
|
-
rowGap && _styleMaps.spaceStylesMap.rowGap[rowGap], alignItems && alignItemsMap[alignItems], direction && flexDirectionMap[direction], justifyContent && justifyContentMap[justifyContent], wrap && flexWrapMap[wrap],
|
|
126
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
127
|
-
resolvedStyles.emotion],
|
|
125
|
+
rowGap && _styleMaps.spaceStylesMap.rowGap[rowGap], alignItems && alignItemsMap[alignItems], direction && flexDirectionMap[direction], justifyContent && justifyContentMap[justifyContent], wrap && flexWrapMap[wrap], resolvedStyles.emotion],
|
|
128
126
|
"data-testid": testId,
|
|
129
127
|
ref: ref
|
|
130
128
|
}, children);
|
|
@@ -187,9 +187,7 @@ var Grid = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
187
187
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
188
188
|
columnGap && _styleMaps.spaceStylesMap.columnGap[columnGap],
|
|
189
189
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
190
|
-
rowGap && _styleMaps.spaceStylesMap.rowGap[rowGap], alignItems && alignItemsMap[alignItems], alignContent && alignContentMap[alignContent], justifyContent && justifyContentMap[justifyContent], autoFlow && gridAutoFlowMap[autoFlow],
|
|
191
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
192
|
-
resolvedStyles.emotion],
|
|
190
|
+
rowGap && _styleMaps.spaceStylesMap.rowGap[rowGap], alignItems && alignItemsMap[alignItems], alignContent && alignContentMap[alignContent], justifyContent && justifyContentMap[justifyContent], autoFlow && gridAutoFlowMap[autoFlow], resolvedStyles.emotion],
|
|
193
191
|
"data-testid": testId,
|
|
194
192
|
ref: ref
|
|
195
193
|
}, children);
|
|
@@ -13,7 +13,6 @@ var _xcss = require("../xcss/xcss");
|
|
|
13
13
|
var _flex = _interopRequireDefault(require("./flex"));
|
|
14
14
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
15
15
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
-
/* eslint-disable @repo/internal/styles/no-exported-styles */
|
|
17
16
|
/**
|
|
18
17
|
* @jsxRuntime classic
|
|
19
18
|
* @jsx jsx
|
|
@@ -95,7 +95,7 @@ var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
95
95
|
action: 'clicked',
|
|
96
96
|
componentName: componentName || 'Pressable',
|
|
97
97
|
packageName: "@atlaskit/primitives",
|
|
98
|
-
packageVersion: "14.
|
|
98
|
+
packageVersion: "14.5.0",
|
|
99
99
|
analyticsData: analyticsContext,
|
|
100
100
|
actionSubject: 'button'
|
|
101
101
|
});
|
|
@@ -105,42 +105,36 @@ var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
105
105
|
var _spreadClass = htmlAttributes.className,
|
|
106
106
|
safeHtmlAttributes = (0, _objectWithoutProperties2.default)(htmlAttributes, _excluded2);
|
|
107
107
|
var resolvedStyles = (0, _xcss.parseXcss)(xcss);
|
|
108
|
-
return (
|
|
109
|
-
// eslint-disable-next-line @atlaskit/
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
paddingInlineEnd && _styleMaps.paddingStylesMap.paddingInlineEnd[paddingInlineEnd],
|
|
140
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
141
|
-
resolvedStyles.emotion],
|
|
142
|
-
"data-testid": testId
|
|
143
|
-
}), children)
|
|
144
|
-
);
|
|
108
|
+
return (0, _react2.jsx)("button", (0, _extends2.default)({
|
|
109
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
110
|
+
style: style,
|
|
111
|
+
ref: ref
|
|
112
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
113
|
+
,
|
|
114
|
+
className: resolvedStyles.static
|
|
115
|
+
}, safeHtmlAttributes, {
|
|
116
|
+
// eslint-disable-next-line react/button-has-type
|
|
117
|
+
type: type,
|
|
118
|
+
onClick: onClick,
|
|
119
|
+
disabled: isDisabled,
|
|
120
|
+
css: [baseStyles, focusRingStyles, isDisabled ? disabledStyles : enabledStyles,
|
|
121
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
122
|
+
backgroundColor && _styleMaps.backgroundColorStylesMap[backgroundColor],
|
|
123
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
124
|
+
padding && _styleMaps.paddingStylesMap.padding[padding],
|
|
125
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
126
|
+
paddingBlock && _styleMaps.paddingStylesMap.paddingBlock[paddingBlock],
|
|
127
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
128
|
+
paddingBlockStart && _styleMaps.paddingStylesMap.paddingBlockStart[paddingBlockStart],
|
|
129
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
130
|
+
paddingBlockEnd && _styleMaps.paddingStylesMap.paddingBlockEnd[paddingBlockEnd],
|
|
131
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
132
|
+
paddingInline && _styleMaps.paddingStylesMap.paddingInline[paddingInline],
|
|
133
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
134
|
+
paddingInlineStart && _styleMaps.paddingStylesMap.paddingInlineStart[paddingInlineStart],
|
|
135
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
136
|
+
paddingInlineEnd && _styleMaps.paddingStylesMap.paddingInlineEnd[paddingInlineEnd], resolvedStyles.emotion],
|
|
137
|
+
"data-testid": testId
|
|
138
|
+
}), children);
|
|
145
139
|
});
|
|
146
140
|
var _default = exports.default = Pressable;
|
|
@@ -10,7 +10,6 @@ var _react = require("react");
|
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
11
|
var _xcss = require("../xcss/xcss");
|
|
12
12
|
var _flex = _interopRequireDefault(require("./flex"));
|
|
13
|
-
/* eslint-disable @repo/internal/styles/no-exported-styles */
|
|
14
13
|
/**
|
|
15
14
|
* @jsxRuntime classic
|
|
16
15
|
* @jsx jsx
|
|
@@ -8,7 +8,6 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _react2 = require("@emotion/react");
|
|
10
10
|
var _tinyInvariant = _interopRequireDefault(require("tiny-invariant"));
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
var _hasTextAncestorContext = require("../utils/has-text-ancestor-context");
|
|
13
12
|
var _surfaceProvider = require("../utils/surface-provider");
|
|
14
13
|
var _styleMaps = require("../xcss/style-maps.partial");
|
|
@@ -60,36 +59,19 @@ var wordBreakMap = {
|
|
|
60
59
|
*/
|
|
61
60
|
var useColor = function useColor(colorProp, hasTextAncestor) {
|
|
62
61
|
var surface = (0, _surfaceProvider.useSurface)();
|
|
63
|
-
if ((0, _platformFeatureFlags.fg)('platform-typography-improved-color-control')) {
|
|
64
|
-
if (colorProp === 'inherit') {
|
|
65
|
-
return undefined;
|
|
66
|
-
}
|
|
67
|
-
if (colorProp) {
|
|
68
|
-
return colorProp;
|
|
69
|
-
}
|
|
70
|
-
if (hasTextAncestor) {
|
|
71
|
-
return undefined;
|
|
72
|
-
}
|
|
73
|
-
if (_styleMaps.inverseColorMap.hasOwnProperty(surface)) {
|
|
74
|
-
return _styleMaps.inverseColorMap[surface];
|
|
75
|
-
}
|
|
76
|
-
return 'color.text';
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Where the color of the surface is inverted we always override the color
|
|
81
|
-
* as there is no valid choice that is not covered by the override.
|
|
82
|
-
*/
|
|
83
|
-
if (_styleMaps.inverseColorMap.hasOwnProperty(surface)) {
|
|
84
|
-
return _styleMaps.inverseColorMap[surface];
|
|
85
|
-
}
|
|
86
62
|
if (colorProp === 'inherit') {
|
|
87
63
|
return undefined;
|
|
88
64
|
}
|
|
89
|
-
if (
|
|
65
|
+
if (colorProp) {
|
|
66
|
+
return colorProp;
|
|
67
|
+
}
|
|
68
|
+
if (hasTextAncestor) {
|
|
90
69
|
return undefined;
|
|
91
70
|
}
|
|
92
|
-
|
|
71
|
+
if (_styleMaps.inverseColorMap.hasOwnProperty(surface)) {
|
|
72
|
+
return _styleMaps.inverseColorMap[surface];
|
|
73
|
+
}
|
|
74
|
+
return 'color.text';
|
|
93
75
|
};
|
|
94
76
|
|
|
95
77
|
/**
|
package/dist/cjs/xcss/xcss.js
CHANGED
|
@@ -14,8 +14,7 @@ var _react = require("@emotion/react");
|
|
|
14
14
|
var _styleMaps = require("./style-maps.partial");
|
|
15
15
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
16
16
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
17
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
18
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
17
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
19
18
|
var tokensMap = exports.tokensMap = {
|
|
20
19
|
backgroundColor: _styleMaps.backgroundColorMap,
|
|
21
20
|
blockSize: _styleMaps.dimensionMap,
|
|
@@ -329,7 +329,6 @@ const Box = /*#__PURE__*/forwardRef(({
|
|
|
329
329
|
,
|
|
330
330
|
ref: ref,
|
|
331
331
|
className: ax(["_19itglyw _vchhusvi _r06hglyw", backgroundColor && backgroundColorMap[backgroundColor], backgroundColor && isSurfaceToken(backgroundColor) && setSurfaceTokenMap[backgroundColor], paddingBlockStart && paddingBlockStartMap[paddingBlockStart], paddingBlockEnd && paddingBlockEndMap[paddingBlockEnd], paddingInlineStart && paddingInlineStartMap[paddingInlineStart], paddingInlineEnd && paddingInlineEndMap[paddingInlineEnd], xcss])
|
|
332
|
-
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
333
332
|
}, safeHtmlAttributes, {
|
|
334
333
|
"data-testid": testId
|
|
335
334
|
}), children);
|
|
@@ -46,7 +46,7 @@ const Pressable = /*#__PURE__*/forwardRef(({
|
|
|
46
46
|
action: 'clicked',
|
|
47
47
|
componentName: componentName || 'Pressable',
|
|
48
48
|
packageName: "@atlaskit/primitives",
|
|
49
|
-
packageVersion: "14.
|
|
49
|
+
packageVersion: "14.5.0",
|
|
50
50
|
analyticsData: analyticsContext,
|
|
51
51
|
actionSubject: 'button'
|
|
52
52
|
});
|
|
@@ -64,9 +64,7 @@ const Pressable = /*#__PURE__*/forwardRef(({
|
|
|
64
64
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- TODO: Properly type this and allow pass-through if we can determine the type
|
|
65
65
|
,
|
|
66
66
|
style: style
|
|
67
|
-
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
68
67
|
}, safeHtmlAttributes, {
|
|
69
|
-
// eslint-disable-next-line react/button-has-type
|
|
70
68
|
type: type,
|
|
71
69
|
onClick: onClick,
|
|
72
70
|
disabled: isDisabled,
|
|
@@ -4,7 +4,6 @@ import * as React from 'react';
|
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
import invariant from 'tiny-invariant';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { HasTextAncestorProvider, useHasTextAncestor } from '../../utils/has-text-ancestor-context';
|
|
9
8
|
import { useSurface } from '../../utils/surface-provider';
|
|
10
9
|
const asAllowlist = ['span', 'p', 'strong', 'em'];
|
|
@@ -13,36 +12,19 @@ const asAllowlist = ['span', 'p', 'strong', 'em'];
|
|
|
13
12
|
*/
|
|
14
13
|
const useColor = (colorProp, hasTextAncestor) => {
|
|
15
14
|
const surface = useSurface();
|
|
16
|
-
if (fg('platform-typography-improved-color-control')) {
|
|
17
|
-
if (colorProp === 'inherit') {
|
|
18
|
-
return undefined;
|
|
19
|
-
}
|
|
20
|
-
if (colorProp) {
|
|
21
|
-
return colorProp;
|
|
22
|
-
}
|
|
23
|
-
if (hasTextAncestor) {
|
|
24
|
-
return undefined;
|
|
25
|
-
}
|
|
26
|
-
if (inverseColorMap.hasOwnProperty(surface)) {
|
|
27
|
-
return inverseColorMap[surface];
|
|
28
|
-
}
|
|
29
|
-
return 'color.text';
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/*
|
|
33
|
-
* Where the color of the surface is inverted we always override the color
|
|
34
|
-
* as there is no valid choice that is not covered by the override.
|
|
35
|
-
*/
|
|
36
|
-
if (surface in inverseColorMap) {
|
|
37
|
-
return inverseColorMap[surface];
|
|
38
|
-
}
|
|
39
15
|
if (colorProp === 'inherit') {
|
|
40
16
|
return undefined;
|
|
41
17
|
}
|
|
42
|
-
if (
|
|
18
|
+
if (colorProp) {
|
|
19
|
+
return colorProp;
|
|
20
|
+
}
|
|
21
|
+
if (hasTextAncestor) {
|
|
43
22
|
return undefined;
|
|
44
23
|
}
|
|
45
|
-
|
|
24
|
+
if (inverseColorMap.hasOwnProperty(surface)) {
|
|
25
|
+
return inverseColorMap[surface];
|
|
26
|
+
}
|
|
27
|
+
return 'color.text';
|
|
46
28
|
};
|
|
47
29
|
const styles = {
|
|
48
30
|
root: "_19pkidpf _2hwxidpf _otyridpf _18u0idpf _1i4qfg65",
|
|
@@ -163,9 +145,7 @@ const Text = /*#__PURE__*/forwardRef(({
|
|
|
163
145
|
size = 'medium';
|
|
164
146
|
}
|
|
165
147
|
const component = /*#__PURE__*/React.createElement(Component, {
|
|
166
|
-
id: id
|
|
167
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
168
|
-
,
|
|
148
|
+
id: id,
|
|
169
149
|
className: ax([styles.root, size && fontSizeMap[size], color && textColorMap[color], maxLines && styles.truncation, maxLines === 1 && styles.breakAll, align && styles[`textAlign.${align}`], weight && fontWeightMap[weight], Component === 'em' && styles['as.em'], Component === 'strong' && styles['as.strong'], xcss]),
|
|
170
150
|
style: {
|
|
171
151
|
WebkitLineClamp: maxLines
|
|
@@ -90,7 +90,7 @@ const AnchorNoRef = ({
|
|
|
90
90
|
action: 'clicked',
|
|
91
91
|
componentName: componentName || 'Anchor',
|
|
92
92
|
packageName: "@atlaskit/primitives",
|
|
93
|
-
packageVersion: "14.
|
|
93
|
+
packageVersion: "14.5.0",
|
|
94
94
|
analyticsData: analyticsContext,
|
|
95
95
|
actionSubject: 'link'
|
|
96
96
|
});
|
|
@@ -151,9 +151,7 @@ const AnchorNoRef = ({
|
|
|
151
151
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
152
152
|
paddingInlineStart && paddingStylesMap.paddingInlineStart[paddingInlineStart],
|
|
153
153
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
154
|
-
paddingInlineEnd && paddingStylesMap.paddingInlineEnd[paddingInlineEnd],
|
|
155
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
156
|
-
resolvedStyles.emotion],
|
|
154
|
+
paddingInlineEnd && paddingStylesMap.paddingInlineEnd[paddingInlineEnd], resolvedStyles.emotion],
|
|
157
155
|
"data-testid": testId,
|
|
158
156
|
"data-is-router-link": testId ? isRouterLink ? 'true' : 'false' : undefined
|
|
159
157
|
}), children, target === '_blank' && (children && !ariaLabel && !ariaLabelledBy || ariaLabelledBy) && jsx(VisuallyHidden, {
|
|
@@ -65,9 +65,7 @@ const Bleed = /*#__PURE__*/React.memo(({
|
|
|
65
65
|
return jsx("div", {
|
|
66
66
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
67
67
|
className: resolvedStyles.static,
|
|
68
|
-
css: [baseStyles, (inline || all) && inlineBleedMap[inline || all], (block || all) && blockBleedMap[block || all],
|
|
69
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
70
|
-
resolvedStyles.emotion],
|
|
68
|
+
css: [baseStyles, (inline || all) && inlineBleedMap[inline || all], (block || all) && blockBleedMap[block || all], resolvedStyles.emotion],
|
|
71
69
|
"data-testid": testId
|
|
72
70
|
}, children);
|
|
73
71
|
});
|
|
@@ -61,7 +61,6 @@ export const Box = /*#__PURE__*/forwardRef(({
|
|
|
61
61
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
62
62
|
,
|
|
63
63
|
className: resolvedStyles.static
|
|
64
|
-
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
65
64
|
}, safeHtmlAttributes, {
|
|
66
65
|
css: [baseStyles,
|
|
67
66
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
@@ -81,9 +80,7 @@ export const Box = /*#__PURE__*/forwardRef(({
|
|
|
81
80
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
82
81
|
paddingInlineStart && paddingStylesMap.paddingInlineStart[paddingInlineStart],
|
|
83
82
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
84
|
-
paddingInlineEnd && paddingStylesMap.paddingInlineEnd[paddingInlineEnd],
|
|
85
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
86
|
-
resolvedStyles.emotion],
|
|
83
|
+
paddingInlineEnd && paddingStylesMap.paddingInlineEnd[paddingInlineEnd], resolvedStyles.emotion],
|
|
87
84
|
"data-testid": testId
|
|
88
85
|
}), children);
|
|
89
86
|
return backgroundColor ? jsx(SurfaceContext.Provider, {
|
|
@@ -115,9 +115,7 @@ const Flex = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
115
115
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
116
116
|
columnGap && spaceStylesMap.columnGap[columnGap],
|
|
117
117
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
118
|
-
rowGap && spaceStylesMap.rowGap[rowGap], alignItems && alignItemsMap[alignItems], direction && flexDirectionMap[direction], justifyContent && justifyContentMap[justifyContent], wrap && flexWrapMap[wrap],
|
|
119
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
120
|
-
resolvedStyles.emotion],
|
|
118
|
+
rowGap && spaceStylesMap.rowGap[rowGap], alignItems && alignItemsMap[alignItems], direction && flexDirectionMap[direction], justifyContent && justifyContentMap[justifyContent], wrap && flexWrapMap[wrap], resolvedStyles.emotion],
|
|
121
119
|
"data-testid": testId,
|
|
122
120
|
ref: ref
|
|
123
121
|
}, children);
|
|
@@ -179,9 +179,7 @@ const Grid = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
179
179
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
180
180
|
columnGap && spaceStylesMap.columnGap[columnGap],
|
|
181
181
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
182
|
-
rowGap && spaceStylesMap.rowGap[rowGap], alignItems && alignItemsMap[alignItems], alignContent && alignContentMap[alignContent], justifyContent && justifyContentMap[justifyContent], autoFlow && gridAutoFlowMap[autoFlow],
|
|
183
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
184
|
-
resolvedStyles.emotion],
|
|
182
|
+
rowGap && spaceStylesMap.rowGap[rowGap], alignItems && alignItemsMap[alignItems], alignContent && alignContentMap[alignContent], justifyContent && justifyContentMap[justifyContent], autoFlow && gridAutoFlowMap[autoFlow], resolvedStyles.emotion],
|
|
185
183
|
"data-testid": testId,
|
|
186
184
|
ref: ref
|
|
187
185
|
}, children);
|