@atlaskit/visually-hidden 1.1.2 → 1.2.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 +12 -0
- package/README.md +2 -11
- package/dist/cjs/index.js +0 -2
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/visually-hidden.js +5 -7
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/visually-hidden.js +2 -2
- package/dist/esm/version.json +1 -1
- package/dist/esm/visually-hidden.js +5 -5
- package/dist/types/types.d.ts +8 -8
- package/package.json +15 -10
- package/report.api.md +21 -41
- package/dist/types-ts4.0/index.d.ts +0 -2
- package/dist/types-ts4.0/types.d.ts +0 -22
- package/dist/types-ts4.0/visually-hidden.d.ts +0 -23
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/visually-hidden
|
|
2
2
|
|
|
3
|
+
## 1.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
|
|
8
|
+
|
|
9
|
+
## 1.2.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
|
|
14
|
+
|
|
3
15
|
## 1.1.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Visually hidden
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A utility that hides content from the screen while retaining readability by screen readers for accessibility.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -10,13 +10,4 @@ yarn add @atlaskit/visually-hidden
|
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
|
-
|
|
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
|
-
```
|
|
13
|
+
[View documentation](https://atlassian.design/components/visually-hidden/).
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -11,5 +10,4 @@ Object.defineProperty(exports, "default", {
|
|
|
11
10
|
return _visuallyHidden.default;
|
|
12
11
|
}
|
|
13
12
|
});
|
|
14
|
-
|
|
15
13
|
var _visuallyHidden = _interopRequireDefault(require("./visually-hidden"));
|
package/dist/cjs/version.json
CHANGED
|
@@ -4,10 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("@emotion/react");
|
|
9
|
-
|
|
10
8
|
/** @jsx jsx */
|
|
9
|
+
|
|
11
10
|
// eslint-disable-next-line @atlaskit/design-system/use-visually-hidden
|
|
12
11
|
var visuallyHiddenStyles = (0, _react.css)({
|
|
13
12
|
width: '1px',
|
|
@@ -19,6 +18,7 @@ var visuallyHiddenStyles = (0, _react.css)({
|
|
|
19
18
|
overflow: 'hidden',
|
|
20
19
|
whiteSpace: 'nowrap'
|
|
21
20
|
});
|
|
21
|
+
|
|
22
22
|
/**
|
|
23
23
|
* __Visually hidden__
|
|
24
24
|
*
|
|
@@ -37,12 +37,11 @@ var visuallyHiddenStyles = (0, _react.css)({
|
|
|
37
37
|
* );
|
|
38
38
|
* ```
|
|
39
39
|
*/
|
|
40
|
-
|
|
41
40
|
var VisuallyHidden = function VisuallyHidden(_ref) {
|
|
42
41
|
var children = _ref.children,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
testId = _ref.testId,
|
|
43
|
+
role = _ref.role,
|
|
44
|
+
id = _ref.id;
|
|
46
45
|
return (0, _react.jsx)("span", {
|
|
47
46
|
id: id,
|
|
48
47
|
"data-testid": testId,
|
|
@@ -50,6 +49,5 @@ var VisuallyHidden = function VisuallyHidden(_ref) {
|
|
|
50
49
|
role: role
|
|
51
50
|
}, children);
|
|
52
51
|
};
|
|
53
|
-
|
|
54
52
|
var _default = VisuallyHidden;
|
|
55
53
|
exports.default = _default;
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
+
|
|
2
3
|
import { css, jsx } from '@emotion/react';
|
|
3
4
|
// eslint-disable-next-line @atlaskit/design-system/use-visually-hidden
|
|
4
5
|
const visuallyHiddenStyles = css({
|
|
@@ -11,6 +12,7 @@ const visuallyHiddenStyles = css({
|
|
|
11
12
|
overflow: 'hidden',
|
|
12
13
|
whiteSpace: 'nowrap'
|
|
13
14
|
});
|
|
15
|
+
|
|
14
16
|
/**
|
|
15
17
|
* __Visually hidden__
|
|
16
18
|
*
|
|
@@ -29,7 +31,6 @@ const visuallyHiddenStyles = css({
|
|
|
29
31
|
* );
|
|
30
32
|
* ```
|
|
31
33
|
*/
|
|
32
|
-
|
|
33
34
|
const VisuallyHidden = ({
|
|
34
35
|
children,
|
|
35
36
|
testId,
|
|
@@ -43,5 +44,4 @@ const VisuallyHidden = ({
|
|
|
43
44
|
role: role
|
|
44
45
|
}, children);
|
|
45
46
|
};
|
|
46
|
-
|
|
47
47
|
export default VisuallyHidden;
|
package/dist/esm/version.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
+
|
|
2
3
|
import { css, jsx } from '@emotion/react';
|
|
3
4
|
// eslint-disable-next-line @atlaskit/design-system/use-visually-hidden
|
|
4
5
|
var visuallyHiddenStyles = css({
|
|
@@ -11,6 +12,7 @@ var visuallyHiddenStyles = css({
|
|
|
11
12
|
overflow: 'hidden',
|
|
12
13
|
whiteSpace: 'nowrap'
|
|
13
14
|
});
|
|
15
|
+
|
|
14
16
|
/**
|
|
15
17
|
* __Visually hidden__
|
|
16
18
|
*
|
|
@@ -29,12 +31,11 @@ var visuallyHiddenStyles = css({
|
|
|
29
31
|
* );
|
|
30
32
|
* ```
|
|
31
33
|
*/
|
|
32
|
-
|
|
33
34
|
var VisuallyHidden = function VisuallyHidden(_ref) {
|
|
34
35
|
var children = _ref.children,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
testId = _ref.testId,
|
|
37
|
+
role = _ref.role,
|
|
38
|
+
id = _ref.id;
|
|
38
39
|
return jsx("span", {
|
|
39
40
|
id: id,
|
|
40
41
|
"data-testid": testId,
|
|
@@ -42,5 +43,4 @@ var VisuallyHidden = function VisuallyHidden(_ref) {
|
|
|
42
43
|
role: role
|
|
43
44
|
}, children);
|
|
44
45
|
};
|
|
45
|
-
|
|
46
46
|
export default VisuallyHidden;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
export
|
|
3
|
-
/**
|
|
4
|
-
* A `testId` prop is provided for specified elements, which is a unique
|
|
5
|
-
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
6
|
-
* serving as a hook for automated tests
|
|
7
|
-
*/
|
|
8
|
-
testId?: string;
|
|
2
|
+
export type VisuallyHiddenProps = {
|
|
9
3
|
/**
|
|
10
4
|
* The element or elements that should be hidden.
|
|
11
5
|
*/
|
|
12
6
|
children: ReactNode;
|
|
13
7
|
/**
|
|
14
|
-
*
|
|
8
|
+
* An ARIA role attribute to aid screen readers.
|
|
15
9
|
*/
|
|
16
10
|
role?: string;
|
|
17
11
|
/**
|
|
@@ -19,4 +13,10 @@ export declare type VisuallyHiddenProps = {
|
|
|
19
13
|
* on a paired element.
|
|
20
14
|
*/
|
|
21
15
|
id?: string;
|
|
16
|
+
/**
|
|
17
|
+
* A `testId` prop is provided for specified elements, which is a unique
|
|
18
|
+
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
19
|
+
* serving as a hook for automated tests.
|
|
20
|
+
*/
|
|
21
|
+
testId?: string;
|
|
22
22
|
};
|
package/package.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/visually-hidden",
|
|
3
|
-
"version": "1.1
|
|
4
|
-
"description": "A
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"description": "A utility that hides content from the screen while retaining readability by screen readers for accessibility.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"registry": "https://registry.npmjs.org/"
|
|
9
9
|
},
|
|
10
10
|
"atlassian": {
|
|
11
|
-
"disableProductCI": true,
|
|
12
11
|
"team": "Design System Team",
|
|
13
12
|
"inPublicMirror": true,
|
|
14
13
|
"releaseModel": "scheduled",
|
|
@@ -23,10 +22,10 @@
|
|
|
23
22
|
"module:es2019": "dist/es2019/index.js",
|
|
24
23
|
"types": "dist/types/index.d.ts",
|
|
25
24
|
"typesVersions": {
|
|
26
|
-
">=4.
|
|
25
|
+
">=4.5 <4.9": {
|
|
27
26
|
"*": [
|
|
28
|
-
"dist/types-ts4.
|
|
29
|
-
"dist/types-ts4.
|
|
27
|
+
"dist/types-ts4.5/*",
|
|
28
|
+
"dist/types-ts4.5/index.d.ts"
|
|
30
29
|
]
|
|
31
30
|
}
|
|
32
31
|
},
|
|
@@ -43,15 +42,19 @@
|
|
|
43
42
|
"react": "^16.8.0"
|
|
44
43
|
},
|
|
45
44
|
"devDependencies": {
|
|
45
|
+
"@atlaskit/button": "^16.7.0",
|
|
46
46
|
"@atlaskit/docs": "*",
|
|
47
|
-
"@atlaskit/ds-lib": "^2.0
|
|
47
|
+
"@atlaskit/ds-lib": "^2.2.0",
|
|
48
|
+
"@atlaskit/section-message": "^6.4.0",
|
|
48
49
|
"@atlaskit/ssr": "*",
|
|
50
|
+
"@atlaskit/toggle": "^12.6.0",
|
|
51
|
+
"@atlaskit/tokens": "^1.4.0",
|
|
49
52
|
"@atlaskit/visual-regression": "^0.8.0",
|
|
50
53
|
"@atlaskit/webdriver-runner": "*",
|
|
51
54
|
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
52
55
|
"@testing-library/react": "^12.1.5",
|
|
53
56
|
"react-dom": "^16.8.0",
|
|
54
|
-
"typescript": "4.
|
|
57
|
+
"typescript": "~4.9.5",
|
|
55
58
|
"wait-for-expect": "^1.2.0"
|
|
56
59
|
},
|
|
57
60
|
"techstack": {
|
|
@@ -68,10 +71,12 @@
|
|
|
68
71
|
],
|
|
69
72
|
"ui-components": "lite-mode",
|
|
70
73
|
"analytics": "analytics-next",
|
|
71
|
-
"
|
|
74
|
+
"design-tokens": [
|
|
75
|
+
"color"
|
|
76
|
+
],
|
|
72
77
|
"deprecation": "no-deprecated-imports"
|
|
73
78
|
}
|
|
74
79
|
},
|
|
75
|
-
"homepage": "https://
|
|
80
|
+
"homepage": "https://atlassian.design/components/visually-hidden/",
|
|
76
81
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
|
|
77
82
|
}
|
package/report.api.md
CHANGED
|
@@ -1,55 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- API Report Version: 2.3 -->
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## API Report File for "@atlaskit/visually-hidden"
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
> Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
|
|
6
|
+
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
### Table of contents
|
|
9
|
+
|
|
10
|
+
- [Main Entry Types](#main-entry-types)
|
|
11
|
+
|
|
12
|
+
### Main Entry Types
|
|
13
|
+
|
|
14
|
+
<!--SECTION START: Main Entry Types-->
|
|
15
|
+
|
|
16
|
+
```ts
|
|
8
17
|
import { FC } from 'react';
|
|
9
18
|
import { ReactNode } from 'react';
|
|
10
19
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*
|
|
14
|
-
* A composable element to apply a visually hidden effect to children.
|
|
15
|
-
* Useful for accessibility compliance.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```jsx
|
|
19
|
-
* import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
20
|
-
*
|
|
21
|
-
* export default () => (
|
|
22
|
-
* <div style={{ border: '1px solid black' }}>
|
|
23
|
-
* There is text hidden between the brackets [
|
|
24
|
-
* <VisuallyHidden>Can't see me!</VisuallyHidden>]
|
|
25
|
-
* </div>
|
|
26
|
-
* );
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
declare const VisuallyHidden: FC<VisuallyHiddenProps>;
|
|
20
|
+
// @public
|
|
21
|
+
const VisuallyHidden: FC<VisuallyHiddenProps>;
|
|
30
22
|
export default VisuallyHidden;
|
|
31
23
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
* A `testId` prop is provided for specified elements, which is a unique
|
|
35
|
-
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
36
|
-
* serving as a hook for automated tests
|
|
37
|
-
*/
|
|
24
|
+
// @public (undocumented)
|
|
25
|
+
export type VisuallyHiddenProps = {
|
|
38
26
|
testId?: string;
|
|
39
|
-
/**
|
|
40
|
-
* The element or elements that should be hidden.
|
|
41
|
-
*/
|
|
42
27
|
children: ReactNode;
|
|
43
|
-
/**
|
|
44
|
-
* Role attribute is passed on to the span to aid screen readers.
|
|
45
|
-
*/
|
|
46
28
|
role?: string;
|
|
47
|
-
/**
|
|
48
|
-
* An id may be appropriate for this component if used in conjunction with `aria-describedby`
|
|
49
|
-
* on a paired element.
|
|
50
|
-
*/
|
|
51
29
|
id?: string;
|
|
52
30
|
};
|
|
53
31
|
|
|
54
|
-
|
|
55
|
-
|
|
32
|
+
// (No @packageDocumentation comment for this package)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
<!--SECTION END: Main Entry Types-->
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export declare type VisuallyHiddenProps = {
|
|
3
|
-
/**
|
|
4
|
-
* A `testId` prop is provided for specified elements, which is a unique
|
|
5
|
-
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
6
|
-
* serving as a hook for automated tests
|
|
7
|
-
*/
|
|
8
|
-
testId?: string;
|
|
9
|
-
/**
|
|
10
|
-
* The element or elements that should be hidden.
|
|
11
|
-
*/
|
|
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;
|
|
22
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { FC } from 'react';
|
|
3
|
-
import type { VisuallyHiddenProps } from './types';
|
|
4
|
-
/**
|
|
5
|
-
* __Visually hidden__
|
|
6
|
-
*
|
|
7
|
-
* A composable element to apply a visually hidden effect to children.
|
|
8
|
-
* Useful for accessibility compliance.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```jsx
|
|
12
|
-
* import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
13
|
-
*
|
|
14
|
-
* export default () => (
|
|
15
|
-
* <div style={{ border: '1px solid black' }}>
|
|
16
|
-
* There is text hidden between the brackets [
|
|
17
|
-
* <VisuallyHidden>Can't see me!</VisuallyHidden>]
|
|
18
|
-
* </div>
|
|
19
|
-
* );
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
declare const VisuallyHidden: FC<VisuallyHiddenProps>;
|
|
23
|
-
export default VisuallyHidden;
|