@atlaskit/primitives 13.3.3 → 13.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/primitives
2
2
 
3
+ ## 13.3.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#178771](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/178771)
8
+ [`77f2655aef31d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/77f2655aef31d) -
9
+ Fixing label text for compiled/anchor to be 1:1 with primitive as part of compiled migration
10
+
3
11
  ## 13.3.3
4
12
 
5
13
  ### Patch Changes
@@ -4,6 +4,9 @@ description: An anchor is a primitive for building custom links.
4
4
  order: 0
5
5
  ---
6
6
 
7
+ import SectionMessage, { SectionMessageAction } from '@atlaskit/section-message';
8
+ import Link from '@atlaskit/link';
9
+
7
10
  import AnchorDefault from '../../examples/constellation/anchor/default';
8
11
  import AnchorBasic from '../../examples/constellation/anchor/basic';
9
12
  import AnchorStyled from '../../examples/constellation/anchor/styled';
@@ -14,7 +17,24 @@ import AnchorAnalytics from '../../examples/constellation/anchor/analytics';
14
17
  import AnchorAnalyticsGASv3 from '../../examples/constellation/anchor/analytics-gasv3';
15
18
 
16
19
  import { CodeDocsHeader } from '@af/design-system-docs-ui';
17
- import SectionMessage from '@atlaskit/section-message';
20
+
21
+ <SectionMessage
22
+ appearance="information"
23
+ actions={[
24
+ <SectionMessageAction href="/components/link/examples">
25
+ View link documentation
26
+ </SectionMessageAction>,
27
+ <SectionMessageAction href="/components/button/link-button/examples">
28
+ View link button documentation
29
+ </SectionMessageAction>,
30
+ ]}
31
+ >
32
+ Anchor is for building non-text links, such as a card. It comes with minimal styling. If you're
33
+ using a link within text, use the purpose-built{' '}
34
+ <Link href="/components/link/examples">link component</Link>. For links that appear as buttons,
35
+ use the existing <Link href="/components/button/link-button/examples">link button component</Link>
36
+ .
37
+ </SectionMessage>
18
38
 
19
39
  <CodeDocsHeader
20
40
  name="@atlaskit/primitives"
@@ -25,9 +45,6 @@ import SectionMessage from '@atlaskit/section-message';
25
45
  Anchor is a primitive for building custom links with Atlassian Design System styling, routing
26
46
  support, and built-in event tracking. It renders an anchor `<a>` element.
27
47
 
28
- Only use anchor when existing components such as [link](/components/link/examples) or
29
- [link button](/components/button/link-button/examples) can't be customized to fit your needs.
30
-
31
48
  ## Default
32
49
 
33
50
  Anchor is unstyled besides a default underline and consistent Atlassian Design System focus styles.
@@ -23,7 +23,7 @@ var _useId = require("@atlaskit/ds-lib/use-id");
23
23
  var _interactionContext = _interopRequireDefault(require("@atlaskit/interaction-context"));
24
24
  var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
25
25
  var _focusable = _interopRequireDefault(require("./focusable"));
26
- var _excluded = ["href", "children", "onClick", "interactionName", "componentName", "analyticsContext", "aria-label", "aria-labelledby", "style", "target", "testId", "xcss", "opensInNewWindowLabel"],
26
+ var _excluded = ["href", "children", "onClick", "interactionName", "componentName", "analyticsContext", "aria-label", "aria-labelledby", "style", "target", "testId", "xcss", "newWindowLabel"],
27
27
  _excluded2 = ["className"];
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; }
@@ -56,8 +56,8 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
56
56
  target = _ref.target,
57
57
  testId = _ref.testId,
58
58
  xcss = _ref.xcss,
59
- _ref$opensInNewWindow = _ref.opensInNewWindowLabel,
60
- opensInNewWindowLabel = _ref$opensInNewWindow === void 0 ? '(opens new window)' : _ref$opensInNewWindow,
59
+ _ref$newWindowLabel = _ref.newWindowLabel,
60
+ newWindowLabel = _ref$newWindowLabel === void 0 ? '(opens new window)' : _ref$newWindowLabel,
61
61
  htmlAttributes = (0, _objectWithoutProperties2.default)(_ref, _excluded);
62
62
  var interactionContext = (0, _react.useContext)(_interactionContext.default);
63
63
  var handleClick = (0, _react.useCallback)(function (e, analyticsEvent) {
@@ -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.3.3",
73
+ packageVersion: "13.3.4",
74
74
  analyticsData: analyticsContext,
75
75
  actionSubject: 'link'
76
76
  });
@@ -110,7 +110,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
110
110
  href: !isRouterLink && typeof href !== 'string' ? undefined : href,
111
111
  target: target,
112
112
  onClick: onClick,
113
- "aria-label": ariaLabel && target === '_blank' && !ariaLabelledBy ? "".concat(ariaLabel, " ").concat(opensInNewWindowLabel) : ariaLabel,
113
+ "aria-label": ariaLabel && target === '_blank' && !ariaLabelledBy ? "".concat(ariaLabel, " , ").concat(newWindowLabel) : ariaLabel,
114
114
  "aria-labelledby": ariaLabelledBy && target === '_blank' ? "".concat(ariaLabelledBy, " ").concat(opensNewWindowLabelId) : ariaLabelledBy
115
115
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- TODO: We need to handle pass-through `xcss` => `xcss` here.
116
116
  ,
@@ -119,7 +119,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
119
119
  "data-is-router-link": testId ? isRouterLink ? 'true' : 'false' : undefined
120
120
  }), children, target === '_blank' && (children && !ariaLabel && !ariaLabelledBy || ariaLabelledBy) && /*#__PURE__*/React.createElement(_visuallyHidden.default, {
121
121
  id: opensNewWindowLabelId
122
- }, opensInNewWindowLabel));
122
+ }, newWindowLabel));
123
123
  };
124
124
 
125
125
  // Workarounds to support generic types with forwardRef
@@ -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.3.3",
63
+ packageVersion: "13.3.4",
64
64
  analyticsData: analyticsContext,
65
65
  actionSubject: 'button'
66
66
  });
@@ -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.3.3",
103
+ packageVersion: "13.3.4",
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.3.3",
98
+ packageVersion: "13.3.4",
99
99
  analyticsData: analyticsContext,
100
100
  actionSubject: 'button'
101
101
  });
@@ -41,7 +41,7 @@ const AnchorNoRef = ({
41
41
  target,
42
42
  testId,
43
43
  xcss,
44
- opensInNewWindowLabel = '(opens new window)',
44
+ newWindowLabel = '(opens new window)',
45
45
  ...htmlAttributes
46
46
  }, ref) => {
47
47
  const interactionContext = useContext(InteractionContext);
@@ -55,7 +55,7 @@ const AnchorNoRef = ({
55
55
  action: 'clicked',
56
56
  componentName: componentName || 'Anchor',
57
57
  packageName: "@atlaskit/primitives",
58
- packageVersion: "13.3.3",
58
+ packageVersion: "13.3.4",
59
59
  analyticsData: analyticsContext,
60
60
  actionSubject: 'link'
61
61
  });
@@ -97,7 +97,7 @@ const AnchorNoRef = ({
97
97
  href: !isRouterLink && typeof href !== 'string' ? undefined : href,
98
98
  target: target,
99
99
  onClick: onClick,
100
- "aria-label": ariaLabel && target === '_blank' && !ariaLabelledBy ? `${ariaLabel} ${opensInNewWindowLabel}` : ariaLabel,
100
+ "aria-label": ariaLabel && target === '_blank' && !ariaLabelledBy ? `${ariaLabel} , ${newWindowLabel}` : ariaLabel,
101
101
  "aria-labelledby": ariaLabelledBy && target === '_blank' ? `${ariaLabelledBy} ${opensNewWindowLabelId}` : ariaLabelledBy
102
102
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- TODO: We need to handle pass-through `xcss` => `xcss` here.
103
103
  ,
@@ -106,7 +106,7 @@ const AnchorNoRef = ({
106
106
  "data-is-router-link": testId ? isRouterLink ? 'true' : 'false' : undefined
107
107
  }), children, target === '_blank' && (children && !ariaLabel && !ariaLabelledBy || ariaLabelledBy) && /*#__PURE__*/React.createElement(VisuallyHidden, {
108
108
  id: opensNewWindowLabelId
109
- }, opensInNewWindowLabel));
109
+ }, newWindowLabel));
110
110
  };
111
111
 
112
112
  // Workarounds to support generic types with forwardRef
@@ -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.3.3",
49
+ packageVersion: "13.3.4",
50
50
  analyticsData: analyticsContext,
51
51
  actionSubject: 'button'
52
52
  });
@@ -90,7 +90,7 @@ const AnchorNoRef = ({
90
90
  action: 'clicked',
91
91
  componentName: componentName || 'Anchor',
92
92
  packageName: "@atlaskit/primitives",
93
- packageVersion: "13.3.3",
93
+ packageVersion: "13.3.4",
94
94
  analyticsData: analyticsContext,
95
95
  actionSubject: 'link'
96
96
  });
@@ -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.3.3",
88
+ packageVersion: "13.3.4",
89
89
  analyticsData: analyticsContext,
90
90
  actionSubject: 'button'
91
91
  });
@@ -2,7 +2,7 @@
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";
5
- var _excluded = ["href", "children", "onClick", "interactionName", "componentName", "analyticsContext", "aria-label", "aria-labelledby", "style", "target", "testId", "xcss", "opensInNewWindowLabel"],
5
+ var _excluded = ["href", "children", "onClick", "interactionName", "componentName", "analyticsContext", "aria-label", "aria-labelledby", "style", "target", "testId", "xcss", "newWindowLabel"],
6
6
  _excluded2 = ["className"];
7
7
  import "./anchor.compiled.css";
8
8
  import * as React from 'react';
@@ -46,8 +46,8 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
46
46
  target = _ref.target,
47
47
  testId = _ref.testId,
48
48
  xcss = _ref.xcss,
49
- _ref$opensInNewWindow = _ref.opensInNewWindowLabel,
50
- opensInNewWindowLabel = _ref$opensInNewWindow === void 0 ? '(opens new window)' : _ref$opensInNewWindow,
49
+ _ref$newWindowLabel = _ref.newWindowLabel,
50
+ newWindowLabel = _ref$newWindowLabel === void 0 ? '(opens new window)' : _ref$newWindowLabel,
51
51
  htmlAttributes = _objectWithoutProperties(_ref, _excluded);
52
52
  var interactionContext = useContext(InteractionContext);
53
53
  var handleClick = useCallback(function (e, analyticsEvent) {
@@ -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.3.3",
63
+ packageVersion: "13.3.4",
64
64
  analyticsData: analyticsContext,
65
65
  actionSubject: 'link'
66
66
  });
@@ -100,7 +100,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
100
100
  href: !isRouterLink && typeof href !== 'string' ? undefined : href,
101
101
  target: target,
102
102
  onClick: onClick,
103
- "aria-label": ariaLabel && target === '_blank' && !ariaLabelledBy ? "".concat(ariaLabel, " ").concat(opensInNewWindowLabel) : ariaLabel,
103
+ "aria-label": ariaLabel && target === '_blank' && !ariaLabelledBy ? "".concat(ariaLabel, " , ").concat(newWindowLabel) : ariaLabel,
104
104
  "aria-labelledby": ariaLabelledBy && target === '_blank' ? "".concat(ariaLabelledBy, " ").concat(opensNewWindowLabelId) : ariaLabelledBy
105
105
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- TODO: We need to handle pass-through `xcss` => `xcss` here.
106
106
  ,
@@ -109,7 +109,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
109
109
  "data-is-router-link": testId ? isRouterLink ? 'true' : 'false' : undefined
110
110
  }), children, target === '_blank' && (children && !ariaLabel && !ariaLabelledBy || ariaLabelledBy) && /*#__PURE__*/React.createElement(VisuallyHidden, {
111
111
  id: opensNewWindowLabelId
112
- }, opensInNewWindowLabel));
112
+ }, newWindowLabel));
113
113
  };
114
114
 
115
115
  // Workarounds to support generic types with forwardRef
@@ -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.3.3",
53
+ packageVersion: "13.3.4",
54
54
  analyticsData: analyticsContext,
55
55
  actionSubject: 'button'
56
56
  });
@@ -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.3.3",
97
+ packageVersion: "13.3.4",
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.3.3",
92
+ packageVersion: "13.3.4",
93
93
  analyticsData: analyticsContext,
94
94
  actionSubject: 'button'
95
95
  });
@@ -31,7 +31,7 @@ type BaseAnchorProps = {
31
31
  * Override the default text to signify that a link opens in a new window.
32
32
  * This is appended to the `aria-label` attribute when the `target` prop is set to `_blank`.
33
33
  */
34
- opensInNewWindowLabel?: string;
34
+ newWindowLabel?: string;
35
35
  /**
36
36
  * Forwarded ref.
37
37
  */
@@ -47,7 +47,7 @@ export type AnchorProps<RouterLinkConfig extends Record<string, any> = never> =
47
47
  * - [Code](https://atlassian.design/components/primitives/anchor/code)
48
48
  * - [Usage](https://atlassian.design/components/primitives/anchor/usage)
49
49
  */
50
- declare const AnchorNoRef: <RouterLinkConfig extends Record<string, any> = never>({ href, children, onClick: providedOnClick, interactionName, componentName, analyticsContext, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, style, target, testId, xcss, opensInNewWindowLabel, ...htmlAttributes }: AnchorProps<RouterLinkConfig>, ref?: Ref<HTMLAnchorElement>) => JSX.Element;
50
+ declare const AnchorNoRef: <RouterLinkConfig extends Record<string, any> = never>({ href, children, onClick: providedOnClick, interactionName, componentName, analyticsContext, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, style, target, testId, xcss, newWindowLabel, ...htmlAttributes }: AnchorProps<RouterLinkConfig>, ref?: Ref<HTMLAnchorElement>) => JSX.Element;
51
51
  /**
52
52
  * __Anchor__
53
53
  *
@@ -31,7 +31,7 @@ type BaseAnchorProps = {
31
31
  * Override the default text to signify that a link opens in a new window.
32
32
  * This is appended to the `aria-label` attribute when the `target` prop is set to `_blank`.
33
33
  */
34
- opensInNewWindowLabel?: string;
34
+ newWindowLabel?: string;
35
35
  /**
36
36
  * Forwarded ref.
37
37
  */
@@ -47,7 +47,7 @@ export type AnchorProps<RouterLinkConfig extends Record<string, any> = never> =
47
47
  * - [Code](https://atlassian.design/components/primitives/anchor/code)
48
48
  * - [Usage](https://atlassian.design/components/primitives/anchor/usage)
49
49
  */
50
- declare const AnchorNoRef: <RouterLinkConfig extends Record<string, any> = never>({ href, children, onClick: providedOnClick, interactionName, componentName, analyticsContext, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, style, target, testId, xcss, opensInNewWindowLabel, ...htmlAttributes }: AnchorProps<RouterLinkConfig>, ref?: Ref<HTMLAnchorElement>) => JSX.Element;
50
+ declare const AnchorNoRef: <RouterLinkConfig extends Record<string, any> = never>({ href, children, onClick: providedOnClick, interactionName, componentName, analyticsContext, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, style, target, testId, xcss, newWindowLabel, ...htmlAttributes }: AnchorProps<RouterLinkConfig>, ref?: Ref<HTMLAnchorElement>) => JSX.Element;
51
51
  /**
52
52
  * __Anchor__
53
53
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/primitives",
3
- "version": "13.3.3",
3
+ "version": "13.3.4",
4
4
  "description": "Primitives are token-backed low-level building blocks.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"