@atlaskit/visually-hidden 1.0.2 → 1.1.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/visually-hidden
2
2
 
3
+ ## 1.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
8
+
9
+ ## 1.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`86b6aecec17`](https://bitbucket.org/atlassian/atlassian-frontend/commits/86b6aecec17) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
14
+
3
15
  ## 1.0.2
4
16
 
5
17
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/visually-hidden",
3
- "version": "1.0.2",
3
+ "version": "1.1.1",
4
4
  "sideEffects": false
5
5
  }
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _core = require("@emotion/core");
8
+ var _react = require("@emotion/react");
9
9
 
10
10
  /** @jsx jsx */
11
11
  // eslint-disable-next-line @atlaskit/design-system/use-visually-hidden
12
- var visuallyHiddenStyles = (0, _core.css)({
12
+ var visuallyHiddenStyles = (0, _react.css)({
13
13
  width: '1px',
14
14
  height: '1px',
15
15
  padding: '0',
@@ -43,7 +43,7 @@ var VisuallyHidden = function VisuallyHidden(_ref) {
43
43
  testId = _ref.testId,
44
44
  role = _ref.role,
45
45
  id = _ref.id;
46
- return (0, _core.jsx)("span", {
46
+ return (0, _react.jsx)("span", {
47
47
  id: id,
48
48
  "data-testid": testId,
49
49
  css: visuallyHiddenStyles,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/visually-hidden",
3
- "version": "1.0.2",
3
+ "version": "1.1.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { css, jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/react';
3
3
  // eslint-disable-next-line @atlaskit/design-system/use-visually-hidden
4
4
  const visuallyHiddenStyles = css({
5
5
  width: '1px',
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/visually-hidden",
3
- "version": "1.0.2",
3
+ "version": "1.1.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { css, jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/react';
3
3
  // eslint-disable-next-line @atlaskit/design-system/use-visually-hidden
4
4
  var visuallyHiddenStyles = css({
5
5
  width: '1px',
@@ -0,0 +1,2 @@
1
+ export { default } from './visually-hidden';
2
+ export type { VisuallyHiddenProps } from './types';
@@ -0,0 +1,22 @@
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
+ };
@@ -0,0 +1,23 @@
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/visually-hidden",
3
- "version": "1.0.2",
3
+ "version": "1.1.1",
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",
@@ -21,6 +21,13 @@
21
21
  "module": "dist/esm/index.js",
22
22
  "module:es2019": "dist/es2019/index.js",
23
23
  "types": "dist/types/index.d.ts",
24
+ "typesVersions": {
25
+ ">=4.0 <4.5": {
26
+ "*": [
27
+ "dist/types-ts4.0/*"
28
+ ]
29
+ }
30
+ },
24
31
  "sideEffects": false,
25
32
  "atlaskit:src": "src/index.tsx",
26
33
  "af:exports": {
@@ -28,20 +35,21 @@
28
35
  },
29
36
  "dependencies": {
30
37
  "@babel/runtime": "^7.0.0",
31
- "@emotion/core": "^10.0.9"
38
+ "@emotion/react": "^11.7.1"
32
39
  },
33
40
  "peerDependencies": {
34
41
  "react": "^16.8.0"
35
42
  },
36
43
  "devDependencies": {
37
44
  "@atlaskit/docs": "*",
45
+ "@atlaskit/ds-lib": "^2.0.1",
38
46
  "@atlaskit/ssr": "*",
39
47
  "@atlaskit/visual-regression": "^0.8.0",
40
48
  "@atlaskit/webdriver-runner": "*",
41
49
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
42
- "@testing-library/react": "^8.0.1",
50
+ "@testing-library/react": "^12.1.5",
43
51
  "react-dom": "^16.8.0",
44
- "typescript": "4.3.5",
52
+ "typescript": "4.5.5",
45
53
  "wait-for-expect": "^1.2.0"
46
54
  },
47
55
  "techstack": {