@atlaskit/focus-ring 1.3.0 → 1.3.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/focus-ring
2
2
 
3
+ ## 1.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
8
+
9
+ ## 1.3.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
14
+
3
15
  ## 1.3.0
4
16
 
5
17
  ### Minor Changes
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/focus-ring",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/focus-ring",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/focus-ring",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "sideEffects": false
5
5
  }
@@ -3,7 +3,7 @@ export interface FocusEventHandlers {
3
3
  onFocus: FocusEventHandler;
4
4
  onBlur: FocusEventHandler;
5
5
  }
6
- export declare type FocusState = 'on' | 'off';
6
+ export type FocusState = 'on' | 'off';
7
7
  export interface FocusRingProps {
8
8
  /**
9
9
  * Makes the `FocusRing` a controlled component (opting out of native focus behavior). The focus ring
@@ -0,0 +1,26 @@
1
+ /** @jsx jsx */
2
+ import { FC } from 'react';
3
+ import type { FocusRingProps } from './types';
4
+ /**
5
+ * __Focus ring__
6
+ *
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 assistance from the Design System accessibility team.
11
+ *
12
+ * - [Code](https://atlaskit.atlassian.com/packages/design-system/focus-ring)
13
+ *
14
+ * @example
15
+ * ```jsx
16
+ * import FocusRing from '@atlaskit/focus-ring';
17
+ *
18
+ * const InteractiveComponent = () => (
19
+ * <FocusRing>
20
+ * <button type="button">Hello</button>
21
+ * </FocusRing>
22
+ * )
23
+ * ```
24
+ */
25
+ declare const FocusRing: FC<FocusRingProps>;
26
+ export default FocusRing;
@@ -0,0 +1,3 @@
1
+ export { default } from './focus-ring';
2
+ export { default as useFocusRing } from './use-focus-ring';
3
+ export type { FocusRingProps, FocusEventHandlers, FocusState } from './types';
@@ -0,0 +1,22 @@
1
+ import type { FocusEventHandler, ReactElement } from 'react';
2
+ export interface FocusEventHandlers {
3
+ onFocus: FocusEventHandler;
4
+ onBlur: FocusEventHandler;
5
+ }
6
+ export type FocusState = 'on' | 'off';
7
+ export interface FocusRingProps {
8
+ /**
9
+ * Makes the `FocusRing` a controlled component (opting out of native focus behavior). The focus ring
10
+ * will apply the visual focus indicator when the `focus` prop is set to `on`. This prop should be used
11
+ * in conjunction with `useFocusRing`.
12
+ */
13
+ focus?: FocusState;
14
+ /**
15
+ * Controls whether the focus ring should be applied around or within the composed element.
16
+ */
17
+ isInset?: boolean;
18
+ /**
19
+ * The focusable element to be rendered within the `FocusRing`.
20
+ */
21
+ children: ReactElement;
22
+ }
@@ -0,0 +1,16 @@
1
+ import type { FocusEventHandlers, FocusState } from './types';
2
+ /**
3
+ * __Use focus ring__
4
+ *
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
+ *
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.
10
+ *
11
+ */
12
+ declare const useFocusRing: (initialState?: FocusState) => {
13
+ readonly focusState: "on" | "off";
14
+ readonly focusProps: FocusEventHandlers;
15
+ };
16
+ export default useFocusRing;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/focus-ring",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
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",
@@ -20,13 +20,21 @@
20
20
  "module": "dist/esm/index.js",
21
21
  "module:es2019": "dist/es2019/index.js",
22
22
  "types": "dist/types/index.d.ts",
23
+ "typesVersions": {
24
+ ">=4.5 <4.9": {
25
+ "*": [
26
+ "dist/types-ts4.5/*",
27
+ "dist/types-ts4.5/index.d.ts"
28
+ ]
29
+ }
30
+ },
23
31
  "sideEffects": false,
24
32
  "atlaskit:src": "src/index.tsx",
25
33
  "af:exports": {
26
34
  ".": "./src/index.tsx"
27
35
  },
28
36
  "dependencies": {
29
- "@atlaskit/tokens": "^1.3.0",
37
+ "@atlaskit/tokens": "^1.4.0",
30
38
  "@babel/runtime": "^7.0.0",
31
39
  "@emotion/react": "^11.7.1"
32
40
  },
@@ -46,7 +54,7 @@
46
54
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
47
55
  "@testing-library/react": "^12.1.5",
48
56
  "react-dom": "^16.8.0",
49
- "typescript": "4.5.5",
57
+ "typescript": "~4.9.5",
50
58
  "wait-for-expect": "^1.2.0"
51
59
  },
52
60
  "techstack": {