@atlaskit/primitives
Advanced tools
Comparing version 5.2.0 to 5.3.0
# @atlaskit/primitives | ||
## 5.3.0 | ||
### Minor Changes | ||
- [#86400](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/86400) [`92f574fd392d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/92f574fd392d) - - Anchor now suffixes the accessible label with visually hidden text "(opens new window)" when `target` is set to `_blank`. This improves accessibility for screen readers. | ||
- Anchor no longer automatically opens external links in new windows, which is a poor usability and accessibility practice. Previously this involved applying default attributes `rel="noopener noreferrer"` and `target="_blank"` when the link was detected to link externally. | ||
## 5.2.0 | ||
@@ -4,0 +11,0 @@ |
@@ -19,5 +19,6 @@ "use strict"; | ||
var _interactionContext = _interopRequireDefault(require("@atlaskit/interaction-context")); | ||
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden")); | ||
var _xcss = require("../xcss/xcss"); | ||
var _box = _interopRequireDefault(require("./box")); | ||
var _excluded = ["href", "children", "backgroundColor", "padding", "paddingBlock", "paddingBlockStart", "paddingBlockEnd", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "testId", "xcss", "target", "rel", "onClick", "interactionName", "componentName", "analyticsContext"]; | ||
var _excluded = ["href", "children", "backgroundColor", "padding", "paddingBlock", "paddingBlockStart", "paddingBlockEnd", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "testId", "xcss", "target", "onClick", "interactionName", "componentName", "analyticsContext"]; | ||
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); } | ||
@@ -63,3 +64,2 @@ 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 && Object.prototype.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; } | ||
target = _ref.target, | ||
rel = _ref.rel, | ||
_ref$onClick = _ref.onClick, | ||
@@ -81,3 +81,3 @@ providedOnClick = _ref$onClick === void 0 ? _noop.default : _ref$onClick, | ||
packageName: "@atlaskit/primitives", | ||
packageVersion: "5.2.0", | ||
packageVersion: "5.3.0", | ||
analyticsData: analyticsContext, | ||
@@ -114,4 +114,3 @@ actionSubject: 'link' | ||
href: !isRouterLink && typeof href !== 'string' ? undefined : href, | ||
target: isExternal && target === undefined ? '_blank' : target, | ||
rel: isExternal && rel === undefined ? 'noopener noreferrer' : rel, | ||
target: target, | ||
backgroundColor: backgroundColor, | ||
@@ -129,3 +128,3 @@ padding: padding, | ||
xcss: styles | ||
}), children); | ||
}), children, target === '_blank' && /*#__PURE__*/_react.default.createElement(_visuallyHidden.default, null, "(opens new window)")); | ||
}; | ||
@@ -132,0 +131,0 @@ |
@@ -83,3 +83,3 @@ "use strict"; | ||
packageName: "@atlaskit/primitives", | ||
packageVersion: "5.2.0", | ||
packageVersion: "5.3.0", | ||
analyticsData: analyticsContext, | ||
@@ -86,0 +86,0 @@ actionSubject: 'button' |
@@ -8,2 +8,3 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
import InteractionContext from '@atlaskit/interaction-context'; | ||
import VisuallyHidden from '@atlaskit/visually-hidden'; | ||
import { xcss } from '../xcss/xcss'; | ||
@@ -49,3 +50,2 @@ import Box from './box'; | ||
target, | ||
rel, | ||
onClick: providedOnClick = noop, | ||
@@ -67,3 +67,3 @@ interactionName, | ||
packageName: "@atlaskit/primitives", | ||
packageVersion: "5.2.0", | ||
packageVersion: "5.3.0", | ||
analyticsData: analyticsContext, | ||
@@ -100,4 +100,3 @@ actionSubject: 'link' | ||
href: !isRouterLink && typeof href !== 'string' ? undefined : href, | ||
target: isExternal && target === undefined ? '_blank' : target, | ||
rel: isExternal && rel === undefined ? 'noopener noreferrer' : rel, | ||
target: target, | ||
backgroundColor: backgroundColor, | ||
@@ -115,3 +114,3 @@ padding: padding, | ||
xcss: styles | ||
}), children); | ||
}), children, target === '_blank' && /*#__PURE__*/React.createElement(VisuallyHidden, null, "(opens new window)")); | ||
}; | ||
@@ -118,0 +117,0 @@ |
@@ -69,3 +69,3 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
packageName: "@atlaskit/primitives", | ||
packageVersion: "5.2.0", | ||
packageVersion: "5.3.0", | ||
analyticsData: analyticsContext, | ||
@@ -72,0 +72,0 @@ actionSubject: 'button' |
@@ -5,3 +5,3 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties"; | ||
var _excluded = ["href", "children", "backgroundColor", "padding", "paddingBlock", "paddingBlockStart", "paddingBlockEnd", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "testId", "xcss", "target", "rel", "onClick", "interactionName", "componentName", "analyticsContext"]; | ||
var _excluded = ["href", "children", "backgroundColor", "padding", "paddingBlock", "paddingBlockStart", "paddingBlockEnd", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "testId", "xcss", "target", "onClick", "interactionName", "componentName", "analyticsContext"]; | ||
import React, { forwardRef, useCallback, useContext } from 'react'; | ||
@@ -13,2 +13,3 @@ import invariant from 'tiny-invariant'; | ||
import InteractionContext from '@atlaskit/interaction-context'; | ||
import VisuallyHidden from '@atlaskit/visually-hidden'; | ||
import { xcss } from '../xcss/xcss'; | ||
@@ -54,3 +55,2 @@ import Box from './box'; | ||
target = _ref.target, | ||
rel = _ref.rel, | ||
_ref$onClick = _ref.onClick, | ||
@@ -72,3 +72,3 @@ providedOnClick = _ref$onClick === void 0 ? noop : _ref$onClick, | ||
packageName: "@atlaskit/primitives", | ||
packageVersion: "5.2.0", | ||
packageVersion: "5.3.0", | ||
analyticsData: analyticsContext, | ||
@@ -105,4 +105,3 @@ actionSubject: 'link' | ||
href: !isRouterLink && typeof href !== 'string' ? undefined : href, | ||
target: isExternal && target === undefined ? '_blank' : target, | ||
rel: isExternal && rel === undefined ? 'noopener noreferrer' : rel, | ||
target: target, | ||
backgroundColor: backgroundColor, | ||
@@ -120,3 +119,3 @@ padding: padding, | ||
xcss: styles | ||
}), children); | ||
}), children, target === '_blank' && /*#__PURE__*/React.createElement(VisuallyHidden, null, "(opens new window)")); | ||
}; | ||
@@ -123,0 +122,0 @@ |
@@ -73,3 +73,3 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
packageName: "@atlaskit/primitives", | ||
packageVersion: "5.2.0", | ||
packageVersion: "5.3.0", | ||
analyticsData: analyticsContext, | ||
@@ -76,0 +76,0 @@ actionSubject: 'button' |
@@ -29,3 +29,3 @@ import React, { type ReactNode, type Ref } from 'react'; | ||
}; | ||
declare const Anchor: <RouterLinkConfig extends Record<string, any> = never>({ href, children, backgroundColor, padding, paddingBlock, paddingBlockStart, paddingBlockEnd, paddingInline, paddingInlineStart, paddingInlineEnd, testId, xcss: xcssStyles, target, rel, onClick: providedOnClick, interactionName, componentName, analyticsContext, ...htmlAttributes }: AnchorProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element; | ||
declare const Anchor: <RouterLinkConfig extends Record<string, any> = never>({ href, children, backgroundColor, padding, paddingBlock, paddingBlockStart, paddingBlockEnd, paddingInline, paddingInlineStart, paddingInlineEnd, testId, xcss: xcssStyles, target, onClick: providedOnClick, interactionName, componentName, analyticsContext, ...htmlAttributes }: AnchorProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element; | ||
/** | ||
@@ -32,0 +32,0 @@ * __UNSAFE_ANCHOR__ |
@@ -29,3 +29,3 @@ import React, { type ReactNode, type Ref } from 'react'; | ||
}; | ||
declare const Anchor: <RouterLinkConfig extends Record<string, any> = never>({ href, children, backgroundColor, padding, paddingBlock, paddingBlockStart, paddingBlockEnd, paddingInline, paddingInlineStart, paddingInlineEnd, testId, xcss: xcssStyles, target, rel, onClick: providedOnClick, interactionName, componentName, analyticsContext, ...htmlAttributes }: AnchorProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element; | ||
declare const Anchor: <RouterLinkConfig extends Record<string, any> = never>({ href, children, backgroundColor, padding, paddingBlock, paddingBlockStart, paddingBlockEnd, paddingInline, paddingInlineStart, paddingInlineEnd, testId, xcss: xcssStyles, target, onClick: providedOnClick, interactionName, componentName, analyticsContext, ...htmlAttributes }: AnchorProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element; | ||
/** | ||
@@ -32,0 +32,0 @@ * __UNSAFE_ANCHOR__ |
{ | ||
"name": "@atlaskit/primitives", | ||
"version": "5.2.0", | ||
"version": "5.3.0", | ||
"description": "Primitives are token-backed low-level building blocks.", | ||
@@ -106,3 +106,3 @@ "publishConfig": { | ||
"status": { | ||
"type": "alpha" | ||
"type": "closed-beta" | ||
} | ||
@@ -132,2 +132,3 @@ }, | ||
"@atlaskit/tokens": "^1.42.0", | ||
"@atlaskit/visually-hidden": "^1.2.4", | ||
"@babel/runtime": "^7.0.0", | ||
@@ -134,0 +135,0 @@ "@emotion/react": "^11.7.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1857914
199
14971
13
+ Added@atlaskit/visually-hidden@1.5.1(transitive)