@atlaskit/primitives 14.6.0 → 14.7.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 +17 -0
- package/dist/cjs/compiled/components/anchor.js +1 -1
- package/dist/cjs/compiled/components/pressable.js +9 -2
- package/dist/cjs/components/anchor.js +1 -1
- package/dist/cjs/components/pressable.js +1 -1
- package/dist/cjs/index.js +0 -6
- package/dist/es2019/compiled/components/anchor.js +1 -1
- package/dist/es2019/compiled/components/pressable.js +8 -1
- package/dist/es2019/components/anchor.js +1 -1
- package/dist/es2019/components/pressable.js +1 -1
- package/dist/es2019/index.js +1 -5
- package/dist/esm/compiled/components/anchor.js +1 -1
- package/dist/esm/compiled/components/pressable.js +9 -2
- package/dist/esm/components/anchor.js +1 -1
- package/dist/esm/components/pressable.js +1 -1
- package/dist/esm/index.js +1 -5
- package/dist/types/index.d.ts +2 -10
- package/dist/types-ts4.5/index.d.ts +2 -10
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/primitives
|
|
2
2
|
|
|
3
|
+
## 14.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#148964](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/148964)
|
|
8
|
+
[`79dddcb8a67c0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/79dddcb8a67c0) -
|
|
9
|
+
Add tabindex="0" to Pressable for Safari so that click events are fired
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 14.7.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [#146876](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/146876)
|
|
17
|
+
[`1f9d7feceff9f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1f9d7feceff9f) -
|
|
18
|
+
Removed deprecated unsafe anchor and unsafe anchor props.
|
|
19
|
+
|
|
3
20
|
## 14.6.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
|
@@ -70,7 +70,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
70
70
|
action: 'clicked',
|
|
71
71
|
componentName: componentName || 'Anchor',
|
|
72
72
|
packageName: "@atlaskit/primitives",
|
|
73
|
-
packageVersion: "14.
|
|
73
|
+
packageVersion: "14.7.1",
|
|
74
74
|
analyticsData: analyticsContext,
|
|
75
75
|
actionSubject: 'link'
|
|
76
76
|
});
|
|
@@ -15,10 +15,11 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
15
15
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
16
16
|
var _react2 = require("@compiled/react");
|
|
17
17
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
18
|
+
var _deviceCheck = require("@atlaskit/ds-lib/device-check");
|
|
18
19
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
19
20
|
var _interactionContext = _interopRequireDefault(require("@atlaskit/interaction-context"));
|
|
20
21
|
var _focusable = _interopRequireDefault(require("./focusable"));
|
|
21
|
-
var _excluded = ["children", "isDisabled", "type", "onClick", "interactionName", "componentName", "analyticsContext", "style", "testId", "xcss"],
|
|
22
|
+
var _excluded = ["children", "isDisabled", "type", "onClick", "interactionName", "componentName", "analyticsContext", "style", "testId", "xcss", "tabIndex"],
|
|
22
23
|
_excluded2 = ["className"];
|
|
23
24
|
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); }
|
|
24
25
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -49,6 +50,7 @@ var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
49
50
|
style = _ref.style,
|
|
50
51
|
testId = _ref.testId,
|
|
51
52
|
xcss = _ref.xcss,
|
|
53
|
+
tabIndex = _ref.tabIndex,
|
|
52
54
|
htmlAttributes = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
53
55
|
var interactionContext = (0, _react.useContext)(_interactionContext.default);
|
|
54
56
|
var handleClick = (0, _react.useCallback)(function (e, analyticsEvent) {
|
|
@@ -60,7 +62,7 @@ var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
60
62
|
action: 'clicked',
|
|
61
63
|
componentName: componentName || 'Pressable',
|
|
62
64
|
packageName: "@atlaskit/primitives",
|
|
63
|
-
packageVersion: "14.
|
|
65
|
+
packageVersion: "14.7.1",
|
|
64
66
|
analyticsData: analyticsContext,
|
|
65
67
|
actionSubject: 'button'
|
|
66
68
|
});
|
|
@@ -73,6 +75,11 @@ var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
73
75
|
// @ts-expect-error we don't allow `button` on Focusable for makers as they should use Pressable instead
|
|
74
76
|
, (0, _extends2.default)({
|
|
75
77
|
as: "button"
|
|
78
|
+
// Safari does not apply focus to buttons on click like other browsers, which means click events will not be fired.
|
|
79
|
+
// Adding a tabIndex of 0 to the button will allow it to be focused on click.
|
|
80
|
+
// This is a known issue in Safari that is meant to be "intended", see https://bugs.webkit.org/show_bug.cgi?id=22261
|
|
81
|
+
,
|
|
82
|
+
tabIndex: tabIndex !== null && tabIndex !== void 0 ? tabIndex : (0, _deviceCheck.isSafari)() && !isDisabled ? 0 : undefined
|
|
76
83
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- TODO: Properly type this and allow pass-through if we can determine the type
|
|
77
84
|
,
|
|
78
85
|
style: style
|
|
@@ -100,7 +100,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
|
|
|
100
100
|
action: 'clicked',
|
|
101
101
|
componentName: componentName || 'Anchor',
|
|
102
102
|
packageName: "@atlaskit/primitives",
|
|
103
|
-
packageVersion: "14.
|
|
103
|
+
packageVersion: "14.7.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: "14.
|
|
98
|
+
packageVersion: "14.7.1",
|
|
99
99
|
analyticsData: analyticsContext,
|
|
100
100
|
actionSubject: 'button'
|
|
101
101
|
});
|
package/dist/cjs/index.js
CHANGED
|
@@ -58,12 +58,6 @@ Object.defineProperty(exports, "Text", {
|
|
|
58
58
|
return _text.default;
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
|
-
Object.defineProperty(exports, "UNSAFE_ANCHOR", {
|
|
62
|
-
enumerable: true,
|
|
63
|
-
get: function get() {
|
|
64
|
-
return _anchor.default;
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
61
|
Object.defineProperty(exports, "UNSAFE_BREAKPOINTS_CONFIG", {
|
|
68
62
|
enumerable: true,
|
|
69
63
|
get: function get() {
|
|
@@ -6,6 +6,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
6
6
|
import { forwardRef, useCallback, useContext } from 'react';
|
|
7
7
|
import { cx } from '@compiled/react';
|
|
8
8
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
|
|
9
|
+
import { isSafari } from '@atlaskit/ds-lib/device-check';
|
|
9
10
|
import noop from '@atlaskit/ds-lib/noop';
|
|
10
11
|
import InteractionContext from '@atlaskit/interaction-context';
|
|
11
12
|
import Focusable from './focusable';
|
|
@@ -34,6 +35,7 @@ const Pressable = /*#__PURE__*/forwardRef(({
|
|
|
34
35
|
style,
|
|
35
36
|
testId,
|
|
36
37
|
xcss,
|
|
38
|
+
tabIndex,
|
|
37
39
|
...htmlAttributes
|
|
38
40
|
}, ref) => {
|
|
39
41
|
const interactionContext = useContext(InteractionContext);
|
|
@@ -46,7 +48,7 @@ const Pressable = /*#__PURE__*/forwardRef(({
|
|
|
46
48
|
action: 'clicked',
|
|
47
49
|
componentName: componentName || 'Pressable',
|
|
48
50
|
packageName: "@atlaskit/primitives",
|
|
49
|
-
packageVersion: "14.
|
|
51
|
+
packageVersion: "14.7.1",
|
|
50
52
|
analyticsData: analyticsContext,
|
|
51
53
|
actionSubject: 'button'
|
|
52
54
|
});
|
|
@@ -61,6 +63,11 @@ const Pressable = /*#__PURE__*/forwardRef(({
|
|
|
61
63
|
// @ts-expect-error we don't allow `button` on Focusable for makers as they should use Pressable instead
|
|
62
64
|
, _extends({
|
|
63
65
|
as: "button"
|
|
66
|
+
// Safari does not apply focus to buttons on click like other browsers, which means click events will not be fired.
|
|
67
|
+
// Adding a tabIndex of 0 to the button will allow it to be focused on click.
|
|
68
|
+
// This is a known issue in Safari that is meant to be "intended", see https://bugs.webkit.org/show_bug.cgi?id=22261
|
|
69
|
+
,
|
|
70
|
+
tabIndex: tabIndex !== null && tabIndex !== void 0 ? tabIndex : isSafari() && !isDisabled ? 0 : undefined
|
|
64
71
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- TODO: Properly type this and allow pass-through if we can determine the type
|
|
65
72
|
,
|
|
66
73
|
style: style
|
|
@@ -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.
|
|
88
|
+
packageVersion: "14.7.1",
|
|
89
89
|
analyticsData: analyticsContext,
|
|
90
90
|
actionSubject: 'button'
|
|
91
91
|
});
|
package/dist/es2019/index.js
CHANGED
|
@@ -7,11 +7,7 @@ export { default as Grid } from './components/grid';
|
|
|
7
7
|
export { default as Bleed } from './components/bleed';
|
|
8
8
|
export { default as Text } from './components/text';
|
|
9
9
|
export { default as Pressable } from './components/pressable';
|
|
10
|
-
export {
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Use `Anchor` instead. This will be removed in a future major release.
|
|
13
|
-
*/
|
|
14
|
-
default as UNSAFE_ANCHOR, default as Anchor } from './components/anchor';
|
|
10
|
+
export { default as Anchor } from './components/anchor';
|
|
15
11
|
export { media, UNSAFE_media, UNSAFE_BREAKPOINTS_CONFIG } from './responsive';
|
|
16
12
|
export { useSurface as UNSAFE_useSurface } from './utils/surface-provider';
|
|
17
13
|
export { inverseColorMap as UNSAFE_inverseColorMap } from './xcss/style-maps.partial';
|
|
@@ -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: "14.
|
|
63
|
+
packageVersion: "14.7.1",
|
|
64
64
|
analyticsData: analyticsContext,
|
|
65
65
|
actionSubject: 'link'
|
|
66
66
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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
|
-
var _excluded = ["children", "isDisabled", "type", "onClick", "interactionName", "componentName", "analyticsContext", "style", "testId", "xcss"],
|
|
4
|
+
var _excluded = ["children", "isDisabled", "type", "onClick", "interactionName", "componentName", "analyticsContext", "style", "testId", "xcss", "tabIndex"],
|
|
5
5
|
_excluded2 = ["className"];
|
|
6
6
|
import "./pressable.compiled.css";
|
|
7
7
|
import * as React from 'react';
|
|
@@ -9,6 +9,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
9
9
|
import { forwardRef, useCallback, useContext } from 'react';
|
|
10
10
|
import { cx } from '@compiled/react';
|
|
11
11
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
|
|
12
|
+
import { isSafari } from '@atlaskit/ds-lib/device-check';
|
|
12
13
|
import noop from '@atlaskit/ds-lib/noop';
|
|
13
14
|
import InteractionContext from '@atlaskit/interaction-context';
|
|
14
15
|
import Focusable from './focusable';
|
|
@@ -39,6 +40,7 @@ var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
39
40
|
style = _ref.style,
|
|
40
41
|
testId = _ref.testId,
|
|
41
42
|
xcss = _ref.xcss,
|
|
43
|
+
tabIndex = _ref.tabIndex,
|
|
42
44
|
htmlAttributes = _objectWithoutProperties(_ref, _excluded);
|
|
43
45
|
var interactionContext = useContext(InteractionContext);
|
|
44
46
|
var handleClick = useCallback(function (e, analyticsEvent) {
|
|
@@ -50,7 +52,7 @@ var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
50
52
|
action: 'clicked',
|
|
51
53
|
componentName: componentName || 'Pressable',
|
|
52
54
|
packageName: "@atlaskit/primitives",
|
|
53
|
-
packageVersion: "14.
|
|
55
|
+
packageVersion: "14.7.1",
|
|
54
56
|
analyticsData: analyticsContext,
|
|
55
57
|
actionSubject: 'button'
|
|
56
58
|
});
|
|
@@ -63,6 +65,11 @@ var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
63
65
|
// @ts-expect-error we don't allow `button` on Focusable for makers as they should use Pressable instead
|
|
64
66
|
, _extends({
|
|
65
67
|
as: "button"
|
|
68
|
+
// Safari does not apply focus to buttons on click like other browsers, which means click events will not be fired.
|
|
69
|
+
// Adding a tabIndex of 0 to the button will allow it to be focused on click.
|
|
70
|
+
// This is a known issue in Safari that is meant to be "intended", see https://bugs.webkit.org/show_bug.cgi?id=22261
|
|
71
|
+
,
|
|
72
|
+
tabIndex: tabIndex !== null && tabIndex !== void 0 ? tabIndex : isSafari() && !isDisabled ? 0 : undefined
|
|
66
73
|
// 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
|
|
67
74
|
,
|
|
68
75
|
style: style
|
|
@@ -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: "14.
|
|
97
|
+
packageVersion: "14.7.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: "14.
|
|
92
|
+
packageVersion: "14.7.1",
|
|
93
93
|
analyticsData: analyticsContext,
|
|
94
94
|
actionSubject: 'button'
|
|
95
95
|
});
|
package/dist/esm/index.js
CHANGED
|
@@ -7,11 +7,7 @@ export { default as Grid } from './components/grid';
|
|
|
7
7
|
export { default as Bleed } from './components/bleed';
|
|
8
8
|
export { default as Text } from './components/text';
|
|
9
9
|
export { default as Pressable } from './components/pressable';
|
|
10
|
-
export {
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Use `Anchor` instead. This will be removed in a future major release.
|
|
13
|
-
*/
|
|
14
|
-
default as UNSAFE_ANCHOR, default as Anchor } from './components/anchor';
|
|
10
|
+
export { default as Anchor } from './components/anchor';
|
|
15
11
|
export { media, UNSAFE_media, UNSAFE_BREAKPOINTS_CONFIG } from './responsive';
|
|
16
12
|
export { useSurface as UNSAFE_useSurface } from './utils/surface-provider';
|
|
17
13
|
export { inverseColorMap as UNSAFE_inverseColorMap } from './xcss/style-maps.partial';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -17,16 +17,8 @@ export { default as Text } from './components/text';
|
|
|
17
17
|
export type { TextProps } from './components/text';
|
|
18
18
|
export { default as Pressable } from './components/pressable';
|
|
19
19
|
export type { PressableProps } from './components/pressable';
|
|
20
|
-
export {
|
|
21
|
-
|
|
22
|
-
* @deprecated Use `Anchor` instead. This will be removed in a future major release.
|
|
23
|
-
*/
|
|
24
|
-
default as UNSAFE_ANCHOR, default as Anchor, } from './components/anchor';
|
|
25
|
-
export type {
|
|
26
|
-
/**
|
|
27
|
-
* @deprecated Use `AnchorProps` instead. This will be removed in a future major release.
|
|
28
|
-
*/
|
|
29
|
-
AnchorProps as UNSAFE_AnchorProps, AnchorProps, } from './components/anchor';
|
|
20
|
+
export { default as Anchor } from './components/anchor';
|
|
21
|
+
export type { AnchorProps } from './components/anchor';
|
|
30
22
|
export { media, UNSAFE_media, UNSAFE_BREAKPOINTS_CONFIG } from './responsive';
|
|
31
23
|
export type { Breakpoint, MediaQuery } from './responsive';
|
|
32
24
|
export { useSurface as UNSAFE_useSurface } from './utils/surface-provider';
|
|
@@ -17,16 +17,8 @@ export { default as Text } from './components/text';
|
|
|
17
17
|
export type { TextProps } from './components/text';
|
|
18
18
|
export { default as Pressable } from './components/pressable';
|
|
19
19
|
export type { PressableProps } from './components/pressable';
|
|
20
|
-
export {
|
|
21
|
-
|
|
22
|
-
* @deprecated Use `Anchor` instead. This will be removed in a future major release.
|
|
23
|
-
*/
|
|
24
|
-
default as UNSAFE_ANCHOR, default as Anchor, } from './components/anchor';
|
|
25
|
-
export type {
|
|
26
|
-
/**
|
|
27
|
-
* @deprecated Use `AnchorProps` instead. This will be removed in a future major release.
|
|
28
|
-
*/
|
|
29
|
-
AnchorProps as UNSAFE_AnchorProps, AnchorProps, } from './components/anchor';
|
|
20
|
+
export { default as Anchor } from './components/anchor';
|
|
21
|
+
export type { AnchorProps } from './components/anchor';
|
|
30
22
|
export { media, UNSAFE_media, UNSAFE_BREAKPOINTS_CONFIG } from './responsive';
|
|
31
23
|
export type { Breakpoint, MediaQuery } from './responsive';
|
|
32
24
|
export { useSurface as UNSAFE_useSurface } from './utils/surface-provider';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/primitives",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.7.1",
|
|
4
4
|
"description": "Primitives are token-backed low-level building blocks.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
"@atlaskit/icon-object": "^7.1.0",
|
|
160
160
|
"@atlaskit/image": "^3.0.0",
|
|
161
161
|
"@atlaskit/link": "^3.1.0",
|
|
162
|
-
"@atlaskit/logo": "^
|
|
162
|
+
"@atlaskit/logo": "^18.0.0",
|
|
163
163
|
"@atlaskit/lozenge": "^12.2.0",
|
|
164
164
|
"@atlaskit/motion": "^5.1.0",
|
|
165
165
|
"@atlaskit/range": "^9.0.0",
|
|
@@ -173,6 +173,7 @@
|
|
|
173
173
|
"@atlassian/ssr-tests": "^0.2.0",
|
|
174
174
|
"@testing-library/react": "^13.4.0",
|
|
175
175
|
"@testing-library/react-hooks": "^8.0.1",
|
|
176
|
+
"@testing-library/user-event": "^14.4.3",
|
|
176
177
|
"csstype": "^3.1.0",
|
|
177
178
|
"jscodeshift": "^17.0.0",
|
|
178
179
|
"react-dom": "^18.2.0",
|