@atlaskit/primitives 14.11.1 → 14.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/constellation/box/examples.mdx +4 -5
- package/constellation/inline/examples.mdx +1 -1
- package/constellation/pressable/usage.mdx +2 -2
- package/constellation/stack/examples.mdx +1 -1
- package/constellation/text/examples.mdx +2 -2
- package/dist/cjs/compiled/components/anchor.compiled.css +1 -0
- package/dist/cjs/compiled/components/anchor.js +5 -3
- package/dist/cjs/compiled/components/pressable.js +1 -1
- package/dist/cjs/components/anchor.js +6 -2
- package/dist/cjs/components/pressable.js +1 -1
- package/dist/es2019/compiled/components/anchor.compiled.css +1 -0
- package/dist/es2019/compiled/components/anchor.js +5 -3
- package/dist/es2019/compiled/components/pressable.js +1 -1
- package/dist/es2019/components/anchor.js +6 -2
- package/dist/es2019/components/pressable.js +1 -1
- package/dist/esm/compiled/components/anchor.compiled.css +1 -0
- package/dist/esm/compiled/components/anchor.js +5 -3
- package/dist/esm/compiled/components/pressable.js +1 -1
- package/dist/esm/components/anchor.js +6 -2
- package/dist/esm/components/pressable.js +1 -1
- package/package.json +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/primitives
|
|
2
2
|
|
|
3
|
+
## 14.11.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#193601](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/193601)
|
|
8
|
+
[`d5503d3fc3717`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d5503d3fc3717) -
|
|
9
|
+
Fix issue with positioning in the anchor primitive.
|
|
10
|
+
|
|
3
11
|
## 14.11.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -37,8 +37,7 @@ demonstrates how each prop works with space tokens.
|
|
|
37
37
|
The nomenclature used by these props follows
|
|
38
38
|
[logical properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties). This
|
|
39
39
|
naming is used to support different
|
|
40
|
-
[writing modes](https://developer.mozilla.org/en-US/docs/Web/CSS/writing-mode) in Atlassian
|
|
41
|
-
products.
|
|
40
|
+
[writing modes](https://developer.mozilla.org/en-US/docs/Web/CSS/writing-mode) in Atlassian apps.
|
|
42
41
|
|
|
43
42
|
## Background color
|
|
44
43
|
|
|
@@ -68,8 +67,8 @@ rather than applying conditional behavior to individual props.
|
|
|
68
67
|
|
|
69
68
|
Box is designed to be composed with inline, stack, and other components to create layouts.
|
|
70
69
|
|
|
71
|
-
Atlassian uses dozens of distinct card-like components across
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
Atlassian uses dozens of distinct card-like components across apps. Therefore, rather than providing
|
|
71
|
+
a strict component, the Atlassian Design System empowers and supports you to build your own card
|
|
72
|
+
components in ways that are consistent and will scale over time.
|
|
74
73
|
|
|
75
74
|
<Example Component={BoxPracticalUseCase} packageName="@atlaskit/primitives/box" />
|
|
@@ -114,7 +114,7 @@ It's possible to control the rendered HTML element with the `as` prop.
|
|
|
114
114
|
|
|
115
115
|
## Practical use case
|
|
116
116
|
|
|
117
|
-
An example of how an inline component might be used in
|
|
117
|
+
An example of how an inline component might be used in an app, using Atlassian Design System
|
|
118
118
|
components.
|
|
119
119
|
|
|
120
120
|
<Example Component={InlinePracticalUseCase} packageName="@atlaskit/primitives/inline" />
|
|
@@ -52,7 +52,7 @@ Atlassian UI more visually consistent as things change.
|
|
|
52
52
|
>
|
|
53
53
|
Don't use pressable to redesign elements that already exists in the Atlassian design system, such
|
|
54
54
|
as <a href="/components/button/examples">buttons</a>. This can cause visual and behavioral
|
|
55
|
-
inconsistency in
|
|
55
|
+
inconsistency in apps.
|
|
56
56
|
</DoDont>
|
|
57
57
|
|
|
58
58
|
## Accessibility
|
|
@@ -123,5 +123,5 @@ questions.
|
|
|
123
123
|
## Related
|
|
124
124
|
|
|
125
125
|
- Use existing components such as [buttons](/components/button/examples) or
|
|
126
|
-
[menus](/components/menu/examples) for most actions in Atlassian
|
|
126
|
+
[menus](/components/menu/examples) for most actions in Atlassian apps.
|
|
127
127
|
- Use the [anchor primitive for custom links](/components/primitives/button/usage).
|
|
@@ -91,7 +91,7 @@ It's possible to control the rendered HTML element with the `as` prop.
|
|
|
91
91
|
|
|
92
92
|
## Practical use case
|
|
93
93
|
|
|
94
|
-
An example of how a stack component might be used in
|
|
94
|
+
An example of how a stack component might be used in an app, using Atlassian Design System
|
|
95
95
|
components.
|
|
96
96
|
|
|
97
97
|
<Example Component={StackPracticalUseCase} packageName="@atlaskit/primitives/stack" />
|
|
@@ -82,9 +82,9 @@ The available values for paragraph spacing are outlined in the
|
|
|
82
82
|
|
|
83
83
|
## Truncation
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
[Avoid truncation](/content/language-and-grammar/#truncation) whenever possible.
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
If truncation cannot be avoided, for example when displaying user-generated content, use the
|
|
88
88
|
`maxLines` prop to indicate how text should be truncated.
|
|
89
89
|
|
|
90
90
|
<Example Component={TextTruncation} packageName="@atlaskit/primitives" />
|
|
@@ -21,13 +21,15 @@ var _appProvider = require("@atlaskit/app-provider");
|
|
|
21
21
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
22
22
|
var _useId = require("@atlaskit/ds-lib/use-id");
|
|
23
23
|
var _interactionContext = _interopRequireDefault(require("@atlaskit/interaction-context"));
|
|
24
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
24
25
|
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
|
|
25
26
|
var _focusable = _interopRequireDefault(require("./focusable"));
|
|
26
27
|
var _excluded = ["href", "children", "onClick", "interactionName", "componentName", "analyticsContext", "aria-label", "aria-labelledby", "style", "target", "testId", "xcss", "newWindowLabel"],
|
|
27
28
|
_excluded2 = ["className"];
|
|
28
29
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
29
30
|
var styles = {
|
|
30
|
-
root: "_4bfu1r31 _1hms8stv _ajmmnqa1 _vchhusvi"
|
|
31
|
+
root: "_4bfu1r31 _1hms8stv _ajmmnqa1 _vchhusvi",
|
|
32
|
+
position: "_kqswh2mm"
|
|
31
33
|
};
|
|
32
34
|
var IS_EXTERNAL_LINK_REGEX = /^(?:(http|https):\/\/)/;
|
|
33
35
|
var IS_NON_HTTP_BASED = /^(((mailto|tel|sms|blob):)|(#))/;
|
|
@@ -69,7 +71,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
69
71
|
action: 'clicked',
|
|
70
72
|
componentName: componentName || 'Anchor',
|
|
71
73
|
packageName: "@atlaskit/primitives",
|
|
72
|
-
packageVersion: "14.11.
|
|
74
|
+
packageVersion: "14.11.1",
|
|
73
75
|
analyticsData: analyticsContext,
|
|
74
76
|
actionSubject: 'link'
|
|
75
77
|
});
|
|
@@ -109,7 +111,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
109
111
|
onClick: onClick,
|
|
110
112
|
"aria-label": ariaLabel && target === '_blank' && !ariaLabelledBy ? "".concat(ariaLabel, " , ").concat(newWindowLabel) : ariaLabel,
|
|
111
113
|
"aria-labelledby": ariaLabelledBy && target === '_blank' ? "".concat(ariaLabelledBy, " ").concat(opensNewWindowLabelId) : ariaLabelledBy,
|
|
112
|
-
xcss: (0, _react2.cx)(styles.root, xcss),
|
|
114
|
+
xcss: (0, _react2.cx)(styles.root, (0, _platformFeatureFlags.fg)('platform_design-system-team_anchor-positioning') ? styles.position : undefined, xcss),
|
|
113
115
|
testId: testId,
|
|
114
116
|
"data-is-router-link": testId ? isRouterLink ? 'true' : 'false' : undefined
|
|
115
117
|
}), children, target === '_blank' && (children && !ariaLabel && !ariaLabelledBy || ariaLabelledBy) && /*#__PURE__*/React.createElement(_visuallyHidden.default, {
|
|
@@ -61,7 +61,7 @@ var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
61
61
|
action: 'clicked',
|
|
62
62
|
componentName: componentName || 'Pressable',
|
|
63
63
|
packageName: "@atlaskit/primitives",
|
|
64
|
-
packageVersion: "14.11.
|
|
64
|
+
packageVersion: "14.11.1",
|
|
65
65
|
analyticsData: analyticsContext,
|
|
66
66
|
actionSubject: 'button'
|
|
67
67
|
});
|
|
@@ -16,6 +16,7 @@ var _appProvider = require("@atlaskit/app-provider");
|
|
|
16
16
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
17
17
|
var _useId = require("@atlaskit/ds-lib/use-id");
|
|
18
18
|
var _interactionContext = _interopRequireDefault(require("@atlaskit/interaction-context"));
|
|
19
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
20
|
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
|
|
20
21
|
var _styleMaps = require("../xcss/style-maps.partial");
|
|
21
22
|
var _xcss = require("../xcss/xcss");
|
|
@@ -51,6 +52,9 @@ var baseStyles = (0, _react2.css)({
|
|
|
51
52
|
boxSizing: 'border-box',
|
|
52
53
|
textDecoration: 'underline'
|
|
53
54
|
});
|
|
55
|
+
var positionStyles = (0, _react2.css)({
|
|
56
|
+
position: 'relative'
|
|
57
|
+
});
|
|
54
58
|
var IS_EXTERNAL_LINK_REGEX = /^(?:(http|https):\/\/)/;
|
|
55
59
|
var IS_NON_HTTP_BASED = /^(((mailto|tel|sms|blob):)|(#))/;
|
|
56
60
|
// Comma is added here to add a slight pause between announcing the anchor label and "opens in new window"
|
|
@@ -100,7 +104,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
100
104
|
action: 'clicked',
|
|
101
105
|
componentName: componentName || 'Anchor',
|
|
102
106
|
packageName: "@atlaskit/primitives",
|
|
103
|
-
packageVersion: "14.11.
|
|
107
|
+
packageVersion: "14.11.1",
|
|
104
108
|
analyticsData: analyticsContext,
|
|
105
109
|
actionSubject: 'link'
|
|
106
110
|
});
|
|
@@ -142,7 +146,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
142
146
|
"aria-label": ariaLabel && target === '_blank' && !ariaLabelledBy ? //`${ariaLabel} ${OPENS_NEW_WINDOW_LABEL}`
|
|
143
147
|
"".concat(ariaLabel, " , ").concat(newWindowLabel ? newWindowLabel : OPENS_NEW_WINDOW_LABEL) : ariaLabel,
|
|
144
148
|
"aria-labelledby": ariaLabelledBy && target === '_blank' ? "".concat(ariaLabelledBy, " ").concat(opensNewWindowLabelId) : ariaLabelledBy,
|
|
145
|
-
css: [baseStyles, focusRingStyles,
|
|
149
|
+
css: [baseStyles, (0, _platformFeatureFlags.fg)('platform_design-system-team_anchor-positioning') ? positionStyles : undefined, focusRingStyles,
|
|
146
150
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
147
151
|
backgroundColor && _styleMaps.backgroundColorStylesMap[backgroundColor],
|
|
148
152
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
@@ -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.11.
|
|
98
|
+
packageVersion: "14.11.1",
|
|
99
99
|
analyticsData: analyticsContext,
|
|
100
100
|
actionSubject: 'button'
|
|
101
101
|
});
|
|
@@ -11,10 +11,12 @@ import { useRouterLink } from '@atlaskit/app-provider';
|
|
|
11
11
|
import noop from '@atlaskit/ds-lib/noop';
|
|
12
12
|
import { useId } from '@atlaskit/ds-lib/use-id';
|
|
13
13
|
import InteractionContext from '@atlaskit/interaction-context';
|
|
14
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
15
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
15
16
|
import Focusable from './focusable';
|
|
16
17
|
const styles = {
|
|
17
|
-
root: "_4bfu1r31 _1hms8stv _ajmmnqa1 _vchhusvi"
|
|
18
|
+
root: "_4bfu1r31 _1hms8stv _ajmmnqa1 _vchhusvi",
|
|
19
|
+
position: "_kqswh2mm"
|
|
18
20
|
};
|
|
19
21
|
const IS_EXTERNAL_LINK_REGEX = /^(?:(http|https):\/\/)/;
|
|
20
22
|
const IS_NON_HTTP_BASED = /^(((mailto|tel|sms|blob):)|(#))/;
|
|
@@ -55,7 +57,7 @@ const AnchorNoRef = ({
|
|
|
55
57
|
action: 'clicked',
|
|
56
58
|
componentName: componentName || 'Anchor',
|
|
57
59
|
packageName: "@atlaskit/primitives",
|
|
58
|
-
packageVersion: "14.11.
|
|
60
|
+
packageVersion: "14.11.1",
|
|
59
61
|
analyticsData: analyticsContext,
|
|
60
62
|
actionSubject: 'link'
|
|
61
63
|
});
|
|
@@ -97,7 +99,7 @@ const AnchorNoRef = ({
|
|
|
97
99
|
onClick: onClick,
|
|
98
100
|
"aria-label": ariaLabel && target === '_blank' && !ariaLabelledBy ? `${ariaLabel} , ${newWindowLabel}` : ariaLabel,
|
|
99
101
|
"aria-labelledby": ariaLabelledBy && target === '_blank' ? `${ariaLabelledBy} ${opensNewWindowLabelId}` : ariaLabelledBy,
|
|
100
|
-
xcss: cx(styles.root, xcss),
|
|
102
|
+
xcss: cx(styles.root, fg('platform_design-system-team_anchor-positioning') ? styles.position : undefined, xcss),
|
|
101
103
|
testId: testId,
|
|
102
104
|
"data-is-router-link": testId ? isRouterLink ? 'true' : 'false' : undefined
|
|
103
105
|
}), children, target === '_blank' && (children && !ariaLabel && !ariaLabelledBy || ariaLabelledBy) && /*#__PURE__*/React.createElement(VisuallyHidden, {
|
|
@@ -48,7 +48,7 @@ const Pressable = /*#__PURE__*/forwardRef(({
|
|
|
48
48
|
action: 'clicked',
|
|
49
49
|
componentName: componentName || 'Pressable',
|
|
50
50
|
packageName: "@atlaskit/primitives",
|
|
51
|
-
packageVersion: "14.11.
|
|
51
|
+
packageVersion: "14.11.1",
|
|
52
52
|
analyticsData: analyticsContext,
|
|
53
53
|
actionSubject: 'button'
|
|
54
54
|
});
|
|
@@ -13,6 +13,7 @@ import { useRouterLink } from '@atlaskit/app-provider';
|
|
|
13
13
|
import noop from '@atlaskit/ds-lib/noop';
|
|
14
14
|
import { useId } from '@atlaskit/ds-lib/use-id';
|
|
15
15
|
import InteractionContext from '@atlaskit/interaction-context';
|
|
16
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
17
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
17
18
|
import { backgroundColorStylesMap, borderColorMap, borderWidthMap, paddingStylesMap, positiveSpaceMap } from '../xcss/style-maps.partial';
|
|
18
19
|
import { parseXcss } from '../xcss/xcss';
|
|
@@ -41,6 +42,9 @@ const baseStyles = css({
|
|
|
41
42
|
boxSizing: 'border-box',
|
|
42
43
|
textDecoration: 'underline'
|
|
43
44
|
});
|
|
45
|
+
const positionStyles = css({
|
|
46
|
+
position: 'relative'
|
|
47
|
+
});
|
|
44
48
|
const IS_EXTERNAL_LINK_REGEX = /^(?:(http|https):\/\/)/;
|
|
45
49
|
const IS_NON_HTTP_BASED = /^(((mailto|tel|sms|blob):)|(#))/;
|
|
46
50
|
// Comma is added here to add a slight pause between announcing the anchor label and "opens in new window"
|
|
@@ -90,7 +94,7 @@ const AnchorNoRef = ({
|
|
|
90
94
|
action: 'clicked',
|
|
91
95
|
componentName: componentName || 'Anchor',
|
|
92
96
|
packageName: "@atlaskit/primitives",
|
|
93
|
-
packageVersion: "14.11.
|
|
97
|
+
packageVersion: "14.11.1",
|
|
94
98
|
analyticsData: analyticsContext,
|
|
95
99
|
actionSubject: 'link'
|
|
96
100
|
});
|
|
@@ -135,7 +139,7 @@ const AnchorNoRef = ({
|
|
|
135
139
|
//`${ariaLabel} ${OPENS_NEW_WINDOW_LABEL}`
|
|
136
140
|
`${ariaLabel} , ${newWindowLabel ? newWindowLabel : OPENS_NEW_WINDOW_LABEL}` : ariaLabel,
|
|
137
141
|
"aria-labelledby": ariaLabelledBy && target === '_blank' ? `${ariaLabelledBy} ${opensNewWindowLabelId}` : ariaLabelledBy,
|
|
138
|
-
css: [baseStyles, focusRingStyles,
|
|
142
|
+
css: [baseStyles, fg('platform_design-system-team_anchor-positioning') ? positionStyles : undefined, focusRingStyles,
|
|
139
143
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
140
144
|
backgroundColor && backgroundColorStylesMap[backgroundColor],
|
|
141
145
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
@@ -85,7 +85,7 @@ const Pressable = /*#__PURE__*/forwardRef(({
|
|
|
85
85
|
action: 'clicked',
|
|
86
86
|
componentName: componentName || 'Pressable',
|
|
87
87
|
packageName: "@atlaskit/primitives",
|
|
88
|
-
packageVersion: "14.11.
|
|
88
|
+
packageVersion: "14.11.1",
|
|
89
89
|
analyticsData: analyticsContext,
|
|
90
90
|
actionSubject: 'button'
|
|
91
91
|
});
|
|
@@ -15,10 +15,12 @@ import { useRouterLink } from '@atlaskit/app-provider';
|
|
|
15
15
|
import noop from '@atlaskit/ds-lib/noop';
|
|
16
16
|
import { useId } from '@atlaskit/ds-lib/use-id';
|
|
17
17
|
import InteractionContext from '@atlaskit/interaction-context';
|
|
18
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
18
19
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
19
20
|
import Focusable from './focusable';
|
|
20
21
|
var styles = {
|
|
21
|
-
root: "_4bfu1r31 _1hms8stv _ajmmnqa1 _vchhusvi"
|
|
22
|
+
root: "_4bfu1r31 _1hms8stv _ajmmnqa1 _vchhusvi",
|
|
23
|
+
position: "_kqswh2mm"
|
|
22
24
|
};
|
|
23
25
|
var IS_EXTERNAL_LINK_REGEX = /^(?:(http|https):\/\/)/;
|
|
24
26
|
var IS_NON_HTTP_BASED = /^(((mailto|tel|sms|blob):)|(#))/;
|
|
@@ -60,7 +62,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
60
62
|
action: 'clicked',
|
|
61
63
|
componentName: componentName || 'Anchor',
|
|
62
64
|
packageName: "@atlaskit/primitives",
|
|
63
|
-
packageVersion: "14.11.
|
|
65
|
+
packageVersion: "14.11.1",
|
|
64
66
|
analyticsData: analyticsContext,
|
|
65
67
|
actionSubject: 'link'
|
|
66
68
|
});
|
|
@@ -100,7 +102,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
100
102
|
onClick: onClick,
|
|
101
103
|
"aria-label": ariaLabel && target === '_blank' && !ariaLabelledBy ? "".concat(ariaLabel, " , ").concat(newWindowLabel) : ariaLabel,
|
|
102
104
|
"aria-labelledby": ariaLabelledBy && target === '_blank' ? "".concat(ariaLabelledBy, " ").concat(opensNewWindowLabelId) : ariaLabelledBy,
|
|
103
|
-
xcss: cx(styles.root, xcss),
|
|
105
|
+
xcss: cx(styles.root, fg('platform_design-system-team_anchor-positioning') ? styles.position : undefined, xcss),
|
|
104
106
|
testId: testId,
|
|
105
107
|
"data-is-router-link": testId ? isRouterLink ? 'true' : 'false' : undefined
|
|
106
108
|
}), children, target === '_blank' && (children && !ariaLabel && !ariaLabelledBy || ariaLabelledBy) && /*#__PURE__*/React.createElement(VisuallyHidden, {
|
|
@@ -52,7 +52,7 @@ var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
52
52
|
action: 'clicked',
|
|
53
53
|
componentName: componentName || 'Pressable',
|
|
54
54
|
packageName: "@atlaskit/primitives",
|
|
55
|
-
packageVersion: "14.11.
|
|
55
|
+
packageVersion: "14.11.1",
|
|
56
56
|
analyticsData: analyticsContext,
|
|
57
57
|
actionSubject: 'button'
|
|
58
58
|
});
|
|
@@ -17,6 +17,7 @@ import { useRouterLink } from '@atlaskit/app-provider';
|
|
|
17
17
|
import noop from '@atlaskit/ds-lib/noop';
|
|
18
18
|
import { useId } from '@atlaskit/ds-lib/use-id';
|
|
19
19
|
import InteractionContext from '@atlaskit/interaction-context';
|
|
20
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
20
21
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
21
22
|
import { backgroundColorStylesMap, borderColorMap, borderWidthMap, paddingStylesMap, positiveSpaceMap } from '../xcss/style-maps.partial';
|
|
22
23
|
import { parseXcss } from '../xcss/xcss';
|
|
@@ -45,6 +46,9 @@ var baseStyles = css({
|
|
|
45
46
|
boxSizing: 'border-box',
|
|
46
47
|
textDecoration: 'underline'
|
|
47
48
|
});
|
|
49
|
+
var positionStyles = css({
|
|
50
|
+
position: 'relative'
|
|
51
|
+
});
|
|
48
52
|
var IS_EXTERNAL_LINK_REGEX = /^(?:(http|https):\/\/)/;
|
|
49
53
|
var IS_NON_HTTP_BASED = /^(((mailto|tel|sms|blob):)|(#))/;
|
|
50
54
|
// Comma is added here to add a slight pause between announcing the anchor label and "opens in new window"
|
|
@@ -94,7 +98,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
94
98
|
action: 'clicked',
|
|
95
99
|
componentName: componentName || 'Anchor',
|
|
96
100
|
packageName: "@atlaskit/primitives",
|
|
97
|
-
packageVersion: "14.11.
|
|
101
|
+
packageVersion: "14.11.1",
|
|
98
102
|
analyticsData: analyticsContext,
|
|
99
103
|
actionSubject: 'link'
|
|
100
104
|
});
|
|
@@ -136,7 +140,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
136
140
|
"aria-label": ariaLabel && target === '_blank' && !ariaLabelledBy ? //`${ariaLabel} ${OPENS_NEW_WINDOW_LABEL}`
|
|
137
141
|
"".concat(ariaLabel, " , ").concat(newWindowLabel ? newWindowLabel : OPENS_NEW_WINDOW_LABEL) : ariaLabel,
|
|
138
142
|
"aria-labelledby": ariaLabelledBy && target === '_blank' ? "".concat(ariaLabelledBy, " ").concat(opensNewWindowLabelId) : ariaLabelledBy,
|
|
139
|
-
css: [baseStyles, focusRingStyles,
|
|
143
|
+
css: [baseStyles, fg('platform_design-system-team_anchor-positioning') ? positionStyles : undefined, focusRingStyles,
|
|
140
144
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
141
145
|
backgroundColor && backgroundColorStylesMap[backgroundColor],
|
|
142
146
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
@@ -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: "14.11.
|
|
92
|
+
packageVersion: "14.11.1",
|
|
93
93
|
analyticsData: analyticsContext,
|
|
94
94
|
actionSubject: 'button'
|
|
95
95
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/primitives",
|
|
3
|
-
"version": "14.11.
|
|
3
|
+
"version": "14.11.2",
|
|
4
4
|
"description": "Primitives are token-backed low-level building blocks.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -235,5 +235,10 @@
|
|
|
235
235
|
"./anchor": "./src/components/anchor.tsx",
|
|
236
236
|
"./responsive": "./src/responsive/index.tsx",
|
|
237
237
|
"./compiled": "./src/compiled/index.tsx"
|
|
238
|
+
},
|
|
239
|
+
"platform-feature-flags": {
|
|
240
|
+
"platform_design-system-team_anchor-positioning": {
|
|
241
|
+
"type": "boolean"
|
|
242
|
+
}
|
|
238
243
|
}
|
|
239
244
|
}
|