@atlaskit/visually-hidden 0.1.2 → 1.0.2
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 +21 -0
- package/README.md +17 -2
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/visually-hidden.js +7 -2
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/visually-hidden.js +7 -2
- package/dist/esm/version.json +1 -1
- package/dist/esm/visually-hidden.js +7 -2
- package/dist/types/types.d.ts +9 -0
- package/package.json +14 -9
- package/report.api.md +53 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/visually-hidden
|
|
2
2
|
|
|
3
|
+
## 1.0.2
|
|
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.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
|
|
14
|
+
|
|
15
|
+
## 1.0.0
|
|
16
|
+
|
|
17
|
+
### Major Changes
|
|
18
|
+
|
|
19
|
+
- [`08ce7935675`](https://bitbucket.org/atlassian/atlassian-frontend/commits/08ce7935675) - Update `@atlaskit/visually-hidden` to v1. No breaking changes from previous version.
|
|
20
|
+
|
|
21
|
+
`@atlaskit/visually-hidden` now exposes an additional `id` prop. This prop is exposed to allow consumers to pair the component with the
|
|
22
|
+
`aria-describedby` HTML attribute.
|
|
23
|
+
|
|
3
24
|
## 0.1.2
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Visually hidden
|
|
2
2
|
|
|
3
3
|
A composable element that hides elements from the screen while keeping them accessible.
|
|
4
4
|
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
yarn add @atlaskit/visually-hidden
|
|
9
|
+
```
|
|
10
|
+
|
|
5
11
|
## Usage
|
|
6
12
|
|
|
7
|
-
|
|
13
|
+
```jsx
|
|
14
|
+
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
15
|
+
|
|
16
|
+
export default () => (
|
|
17
|
+
<div style={{ border: '1px solid black' }}>
|
|
18
|
+
There is text hidden between the brackets [
|
|
19
|
+
<VisuallyHidden>Can't see me!</VisuallyHidden>]
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
```
|
package/dist/cjs/version.json
CHANGED
|
@@ -8,6 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _core = require("@emotion/core");
|
|
9
9
|
|
|
10
10
|
/** @jsx jsx */
|
|
11
|
+
// eslint-disable-next-line @atlaskit/design-system/use-visually-hidden
|
|
11
12
|
var visuallyHiddenStyles = (0, _core.css)({
|
|
12
13
|
width: '1px',
|
|
13
14
|
height: '1px',
|
|
@@ -39,10 +40,14 @@ var visuallyHiddenStyles = (0, _core.css)({
|
|
|
39
40
|
|
|
40
41
|
var VisuallyHidden = function VisuallyHidden(_ref) {
|
|
41
42
|
var children = _ref.children,
|
|
42
|
-
testId = _ref.testId
|
|
43
|
+
testId = _ref.testId,
|
|
44
|
+
role = _ref.role,
|
|
45
|
+
id = _ref.id;
|
|
43
46
|
return (0, _core.jsx)("span", {
|
|
47
|
+
id: id,
|
|
44
48
|
"data-testid": testId,
|
|
45
|
-
css: visuallyHiddenStyles
|
|
49
|
+
css: visuallyHiddenStyles,
|
|
50
|
+
role: role
|
|
46
51
|
}, children);
|
|
47
52
|
};
|
|
48
53
|
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { css, jsx } from '@emotion/core';
|
|
3
|
+
// eslint-disable-next-line @atlaskit/design-system/use-visually-hidden
|
|
3
4
|
const visuallyHiddenStyles = css({
|
|
4
5
|
width: '1px',
|
|
5
6
|
height: '1px',
|
|
@@ -31,11 +32,15 @@ const visuallyHiddenStyles = css({
|
|
|
31
32
|
|
|
32
33
|
const VisuallyHidden = ({
|
|
33
34
|
children,
|
|
34
|
-
testId
|
|
35
|
+
testId,
|
|
36
|
+
role,
|
|
37
|
+
id
|
|
35
38
|
}) => {
|
|
36
39
|
return jsx("span", {
|
|
40
|
+
id: id,
|
|
37
41
|
"data-testid": testId,
|
|
38
|
-
css: visuallyHiddenStyles
|
|
42
|
+
css: visuallyHiddenStyles,
|
|
43
|
+
role: role
|
|
39
44
|
}, children);
|
|
40
45
|
};
|
|
41
46
|
|
package/dist/esm/version.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { css, jsx } from '@emotion/core';
|
|
3
|
+
// eslint-disable-next-line @atlaskit/design-system/use-visually-hidden
|
|
3
4
|
var visuallyHiddenStyles = css({
|
|
4
5
|
width: '1px',
|
|
5
6
|
height: '1px',
|
|
@@ -31,10 +32,14 @@ var visuallyHiddenStyles = css({
|
|
|
31
32
|
|
|
32
33
|
var VisuallyHidden = function VisuallyHidden(_ref) {
|
|
33
34
|
var children = _ref.children,
|
|
34
|
-
testId = _ref.testId
|
|
35
|
+
testId = _ref.testId,
|
|
36
|
+
role = _ref.role,
|
|
37
|
+
id = _ref.id;
|
|
35
38
|
return jsx("span", {
|
|
39
|
+
id: id,
|
|
36
40
|
"data-testid": testId,
|
|
37
|
-
css: visuallyHiddenStyles
|
|
41
|
+
css: visuallyHiddenStyles,
|
|
42
|
+
role: role
|
|
38
43
|
}, children);
|
|
39
44
|
};
|
|
40
45
|
|
package/dist/types/types.d.ts
CHANGED
|
@@ -10,4 +10,13 @@ export declare type VisuallyHiddenProps = {
|
|
|
10
10
|
* The element or elements that should be hidden.
|
|
11
11
|
*/
|
|
12
12
|
children: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Role attribute is passed on to the span to aid screen readers.
|
|
15
|
+
*/
|
|
16
|
+
role?: string;
|
|
17
|
+
/**
|
|
18
|
+
* An id may be appropriate for this component if used in conjunction with `aria-describedby`
|
|
19
|
+
* on a paired element.
|
|
20
|
+
*/
|
|
21
|
+
id?: string;
|
|
13
22
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/visually-hidden",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A composable element that hides elements from the screen while keeping them accessible.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -9,13 +9,14 @@
|
|
|
9
9
|
},
|
|
10
10
|
"atlassian": {
|
|
11
11
|
"team": "Design System Team",
|
|
12
|
-
"inPublicMirror":
|
|
13
|
-
"releaseModel": "
|
|
12
|
+
"inPublicMirror": true,
|
|
13
|
+
"releaseModel": "scheduled",
|
|
14
14
|
"website": {
|
|
15
|
-
"name": "
|
|
15
|
+
"name": "Visually hidden",
|
|
16
|
+
"category": "Components"
|
|
16
17
|
}
|
|
17
18
|
},
|
|
18
|
-
"repository": "https://bitbucket.org/atlassian/atlassian-frontend",
|
|
19
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
19
20
|
"main": "dist/cjs/index.js",
|
|
20
21
|
"module": "dist/esm/index.js",
|
|
21
22
|
"module:es2019": "dist/es2019/index.js",
|
|
@@ -33,15 +34,14 @@
|
|
|
33
34
|
"react": "^16.8.0"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
|
-
"@atlaskit/build-utils": "*",
|
|
37
37
|
"@atlaskit/docs": "*",
|
|
38
38
|
"@atlaskit/ssr": "*",
|
|
39
|
-
"@atlaskit/visual-regression": "^0.
|
|
39
|
+
"@atlaskit/visual-regression": "^0.8.0",
|
|
40
40
|
"@atlaskit/webdriver-runner": "*",
|
|
41
41
|
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
42
42
|
"@testing-library/react": "^8.0.1",
|
|
43
43
|
"react-dom": "^16.8.0",
|
|
44
|
-
"typescript": "3.
|
|
44
|
+
"typescript": "4.3.5",
|
|
45
45
|
"wait-for-expect": "^1.2.0"
|
|
46
46
|
},
|
|
47
47
|
"techstack": {
|
|
@@ -50,13 +50,18 @@
|
|
|
50
50
|
"circular-dependencies": "file-and-folder-level"
|
|
51
51
|
},
|
|
52
52
|
"@repo/internal": {
|
|
53
|
+
"dom-events": "use-bind-event-listener",
|
|
53
54
|
"design-system": "v1",
|
|
54
|
-
"styling":
|
|
55
|
+
"styling": [
|
|
56
|
+
"static",
|
|
57
|
+
"emotion"
|
|
58
|
+
],
|
|
55
59
|
"ui-components": "lite-mode",
|
|
56
60
|
"analytics": "analytics-next",
|
|
57
61
|
"theming": "tokens",
|
|
58
62
|
"deprecation": "no-deprecated-imports"
|
|
59
63
|
}
|
|
60
64
|
},
|
|
65
|
+
"homepage": "https://atlaskit.atlassian.com/packages/design-system/visually-hidden",
|
|
61
66
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
|
|
62
67
|
}
|
package/report.api.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/visually-hidden"
|
|
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 { ReactNode } from 'react';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* __Visually hidden__
|
|
11
|
+
*
|
|
12
|
+
* A composable element to apply a visually hidden effect to children.
|
|
13
|
+
* Useful for accessibility compliance.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```jsx
|
|
17
|
+
* import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
18
|
+
*
|
|
19
|
+
* export default () => (
|
|
20
|
+
* <div style={{ border: '1px solid black' }}>
|
|
21
|
+
* There is text hidden between the brackets [
|
|
22
|
+
* <VisuallyHidden>Can't see me!</VisuallyHidden>]
|
|
23
|
+
* </div>
|
|
24
|
+
* );
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
declare const VisuallyHidden: FC<VisuallyHiddenProps>;
|
|
28
|
+
export default VisuallyHidden;
|
|
29
|
+
|
|
30
|
+
export declare type VisuallyHiddenProps = {
|
|
31
|
+
/**
|
|
32
|
+
* A `testId` prop is provided for specified elements, which is a unique
|
|
33
|
+
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
34
|
+
* serving as a hook for automated tests
|
|
35
|
+
*/
|
|
36
|
+
testId?: string;
|
|
37
|
+
/**
|
|
38
|
+
* The element or elements that should be hidden.
|
|
39
|
+
*/
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* Role attribute is passed on to the span to aid screen readers.
|
|
43
|
+
*/
|
|
44
|
+
role?: string;
|
|
45
|
+
/**
|
|
46
|
+
* An id may be appropriate for this component if used in conjunction with `aria-describedby`
|
|
47
|
+
* on a paired element.
|
|
48
|
+
*/
|
|
49
|
+
id?: string;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export {};
|
|
53
|
+
````
|