@fluentui-react-native/focus-trap-zone 0.13.0 → 0.13.3

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,41 @@
1
1
  # Change Log - @fluentui-react-native/focus-trap-zone
2
2
 
3
+ ## 0.13.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 9cf4444: Migrate from ESLint to oxlint
8
+ - Updated dependencies [9cf4444]
9
+ - @uifabricshared/foundation-composable@0.14.3
10
+ - @uifabricshared/foundation-settings@0.16.3
11
+ - @fluentui-react-native/interactive-hooks@0.28.3
12
+ - @fluentui-react-native/adapters@0.14.3
13
+
14
+ ## 0.13.2
15
+
16
+ ### Patch Changes
17
+
18
+ - 8a7b549: Update to the latest rnx-kit versions, fix some typing issues, and correct the vscode settings
19
+ - Updated dependencies [8a7b549]
20
+ - @uifabricshared/foundation-composable@0.14.2
21
+ - @uifabricshared/foundation-settings@0.16.2
22
+ - @fluentui-react-native/interactive-hooks@0.28.2
23
+ - @fluentui-react-native/adapters@0.14.2
24
+
25
+ ## 0.13.1
26
+
27
+ ### Patch Changes
28
+
29
+ - f72b43a: Fix codegen definitions for native components in repo
30
+ - 0d6e9c1: chore: migrate to `oxfmt`
31
+ - ac6e7af: Ensure packages have a default export that references the typescript entrypoint and clean up build dependency ordering
32
+ - Updated dependencies [0d6e9c1]
33
+ - Updated dependencies [ac6e7af]
34
+ - @uifabricshared/foundation-composable@0.14.1
35
+ - @uifabricshared/foundation-settings@0.16.1
36
+ - @fluentui-react-native/interactive-hooks@0.28.1
37
+ - @fluentui-react-native/adapters@0.14.1
38
+
3
39
  ## 0.13.0
4
40
 
5
41
  ### Minor Changes
@@ -5,12 +5,5 @@
5
5
  */
6
6
  import type { IFocusTrapZoneProps, IFocusTrapZoneSlotProps } from './FocusTrapZone.types';
7
7
  export declare function filterOutComponentRef(propName: string): boolean;
8
- export declare const FocusTrapZone: import('@uifabricshared/foundation-composable').IWithComposable<
9
- import('react').FunctionComponent<IFocusTrapZoneProps<import('@fluentui-react-native/adapters').IViewProps>>,
10
- import('@uifabricshared/foundation-composable').IComposable<
11
- IFocusTrapZoneProps<import('@fluentui-react-native/adapters').IViewProps>,
12
- IFocusTrapZoneSlotProps<import('@fluentui-react-native/adapters').IViewProps>,
13
- object
14
- >
15
- >;
16
- //# sourceMappingURL=FocusTrapZone.d.ts.map
8
+ export declare const FocusTrapZone: import("@uifabricshared/foundation-composable").IWithComposable<import("react").FunctionComponent<IFocusTrapZoneProps<import("@fluentui-react-native/adapters").IViewProps>>, import("@uifabricshared/foundation-composable").IComposable<IFocusTrapZoneProps<import("@fluentui-react-native/adapters").IViewProps>, IFocusTrapZoneSlotProps<import("@fluentui-react-native/adapters").IViewProps>, object>>;
9
+ //# sourceMappingURL=FocusTrapZone.d.ts.map
@@ -8,17 +8,17 @@ import { composable } from '@uifabricshared/foundation-composable';
8
8
  import { mergeSettings } from '@uifabricshared/foundation-settings';
9
9
  import RCTFocusTrapZone from './FocusTrapZoneNativeComponent';
10
10
  export function filterOutComponentRef(propName) {
11
- return propName !== 'componentRef';
11
+ return propName !== 'componentRef';
12
12
  }
13
13
  export const FocusTrapZone = composable({
14
- usePrepareProps: (userProps, useStyling) => {
15
- const ftzRef = useViewCommandFocus(userProps.componentRef);
16
- return {
17
- slotProps: mergeSettings(useStyling(userProps), { root: { ...userProps, ref: ftzRef } }),
18
- };
19
- },
20
- slots: {
21
- root: { slotType: RCTFocusTrapZone, filter: filterOutComponentRef },
22
- },
14
+ usePrepareProps: (userProps, useStyling) => {
15
+ const ftzRef = useViewCommandFocus(userProps.componentRef);
16
+ return {
17
+ slotProps: mergeSettings(useStyling(userProps), { root: { ...userProps, ref: ftzRef } }),
18
+ };
19
+ },
20
+ slots: {
21
+ root: { slotType: RCTFocusTrapZone, filter: filterOutComponentRef },
22
+ },
23
23
  });
24
- //# sourceMappingURL=FocusTrapZone.js.map
24
+ //# sourceMappingURL=FocusTrapZone.js.map
@@ -2,41 +2,41 @@ import type * as React from 'react';
2
2
  import type { IViewProps } from '@fluentui-react-native/adapters';
3
3
  import type { IFocusable } from '@fluentui-react-native/interactive-hooks';
