@atlaskit/focus-ring 1.2.4 → 1.2.5
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 +6 -0
- package/README.md +3 -1
- package/dist/cjs/focus-ring.js +4 -1
- package/dist/cjs/use-focus-ring.js +4 -22
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/focus-ring.js +4 -1
- package/dist/es2019/use-focus-ring.js +4 -22
- package/dist/es2019/version.json +1 -1
- package/dist/esm/focus-ring.js +4 -1
- 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 +6 -3
package/CHANGELOG.md
CHANGED
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 assisitance from the Design System accessibility team.
|
|
50
53
|
*
|
|
51
54
|
* - [Code](https://atlaskit.atlassian.com/packages/design-system/focus-ring)
|
|
52
55
|
*
|
|
@@ -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
|
@@ -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 assisitance from the Design System accessibility team.
|
|
43
46
|
*
|
|
44
47
|
* - [Code](https://atlaskit.atlassian.com/packages/design-system/focus-ring)
|
|
45
48
|
*
|
|
@@ -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
|
@@ -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 assisitance from the Design System accessibility team.
|
|
43
46
|
*
|
|
44
47
|
* - [Code](https://atlaskit.atlassian.com/packages/design-system/focus-ring)
|
|
45
48
|
*
|
|
@@ -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 assisitance 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.5",
|
|
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",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
".": "./src/index.tsx"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@atlaskit/tokens": "^1.
|
|
30
|
+
"@atlaskit/tokens": "^1.2.0",
|
|
31
31
|
"@babel/runtime": "^7.0.0",
|
|
32
32
|
"@emotion/react": "^11.7.1"
|
|
33
33
|
},
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"@atlaskit/button": "^16.5.0",
|
|
39
39
|
"@atlaskit/docs": "*",
|
|
40
40
|
"@atlaskit/progress-indicator": "^9.4.0",
|
|
41
|
+
"@atlaskit/section-message": "^6.3.10",
|
|
41
42
|
"@atlaskit/ssr": "*",
|
|
42
43
|
"@atlaskit/textfield": "^5.3.0",
|
|
43
44
|
"@atlaskit/visual-regression": "*",
|
|
@@ -63,7 +64,9 @@
|
|
|
63
64
|
],
|
|
64
65
|
"ui-components": "lite-mode",
|
|
65
66
|
"analytics": "analytics-next",
|
|
66
|
-
"
|
|
67
|
+
"design-tokens": [
|
|
68
|
+
"color"
|
|
69
|
+
],
|
|
67
70
|
"deprecation": "no-deprecated-imports"
|
|
68
71
|
}
|
|
69
72
|
},
|