@atlaskit/focus-ring 1.2.4 → 1.2.6
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 +12 -0
- package/README.md +3 -1
- package/dist/cjs/focus-ring.js +7 -3
- package/dist/cjs/use-focus-ring.js +4 -22
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/focus-ring.js +8 -4
- package/dist/es2019/use-focus-ring.js +4 -22
- package/dist/es2019/version.json +1 -1
- package/dist/esm/focus-ring.js +8 -4
- package/dist/esm/use-focus-ring.js +4 -22
- package/dist/esm/version.json +1 -1
- package/dist/types/focus-ring.d.ts +4 -1
- package/dist/types/use-focus-ring.d.ts +4 -22
- package/package.json +7 -5
- package/report.api.md +13 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/focus-ring
|
|
2
2
|
|
|
3
|
+
## 1.2.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`c23cf0b085d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c23cf0b085d) - Adds display name to component for React devtools debugging.
|
|
8
|
+
|
|
9
|
+
## 1.2.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`7f5f23dcb68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7f5f23dcb68) - Introduce shape tokens to some packages.
|
|
14
|
+
|
|
3
15
|
## 1.2.4
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Focus ring
|
|
2
2
|
|
|
3
|
-
A focus ring is used indicate the currently focused item.
|
|
3
|
+
A focus ring is used to visually indicate the currently focused item.
|
|
4
|
+
|
|
5
|
+
This component has accessibility issues that we are working to resolve. Do not use without support from the Atlassian Design System accessibility team.
|
|
4
6
|
|
|
5
7
|
## Usage
|
|
6
8
|
|
package/dist/cjs/focus-ring.js
CHANGED
|
@@ -46,7 +46,10 @@ var insetFocusRingStyles = (0, _react2.css)({
|
|
|
46
46
|
/**
|
|
47
47
|
* __Focus ring__
|
|
48
48
|
*
|
|
49
|
-
* A focus ring
|
|
49
|
+
* A focus ring visually indicates the currently focused item.
|
|
50
|
+
*
|
|
51
|
+
* There are known accessibility issues with this component.
|
|
52
|
+
* Do not use without assistance from the Design System accessibility team.
|
|
50
53
|
*
|
|
51
54
|
* - [Code](https://atlaskit.atlassian.com/packages/design-system/focus-ring)
|
|
52
55
|
*
|
|
@@ -61,7 +64,7 @@ var insetFocusRingStyles = (0, _react2.css)({
|
|
|
61
64
|
* )
|
|
62
65
|
* ```
|
|
63
66
|
*/
|
|
64
|
-
var FocusRing = function
|
|
67
|
+
var FocusRing = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
65
68
|
var children = _ref.children,
|
|
66
69
|
isInset = _ref.isInset,
|
|
67
70
|
focus = _ref.focus;
|
|
@@ -80,6 +83,7 @@ var FocusRing = function FocusRing(_ref) {
|
|
|
80
83
|
className: cx([css(focusCls), children.props.className])
|
|
81
84
|
}) : children);
|
|
82
85
|
});
|
|
83
|
-
};
|
|
86
|
+
});
|
|
87
|
+
FocusRing.displayName = 'FocusRing';
|
|
84
88
|
var _default = FocusRing;
|
|
85
89
|
exports.default = _default;
|
|
@@ -10,30 +10,12 @@ var _react = require("react");
|
|
|
10
10
|
/**
|
|
11
11
|
* __Use focus ring__
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* This component has accessibility issues that we are working to resolve.
|
|
14
|
+
* Do not use without support from the Atlassian Design System accessibility team.
|
|
15
15
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* import VisuallyHidden from '@atlaskit/visuall-hidden';
|
|
19
|
-
* import FocusRing, { useFocusRing } from '@atlaskit/focus-ring';
|
|
16
|
+
* The useFocusRing hook manages focus in the rare cases where the focus ring’s visual application and the element that takes focus differ.
|
|
17
|
+
* This is not typically a good practice for accessibility, so don’t do this unless you’ve consulted with the accessibility team.
|
|
20
18
|
*
|
|
21
|
-
* const InteractiveComponent = () => {
|
|
22
|
-
* const { focusState, focusProps } = useFocusRing();
|
|
23
|
-
*
|
|
24
|
-
* return (
|
|
25
|
-
* <div>
|
|
26
|
-
* <VisuallHidden>
|
|
27
|
-
* <input {...focusProps} />
|
|
28
|
-
* </VisuallyHidden>
|
|
29
|
-
* <FocusRing focus={focusState}>
|
|
30
|
-
* <div role="button">Hello</div>
|
|
31
|
-
* </FocusRing>
|
|
32
|
-
* </div>
|
|
33
|
-
* );
|
|
34
|
-
*
|
|
35
|
-
* }
|
|
36
|
-
* ```
|
|
37
19
|
*/
|
|
38
20
|
var useFocusRing = function useFocusRing() {
|
|
39
21
|
var initialState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'off';
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { Children, cloneElement } from 'react';
|
|
2
|
+
import { Children, cloneElement, memo } from 'react';
|
|
3
3
|
import { ClassNames, css, jsx } from '@emotion/react';
|
|
4
4
|
const BORDER_WIDTH = 2;
|
|
5
5
|
const baseFocusOutsideStyles = css({
|
|
@@ -39,7 +39,10 @@ const insetFocusRingStyles = css({
|
|
|
39
39
|
/**
|
|
40
40
|
* __Focus ring__
|
|
41
41
|
*
|
|
42
|
-
* A focus ring
|
|
42
|
+
* A focus ring visually indicates the currently focused item.
|
|
43
|
+
*
|
|
44
|
+
* There are known accessibility issues with this component.
|
|
45
|
+
* Do not use without assistance from the Design System accessibility team.
|
|
43
46
|
*
|
|
44
47
|
* - [Code](https://atlaskit.atlassian.com/packages/design-system/focus-ring)
|
|
45
48
|
*
|
|
@@ -54,7 +57,7 @@ const insetFocusRingStyles = css({
|
|
|
54
57
|
* )
|
|
55
58
|
* ```
|
|
56
59
|
*/
|
|
57
|
-
const FocusRing = ({
|
|
60
|
+
const FocusRing = /*#__PURE__*/memo(({
|
|
58
61
|
children,
|
|
59
62
|
isInset,
|
|
60
63
|
focus
|
|
@@ -73,5 +76,6 @@ const FocusRing = ({
|
|
|
73
76
|
cloneElement(children, {
|
|
74
77
|
className: cx([css(focusCls), children.props.className])
|
|
75
78
|
}) : children));
|
|
76
|
-
};
|
|
79
|
+
});
|
|
80
|
+
FocusRing.displayName = 'FocusRing';
|
|
77
81
|
export default FocusRing;
|
|
@@ -2,30 +2,12 @@ import { useRef, useState } from 'react';
|
|
|
2
2
|
/**
|
|
3
3
|
* __Use focus ring__
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* This component has accessibility issues that we are working to resolve.
|
|
6
|
+
* Do not use without support from the Atlassian Design System accessibility team.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* import VisuallyHidden from '@atlaskit/visuall-hidden';
|
|
11
|
-
* import FocusRing, { useFocusRing } from '@atlaskit/focus-ring';
|
|
8
|
+
* The useFocusRing hook manages focus in the rare cases where the focus ring’s visual application and the element that takes focus differ.
|
|
9
|
+
* This is not typically a good practice for accessibility, so don’t do this unless you’ve consulted with the accessibility team.
|
|
12
10
|
*
|
|
13
|
-
* const InteractiveComponent = () => {
|
|
14
|
-
* const { focusState, focusProps } = useFocusRing();
|
|
15
|
-
*
|
|
16
|
-
* return (
|
|
17
|
-
* <div>
|
|
18
|
-
* <VisuallHidden>
|
|
19
|
-
* <input {...focusProps} />
|
|
20
|
-
* </VisuallyHidden>
|
|
21
|
-
* <FocusRing focus={focusState}>
|
|
22
|
-
* <div role="button">Hello</div>
|
|
23
|
-
* </FocusRing>
|
|
24
|
-
* </div>
|
|
25
|
-
* );
|
|
26
|
-
*
|
|
27
|
-
* }
|
|
28
|
-
* ```
|
|
29
11
|
*/
|
|
30
12
|
const useFocusRing = (initialState = 'off') => {
|
|
31
13
|
const [focusState, setFocusState] = useState(initialState);
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/focus-ring.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { Children, cloneElement } from 'react';
|
|
2
|
+
import { Children, cloneElement, memo } from 'react';
|
|
3
3
|
import { ClassNames, css, jsx } from '@emotion/react';
|
|
4
4
|
var BORDER_WIDTH = 2;
|
|
5
5
|
var baseFocusOutsideStyles = css({
|
|
@@ -39,7 +39,10 @@ var insetFocusRingStyles = css({
|
|
|
39
39
|
/**
|
|
40
40
|
* __Focus ring__
|
|
41
41
|
*
|
|
42
|
-
* A focus ring
|
|
42
|
+
* A focus ring visually indicates the currently focused item.
|
|
43
|
+
*
|
|
44
|
+
* There are known accessibility issues with this component.
|
|
45
|
+
* Do not use without assistance from the Design System accessibility team.
|
|
43
46
|
*
|
|
44
47
|
* - [Code](https://atlaskit.atlassian.com/packages/design-system/focus-ring)
|
|
45
48
|
*
|
|
@@ -54,7 +57,7 @@ var insetFocusRingStyles = css({
|
|
|
54
57
|
* )
|
|
55
58
|
* ```
|
|
56
59
|
*/
|
|
57
|
-
var FocusRing = function
|
|
60
|
+
var FocusRing = /*#__PURE__*/memo(function (_ref) {
|
|
58
61
|
var children = _ref.children,
|
|
59
62
|
isInset = _ref.isInset,
|
|
60
63
|
focus = _ref.focus;
|
|
@@ -73,5 +76,6 @@ var FocusRing = function FocusRing(_ref) {
|
|
|
73
76
|
className: cx([css(focusCls), children.props.className])
|
|
74
77
|
}) : children);
|
|
75
78
|
});
|
|
76
|
-
};
|
|
79
|
+
});
|
|
80
|
+
FocusRing.displayName = 'FocusRing';
|
|
77
81
|
export default FocusRing;
|
|
@@ -3,30 +3,12 @@ import { useRef, useState } from 'react';
|
|
|
3
3
|
/**
|
|
4
4
|
* __Use focus ring__
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* This component has accessibility issues that we are working to resolve.
|
|
7
|
+
* Do not use without support from the Atlassian Design System accessibility team.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* import VisuallyHidden from '@atlaskit/visuall-hidden';
|
|
12
|
-
* import FocusRing, { useFocusRing } from '@atlaskit/focus-ring';
|
|
9
|
+
* The useFocusRing hook manages focus in the rare cases where the focus ring’s visual application and the element that takes focus differ.
|
|
10
|
+
* This is not typically a good practice for accessibility, so don’t do this unless you’ve consulted with the accessibility team.
|
|
13
11
|
*
|
|
14
|
-
* const InteractiveComponent = () => {
|
|
15
|
-
* const { focusState, focusProps } = useFocusRing();
|
|
16
|
-
*
|
|
17
|
-
* return (
|
|
18
|
-
* <div>
|
|
19
|
-
* <VisuallHidden>
|
|
20
|
-
* <input {...focusProps} />
|
|
21
|
-
* </VisuallyHidden>
|
|
22
|
-
* <FocusRing focus={focusState}>
|
|
23
|
-
* <div role="button">Hello</div>
|
|
24
|
-
* </FocusRing>
|
|
25
|
-
* </div>
|
|
26
|
-
* );
|
|
27
|
-
*
|
|
28
|
-
* }
|
|
29
|
-
* ```
|
|
30
12
|
*/
|
|
31
13
|
var useFocusRing = function useFocusRing() {
|
|
32
14
|
var initialState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'off';
|
package/dist/esm/version.json
CHANGED
|
@@ -4,7 +4,10 @@ import type { FocusRingProps } from './types';
|
|
|
4
4
|
/**
|
|
5
5
|
* __Focus ring__
|
|
6
6
|
*
|
|
7
|
-
* A focus ring
|
|
7
|
+
* A focus ring visually indicates the currently focused item.
|
|
8
|
+
*
|
|
9
|
+
* There are known accessibility issues with this component.
|
|
10
|
+
* Do not use without assistance from the Design System accessibility team.
|
|
8
11
|
*
|
|
9
12
|
* - [Code](https://atlaskit.atlassian.com/packages/design-system/focus-ring)
|
|
10
13
|
*
|
|
@@ -2,30 +2,12 @@ import type { FocusEventHandlers, FocusState } from './types';
|
|
|
2
2
|
/**
|
|
3
3
|
* __Use focus ring__
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* This component has accessibility issues that we are working to resolve.
|
|
6
|
+
* Do not use without support from the Atlassian Design System accessibility team.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* import VisuallyHidden from '@atlaskit/visuall-hidden';
|
|
11
|
-
* import FocusRing, { useFocusRing } from '@atlaskit/focus-ring';
|
|
8
|
+
* The useFocusRing hook manages focus in the rare cases where the focus ring’s visual application and the element that takes focus differ.
|
|
9
|
+
* This is not typically a good practice for accessibility, so don’t do this unless you’ve consulted with the accessibility team.
|
|
12
10
|
*
|
|
13
|
-
* const InteractiveComponent = () => {
|
|
14
|
-
* const { focusState, focusProps } = useFocusRing();
|
|
15
|
-
*
|
|
16
|
-
* return (
|
|
17
|
-
* <div>
|
|
18
|
-
* <VisuallHidden>
|
|
19
|
-
* <input {...focusProps} />
|
|
20
|
-
* </VisuallyHidden>
|
|
21
|
-
* <FocusRing focus={focusState}>
|
|
22
|
-
* <div role="button">Hello</div>
|
|
23
|
-
* </FocusRing>
|
|
24
|
-
* </div>
|
|
25
|
-
* );
|
|
26
|
-
*
|
|
27
|
-
* }
|
|
28
|
-
* ```
|
|
29
11
|
*/
|
|
30
12
|
declare const useFocusRing: (initialState?: FocusState) => {
|
|
31
13
|
readonly focusState: "on" | "off";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/focus-ring",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"description": "A focus ring is used to indicate the currently focused item.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
"registry": "https://registry.npmjs.org/"
|
|
9
9
|
},
|
|
10
10
|
"atlassian": {
|
|
11
|
-
"disableProductCI": true,
|
|
12
11
|
"team": "Design System Team",
|
|
13
12
|
"releaseModel": "scheduled",
|
|
14
13
|
"website": {
|
|
@@ -27,7 +26,7 @@
|
|
|
27
26
|
".": "./src/index.tsx"
|
|
28
27
|
},
|
|
29
28
|
"dependencies": {
|
|
30
|
-
"@atlaskit/tokens": "^1.
|
|
29
|
+
"@atlaskit/tokens": "^1.2.0",
|
|
31
30
|
"@babel/runtime": "^7.0.0",
|
|
32
31
|
"@emotion/react": "^11.7.1"
|
|
33
32
|
},
|
|
@@ -35,9 +34,10 @@
|
|
|
35
34
|
"react": "^16.8.0"
|
|
36
35
|
},
|
|
37
36
|
"devDependencies": {
|
|
38
|
-
"@atlaskit/button": "^16.
|
|
37
|
+
"@atlaskit/button": "^16.6.0",
|
|
39
38
|
"@atlaskit/docs": "*",
|
|
40
39
|
"@atlaskit/progress-indicator": "^9.4.0",
|
|
40
|
+
"@atlaskit/section-message": "^6.3.10",
|
|
41
41
|
"@atlaskit/ssr": "*",
|
|
42
42
|
"@atlaskit/textfield": "^5.3.0",
|
|
43
43
|
"@atlaskit/visual-regression": "*",
|
|
@@ -63,7 +63,9 @@
|
|
|
63
63
|
],
|
|
64
64
|
"ui-components": "lite-mode",
|
|
65
65
|
"analytics": "analytics-next",
|
|
66
|
-
"
|
|
66
|
+
"design-tokens": [
|
|
67
|
+
"color"
|
|
68
|
+
],
|
|
67
69
|
"deprecation": "no-deprecated-imports"
|
|
68
70
|
}
|
|
69
71
|
},
|
package/report.api.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
### Table of contents
|
|
9
9
|
|
|
10
10
|
- [Main Entry Types](#main-entry-types)
|
|
11
|
+
- [Peer Dependencies](#peer-dependencies)
|
|
11
12
|
|
|
12
13
|
### Main Entry Types
|
|
13
14
|
|
|
@@ -50,3 +51,15 @@ export const useFocusRing: (initialState?: FocusState) => {
|
|
|
50
51
|
```
|
|
51
52
|
|
|
52
53
|
<!--SECTION END: Main Entry Types-->
|
|
54
|
+
|
|
55
|
+
### Peer Dependencies
|
|
56
|
+
|
|
57
|
+
<!--SECTION START: Peer Dependencies-->
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"react": "^16.8.0"
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
<!--SECTION END: Peer Dependencies-->
|