4
4
  export type IFocusTrapZoneProps<TBase = IViewProps> = TBase & {
5
- /**
6
- * A RefObject to access the IFocusTrapZone interface. Use this to access the public methods and properties of the component.
7
- */
8
- componentRef?: React.RefObject<IFocusable>;
9
- /**
10
- * Specifies whether the FocusTrapZone's focus trapping behavior is disabled. True, if disabled.
11
- * @default false
12
- */
13
- disabled?: boolean;
14
- /**
15
- * Specifies whether the FocusTrapZone takes focus on render. True, if taking focus is disabled.
16
- * @default false
17
- */
18
- disableFirstFocus?: boolean;
19
- /**
20
- * Determines which element receives focus when focus moves into the FocusTrapZone. If false, the first focusable descendant gets focus.
21
- * If true, the element that was focused when the FocusTrapZone last had a focused descendant is chosen. If it has never had a focused
22
- * descendant before, then the first focusable descendant gets focus.
23
- * @default false
24
- */
25
- focusPreviouslyFocusedInnerElement?: boolean;
26
- /**
27
- * By default, when the FocusTrapZone is unmounted or disabled focus returns to the element outside the FocusTrapZone that last had
28
- * focus. Setting this to true disables this behavior, so the UI behaves as it normally would: If the FocusTrapZone is disabled, focus
29
- * remains on the control inside the FocusTrapZone. If the FocusTrapZone is unmounted, focus usually moves to the nearest focusable
30
- * control, but this can vary.
31
- * @default false
32
- */
33
- ignoreExternalFocusing?: boolean;
5
+ /**
6
+ * A RefObject to access the IFocusTrapZone interface. Use this to access the public methods and properties of the component.
7
+ */
8
+ componentRef?: React.RefObject<IFocusable>;
9
+ /**
10
+ * Specifies whether the FocusTrapZone's focus trapping behavior is disabled. True, if disabled.
11
+ * @default false
12
+ */
13
+ disabled?: boolean;
14
+ /**
15
+ * Specifies whether the FocusTrapZone takes focus on render. True, if taking focus is disabled.
16
+ * @default false
17
+ */
18
+ disableFirstFocus?: boolean;
19
+ /**
20
+ * Determines which element receives focus when focus moves into the FocusTrapZone. If false, the first focusable descendant gets focus.
21
+ * If true, the element that was focused when the FocusTrapZone last had a focused descendant is chosen. If it has never had a focused
22
+ * descendant before, then the first focusable descendant gets focus.
23
+ * @default false
24
+ */
25
+ focusPreviouslyFocusedInnerElement?: boolean;
26
+ /**
27
+ * By default, when the FocusTrapZone is unmounted or disabled focus returns to the element outside the FocusTrapZone that last had
28
+ * focus. Setting this to true disables this behavior, so the UI behaves as it normally would: If the FocusTrapZone is disabled, focus
29
+ * remains on the control inside the FocusTrapZone. If the FocusTrapZone is unmounted, focus usually moves to the nearest focusable
30
+ * control, but this can vary.
31
+ * @default false
32
+ */
33
+ ignoreExternalFocusing?: boolean;
34
34
  };
35
35
  export type IFocusTrapZoneSlotProps<TBase = IViewProps> = {
36
- root: React.PropsWithRef<Omit<IFocusTrapZoneProps<TBase>, 'componentRef'>>;
36
+ root: React.PropsWithRef<Omit<IFocusTrapZoneProps<TBase>, 'componentRef'>>;
37
37
  };
38
38
  export type IFocusTrapZoneType<TBase = IViewProps> = {
39
- props: IFocusTrapZoneProps<TBase>;
40
- slotProps: IFocusTrapZoneSlotProps<TBase>;
39
+ props: IFocusTrapZoneProps<TBase>;
40
+ slotProps: IFocusTrapZoneSlotProps<TBase>;
41
41
  };
