@atlaskit/primitives 13.4.1 → 13.5.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 +18 -0
- package/constellation/text/examples.mdx +8 -0
- package/dist/cjs/compiled/components/anchor.compiled.css +1 -1
- package/dist/cjs/compiled/components/anchor.js +4 -6
- package/dist/cjs/compiled/components/bleed.js +1 -2
- package/dist/cjs/compiled/components/box.js +2 -4
- package/dist/cjs/compiled/components/flex.js +2 -4
- package/dist/cjs/compiled/components/focusable.js +2 -4
- package/dist/cjs/compiled/components/grid.js +2 -4
- package/dist/cjs/compiled/components/inline.js +1 -1
- package/dist/cjs/compiled/components/pressable.js +2 -2
- package/dist/cjs/compiled/components/stack.js +1 -1
- package/dist/cjs/compiled/components/text.js +8 -6
- package/dist/cjs/compiled/responsive/hide.js +2 -4
- package/dist/cjs/compiled/responsive/show.js +2 -4
- package/dist/cjs/components/anchor.js +1 -1
- package/dist/cjs/components/pressable.js +1 -1
- package/dist/cjs/components/text.js +2 -3
- package/dist/es2019/compiled/components/anchor.compiled.css +1 -1
- package/dist/es2019/compiled/components/anchor.js +4 -6
- package/dist/es2019/compiled/components/bleed.js +1 -2
- package/dist/es2019/compiled/components/box.js +2 -4
- package/dist/es2019/compiled/components/flex.js +2 -4
- package/dist/es2019/compiled/components/focusable.js +2 -4
- package/dist/es2019/compiled/components/grid.js +2 -4
- package/dist/es2019/compiled/components/inline.js +1 -1
- package/dist/es2019/compiled/components/pressable.js +2 -2
- package/dist/es2019/compiled/components/stack.js +1 -1
- package/dist/es2019/compiled/components/text.js +8 -6
- package/dist/es2019/compiled/responsive/hide.js +2 -4
- package/dist/es2019/compiled/responsive/show.js +2 -4
- package/dist/es2019/components/anchor.js +1 -1
- package/dist/es2019/components/pressable.js +1 -1
- package/dist/es2019/components/text.js +2 -3
- package/dist/esm/compiled/components/anchor.compiled.css +1 -1
- package/dist/esm/compiled/components/anchor.js +4 -6
- package/dist/esm/compiled/components/bleed.js +1 -2
- package/dist/esm/compiled/components/box.js +2 -4
- package/dist/esm/compiled/components/flex.js +2 -4
- package/dist/esm/compiled/components/focusable.js +2 -4
- package/dist/esm/compiled/components/grid.js +2 -4
- package/dist/esm/compiled/components/inline.js +1 -1
- package/dist/esm/compiled/components/pressable.js +2 -2
- package/dist/esm/compiled/components/stack.js +1 -1
- package/dist/esm/compiled/components/text.js +8 -6
- package/dist/esm/compiled/responsive/hide.js +2 -4
- package/dist/esm/compiled/responsive/show.js +2 -4
- package/dist/esm/components/anchor.js +1 -1
- package/dist/esm/components/pressable.js +1 -1
- package/dist/esm/components/text.js +2 -3
- package/dist/types/compiled/components/text.d.ts +5 -0
- package/dist/types-ts4.5/compiled/components/text.d.ts +5 -0
- package/package.json +1 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/primitives
|
|
2
2
|
|
|
3
|
+
## 13.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#115124](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/115124)
|
|
8
|
+
[`b6dd4e0fcdd67`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b6dd4e0fcdd67) -
|
|
9
|
+
Added support for style overrides of `overflowWrap` and `textDecorationLine` for the compiled
|
|
10
|
+
version of Text.
|
|
11
|
+
|
|
12
|
+
## 13.5.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [#112172](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/112172)
|
|
17
|
+
[`54699aa47995b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/54699aa47995b) -
|
|
18
|
+
[ux] Removed feature flag `platform-primitives-nested-text-inherit-size` resulting in Text to
|
|
19
|
+
inherit size when nested in other Text component.
|
|
20
|
+
|
|
3
21
|
## 13.4.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -12,6 +12,7 @@ import TextAlign from '../../examples/constellation/text/text-align';
|
|
|
12
12
|
import TextAsElement from '../../examples/constellation/text/text-as-element';
|
|
13
13
|
import TextSpacing from '../../examples/constellation/text/text-spacing';
|
|
14
14
|
import TextTruncation from '../../examples/constellation/text/text-truncation';
|
|
15
|
+
import TextCustomization from '../../examples/constellation/text/text-customization';
|
|
15
16
|
|
|
16
17
|
## Basic
|
|
17
18
|
|
|
@@ -87,3 +88,10 @@ However if truncation cannot be avoided, for example when displaying user-genera
|
|
|
87
88
|
`maxLines` prop to indicate how text should be truncated.
|
|
88
89
|
|
|
89
90
|
<Example Component={TextTruncation} packageName="@atlaskit/primitives" />
|
|
91
|
+
|
|
92
|
+
## Customization
|
|
93
|
+
|
|
94
|
+
A restricted set of styles can be customized using the `xcss` prop. This is only available in the
|
|
95
|
+
Compiled version of Text.
|
|
96
|
+
|
|
97
|
+
<Example Component={TextCustomization} packageName="@atlaskit/primitives" />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* anchor.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* anchor.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -28,7 +28,7 @@ var _excluded = ["href", "children", "onClick", "interactionName", "componentNam
|
|
|
28
28
|
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); }
|
|
29
29
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(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; }
|
|
30
30
|
var styles = {
|
|
31
|
-
root: "
|
|
31
|
+
root: "_4bfu1r31 _1hms8stv _ajmmnqa1 _vchhusvi"
|
|
32
32
|
};
|
|
33
33
|
var IS_EXTERNAL_LINK_REGEX = /^(?:(http|https):\/\/)/;
|
|
34
34
|
var IS_NON_HTTP_BASED = /^(((mailto|tel|sms):)|(#))/;
|
|
@@ -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: "13.
|
|
73
|
+
packageVersion: "13.5.1",
|
|
74
74
|
analyticsData: analyticsContext,
|
|
75
75
|
actionSubject: 'link'
|
|
76
76
|
});
|
|
@@ -97,9 +97,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
97
97
|
return /*#__PURE__*/React.createElement(_focusable.default
|
|
98
98
|
// @ts-expect-error we don't allow `a` on Focusable for makers as they should use Anchor instead
|
|
99
99
|
, (0, _extends2.default)({
|
|
100
|
-
as: Component
|
|
101
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- TODO: Allow pass-through from `props.xcss`
|
|
102
|
-
,
|
|
100
|
+
as: Component,
|
|
103
101
|
className: xcss
|
|
104
102
|
// 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
|
|
105
103
|
,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* bleed.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* bleed.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -40,7 +40,6 @@ var Bleed = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
40
40
|
all = _ref.all,
|
|
41
41
|
xcss = _ref.xcss;
|
|
42
42
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
43
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- TODO: Allow pass-through from `props.xcss`
|
|
44
43
|
className: (0, _runtime.ax)([styles.root, all && styles["inline.".concat(all)], inline && styles["inline.".concat(inline)], all && styles["block.".concat(all)], block && styles["block.".concat(block)], xcss]),
|
|
45
44
|
"data-testid": testId
|
|
46
45
|
}, children);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* box.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* box.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -343,9 +343,7 @@ var Box = exports.Box = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
|
|
|
343
343
|
style: style
|
|
344
344
|
// @ts-ignore -- Expression produces a union type that is too complex to represent. We may be able to narrow the type here but unsure.
|
|
345
345
|
,
|
|
346
|
-
ref: ref
|
|
347
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- TODO: Support `xcss` in className pass-through
|
|
348
|
-
,
|
|
346
|
+
ref: ref,
|
|
349
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])
|
|
350
348
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
351
349
|
}, safeHtmlAttributes, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* flex.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* flex.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
@@ -107,9 +107,7 @@ var Flex = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
107
107
|
wrap = _ref.wrap,
|
|
108
108
|
xcss = _ref.xcss;
|
|
109
109
|
return /*#__PURE__*/React.createElement(Component, {
|
|
110
|
-
role: role
|
|
111
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
112
|
-
,
|
|
110
|
+
role: role,
|
|
113
111
|
className: (0, _runtime.ax)([styles.root, gap && columnGapMap[gap], columnGap && columnGapMap[columnGap], gap && rowGapMap[gap], rowGap && rowGapMap[rowGap], alignItems && alignItemsMap[alignItems], direction && flexDirectionMap[direction], justifyContent && justifyContentMap[justifyContent], wrap && flexWrapMap[wrap], xcss]),
|
|
114
112
|
"data-testid": testId,
|
|
115
113
|
ref: ref
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* focusable.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* focusable.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -43,9 +43,7 @@ var Focusable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
43
43
|
safeHtmlAttributes = (0, _objectWithoutProperties2.default)(htmlAttributes, _excluded2);
|
|
44
44
|
return /*#__PURE__*/React.createElement(Component, (0, _extends2.default)({}, safeHtmlAttributes, {
|
|
45
45
|
// @ts-ignore Expression produces a union type that is too complex to represent. We may be able to narrow the type here but unsure.
|
|
46
|
-
ref: ref
|
|
47
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
48
|
-
,
|
|
46
|
+
ref: ref,
|
|
49
47
|
className: (0, _runtime.ax)(["_mizu194a _1ah31bk5 _ra3xnqa1 _128m1bk5 _1cvmnqa1 _4davt94y", isInset && "_1ah3115h _2mwq115h", xcss])
|
|
50
48
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
51
49
|
,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* grid.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* grid.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
@@ -117,9 +117,7 @@ var Grid = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
117
117
|
var Component = as || 'div';
|
|
118
118
|
return /*#__PURE__*/React.createElement(Component, {
|
|
119
119
|
id: id,
|
|
120
|
-
role: role
|
|
121
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- TODO: Allow pass-through from `props.xcss`
|
|
122
|
-
,
|
|
120
|
+
role: role,
|
|
123
121
|
className: (0, _runtime.ax)([baseStyles.root, gap && columnGapMap[gap], columnGap && columnGapMap[columnGap], gap && rowGapMap[gap], rowGap && rowGapMap[rowGap], alignItems && alignItemsMap[alignItems], alignContent && alignContentMap[alignContent], justifyContent && justifyContentMap[justifyContent], autoFlow && gridAutoFlowMap[autoFlow], xcss]),
|
|
124
122
|
"data-testid": testId,
|
|
125
123
|
ref: ref
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* pressable.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* pressable.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -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: "13.
|
|
63
|
+
packageVersion: "13.5.1",
|
|
64
64
|
analyticsData: analyticsContext,
|
|
65
65
|
actionSubject: 'button'
|
|
66
66
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* text.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* text.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -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); }
|
|
@@ -149,21 +148,24 @@ var Text = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
149
148
|
size = _ref.size,
|
|
150
149
|
weight = _ref.weight,
|
|
151
150
|
maxLines = _ref.maxLines,
|
|
151
|
+
xcss = _ref.xcss,
|
|
152
152
|
children = _ref.children;
|
|
153
153
|
(0, _tinyInvariant.default)(asAllowlist.includes(Component), "@atlaskit/primitives: Text received an invalid \"as\" value of \"".concat(Component, "\""));
|
|
154
154
|
var hasTextAncestor = (0, _hasTextAncestorContext.useHasTextAncestor)();
|
|
155
155
|
var color = useColor(colorProp, hasTextAncestor);
|
|
156
|
-
if (
|
|
156
|
+
if (!size && !hasTextAncestor) {
|
|
157
157
|
size = 'medium';
|
|
158
158
|
}
|
|
159
159
|
var component = /*#__PURE__*/React.createElement(Component, {
|
|
160
|
-
id: id
|
|
160
|
+
id: id
|
|
161
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
162
|
+
,
|
|
163
|
+
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]),
|
|
161
164
|
style: {
|
|
162
165
|
WebkitLineClamp: maxLines
|
|
163
166
|
},
|
|
164
167
|
"data-testid": testId,
|
|
165
|
-
ref: ref
|
|
166
|
-
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']])
|
|
168
|
+
ref: ref
|
|
167
169
|
}, children);
|
|
168
170
|
if (hasTextAncestor) {
|
|
169
171
|
// no need to re-apply context if the text is already wrapped
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hide.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* hide.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
@@ -38,9 +38,7 @@ var Hide = exports.Hide = function Hide(_ref) {
|
|
|
38
38
|
_ref$as = _ref.as,
|
|
39
39
|
AsElement = _ref$as === void 0 ? 'div' : _ref$as,
|
|
40
40
|
xcss = _ref.xcss;
|
|
41
|
-
return /*#__PURE__*/React.createElement(AsElement
|
|
42
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- TODO: Allow pass-through from `props.xcss`
|
|
43
|
-
, {
|
|
41
|
+
return /*#__PURE__*/React.createElement(AsElement, {
|
|
44
42
|
className: (0, _runtime.ax)([above && styles["above.".concat(above)], below && styles["below.".concat(below)], xcss])
|
|
45
43
|
}, children);
|
|
46
44
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* show.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* show.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
@@ -39,9 +39,7 @@ var Show = exports.Show = function Show(_ref) {
|
|
|
39
39
|
_ref$as = _ref.as,
|
|
40
40
|
AsElement = _ref$as === void 0 ? 'div' : _ref$as,
|
|
41
41
|
xcss = _ref.xcss;
|
|
42
|
-
return /*#__PURE__*/React.createElement(AsElement
|
|
43
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- TODO: Allow pass-through from `props.xcss`
|
|
44
|
-
, {
|
|
42
|
+
return /*#__PURE__*/React.createElement(AsElement, {
|
|
45
43
|
className: (0, _runtime.ax)([styles.default, above && styles["above.".concat(above)], below && styles["below.".concat(below)], xcss])
|
|
46
44
|
}, children);
|
|
47
45
|
};
|
|
@@ -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: "13.
|
|
103
|
+
packageVersion: "13.5.1",
|
|
104
104
|
analyticsData: analyticsContext,
|
|
105
105
|
actionSubject: 'link'
|
|
106
106
|
});
|
|
@@ -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: "13.
|
|
98
|
+
packageVersion: "13.5.1",
|
|
99
99
|
analyticsData: analyticsContext,
|
|
100
100
|
actionSubject: 'button'
|
|
101
101
|
});
|
|
@@ -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");
|
|
@@ -100,14 +99,14 @@ var Text = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
100
99
|
(0, _tinyInvariant.default)(asAllowlist.includes(Component), "@atlaskit/primitives: Text received an invalid \"as\" value of \"".concat(Component, "\""));
|
|
101
100
|
var hasTextAncestor = (0, _hasTextAncestorContext.useHasTextAncestor)();
|
|
102
101
|
var color = useColor(colorProp, hasTextAncestor);
|
|
103
|
-
if (!
|
|
102
|
+
if (!size && !hasTextAncestor) {
|
|
104
103
|
size = 'medium';
|
|
105
104
|
}
|
|
106
105
|
var component = (0, _react2.jsx)(Component, {
|
|
107
106
|
ref: ref,
|
|
108
107
|
css: [resetStyles,
|
|
109
108
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
110
|
-
size
|
|
109
|
+
size && _styleMaps.textSizeStylesMap[size],
|
|
111
110
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
112
111
|
color && _styleMaps.textColorStylesMap[color], maxLines && truncationStyles, maxLines === 1 && wordBreakMap.breakAll, align && textAlignMap[align],
|
|
113
112
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* anchor.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* anchor.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import "./anchor.compiled.css";
|
|
4
4
|
import * as React from 'react';
|
|
@@ -14,7 +14,7 @@ import InteractionContext from '@atlaskit/interaction-context';
|
|
|
14
14
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
15
15
|
import Focusable from './focusable';
|
|
16
16
|
const styles = {
|
|
17
|
-
root: "
|
|
17
|
+
root: "_4bfu1r31 _1hms8stv _ajmmnqa1 _vchhusvi"
|
|
18
18
|
};
|
|
19
19
|
const IS_EXTERNAL_LINK_REGEX = /^(?:(http|https):\/\/)/;
|
|
20
20
|
const IS_NON_HTTP_BASED = /^(((mailto|tel|sms):)|(#))/;
|
|
@@ -55,7 +55,7 @@ const AnchorNoRef = ({
|
|
|
55
55
|
action: 'clicked',
|
|
56
56
|
componentName: componentName || 'Anchor',
|
|
57
57
|
packageName: "@atlaskit/primitives",
|
|
58
|
-
packageVersion: "13.
|
|
58
|
+
packageVersion: "13.5.1",
|
|
59
59
|
analyticsData: analyticsContext,
|
|
60
60
|
actionSubject: 'link'
|
|
61
61
|
});
|
|
@@ -84,9 +84,7 @@ const AnchorNoRef = ({
|
|
|
84
84
|
return /*#__PURE__*/React.createElement(Focusable
|
|
85
85
|
// @ts-expect-error we don't allow `a` on Focusable for makers as they should use Anchor instead
|
|
86
86
|
, _extends({
|
|
87
|
-
as: Component
|
|
88
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- TODO: Allow pass-through from `props.xcss`
|
|
89
|
-
,
|
|
87
|
+
as: Component,
|
|
90
88
|
className: xcss
|
|
91
89
|
// 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
|
|
92
90
|
,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* bleed.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* bleed.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import "./bleed.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React from 'react';
|
|
@@ -34,7 +34,6 @@ const Bleed = /*#__PURE__*/React.memo(({
|
|
|
34
34
|
xcss
|
|
35
35
|
}) => {
|
|
36
36
|
return /*#__PURE__*/React.createElement("div", {
|
|
37
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- TODO: Allow pass-through from `props.xcss`
|
|
38
37
|
className: ax([styles.root, all && styles[`inline.${all}`], inline && styles[`inline.${inline}`], all && styles[`block.${all}`], block && styles[`block.${block}`], xcss]),
|
|
39
38
|
"data-testid": testId
|
|
40
39
|
}, children);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* box.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* box.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import "./box.compiled.css";
|
|
4
4
|
import * as React from 'react';
|
|
@@ -327,9 +327,7 @@ export const Box = /*#__PURE__*/forwardRef(({
|
|
|
327
327
|
style: style
|
|
328
328
|
// @ts-ignore -- Expression produces a union type that is too complex to represent. We may be able to narrow the type here but unsure.
|
|
329
329
|
,
|
|
330
|
-
ref: ref
|
|
331
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- TODO: Support `xcss` in className pass-through
|
|
332
|
-
,
|
|
330
|
+
ref: ref,
|
|
333
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])
|
|
334
332
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
335
333
|
}, safeHtmlAttributes, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* flex.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* flex.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import "./flex.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -98,9 +98,7 @@ const Flex = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
98
98
|
xcss
|
|
99
99
|
}, ref) => {
|
|
100
100
|
return /*#__PURE__*/React.createElement(Component, {
|
|
101
|
-
role: role
|
|
102
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
103
|
-
,
|
|
101
|
+
role: role,
|
|
104
102
|
className: ax([styles.root, gap && columnGapMap[gap], columnGap && columnGapMap[columnGap], gap && rowGapMap[gap], rowGap && rowGapMap[rowGap], alignItems && alignItemsMap[alignItems], direction && flexDirectionMap[direction], justifyContent && justifyContentMap[justifyContent], wrap && flexWrapMap[wrap], xcss]),
|
|
105
103
|
"data-testid": testId,
|
|
106
104
|
ref: ref
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* focusable.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* focusable.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import "./focusable.compiled.css";
|
|
4
4
|
import * as React from 'react';
|
|
@@ -29,9 +29,7 @@ const Focusable = /*#__PURE__*/forwardRef(({
|
|
|
29
29
|
} = htmlAttributes;
|
|
30
30
|
return /*#__PURE__*/React.createElement(Component, _extends({}, safeHtmlAttributes, {
|
|
31
31
|
// @ts-ignore Expression produces a union type that is too complex to represent. We may be able to narrow the type here but unsure.
|
|
32
|
-
ref: ref
|
|
33
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
34
|
-
,
|
|
32
|
+
ref: ref,
|
|
35
33
|
className: ax(["_mizu194a _1ah31bk5 _ra3xnqa1 _128m1bk5 _1cvmnqa1 _4davt94y", isInset && "_1ah311pw _2mwq11pw", xcss])
|
|
36
34
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
37
35
|
,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* grid.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* grid.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import "./grid.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -109,9 +109,7 @@ const Grid = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
109
109
|
const Component = as || 'div';
|
|
110
110
|
return /*#__PURE__*/React.createElement(Component, {
|
|
111
111
|
id: id,
|
|
112
|
-
role: role
|
|
113
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- TODO: Allow pass-through from `props.xcss`
|
|
114
|
-
,
|
|
112
|
+
role: role,
|
|
115
113
|
className: ax([baseStyles.root, gap && columnGapMap[gap], columnGap && columnGapMap[columnGap], gap && rowGapMap[gap], rowGap && rowGapMap[rowGap], alignItems && alignItemsMap[alignItems], alignContent && alignContentMap[alignContent], justifyContent && justifyContentMap[justifyContent], autoFlow && gridAutoFlowMap[autoFlow], xcss]),
|
|
116
114
|
"data-testid": testId,
|
|
117
115
|
ref: ref
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* pressable.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* pressable.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import "./pressable.compiled.css";
|
|
4
4
|
import * as React from 'react';
|
|
@@ -46,7 +46,7 @@ const Pressable = /*#__PURE__*/forwardRef(({
|
|
|
46
46
|
action: 'clicked',
|
|
47
47
|
componentName: componentName || 'Pressable',
|
|
48
48
|
packageName: "@atlaskit/primitives",
|
|
49
|
-
packageVersion: "13.
|
|
49
|
+
packageVersion: "13.5.1",
|
|
50
50
|
analyticsData: analyticsContext,
|
|
51
51
|
actionSubject: 'button'
|
|
52
52
|
});
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/* text.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* text.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import "./text.compiled.css";
|
|
3
3
|
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'];
|
|
@@ -138,22 +137,25 @@ const Text = /*#__PURE__*/forwardRef(({
|
|
|
138
137
|
size,
|
|
139
138
|
weight,
|
|
140
139
|
maxLines,
|
|
140
|
+
xcss,
|
|
141
141
|
children
|
|
142
142
|
}, ref) => {
|
|
143
143
|
invariant(asAllowlist.includes(Component), `@atlaskit/primitives: Text received an invalid "as" value of "${Component}"`);
|
|
144
144
|
const hasTextAncestor = useHasTextAncestor();
|
|
145
145
|
const color = useColor(colorProp, hasTextAncestor);
|
|
146
|
-
if (
|
|
146
|
+
if (!size && !hasTextAncestor) {
|
|
147
147
|
size = 'medium';
|
|
148
148
|
}
|
|
149
149
|
const component = /*#__PURE__*/React.createElement(Component, {
|
|
150
|
-
id: id
|
|
150
|
+
id: id
|
|
151
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
152
|
+
,
|
|
153
|
+
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]),
|
|
151
154
|
style: {
|
|
152
155
|
WebkitLineClamp: maxLines
|
|
153
156
|
},
|
|
154
157
|
"data-testid": testId,
|
|
155
|
-
ref: ref
|
|
156
|
-
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']])
|
|
158
|
+
ref: ref
|
|
157
159
|
}, children);
|
|
158
160
|
if (hasTextAncestor) {
|
|
159
161
|
// no need to re-apply context if the text is already wrapped
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hide.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* hide.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import "./hide.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -29,9 +29,7 @@ export const Hide = ({
|
|
|
29
29
|
as: AsElement = 'div',
|
|
30
30
|
xcss
|
|
31
31
|
}) => {
|
|
32
|
-
return /*#__PURE__*/React.createElement(AsElement
|
|
33
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- TODO: Allow pass-through from `props.xcss`
|
|
34
|
-
, {
|
|
32
|
+
return /*#__PURE__*/React.createElement(AsElement, {
|
|
35
33
|
className: ax([above && styles[`above.${above}`], below && styles[`below.${below}`], xcss])
|
|
36
34
|
}, children);
|
|
37
35
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* show.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* show.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import "./show.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -30,9 +30,7 @@ export const Show = ({
|
|
|
30
30
|
as: AsElement = 'div',
|
|
31
31
|
xcss
|
|
32
32
|
}) => {
|
|
33
|
-
return /*#__PURE__*/React.createElement(AsElement
|
|
34
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- TODO: Allow pass-through from `props.xcss`
|
|
35
|
-
, {
|
|
33
|
+
return /*#__PURE__*/React.createElement(AsElement, {
|
|
36
34
|
className: ax([styles.default, above && styles[`above.${above}`], below && styles[`below.${below}`], xcss])
|
|
37
35
|
}, children);
|
|
38
36
|
};
|
|
@@ -85,7 +85,7 @@ const Pressable = /*#__PURE__*/forwardRef(({
|
|
|
85
85
|
action: 'clicked',
|
|
86
86
|
componentName: componentName || 'Pressable',
|
|
87
87
|
packageName: "@atlaskit/primitives",
|
|
88
|
-
packageVersion: "13.
|
|
88
|
+
packageVersion: "13.5.1",
|
|
89
89
|
analyticsData: analyticsContext,
|
|
90
90
|
actionSubject: 'button'
|
|
91
91
|
});
|
|
@@ -7,7 +7,6 @@ import { forwardRef } from 'react';
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import invariant from 'tiny-invariant';
|
|
10
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
10
|
import { HasTextAncestorProvider, useHasTextAncestor } from '../utils/has-text-ancestor-context';
|
|
12
11
|
import { useSurface } from '../utils/surface-provider';
|
|
13
12
|
import { inverseColorMap, textColorStylesMap, textSizeStylesMap, textWeightStylesMap } from '../xcss/style-maps.partial';
|
|
@@ -92,14 +91,14 @@ const Text = /*#__PURE__*/forwardRef(({
|
|
|
92
91
|
invariant(asAllowlist.includes(Component), `@atlaskit/primitives: Text received an invalid "as" value of "${Component}"`);
|
|
93
92
|
const hasTextAncestor = useHasTextAncestor();
|
|
94
93
|
const color = useColor(colorProp, hasTextAncestor);
|
|
95
|
-
if (!
|
|
94
|
+
if (!size && !hasTextAncestor) {
|
|
96
95
|
size = 'medium';
|
|
97
96
|
}
|
|
98
97
|
const component = jsx(Component, {
|
|
99
98
|
ref: ref,
|
|
100
99
|
css: [resetStyles,
|
|
101
100
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
102
|
-
size
|
|
101
|
+
size && textSizeStylesMap[size],
|
|
103
102
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
104
103
|
color && textColorStylesMap[color], maxLines && truncationStyles, maxLines === 1 && wordBreakMap.breakAll, align && textAlignMap[align],
|
|
105
104
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* anchor.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* anchor.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
@@ -18,7 +18,7 @@ import InteractionContext from '@atlaskit/interaction-context';
|
|
|
18
18
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
19
19
|
import Focusable from './focusable';
|
|
20
20
|
var styles = {
|
|
21
|
-
root: "
|
|
21
|
+
root: "_4bfu1r31 _1hms8stv _ajmmnqa1 _vchhusvi"
|
|
22
22
|
};
|
|
23
23
|
var IS_EXTERNAL_LINK_REGEX = /^(?:(http|https):\/\/)/;
|
|
24
24
|
var IS_NON_HTTP_BASED = /^(((mailto|tel|sms):)|(#))/;
|
|
@@ -60,7 +60,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
60
60
|
action: 'clicked',
|
|
61
61
|
componentName: componentName || 'Anchor',
|
|
62
62
|
packageName: "@atlaskit/primitives",
|
|
63
|
-
packageVersion: "13.
|
|
63
|
+
packageVersion: "13.5.1",
|
|
64
64
|
analyticsData: analyticsContext,
|
|
65
65
|
actionSubject: 'link'
|
|
66
66
|
});
|
|
@@ -87,9 +87,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
87
87
|
return /*#__PURE__*/React.createElement(Focusable
|
|
88
88
|
// @ts-expect-error we don't allow `a` on Focusable for makers as they should use Anchor instead
|
|
89
89
|
, _extends({
|
|
90
|
-
as: Component
|
|
91
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- TODO: Allow pass-through from `props.xcss`
|
|
92
|
-
,
|
|
90
|
+
as: Component,
|
|
93
91
|
className: xcss
|
|
94
92
|
// 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
|
|
95
93
|
,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* bleed.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* bleed.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import "./bleed.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React from 'react';
|
|
@@ -33,7 +33,6 @@ var Bleed = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
33
33
|
all = _ref.all,
|
|
34
34
|
xcss = _ref.xcss;
|
|
35
35
|
return /*#__PURE__*/React.createElement("div", {
|
|
36
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- TODO: Allow pass-through from `props.xcss`
|
|
37
36
|
className: ax([styles.root, all && styles["inline.".concat(all)], inline && styles["inline.".concat(inline)], all && styles["block.".concat(all)], block && styles["block.".concat(block)], xcss]),
|
|
38
37
|
"data-testid": testId
|
|
39
38
|
}, children);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* box.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* box.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["as", "children", "backgroundColor", "padding", "paddingBlock", "paddingBlockStart", "paddingBlockEnd", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "style", "testId", "xcss"],
|
|
@@ -334,9 +334,7 @@ export var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
334
334
|
style: style
|
|
335
335
|
// @ts-ignore -- Expression produces a union type that is too complex to represent. We may be able to narrow the type here but unsure.
|
|
336
336
|
,
|
|
337
|
-
ref: ref
|
|
338
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- TODO: Support `xcss` in className pass-through
|
|
339
|
-
,
|
|
337
|
+
ref: ref,
|
|
340
338
|
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])
|
|
341
339
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
342
340
|
}, safeHtmlAttributes, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* flex.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* flex.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import "./flex.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -98,9 +98,7 @@ var Flex = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
98
98
|
wrap = _ref.wrap,
|
|
99
99
|
xcss = _ref.xcss;
|
|
100
100
|
return /*#__PURE__*/React.createElement(Component, {
|
|
101
|
-
role: role
|
|
102
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
103
|
-
,
|
|
101
|
+
role: role,
|
|
104
102
|
className: ax([styles.root, gap && columnGapMap[gap], columnGap && columnGapMap[columnGap], gap && rowGapMap[gap], rowGap && rowGapMap[rowGap], alignItems && alignItemsMap[alignItems], direction && flexDirectionMap[direction], justifyContent && justifyContentMap[justifyContent], wrap && flexWrapMap[wrap], xcss]),
|
|
105
103
|
"data-testid": testId,
|
|
106
104
|
ref: ref
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* focusable.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* focusable.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
@@ -33,9 +33,7 @@ var Focusable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
33
33
|
safeHtmlAttributes = _objectWithoutProperties(htmlAttributes, _excluded2);
|
|
34
34
|
return /*#__PURE__*/React.createElement(Component, _extends({}, safeHtmlAttributes, {
|
|
35
35
|
// @ts-ignore Expression produces a union type that is too complex to represent. We may be able to narrow the type here but unsure.
|
|
36
|
-
ref: ref
|
|
37
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
38
|
-
,
|
|
36
|
+
ref: ref,
|
|
39
37
|
className: ax(["_mizu194a _1ah31bk5 _ra3xnqa1 _128m1bk5 _1cvmnqa1 _4davt94y", isInset && "_1ah3115h _2mwq115h", xcss])
|
|
40
38
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
41
39
|
,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* grid.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* grid.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import "./grid.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -108,9 +108,7 @@ var Grid = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
108
108
|
var Component = as || 'div';
|
|
109
109
|
return /*#__PURE__*/React.createElement(Component, {
|
|
110
110
|
id: id,
|
|
111
|
-
role: role
|
|
112
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- TODO: Allow pass-through from `props.xcss`
|
|
113
|
-
,
|
|
111
|
+
role: role,
|
|
114
112
|
className: ax([baseStyles.root, gap && columnGapMap[gap], columnGap && columnGapMap[columnGap], gap && rowGapMap[gap], rowGap && rowGapMap[rowGap], alignItems && alignItemsMap[alignItems], alignContent && alignContentMap[alignContent], justifyContent && justifyContentMap[justifyContent], autoFlow && gridAutoFlowMap[autoFlow], xcss]),
|
|
115
113
|
"data-testid": testId,
|
|
116
114
|
ref: ref
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* pressable.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* pressable.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["children", "isDisabled", "type", "onClick", "interactionName", "componentName", "analyticsContext", "style", "testId", "xcss"],
|
|
@@ -50,7 +50,7 @@ var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
50
50
|
action: 'clicked',
|
|
51
51
|
componentName: componentName || 'Pressable',
|
|
52
52
|
packageName: "@atlaskit/primitives",
|
|
53
|
-
packageVersion: "13.
|
|
53
|
+
packageVersion: "13.5.1",
|
|
54
54
|
analyticsData: analyticsContext,
|
|
55
55
|
actionSubject: 'button'
|
|
56
56
|
});
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/* text.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* text.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import "./text.compiled.css";
|
|
3
3
|
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
|
var asAllowlist = ['span', 'p', 'strong', 'em'];
|
|
@@ -139,21 +138,24 @@ var Text = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
139
138
|
size = _ref.size,
|
|
140
139
|
weight = _ref.weight,
|
|
141
140
|
maxLines = _ref.maxLines,
|
|
141
|
+
xcss = _ref.xcss,
|
|
142
142
|
children = _ref.children;
|
|
143
143
|
invariant(asAllowlist.includes(Component), "@atlaskit/primitives: Text received an invalid \"as\" value of \"".concat(Component, "\""));
|
|
144
144
|
var hasTextAncestor = useHasTextAncestor();
|
|
145
145
|
var color = useColor(colorProp, hasTextAncestor);
|
|
146
|
-
if (
|
|
146
|
+
if (!size && !hasTextAncestor) {
|
|
147
147
|
size = 'medium';
|
|
148
148
|
}
|
|
149
149
|
var component = /*#__PURE__*/React.createElement(Component, {
|
|
150
|
-
id: id
|
|
150
|
+
id: id
|
|
151
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
152
|
+
,
|
|
153
|
+
className: 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]),
|
|
151
154
|
style: {
|
|
152
155
|
WebkitLineClamp: maxLines
|
|
153
156
|
},
|
|
154
157
|
"data-testid": testId,
|
|
155
|
-
ref: ref
|
|
156
|
-
className: 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']])
|
|
158
|
+
ref: ref
|
|
157
159
|
}, children);
|
|
158
160
|
if (hasTextAncestor) {
|
|
159
161
|
// no need to re-apply context if the text is already wrapped
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hide.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* hide.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import "./hide.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -29,9 +29,7 @@ export var Hide = function Hide(_ref) {
|
|
|
29
29
|
_ref$as = _ref.as,
|
|
30
30
|
AsElement = _ref$as === void 0 ? 'div' : _ref$as,
|
|
31
31
|
xcss = _ref.xcss;
|
|
32
|
-
return /*#__PURE__*/React.createElement(AsElement
|
|
33
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- TODO: Allow pass-through from `props.xcss`
|
|
34
|
-
, {
|
|
32
|
+
return /*#__PURE__*/React.createElement(AsElement, {
|
|
35
33
|
className: ax([above && styles["above.".concat(above)], below && styles["below.".concat(below)], xcss])
|
|
36
34
|
}, children);
|
|
37
35
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* show.tsx generated by @compiled/babel-plugin v0.36.
|
|
1
|
+
/* show.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import "./show.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -30,9 +30,7 @@ export var Show = function Show(_ref) {
|
|
|
30
30
|
_ref$as = _ref.as,
|
|
31
31
|
AsElement = _ref$as === void 0 ? 'div' : _ref$as,
|
|
32
32
|
xcss = _ref.xcss;
|
|
33
|
-
return /*#__PURE__*/React.createElement(AsElement
|
|
34
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- TODO: Allow pass-through from `props.xcss`
|
|
35
|
-
, {
|
|
33
|
+
return /*#__PURE__*/React.createElement(AsElement, {
|
|
36
34
|
className: ax([styles.default, above && styles["above.".concat(above)], below && styles["below.".concat(below)], xcss])
|
|
37
35
|
}, children);
|
|
38
36
|
};
|
|
@@ -94,7 +94,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
94
94
|
action: 'clicked',
|
|
95
95
|
componentName: componentName || 'Anchor',
|
|
96
96
|
packageName: "@atlaskit/primitives",
|
|
97
|
-
packageVersion: "13.
|
|
97
|
+
packageVersion: "13.5.1",
|
|
98
98
|
analyticsData: analyticsContext,
|
|
99
99
|
actionSubject: 'link'
|
|
100
100
|
});
|
|
@@ -89,7 +89,7 @@ var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
89
89
|
action: 'clicked',
|
|
90
90
|
componentName: componentName || 'Pressable',
|
|
91
91
|
packageName: "@atlaskit/primitives",
|
|
92
|
-
packageVersion: "13.
|
|
92
|
+
packageVersion: "13.5.1",
|
|
93
93
|
analyticsData: analyticsContext,
|
|
94
94
|
actionSubject: 'button'
|
|
95
95
|
});
|
|
@@ -7,7 +7,6 @@ import { forwardRef } from 'react';
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import invariant from 'tiny-invariant';
|
|
10
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
10
|
import { HasTextAncestorProvider, useHasTextAncestor } from '../utils/has-text-ancestor-context';
|
|
12
11
|
import { useSurface } from '../utils/surface-provider';
|
|
13
12
|
import { inverseColorMap, textColorStylesMap, textSizeStylesMap, textWeightStylesMap } from '../xcss/style-maps.partial';
|
|
@@ -92,14 +91,14 @@ var Text = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
92
91
|
invariant(asAllowlist.includes(Component), "@atlaskit/primitives: Text received an invalid \"as\" value of \"".concat(Component, "\""));
|
|
93
92
|
var hasTextAncestor = useHasTextAncestor();
|
|
94
93
|
var color = useColor(colorProp, hasTextAncestor);
|
|
95
|
-
if (!
|
|
94
|
+
if (!size && !hasTextAncestor) {
|
|
96
95
|
size = 'medium';
|
|
97
96
|
}
|
|
98
97
|
var component = jsx(Component, {
|
|
99
98
|
ref: ref,
|
|
100
99
|
css: [resetStyles,
|
|
101
100
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
102
|
-
size
|
|
101
|
+
size && textSizeStylesMap[size],
|
|
103
102
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
104
103
|
color && textColorStylesMap[color], maxLines && truncationStyles, maxLines === 1 && wordBreakMap.breakAll, align && textAlignMap[align],
|
|
105
104
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import { type ComponentPropsWithRef, type ElementType, type ReactNode } from 'react';
|
|
6
|
+
import { type StrictXCSSProp } from '@atlaskit/css';
|
|
6
7
|
import type { BasePrimitiveProps, FontSize, FontWeight, TextAlign, TextColor } from './types';
|
|
7
8
|
declare const asAllowlist: readonly ["span", "p", "strong", "em"];
|
|
8
9
|
type AsElement = (typeof asAllowlist)[number];
|
|
@@ -43,6 +44,10 @@ type TextPropsBase<T extends ElementType = 'span'> = {
|
|
|
43
44
|
* The [HTML `font-weight` attribute](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight).
|
|
44
45
|
*/
|
|
45
46
|
weight?: FontWeight;
|
|
47
|
+
/**
|
|
48
|
+
* Bounded style overrides.
|
|
49
|
+
*/
|
|
50
|
+
xcss?: StrictXCSSProp<'overflowWrap' | 'textDecorationLine', never>;
|
|
46
51
|
/**
|
|
47
52
|
* Forwarded ref.
|
|
48
53
|
*/
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import { type ComponentPropsWithRef, type ElementType, type ReactNode } from 'react';
|
|
6
|
+
import { type StrictXCSSProp } from '@atlaskit/css';
|
|
6
7
|
import type { BasePrimitiveProps, FontSize, FontWeight, TextAlign, TextColor } from './types';
|
|
7
8
|
declare const asAllowlist: readonly [
|
|
8
9
|
"span",
|
|
@@ -48,6 +49,10 @@ type TextPropsBase<T extends ElementType = 'span'> = {
|
|
|
48
49
|
* The [HTML `font-weight` attribute](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight).
|
|
49
50
|
*/
|
|
50
51
|
weight?: FontWeight;
|
|
52
|
+
/**
|
|
53
|
+
* Bounded style overrides.
|
|
54
|
+
*/
|
|
55
|
+
xcss?: StrictXCSSProp<'overflowWrap' | 'textDecorationLine', never>;
|
|
51
56
|
/**
|
|
52
57
|
* Forwarded ref.
|
|
53
58
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/primitives",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.5.1",
|
|
4
4
|
"description": "Primitives are token-backed low-level building blocks.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -129,7 +129,6 @@
|
|
|
129
129
|
"@atlaskit/css": "^0.8.0",
|
|
130
130
|
"@atlaskit/ds-lib": "^3.5.0",
|
|
131
131
|
"@atlaskit/interaction-context": "^2.6.0",
|
|
132
|
-
"@atlaskit/platform-feature-flags": "^1.0.0",
|
|
133
132
|
"@atlaskit/tokens": "^3.3.0",
|
|
134
133
|
"@atlaskit/visually-hidden": "^1.6.0",
|
|
135
134
|
"@babel/runtime": "^7.0.0",
|
|
@@ -185,11 +184,6 @@
|
|
|
185
184
|
}
|
|
186
185
|
},
|
|
187
186
|
"homepage": "https://atlassian.design/components/primitives/overview/",
|
|
188
|
-
"platform-feature-flags": {
|
|
189
|
-
"platform-primitives-nested-text-inherit-size": {
|
|
190
|
-
"type": "boolean"
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
187
|
"typesVersions": {
|
|
194
188
|
">=4.5 <4.9": {
|
|
195
189
|
"*": [
|