@atlaskit/focus-ring 1.0.3 → 1.0.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 +18 -0
- package/dist/cjs/focus-ring.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/focus-ring.js +2 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/use-focus-ring.d.ts +1 -1
- package/package.json +9 -6
- package/report.api.md +91 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/focus-ring
|
|
2
2
|
|
|
3
|
+
## 1.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
|
|
8
|
+
|
|
9
|
+
## 1.0.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 1.0.4
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
|
|
20
|
+
|
|
3
21
|
## 1.0.3
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/cjs/focus-ring.js
CHANGED
|
@@ -14,11 +14,11 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
14
14
|
/** @jsx jsx */
|
|
15
15
|
var BORDER_WIDTH = 2;
|
|
16
16
|
var baseFocusOutsideStyles = (0, _core.css)({
|
|
17
|
-
outline: "".concat(BORDER_WIDTH, "px solid "
|
|
17
|
+
outline: "".concat(BORDER_WIDTH, "px solid ", "var(--ds-border-focused, ".concat(_colors.B100, ")")),
|
|
18
18
|
outlineOffset: BORDER_WIDTH
|
|
19
19
|
});
|
|
20
20
|
var baseInsetStyles = (0, _core.css)({
|
|
21
|
-
boxShadow: "inset 0px 0px 0px ".concat(BORDER_WIDTH, "px "
|
|
21
|
+
boxShadow: "inset 0px 0px 0px ".concat(BORDER_WIDTH, "px ", "var(--ds-border-focused, ".concat(_colors.B100, ")")),
|
|
22
22
|
outline: 'none'
|
|
23
23
|
});
|
|
24
24
|
var focusRingStyles = (0, _core.css)({
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/version.json
CHANGED
package/dist/esm/focus-ring.js
CHANGED
|
@@ -4,11 +4,11 @@ import { ClassNames, css, jsx } from '@emotion/core';
|
|
|
4
4
|
import { B100 } from '@atlaskit/theme/colors';
|
|
5
5
|
var BORDER_WIDTH = 2;
|
|
6
6
|
var baseFocusOutsideStyles = css({
|
|
7
|
-
outline: "".concat(BORDER_WIDTH, "px solid "
|
|
7
|
+
outline: "".concat(BORDER_WIDTH, "px solid ", "var(--ds-border-focused, ".concat(B100, ")")),
|
|
8
8
|
outlineOffset: BORDER_WIDTH
|
|
9
9
|
});
|
|
10
10
|
var baseInsetStyles = css({
|
|
11
|
-
boxShadow: "inset 0px 0px 0px ".concat(BORDER_WIDTH, "px "
|
|
11
|
+
boxShadow: "inset 0px 0px 0px ".concat(BORDER_WIDTH, "px ", "var(--ds-border-focused, ".concat(B100, ")")),
|
|
12
12
|
outline: 'none'
|
|
13
13
|
});
|
|
14
14
|
var focusRingStyles = css({
|
package/dist/esm/version.json
CHANGED
|
@@ -28,7 +28,7 @@ import type { FocusEventHandlers, FocusState } from './types';
|
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
30
|
declare const useFocusRing: (initialState?: FocusState) => {
|
|
31
|
-
readonly focusState:
|
|
31
|
+
readonly focusState: "on" | "off";
|
|
32
32
|
readonly focusProps: FocusEventHandlers;
|
|
33
33
|
};
|
|
34
34
|
export default useFocusRing;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/focus-ring",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.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",
|
|
@@ -11,10 +11,11 @@
|
|
|
11
11
|
"team": "Design System Team",
|
|
12
12
|
"releaseModel": "scheduled",
|
|
13
13
|
"website": {
|
|
14
|
-
"name": "Focus ring"
|
|
14
|
+
"name": "Focus ring",
|
|
15
|
+
"category": "Components"
|
|
15
16
|
}
|
|
16
17
|
},
|
|
17
|
-
"repository": "https://bitbucket.org/atlassian/atlassian-frontend",
|
|
18
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
18
19
|
"main": "dist/cjs/index.js",
|
|
19
20
|
"module": "dist/esm/index.js",
|
|
20
21
|
"module:es2019": "dist/es2019/index.js",
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
},
|
|
27
28
|
"dependencies": {
|
|
28
29
|
"@atlaskit/theme": "^12.1.0",
|
|
29
|
-
"@atlaskit/tokens": "^0.
|
|
30
|
+
"@atlaskit/tokens": "^0.10.0",
|
|
30
31
|
"@babel/runtime": "^7.0.0",
|
|
31
32
|
"@emotion/core": "^10.0.9"
|
|
32
33
|
},
|
|
@@ -34,7 +35,7 @@
|
|
|
34
35
|
"react": "^16.8.0"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
|
-
"@atlaskit/button": "^16.
|
|
38
|
+
"@atlaskit/button": "^16.3.0",
|
|
38
39
|
"@atlaskit/docs": "*",
|
|
39
40
|
"@atlaskit/progress-indicator": "^9.2.0",
|
|
40
41
|
"@atlaskit/ssr": "*",
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
46
47
|
"@testing-library/react": "^8.0.1",
|
|
47
48
|
"react-dom": "^16.8.0",
|
|
48
|
-
"typescript": "3.
|
|
49
|
+
"typescript": "4.3.5",
|
|
49
50
|
"wait-for-expect": "^1.2.0"
|
|
50
51
|
},
|
|
51
52
|
"techstack": {
|
|
@@ -54,6 +55,7 @@
|
|
|
54
55
|
"circular-dependencies": "file-and-folder-level"
|
|
55
56
|
},
|
|
56
57
|
"@repo/internal": {
|
|
58
|
+
"dom-events": "use-bind-event-listener",
|
|
57
59
|
"design-system": "v1",
|
|
58
60
|
"styling": [
|
|
59
61
|
"static",
|
|
@@ -65,5 +67,6 @@
|
|
|
65
67
|
"deprecation": "no-deprecated-imports"
|
|
66
68
|
}
|
|
67
69
|
},
|
|
70
|
+
"homepage": "https://atlaskit.atlassian.com/packages/design-system/focus-ring",
|
|
68
71
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
|
|
69
72
|
}
|
package/report.api.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/focus-ring"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
````ts
|
|
6
|
+
import { FC } from 'react';
|
|
7
|
+
import type { FocusEventHandler } from 'react';
|
|
8
|
+
import type { ReactElement } from 'react';
|
|
9
|
+
|
|
10
|
+
export declare interface FocusEventHandlers {
|
|
11
|
+
onFocus: FocusEventHandler;
|
|
12
|
+
onBlur: FocusEventHandler;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* __Focus ring__
|
|
17
|
+
*
|
|
18
|
+
* A focus ring is used indicate the currently focused item.
|
|
19
|
+
*
|
|
20
|
+
* - [Code](https://atlaskit.atlassian.com/packages/design-system/focus-ring)
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```jsx
|
|
24
|
+
* import FocusRing from '@atlaskit/focus-ring';
|
|
25
|
+
*
|
|
26
|
+
* const InteractiveComponent = () => (
|
|
27
|
+
* <FocusRing>
|
|
28
|
+
* <button type="button">Hello</button>
|
|
29
|
+
* </FocusRing>
|
|
30
|
+
* )
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
declare const FocusRing: FC<FocusRingProps>;
|
|
34
|
+
export default FocusRing;
|
|
35
|
+
|
|
36
|
+
export declare interface FocusRingProps {
|
|
37
|
+
/**
|
|
38
|
+
* Makes the `FocusRing` a controlled component (opting out of native focus behavior). The focus ring
|
|
39
|
+
* will apply the visual focus indicator when the `focus` prop is set to `on`. This prop should be used
|
|
40
|
+
* in conjunction with `useFocusRing`.
|
|
41
|
+
*/
|
|
42
|
+
focus?: FocusState;
|
|
43
|
+
/**
|
|
44
|
+
* Controls whether the focus ring should be applied around or within the composed element.
|
|
45
|
+
*/
|
|
46
|
+
isInset?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* The focusable element to be rendered within the `FocusRing`.
|
|
49
|
+
*/
|
|
50
|
+
children: ReactElement;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export declare type FocusState = 'on' | 'off';
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* __Use focus ring__
|
|
57
|
+
*
|
|
58
|
+
* The `useFocusRing` hook is designed to manage focus for the `FocusRing` in cases where the `FocusRing`'s visual application
|
|
59
|
+
* and the element that takes focus, differ. See the `focus` prop of `FocusRing` for more information.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```jsx
|
|
63
|
+
* import VisuallyHidden from '@atlaskit/visuall-hidden';
|
|
64
|
+
* import FocusRing, { useFocusRing } from '@atlaskit/focus-ring';
|
|
65
|
+
*
|
|
66
|
+
* const InteractiveComponent = () => {
|
|
67
|
+
* const { focusState, focusProps } = useFocusRing();
|
|
68
|
+
*
|
|
69
|
+
* return (
|
|
70
|
+
* <div>
|
|
71
|
+
* <VisuallHidden>
|
|
72
|
+
* <input {...focusProps} />
|
|
73
|
+
* </VisuallyHidden>
|
|
74
|
+
* <FocusRing focus={focusState}>
|
|
75
|
+
* <div role="button">Hello</div>
|
|
76
|
+
* </FocusRing>
|
|
77
|
+
* </div>
|
|
78
|
+
* );
|
|
79
|
+
*
|
|
80
|
+
* }
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
export declare const useFocusRing: (
|
|
84
|
+
initialState?: FocusState,
|
|
85
|
+
) => {
|
|
86
|
+
readonly focusState: 'on' | 'off';
|
|
87
|
+
readonly focusProps: FocusEventHandlers;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export {};
|
|
91
|
+
````
|