42
- //# sourceMappingURL=FocusTrapZone.types.d.ts.map
42
+ //# sourceMappingURL=FocusTrapZone.types.d.ts.map
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=FocusTrapZone.types.js.map
2
+ //# sourceMappingURL=FocusTrapZone.types.js.map
@@ -1,37 +1,32 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- * @format
5
- */
6
- import { type HostComponent, type ViewProps } from 'react-native';
1
+ import type { HostComponent, ViewProps } from 'react-native';
7
2
  export interface NativeProps extends ViewProps {
8
- /**
9
- * Specifies whether the FocusTrapZone's focus trapping behavior is disabled. True, if disabled.
10
- * @default false
11
- */
12
- disabled?: boolean;
13
- /**
14
- * Specifies whether the FocusTrapZone takes focus on render. True, if taking focus is disabled.
15
- * @default false
16
- */
17
- disableFirstFocus?: boolean;
18
- /**
19
- * Determines which element receives focus when focus moves into the FocusTrapZone. If false, the first focusable descendant gets focus.
20
- * If true, the element that was focused when the FocusTrapZone last had a focused descendant is chosen. If it has never had a focused
21
- * descendant before, then the first focusable descendant gets focus.
22
- * @default false
23
- */
24
- focusPreviouslyFocusedInnerElement?: boolean;
25
- /**
26
- * By default, when the FocusTrapZone is unmounted or disabled focus returns to the element outside the FocusTrapZone that last had
27
- * focus. Setting this to true disables this behavior, so the UI behaves as it normally would: If the FocusTrapZone is disabled, focus
28
- * remains on the control inside the FocusTrapZone. If the FocusTrapZone is unmounted, focus usually moves to the nearest focusable
29
- * control, but this can vary.
30
- * @default false
31
- */
32
- ignoreExternalFocusing?: boolean;
33
- forceFocusInsideTrap?: boolean;
3
+ /**
4
+ * Specifies whether the FocusTrapZone's focus trapping behavior is disabled. True, if disabled.
5
+ * @default false
6
+ */
7
+ disabled?: boolean;
8
+ /**
9
+ * Specifies whether the FocusTrapZone takes focus on render. True, if taking focus is disabled.
10
+ * @default false
11
+ */
12
+ disableFirstFocus?: boolean;
13
+ /**
14
+ * Determines which element receives focus when focus moves into the FocusTrapZone. If false, the first focusable descendant gets focus.
15
+ * If true, the element that was focused when the FocusTrapZone last had a focused descendant is chosen. If it has never had a focused
16
+ * descendant before, then the first focusable descendant gets focus.
17
+ * @default false
18
+ */
19
+ focusPreviouslyFocusedInnerElement?: boolean;
20
+ /**
21
+ * By default, when the FocusTrapZone is unmounted or disabled focus returns to the element outside the FocusTrapZone that last had
22
+ * focus. Setting this to true disables this behavior, so the UI behaves as it normally would: If the FocusTrapZone is disabled, focus
23
+ * remains on the control inside the FocusTrapZone. If the FocusTrapZone is unmounted, focus usually moves to the nearest focusable
24
+ * control, but this can vary.
25
+ * @default false
26
+ */
27
+ ignoreExternalFocusing?: boolean;
28
+ forceFocusInsideTrap?: boolean;
34
29
  }
35
30
  declare const _default: HostComponent<NativeProps>;
36
31
  export default _default;
37
- //# sourceMappingURL=FocusTrapZoneNativeComponent.d.ts.map
32
+ //# sourceMappingURL=FocusTrapZoneNativeComponent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FocusTrapZoneNativeComponent.d.ts","sourceRoot":"","sources":["../src/FocusTrapZoneNativeComponent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAA0B,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1F,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;OAKG;IACH,kCAAkC,CAAC,EAAE,OAAO,CAAC;IAC7C;;;;;;OAMG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;;AAED,wBAAqG"}
1
+ {"version":3,"file":"FocusTrapZoneNativeComponent.d.ts","sourceRoot":"","sources":["../src/FocusTrapZoneNativeComponent.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;OAKG;IACH,kCAAkC,CAAC,EAAE,OAAO,CAAC;IAC7C;;;;;;OAMG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;;AAED,wBAAqG"}
@@ -3,6 +3,6 @@
3
3
  * Licensed under the MIT License.
4
4
  * @format
5
5
  */
6
- import { requireNativeComponent } from 'react-native';
7
- export default requireNativeComponent('RCTFocusTrapZone');
8
- //# sourceMappingURL=FocusTrapZoneNativeComponent.js.map
6
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
7
+ export default codegenNativeComponent('RCTFocusTrapZone');
8
+ //# sourceMappingURL=FocusTrapZoneNativeComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FocusTrapZoneNativeComponent.js","sourceRoot":"","sources":["../src/FocusTrapZoneNativeComponent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,sBAAsB,EAAsC,MAAM,cAAc,CAAC;AAgC1F,eAAe,sBAAsB,CAAc,kBAAkB,CAA+B,CAAC"}
1
+ {"version":3,"file":"FocusTrapZoneNativeComponent.js","sourceRoot":"","sources":["../src/FocusTrapZoneNativeComponent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,sBAAsB,MAAM,yDAAyD,CAAC;AAiC7F,eAAe,sBAAsB,CAAc,kBAAkB,CAA+B,CAAC"}
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=FocusTrapZone.test.d.ts.map
2
+ //# sourceMappingURL=FocusTrapZone.test.d.ts.map
@@ -1,28 +1,20 @@
1
- import { jsx as _jsx } from 'react/jsx-runtime';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { act } from 'react';
3
3
  import * as renderer from 'react-test-renderer';
4
4
  import { FocusTrapZone } from '..';
5
5
  it('FocusTrapZone default props', () => {
6
- let component;
7
- act(() => {
8
- component = renderer.create(_jsx(FocusTrapZone, {}));
9
- });
10
- expect(component.toJSON()).toMatchSnapshot();
6
+ let component;
7
+ act(() => {
8
+ component = renderer.create(_jsx(FocusTrapZone, {}));
9
+ });
10
+ expect(component.toJSON()).toMatchSnapshot();
11
11
  });
12
12
  it('FocusTrapZone all props props', () => {
13
- const ref = { current: null };
14
- let component;
15
- act(() => {
16
- component = renderer.create(
17
- _jsx(FocusTrapZone, {
18
- componentRef: ref,
19
- disableFirstFocus: true,
20
- disabled: true,
21
- ignoreExternalFocusing: true,
22
- focusPreviouslyFocusedInnerElement: true,
23
- }),
24
- );
25
- });
26
- expect(component.toJSON()).toMatchSnapshot();
13
+ const ref = { current: null };
14
+ let component;
15
+ act(() => {
16
+ component = renderer.create(_jsx(FocusTrapZone, { componentRef: ref, disableFirstFocus: true, disabled: true, ignoreExternalFocusing: true, focusPreviouslyFocusedInnerElement: true }));
17
+ });
18
+ expect(component.toJSON()).toMatchSnapshot();
27
19
  });
28
- //# sourceMappingURL=FocusTrapZone.test.js.map
20
+ //# sourceMappingURL=FocusTrapZone.test.js.map
package/lib/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export type { IFocusTrapZoneProps, IFocusTrapZoneSlotProps, IFocusTrapZoneType } from './FocusTrapZone.types';
2
2
  export { FocusTrapZone, filterOutComponentRef } from './FocusTrapZone';
3
- //# sourceMappingURL=index.d.ts.map
3
+ //# sourceMappingURL=index.d.ts.map
package/lib/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export { FocusTrapZone, filterOutComponentRef } from './FocusTrapZone';
2
- //# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -5,12 +5,5 @@
5
5
  */
6
6
  import type { IFocusTrapZoneProps, IFocusTrapZoneSlotProps } from './FocusTrapZone.types';
7
7
  export declare function filterOutComponentRef(propName: string): boolean;
8
- export declare const FocusTrapZone: import('@uifabricshared/foundation-composable').IWithComposable<
9
- import('react').FunctionComponent<IFocusTrapZoneProps<import('@fluentui-react-native/adapters').IViewProps>>,
10
- import('@uifabricshared/foundation-composable').IComposable<
11
- IFocusTrapZoneProps<import('@fluentui-react-native/adapters').IViewProps>,
12
- IFocusTrapZoneSlotProps<import('@fluentui-react-native/adapters').IViewProps>,
13
- object
14
- >
15
- >;
16
- //# sourceMappingURL=FocusTrapZone.d.ts.map
8
+ export declare const FocusTrapZone: import("@uifabricshared/foundation-composable").IWithComposable<import("react").FunctionComponent<IFocusTrapZoneProps<import("@fluentui-react-native/adapters").IViewProps>>, import("@uifabricshared/foundation-composable").IComposable<IFocusTrapZoneProps<import("@fluentui-react-native/adapters").IViewProps>, IFocusTrapZoneSlotProps<import("@fluentui-react-native/adapters").IViewProps>, object>>;
9
+ //# sourceMappingURL=FocusTrapZone.d.ts.map
@@ -1,33 +1,31 @@
1
- 'use strict';
1
+ "use strict";
2
2
  /**
3
3
  * Copyright (c) Microsoft Corporation.
4
4
  * Licensed under the MIT License.
5
5
  * @format
6
6
  */
7
- var __importDefault =
8
- (this && this.__importDefault) ||
9
- function (mod) {
10
- return mod && mod.__esModule ? mod : { default: mod };
11
- };
12
- Object.defineProperty(exports, '__esModule', { value: true });
7
+ var __importDefault = (this && this.__importDefault) || function (mod) {
8
+ return (mod && mod.__esModule) ? mod : { "default": mod };
9
+ };
10
+ Object.defineProperty(exports, "__esModule", { value: true });
13
11
  exports.FocusTrapZone = void 0;
14
12
  exports.filterOutComponentRef = filterOutComponentRef;
15
- const interactive_hooks_1 = require('@fluentui-react-native/interactive-hooks');
16
- const foundation_composable_1 = require('@uifabricshared/foundation-composable');
17
- const foundation_settings_1 = require('@uifabricshared/foundation-settings');
18
- const FocusTrapZoneNativeComponent_1 = __importDefault(require('./FocusTrapZoneNativeComponent'));
13
+ const interactive_hooks_1 = require("@fluentui-react-native/interactive-hooks");
14
+ const foundation_composable_1 = require("@uifabricshared/foundation-composable");
15
+ const foundation_settings_1 = require("@uifabricshared/foundation-settings");
16
+ const FocusTrapZoneNativeComponent_1 = __importDefault(require("./FocusTrapZoneNativeComponent"));
19
17
  function filterOutComponentRef(propName) {
20
- return propName !== 'componentRef';
18
+ return propName !== 'componentRef';
21
19
  }
22
20
  exports.FocusTrapZone = (0, foundation_composable_1.composable)({
23
- usePrepareProps: (userProps, useStyling) => {
24
- const ftzRef = (0, interactive_hooks_1.useViewCommandFocus)(userProps.componentRef);
25
- return {
26
- slotProps: (0, foundation_settings_1.mergeSettings)(useStyling(userProps), { root: { ...userProps, ref: ftzRef } }),
27
- };
28
- },
29
- slots: {
30
- root: { slotType: FocusTrapZoneNativeComponent_1.default, filter: filterOutComponentRef },
31
- },
21
+ usePrepareProps: (userProps, useStyling) => {
22
+ const ftzRef = (0, interactive_hooks_1.useViewCommandFocus)(userProps.componentRef);
23
+ return {
24
+ slotProps: (0, foundation_settings_1.mergeSettings)(useStyling(userProps), { root: { ...userProps, ref: ftzRef } }),
25
+ };
26
+ },
27
+ slots: {
28
+ root: { slotType: FocusTrapZoneNativeComponent_1.default, filter: filterOutComponentRef },
29
+ },
32
30
  });
33
- //# sourceMappingURL=FocusTrapZone.js.map
31
+ //# sourceMappingURL=FocusTrapZone.js.map
@@ -2,41 +2,41 @@ import type * as React from 'react';
2
2
  import type { IViewProps } from '@fluentui-react-native/adapters';
3
3
  import type { IFocusable } from '@fluentui-react-native/interactive-hooks';
4
4
  export type IFocusTrapZoneProps<TBase = IViewProps> = TBase & {
5
- /**
6
- * A RefObject to access the IFocusTrapZone interface. Use this to access the public methods and properties of the component.
7
- */
8
- componentRef?: React.RefObject<IFocusable>;
9
- /**
10
- * Specifies whether the FocusTrapZone's focus trapping behavior is disabled. True, if disabled.
11
- * @default false
12
- */
13
- disabled?: boolean;
14
- /**
15
- * Specifies whether the FocusTrapZone takes focus on render. True, if taking focus is disabled.
16
- * @default false
17
- */
18
- disableFirstFocus?: boolean;
19
- /**
20
- * Determines which element receives focus when focus moves into the FocusTrapZone. If false, the first focusable descendant gets focus.
21
- * If true, the element that was focused when the FocusTrapZone last had a focused descendant is chosen. If it has never had a focused
22
- * descendant before, then the first focusable descendant gets focus.
23
- * @default false
24
- */
25
- focusPreviouslyFocusedInnerElement?: boolean;
26
- /**
27
- * By default, when the FocusTrapZone is unmounted or disabled focus returns to the element outside the FocusTrapZone that last had
28
- * focus. Setting this to true disables this behavior, so the UI behaves as it normally would: If the FocusTrapZone is disabled, focus
29
- * remains on the control inside the FocusTrapZone. If the FocusTrapZone is unmounted, focus usually moves to the nearest focusable
30
- * control, but this can vary.
31
- * @default false
32
- */
33
- ignoreExternalFocusing?: boolean;
5
+ /**
6
+ * A RefObject to access the IFocusTrapZone interface. Use this to access the public methods and properties of the component.
7
+ */
8
+ componentRef?: React.RefObject<IFocusable>;
9
+ /**
10
+ * Specifies whether the FocusTrapZone's focus trapping behavior is disabled. True, if disabled.
11
+ * @default false
12
+ */
13
+ disabled?: boolean;
14
+ /**
15
+ * Specifies whether the FocusTrapZone takes focus on render. True, if taking focus is disabled.
16
+ * @default false
17
+ */
18
+ disableFirstFocus?: boolean;
19
+ /**
20
+ * Determines which element receives focus when focus moves into the FocusTrapZone. If false, the first focusable descendant gets focus.
21
+ * If true, the element that was focused when the FocusTrapZone last had a focused descendant is chosen. If it has never had a focused
22
+ * descendant before, then the first focusable descendant gets focus.
23
+ * @default false
24
+ */
25
+ focusPreviouslyFocusedInnerElement?: boolean;
26
+ /**
27
+ * By default, when the FocusTrapZone is unmounted or disabled focus returns to the element outside the FocusTrapZone that last had
28
+ * focus. Setting this to true disables this behavior, so the UI behaves as it normally would: If the FocusTrapZone is disabled, focus
29
+ * remains on the control inside the FocusTrapZone. If the FocusTrapZone is unmounted, focus usually moves to the nearest focusable
30
+ * control, but this can vary.
31
+ * @default false
32
+ */
33
+ ignoreExternalFocusing?: boolean;
34
34
  };
35
35
  export type IFocusTrapZoneSlotProps<TBase = IViewProps> = {
36
- root: React.PropsWithRef<Omit<IFocusTrapZoneProps<TBase>, 'componentRef'>>;
36
+ root: React.PropsWithRef<Omit<IFocusTrapZoneProps<TBase>, 'componentRef'>>;
37
37
  };
38
38
  export type IFocusTrapZoneType<TBase = IViewProps> = {
39
- props: IFocusTrapZoneProps<TBase>;
40
- slotProps: IFocusTrapZoneSlotProps<TBase>;
39
+ props: IFocusTrapZoneProps<TBase>;
40
+ slotProps: IFocusTrapZoneSlotProps<TBase>;
41
41
  };
42
- //# sourceMappingURL=FocusTrapZone.types.d.ts.map
42
+ //# sourceMappingURL=FocusTrapZone.types.d.ts.map
@@ -1,3 +1,3 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
3
- //# sourceMappingURL=FocusTrapZone.types.js.map
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=FocusTrapZone.types.js.map
@@ -1,37 +1,32 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- * @format
5
- */
6
- import { type HostComponent, type ViewProps } from 'react-native';
1
+ import type { HostComponent, ViewProps } from 'react-native';
7
2
  export interface NativeProps extends ViewProps {
8
- /**
9
- * Specifies whether the FocusTrapZone's focus trapping behavior is disabled. True, if disabled.
10
- * @default false
11
- */
12
- disabled?: boolean;
13
- /**
14
- * Specifies whether the FocusTrapZone takes focus on render. True, if taking focus is disabled.
15
- * @default false
16
- */
17
- disableFirstFocus?: boolean;
18
- /**
19
- * Determines which element receives focus when focus moves into the FocusTrapZone. If false, the first focusable descendant gets focus.
20
- * If true, the element that was focused when the FocusTrapZone last had a focused descendant is chosen. If it has never had a focused
21
- * descendant before, then the first focusable descendant gets focus.
22
- * @default false
23
- */
24
- focusPreviouslyFocusedInnerElement?: boolean;
25
- /**
26
- * By default, when the FocusTrapZone is unmounted or disabled focus returns to the element outside the FocusTrapZone that last had
27
- * focus. Setting this to true disables this behavior, so the UI behaves as it normally would: If the FocusTrapZone is disabled, focus
28
- * remains on the control inside the FocusTrapZone. If the FocusTrapZone is unmounted, focus usually moves to the nearest focusable
29
- * control, but this can vary.
30
- * @default false
31
- */
32
- ignoreExternalFocusing?: boolean;
33
- forceFocusInsideTrap?: boolean;
3
+ /**
4
+ * Specifies whether the FocusTrapZone's focus trapping behavior is disabled. True, if disabled.
5
+ * @default false
6
+ */
7
+ disabled?: boolean;
8
+ /**
9
+ * Specifies whether the FocusTrapZone takes focus on render. True, if taking focus is disabled.
10
+ * @default false
11
+ */
12
+ disableFirstFocus?: boolean;
13
+ /**
14
+ * Determines which element receives focus when focus moves into the FocusTrapZone. If false, the first focusable descendant gets focus.
15
+ * If true, the element that was focused when the FocusTrapZone last had a focused descendant is chosen. If it has never had a focused
16
+ * descendant before, then the first focusable descendant gets focus.
17
+ * @default false
18
+ */
19
+ focusPreviouslyFocusedInnerElement?: boolean;
20
+ /**
21
+ * By default, when the FocusTrapZone is unmounted or disabled focus returns to the element outside the FocusTrapZone that last had
22
+ * focus. Setting this to true disables this behavior, so the UI behaves as it normally would: If the FocusTrapZone is disabled, focus
23
+ * remains on the control inside the FocusTrapZone. If the FocusTrapZone is unmounted, focus usually moves to the nearest focusable
24
+ * control, but this can vary.
25
+ * @default false
26
+ */
27
+ ignoreExternalFocusing?: boolean;
28
+ forceFocusInsideTrap?: boolean;
34
29
  }
35
30
  declare const _default: HostComponent<NativeProps>;
36
31
  export default _default;
37
- //# sourceMappingURL=FocusTrapZoneNativeComponent.d.ts.map
32
+ //# sourceMappingURL=FocusTrapZoneNativeComponent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FocusTrapZoneNativeComponent.d.ts","sourceRoot":"","sources":["../src/FocusTrapZoneNativeComponent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAA0B,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1F,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;OAKG;IACH,kCAAkC,CAAC,EAAE,OAAO,CAAC;IAC7C;;;;;;OAMG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;;AAED,wBAAqG"}
1
+ {"version":3,"file":"FocusTrapZoneNativeComponent.d.ts","sourceRoot":"","sources":["../src/FocusTrapZoneNativeComponent.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;OAKG;IACH,kCAAkC,CAAC,EAAE,OAAO,CAAC;IAC7C;;;;;;OAMG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;;AAED,wBAAqG"}
@@ -1,10 +1,13 @@
1
- 'use strict';
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
2
6
  /**
3
7
  * Copyright (c) Microsoft Corporation.
4
8
  * Licensed under the MIT License.
5
9
  * @format
6
10
  */
7
- Object.defineProperty(exports, '__esModule', { value: true });
8
- const react_native_1 = require('react-native');
9
- exports.default = (0, react_native_1.requireNativeComponent)('RCTFocusTrapZone');
10
- //# sourceMappingURL=FocusTrapZoneNativeComponent.js.map
11
+ const codegenNativeComponent_1 = __importDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));
12
+ exports.default = (0, codegenNativeComponent_1.default)('RCTFocusTrapZone');
13
+ //# sourceMappingURL=FocusTrapZoneNativeComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FocusTrapZoneNativeComponent.js","sourceRoot":"","sources":["../src/FocusTrapZoneNativeComponent.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAEH,+CAA0F;kBAgC3E,IAAA,qCAAsB,EAAc,kBAAkB,CAA+B"}
1
+ {"version":3,"file":"FocusTrapZoneNativeComponent.js","sourceRoot":"","sources":["../src/FocusTrapZoneNativeComponent.ts"],"names":[],"mappings":";;;;;AAAA;;;;GAIG;AACH,qHAA6F;kBAiC9E,IAAA,gCAAsB,EAAc,kBAAkB,CAA+B"}
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=FocusTrapZone.test.d.ts.map
2
+ //# sourceMappingURL=FocusTrapZone.test.d.ts.map
@@ -1,80 +1,55 @@
1
- 'use strict';
2
- var __createBinding =
3
- (this && this.__createBinding) ||
4
- (Object.create
5
- ? function (o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = {
10
- enumerable: true,
11
- get: function () {
12
- return m[k];
13
- },
14
- };
15
- }
16
- Object.defineProperty(o, k2, desc);
17
- }
18
- : function (o, m, k, k2) {
19
- if (k2 === undefined) k2 = k;
20
- o[k2] = m[k];
21
- });
22
- var __setModuleDefault =
23
- (this && this.__setModuleDefault) ||
24
- (Object.create
25
- ? function (o, v) {
26
- Object.defineProperty(o, 'default', { enumerable: true, value: v });
27
- }
28
- : function (o, v) {
29
- o['default'] = v;
30
- });
31
- var __importStar =
32
- (this && this.__importStar) ||
33
- (function () {
34
- var ownKeys = function (o) {
35
- ownKeys =
36
- Object.getOwnPropertyNames ||
37
- function (o) {
38
- var ar = [];
39
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
40
- return ar;
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
41
24
  };
42
- return ownKeys(o);
25
+ return ownKeys(o);
43
26
  };
44
27
  return function (mod) {
45
- if (mod && mod.__esModule) return mod;
46
- var result = {};
47
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== 'default') __createBinding(result, mod, k[i]);
48
- __setModuleDefault(result, mod);
49
- return result;
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
50
33
  };
51
- })();
52
- Object.defineProperty(exports, '__esModule', { value: true });
53
- const jsx_runtime_1 = require('react/jsx-runtime');
54
- const react_1 = require('react');
55
- const renderer = __importStar(require('react-test-renderer'));
56
- const __1 = require('..');
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ const jsx_runtime_1 = require("react/jsx-runtime");
37
+ const react_1 = require("react");
38
+ const renderer = __importStar(require("react-test-renderer"));
39
+ const __1 = require("..");
57
40
  it('FocusTrapZone default props', () => {
58
- let component;
59
- (0, react_1.act)(() => {
60
- component = renderer.create(jsx_runtime_1.jsx(__1.FocusTrapZone, {}));
61
- });
62
- expect(component.toJSON()).toMatchSnapshot();
41
+ let component;
42
+ (0, react_1.act)(() => {
43
+ component = renderer.create(jsx_runtime_1.jsx(__1.FocusTrapZone, {}));
44
+ });
45
+ expect(component.toJSON()).toMatchSnapshot();
63
46
  });
64
47
  it('FocusTrapZone all props props', () => {
65
- const ref = { current: null };
66
- let component;
67
- (0, react_1.act)(() => {
68
- component = renderer.create(
69
- jsx_runtime_1.jsx(__1.FocusTrapZone, {
70
- componentRef: ref,
71
- disableFirstFocus: true,
72
- disabled: true,
73
- ignoreExternalFocusing: true,
74
- focusPreviouslyFocusedInnerElement: true,
75
- }),
76
- );
77
- });
78
- expect(component.toJSON()).toMatchSnapshot();
48
+ const ref = { current: null };
49
+ let component;
50
+ (0, react_1.act)(() => {
51
+ component = renderer.create(jsx_runtime_1.jsx(__1.FocusTrapZone, { componentRef: ref, disableFirstFocus: true, disabled: true, ignoreExternalFocusing: true, focusPreviouslyFocusedInnerElement: true }));
52
+ });
53
+ expect(component.toJSON()).toMatchSnapshot();
79
54
  });
80
- //# sourceMappingURL=FocusTrapZone.test.js.map
55
+ //# sourceMappingURL=FocusTrapZone.test.js.map
@@ -1,3 +1,3 @@
1
1
  export type { IFocusTrapZoneProps, IFocusTrapZoneSlotProps, IFocusTrapZoneType } from './FocusTrapZone.types';
2
2
  export { FocusTrapZone, filterOutComponentRef } from './FocusTrapZone';
3
- //# sourceMappingURL=index.d.ts.map
3
+ //# sourceMappingURL=index.d.ts.map
@@ -1,17 +1,7 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.filterOutComponentRef = exports.FocusTrapZone = void 0;
4
- const FocusTrapZone_1 = require('./FocusTrapZone');
5
- Object.defineProperty(exports, 'FocusTrapZone', {
6
- enumerable: true,
7
- get: function () {
8
- return FocusTrapZone_1.FocusTrapZone;
9
- },
10
- });
11
- Object.defineProperty(exports, 'filterOutComponentRef', {
12
- enumerable: true,
13
- get: function () {
14
- return FocusTrapZone_1.filterOutComponentRef;
15
- },
16
- });
17
- //# sourceMappingURL=index.js.map
4
+ const FocusTrapZone_1 = require("./FocusTrapZone");
5
+ Object.defineProperty(exports, "FocusTrapZone", { enumerable: true, get: function () { return FocusTrapZone_1.FocusTrapZone; } });
6
+ Object.defineProperty(exports, "filterOutComponentRef", { enumerable: true, get: function () { return FocusTrapZone_1.filterOutComponentRef; } });
7
+ //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,68 +1,69 @@
1
1
  {
2
2
  "name": "@fluentui-react-native/focus-trap-zone",
3
- "version": "0.13.0",
3
+ "version": "0.13.3",
4
4
  "description": "A cross-platform FocusTrapZone component using the Fluent Design System",
5
+ "license": "MIT",
6
+ "author": "",
5
7
  "repository": {
6
8
  "type": "git",
7
9
  "url": "https://github.com/microsoft/fluentui-react-native.git",
8
10
  "directory": "packages/components/FocusTrapZone"
9
11
  },
10
- "license": "MIT",
11
- "author": "",
12
+ "main": "lib-commonjs/index.js",
13
+ "module": "lib/index.js",
14
+ "types": "lib/index.d.ts",
12
15
  "exports": {
13
16
  ".": {
14
17
  "types": "./lib/index.d.ts",
15
18
  "import": "./lib/index.js",
16
- "require": "./lib-commonjs/index.js"
19
+ "require": "./lib-commonjs/index.js",
20
+ "default": "./src/index.ts"
17
21
  }
18
22
  },
19
- "main": "lib-commonjs/index.js",
20
- "module": "lib/index.js",
21
- "types": "lib/index.d.ts",
22
23
  "scripts": {
23
24
  "build": "fluentui-scripts build",
24
25
  "build-cjs": "tsgo --outDir lib-commonjs",
25
- "build-esm": "tsgo --outDir lib --module esnext --moduleResolution bundler",
26
+ "build-core": "tsgo --outDir lib --module esnext --moduleResolution bundler",
26
27
  "clean": "fluentui-scripts clean",
27
28
  "depcheck": "fluentui-scripts depcheck",
28
- "lint": "fluentui-scripts eslint",
29
+ "format": "fluentui-scripts format",
30
+ "lint": "fluentui-scripts lint",
29
31
  "lint-package": "fluentui-scripts lint-package",
30
- "prettier": "fluentui-scripts prettier",
31
32
  "test": "fluentui-scripts jest",
32
33
  "update-snapshots": "fluentui-scripts jest -u"
33
34
  },
34
35
  "dependencies": {
35
- "@fluentui-react-native/adapters": "0.14.0",
36
- "@fluentui-react-native/interactive-hooks": "0.28.0",
37
- "@uifabricshared/foundation-composable": "0.14.0",
38
- "@uifabricshared/foundation-settings": "0.16.0"
36
+ "@fluentui-react-native/adapters": "0.14.3",
37
+ "@fluentui-react-native/interactive-hooks": "0.28.3",
38
+ "@uifabricshared/foundation-composable": "0.14.3",
39
+ "@uifabricshared/foundation-settings": "0.16.3"
39
40
  },
40
41
  "devDependencies": {
41
42
  "@babel/core": "^7.20.0",
42
43
  "@fluentui-react-native/babel-config": "0.1.1",
43
- "@fluentui-react-native/eslint-config-rules": "0.1.1",
44
- "@fluentui-react-native/jest-config": "0.1.1",
44
+ "@fluentui-react-native/jest-config": "0.1.0",
45
45
  "@fluentui-react-native/kit-config": "0.1.2",
46
- "@fluentui-react-native/scripts": "0.1.2",
46
+ "@fluentui-react-native/lint-config-rules": "0.1.3",
47
+ "@fluentui-react-native/scripts": "0.1.0",
47
48
  "@office-iss/react-native-win32": "^0.74.0",
48
49
  "@react-native-community/cli": "^20.0.0",
49
50
  "@react-native-community/cli-platform-android": "^20.0.0",
50
51
  "@react-native-community/cli-platform-ios": "^20.0.0",
51
52
  "@react-native/babel-preset": "^0.81.0",
52
53
  "@react-native/metro-config": "^0.81.0",
53
- "@types/react": "~19.1.0",
54
+ "@types/react": "~19.1.4",
54
55
  "@types/react-test-renderer": "^19.1.0",
55
- "react": "19.1.0",
56
- "react-native": "^0.81.0",
56
+ "react": "19.1.4",
57
+ "react-native": "^0.81.6",
57
58
  "react-native-macos": "^0.81.0",
58
59
  "react-native-windows": "^0.81.0",
59
- "react-test-renderer": "19.1.0"
60
+ "react-test-renderer": "19.1.4"
60
61
  },
61
62
  "peerDependencies": {
62
63
  "@office-iss/react-native-win32": "^0.74.0",
63
- "@types/react": "~18.2.0 || ~19.0.0 || ~19.1.0",
64
- "react": "18.2.0 || 19.0.0 || 19.1.0",
65
- "react-native": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0",
64
+ "@types/react": "~18.2.0 || ~19.0.0 || ~19.1.4",
65
+ "react": "18.2.0 || 19.0.0 || 19.1.4",
66
+ "react-native": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.6",
66
67
  "react-native-macos": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0",
67
68
  "react-native-windows": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0"
68
69
  },
@@ -3,8 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  * @format
5
5
  */
6
-
7
- import { requireNativeComponent, type HostComponent, type ViewProps } from 'react-native';
6
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
7
+ import type { HostComponent, ViewProps } from 'react-native';
8
8
 
9
9
  export interface NativeProps extends ViewProps {
10
10
  /**
@@ -36,4 +36,4 @@ export interface NativeProps extends ViewProps {
36
36
  forceFocusInsideTrap?: boolean;
37
37
  }
38
38
 
39
- export default requireNativeComponent<NativeProps>('RCTFocusTrapZone') as HostComponent<NativeProps>;
39
+ export default codegenNativeComponent<NativeProps>('RCTFocusTrapZone') as HostComponent<NativeProps>;
package/eslint.config.js DELETED
@@ -1,3 +0,0 @@
1
- const baseConfig = require('@fluentui-react-native/eslint-config-rules');
2
-
3
- module.exports = baseConfig;