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

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +48 -1
  2. package/lib/FocusTrapZone.d.ts +9 -2
  3. package/lib/FocusTrapZone.js +11 -11
  4. package/lib/FocusTrapZone.js.map +1 -1
  5. package/lib/FocusTrapZone.types.d.ts +33 -33
  6. package/lib/FocusTrapZone.types.js +1 -1
  7. package/lib/FocusTrapZoneNativeComponent.d.ts +28 -28
  8. package/lib/FocusTrapZoneNativeComponent.d.ts.map +1 -1
  9. package/lib/FocusTrapZoneNativeComponent.js +3 -3
  10. package/lib/FocusTrapZoneNativeComponent.js.map +1 -1
  11. package/lib/__tests__/FocusTrapZone.test.d.ts +1 -1
  12. package/lib/__tests__/FocusTrapZone.test.js +22 -9
  13. package/lib/__tests__/FocusTrapZone.test.js.map +1 -1
  14. package/lib/index.d.ts +1 -1
  15. package/lib/index.js +1 -1
  16. package/lib-commonjs/FocusTrapZone.d.ts +9 -2
  17. package/lib-commonjs/FocusTrapZone.js +24 -22
  18. package/lib-commonjs/FocusTrapZone.js.map +1 -1
  19. package/lib-commonjs/FocusTrapZone.types.d.ts +33 -33
  20. package/lib-commonjs/FocusTrapZone.types.js +3 -3
  21. package/lib-commonjs/FocusTrapZoneNativeComponent.d.ts +28 -28
  22. package/lib-commonjs/FocusTrapZoneNativeComponent.d.ts.map +1 -1
  23. package/lib-commonjs/FocusTrapZoneNativeComponent.js +5 -8
  24. package/lib-commonjs/FocusTrapZoneNativeComponent.js.map +1 -1
  25. package/lib-commonjs/__tests__/FocusTrapZone.test.d.ts +1 -1
  26. package/lib-commonjs/__tests__/FocusTrapZone.test.js +76 -36
  27. package/lib-commonjs/__tests__/FocusTrapZone.test.js.map +1 -1
  28. package/lib-commonjs/index.d.ts +1 -1
  29. package/lib-commonjs/index.js +16 -6
  30. package/lib-commonjs/index.js.map +1 -1
  31. package/package.json +61 -61
  32. package/src/FocusTrapZoneNativeComponent.ts +2 -4
  33. package/src/__tests__/FocusTrapZone.test.tsx +13 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # Change Log - @fluentui-react-native/focus-trap-zone
2
2
 
3
+ ## 0.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d7adbdd: # Migration from Beachball to Changesets
8
+
9
+ This changeset represents the migration from Beachball to Changesets for version management and consolidates all changes from 440+ beachball change files that were in the `change/` directory.
10
+
11
+ All 75 affected packages receive a minor version bump to acknowledge the accumulated changes from the beachball era.
12
+
13
+ ## What Changed
14
+
15
+ Going forward, all version management uses Changesets via `yarn changeset`. The following beachball infrastructure has been removed:
16
+
17
+ - ❌ 440+ beachball change files from `change/` directory
18
+ - ❌ `beachball` package dependency
19
+ - ❌ Beachball scripts from `package.json`
20
+ - ❌ `beachball.config.js` configuration file
21
+ - ❌ Beachball publish steps from Azure Pipelines
22
+
23
+ ## New Workflow
24
+
25
+ ✅ **Create changes**: Run `yarn changeset` to document changes
26
+ ✅ **Version bump PRs**: Automatically created by GitHub Actions
27
+ ✅ **Publishing**: Handled by Azure Pipelines using `changeset publish`
28
+ ✅ **Validation**: CI validates changesets and blocks major version bumps
29
+
30
+ For details, see `CHANGESETS_SETUP.md` and `CONTRIBUTING.md`.
31
+
32
+ ### Patch Changes
33
+
34
+ - d1d8c26: We were pinning @types/react and react-native-macos via resolutions. This fixes that which uncovered a bunch of type inconsistencies that needed to be addressed.
35
+ - Updated dependencies [d7adbdd]
36
+ - Updated dependencies [d1d8c26]
37
+ - Updated dependencies [d1d8c26]
38
+ - @fluentui-react-native/adapters@0.14.0
39
+ - @fluentui-react-native/interactive-hooks@0.28.0
40
+ - @uifabricshared/foundation-composable@0.14.0
41
+ - @uifabricshared/foundation-settings@0.16.0
42
+
3
43
  <!-- This log was last generated on Tue, 05 Aug 2025 18:50:43 GMT and should not be manually modified. -->
4
44
 
5
45
  <!-- Start content -->
@@ -1287,7 +1327,7 @@ Thu, 16 Dec 2021 19:10:27 GMT
1287
1327
 
1288
1328
  ### Patches
1289
1329
 
1290
- - Rename Jest snapshots to be platform agnostic (sanajmi@microsoft.com)
1330
+ - Rename Jest snapshots to be platform agnostic (sanajmi@microsoft.com)
1291
1331
  - Bump @fluentui-react-native/adapters to v0.8.1
1292
1332
  - Bump @fluentui-react-native/interactive-hooks to v0.11.1
1293
1333
 
@@ -1792,24 +1832,31 @@ Thu, 16 Apr 2020 23:57:38 GMT
1792
1832
  - publish with correct main/module references (jasonmo@microsoft.com)
1793
1833
 
1794
1834
  ## 0.2.11
1835
+
1795
1836
  Thu, 09 Apr 2020 18:39:15 GMT
1796
1837
 
1797
1838
  ### Patches
1798
1839
 
1799
1840
  - merge conflicts (ppatboyd@outlook.com)
1841
+
1800
1842
  ## 0.2.9
1843
+
1801
1844
  Fri, 03 Apr 2020 20:40:51 GMT
1802
1845
 
1803
1846
  ### Patches
1804
1847
 
1805
1848
  - switch the bin name from just-script to fluent-scripts to disambiguate names (jasonmo@microsoft.com)
1849
+
1806
1850
  ## 0.2.7
1851
+
1807
1852
  Mon, 30 Mar 2020 16:27:00 GMT
1808
1853
 
1809
1854
  ### Patches
1810
1855
 
1811
1856
  - Update main attribute to specify TypeScript index file. (kinhln@microsoft.com)
1857
+
1812
1858
  ## 0.2.0
1859
+
1813
1860
  Mon, 16 Mar 2020 23:03:24 GMT
1814
1861
 
1815
1862
  ### Minor changes
@@ -5,5 +5,12 @@
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<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
+ 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,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
@@ -1 +1 @@
1
- {"version":3,"file":"FocusTrapZone.js","sourceRoot":"","sources":["../src/FocusTrapZone.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAGpE,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAE9D,MAAM,UAAU,qBAAqB,CAAC,QAAgB;IACpD,OAAO,QAAQ,KAAK,cAAc,CAAC;AACrC,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAqB;IAC1D,eAAe,EAAE,CAAC,SAA8B,EAAE,UAA2C,EAAE,EAAE;QAC/F,MAAM,MAAM,GAAG,mBAAmB,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QAC3D,OAAO;YACL,SAAS,EAAE,aAAa,CAA0B,UAAU,CAAC,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC;SAClH,CAAC;IACJ,CAAC;IACD,KAAK,EAAE;QACL,IAAI,EAAE,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,qBAAqB,EAAE;KACpE;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"FocusTrapZone.js","sourceRoot":"","sources":["../src/FocusTrapZone.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAGpE,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAE9D,MAAM,UAAU,qBAAqB,CAAC,QAAgB,EAAW;IAC/D,OAAO,QAAQ,KAAK,cAAc,CAAC;AAAA,CACpC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAqB;IAC1D,eAAe,EAAE,CAAC,SAA8B,EAAE,UAA2C,EAAE,EAAE,CAAC;QAChG,MAAM,MAAM,GAAG,mBAAmB,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QAC3D,OAAO;YACL,SAAS,EAAE,aAAa,CAA0B,UAAU,CAAC,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC;SAClH,CAAC;IAAA,CACH;IACD,KAAK,EAAE;QACL,IAAI,EAAE,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,qBAAqB,EAAE;KACpE;CACF,CAAC,CAAC"}
@@ -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
@@ -3,35 +3,35 @@
3
3
  * Licensed under the MIT License.
4
4
  * @format
5
5
  */
6
- import type { HostComponent, ViewProps } from 'react-native';
6
+ import { type HostComponent, type ViewProps } from 'react-native';
7
7
  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;
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;
34
34
  }
35
35
  declare const _default: HostComponent<NativeProps>;
36
36
  export default _default;
37
- //# sourceMappingURL=FocusTrapZoneNativeComponent.d.ts.map
37
+ //# 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,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI7D,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":"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"}
@@ -3,6 +3,6 @@
3
3
  * Licensed under the MIT License.
4
4
  * @format
5
5
  */
6
- import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
7
- export default codegenNativeComponent('RCTFocusTrapZone');
8
- //# sourceMappingURL=FocusTrapZoneNativeComponent.js.map
6
+ import { requireNativeComponent } from 'react-native';
7
+ export default requireNativeComponent('RCTFocusTrapZone');
8
+ //# sourceMappingURL=FocusTrapZoneNativeComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FocusTrapZoneNativeComponent.js","sourceRoot":"","sources":["../src/FocusTrapZoneNativeComponent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,sBAAsB,MAAM,yDAAyD,CAAC;AAgC7F,eAAe,sBAAsB,CAAc,kBAAkB,CAA+B,CAAC"}
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,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=FocusTrapZone.test.d.ts.map
2
+ //# sourceMappingURL=FocusTrapZone.test.d.ts.map
@@ -1,15 +1,28 @@
1
- import * as React from 'react';
1
+ import { jsx as _jsx } from 'react/jsx-runtime';
2
+ import { act } from 'react';
2
3
  import * as renderer from 'react-test-renderer';
3
4
  import { FocusTrapZone } from '..';
4
5
  it('FocusTrapZone default props', () => {
5
- const tree = renderer.create(React.createElement(FocusTrapZone, null)).toJSON();
6
- expect(tree).toMatchSnapshot();
6
+ let component;
7
+ act(() => {
8
+ component = renderer.create(_jsx(FocusTrapZone, {}));
9
+ });
10
+ expect(component.toJSON()).toMatchSnapshot();
7
11
  });
8
12
  it('FocusTrapZone all props props', () => {
9
- const ref = { current: null };
10
- const tree = renderer
11
- .create(React.createElement(FocusTrapZone, { componentRef: ref, disableFirstFocus: true, disabled: true, ignoreExternalFocusing: true, focusPreviouslyFocusedInnerElement: true }))
12
- .toJSON();
13
- expect(tree).toMatchSnapshot();
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();
14
27
  });
15
- //# sourceMappingURL=FocusTrapZone.test.js.map
28
+ //# sourceMappingURL=FocusTrapZone.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FocusTrapZone.test.js","sourceRoot":"","sources":["../../src/__tests__/FocusTrapZone.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAEnC,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;IACrC,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,oBAAC,aAAa,OAAG,CAAC,CAAC,MAAM,EAAE,CAAC;IACzD,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;AACjC,CAAC,CAAC,CAAC;AAEH,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;IACvC,MAAM,GAAG,GAAgC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3D,MAAM,IAAI,GAAG,QAAQ;SAClB,MAAM,CAAC,oBAAC,aAAa,IAAC,YAAY,EAAE,GAAG,EAAE,iBAAiB,QAAC,QAAQ,QAAC,sBAAsB,QAAC,kCAAkC,SAAG,CAAC;SACjI,MAAM,EAAE,CAAC;IACZ,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;AACjC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"FocusTrapZone.test.js","sourceRoot":"","sources":["../../src/__tests__/FocusTrapZone.test.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5B,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAEnC,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE,CAAC;IACtC,IAAI,SAAqC,CAAC;IAC1C,GAAG,CAAC,GAAG,EAAE,CAAC;QACR,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAC,aAAa,KAAG,CAAC,CAAC;IAAA,CAChD,CAAC,CAAC;IACH,MAAM,CAAC,SAAU,CAAC,MAAM,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC;AAAA,CAC/C,CAAC,CAAC;AAEH,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE,CAAC;IACxC,MAAM,GAAG,GAAgC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3D,IAAI,SAAqC,CAAC;IAC1C,GAAG,CAAC,GAAG,EAAE,CAAC;QACR,SAAS,GAAG,QAAQ,CAAC,MAAM,CACzB,KAAC,aAAa,IAAC,YAAY,EAAE,GAAG,EAAE,iBAAiB,QAAC,QAAQ,QAAC,sBAAsB,QAAC,kCAAkC,SAAG,CAC1H,CAAC;IAAA,CACH,CAAC,CAAC;IACH,MAAM,CAAC,SAAU,CAAC,MAAM,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC;AAAA,CAC/C,CAAC,CAAC"}
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,5 +5,12 @@
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<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
+ 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
@@ -1,31 +1,33 @@
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 = (this && this.__importDefault) || function (mod) {
8
- return (mod && mod.__esModule) ? mod : { "default": mod };
9
- };
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.FocusTrapZone = exports.filterOutComponentRef = void 0;
12
- const interactive_hooks_1 = require("@fluentui-react-native/interactive-hooks");
13
- const foundation_composable_1 = require("@uifabricshared/foundation-composable");
14
- const foundation_settings_1 = require("@uifabricshared/foundation-settings");
15
- const FocusTrapZoneNativeComponent_1 = __importDefault(require("./FocusTrapZoneNativeComponent"));
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 });
13
+ exports.FocusTrapZone = void 0;
14
+ 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'));
16
19
  function filterOutComponentRef(propName) {
17
- return propName !== 'componentRef';
20
+ return propName !== 'componentRef';
18
21
  }
19
- exports.filterOutComponentRef = filterOutComponentRef;
20
22
  exports.FocusTrapZone = (0, foundation_composable_1.composable)({
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
- },
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
+ },
30
32
  });
31
- //# sourceMappingURL=FocusTrapZone.js.map
33
+ //# sourceMappingURL=FocusTrapZone.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FocusTrapZone.js","sourceRoot":"","sources":["../src/FocusTrapZone.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;AAEH,gFAA+E;AAE/E,iFAAmE;AACnE,6EAAoE;AAGpE,kGAA8D;AAE9D,SAAgB,qBAAqB,CAAC,QAAgB;IACpD,OAAO,QAAQ,KAAK,cAAc,CAAC;AACrC,CAAC;AAFD,sDAEC;AAEY,QAAA,aAAa,GAAG,IAAA,kCAAU,EAAqB;IAC1D,eAAe,EAAE,CAAC,SAA8B,EAAE,UAA2C,EAAE,EAAE;QAC/F,MAAM,MAAM,GAAG,IAAA,uCAAmB,EAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QAC3D,OAAO;YACL,SAAS,EAAE,IAAA,mCAAa,EAA0B,UAAU,CAAC,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC;SAClH,CAAC;IACJ,CAAC;IACD,KAAK,EAAE;QACL,IAAI,EAAE,EAAE,QAAQ,EAAE,sCAAgB,EAAE,MAAM,EAAE,qBAAqB,EAAE;KACpE;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"FocusTrapZone.js","sourceRoot":"","sources":["../src/FocusTrapZone.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;AAEH,gFAA+E;AAE/E,iFAAmE;AACnE,6EAAoE;AAGpE,kGAA8D;AAE9D,+BAAsC,QAAgB,EAAW;IAC/D,OAAO,QAAQ,KAAK,cAAc,CAAC;AAAA,CACpC;AAEY,QAAA,aAAa,GAAG,IAAA,kCAAU,EAAqB;IAC1D,eAAe,EAAE,CAAC,SAA8B,EAAE,UAA2C,EAAE,EAAE,CAAC;QAChG,MAAM,MAAM,GAAG,IAAA,uCAAmB,EAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QAC3D,OAAO;YACL,SAAS,EAAE,IAAA,mCAAa,EAA0B,UAAU,CAAC,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC;SAClH,CAAC;IAAA,CACH;IACD,KAAK,EAAE;QACL,IAAI,EAAE,EAAE,QAAQ,EAAE,sCAAgB,EAAE,MAAM,EAAE,qBAAqB,EAAE;KACpE;CACF,CAAC,CAAC"}
@@ -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
@@ -3,35 +3,35 @@
3
3
  * Licensed under the MIT License.
4
4
  * @format
5
5
  */
6
- import type { HostComponent, ViewProps } from 'react-native';
6
+ import { type HostComponent, type ViewProps } from 'react-native';
7
7
  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;
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;
34
34
  }
35
35
  declare const _default: HostComponent<NativeProps>;
36
36
  export default _default;
37
- //# sourceMappingURL=FocusTrapZoneNativeComponent.d.ts.map
37
+ //# 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,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI7D,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":"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,13 +1,10 @@
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 = (this && this.__importDefault) || function (mod) {
8
- return (mod && mod.__esModule) ? mod : { "default": mod };
9
- };
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- const codegenNativeComponent_1 = __importDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));
12
- exports.default = (0, codegenNativeComponent_1.default)('RCTFocusTrapZone');
13
- //# sourceMappingURL=FocusTrapZoneNativeComponent.js.map
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
@@ -1 +1 @@
1
- {"version":3,"file":"FocusTrapZoneNativeComponent.js","sourceRoot":"","sources":["../src/FocusTrapZoneNativeComponent.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;AAIH,qHAA6F;AAgC7F,kBAAe,IAAA,gCAAsB,EAAc,kBAAkB,CAA+B,CAAC"}
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,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=FocusTrapZone.test.d.ts.map
2
+ //# sourceMappingURL=FocusTrapZone.test.d.ts.map
@@ -1,40 +1,80 @@
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 (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- const React = __importStar(require("react"));
27
- const renderer = __importStar(require("react-test-renderer"));
28
- const __1 = require("..");
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;
41
+ };
42
+ return ownKeys(o);
43
+ };
44
+ 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;
50
+ };
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('..');
29
57
  it('FocusTrapZone default props', () => {
30
- const tree = renderer.create(React.createElement(__1.FocusTrapZone, null)).toJSON();
31
- expect(tree).toMatchSnapshot();
58
+ let component;
59
+ (0, react_1.act)(() => {
60
+ component = renderer.create(jsx_runtime_1.jsx(__1.FocusTrapZone, {}));
61
+ });
62
+ expect(component.toJSON()).toMatchSnapshot();
32
63
  });
33
64
  it('FocusTrapZone all props props', () => {
34
- const ref = { current: null };
35
- const tree = renderer
36
- .create(React.createElement(__1.FocusTrapZone, { componentRef: ref, disableFirstFocus: true, disabled: true, ignoreExternalFocusing: true, focusPreviouslyFocusedInnerElement: true }))
37
- .toJSON();
38
- expect(tree).toMatchSnapshot();
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();
39
79
  });
40
- //# sourceMappingURL=FocusTrapZone.test.js.map
80
+ //# sourceMappingURL=FocusTrapZone.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FocusTrapZone.test.js","sourceRoot":"","sources":["../../src/__tests__/FocusTrapZone.test.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAG/B,8DAAgD;AAEhD,0BAAmC;AAEnC,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;IACrC,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,oBAAC,iBAAa,OAAG,CAAC,CAAC,MAAM,EAAE,CAAC;IACzD,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;AACjC,CAAC,CAAC,CAAC;AAEH,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;IACvC,MAAM,GAAG,GAAgC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3D,MAAM,IAAI,GAAG,QAAQ;SAClB,MAAM,CAAC,oBAAC,iBAAa,IAAC,YAAY,EAAE,GAAG,EAAE,iBAAiB,QAAC,QAAQ,QAAC,sBAAsB,QAAC,kCAAkC,SAAG,CAAC;SACjI,MAAM,EAAE,CAAC;IACZ,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;AACjC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"FocusTrapZone.test.js","sourceRoot":"","sources":["../../src/__tests__/FocusTrapZone.test.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,iCAA4B;AAG5B,MAAY,QAAQ,gDAA4B;AAEhD,0BAAmC;AAEnC,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE,CAAC;IACtC,IAAI,SAAqC,CAAC;IAC1C,IAAA,WAAG,EAAC,GAAG,EAAE,CAAC;QACR,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,kBAAC,iBAAa,KAAG,CAAC,CAAC;IAAA,CAChD,CAAC,CAAC;IACH,MAAM,CAAC,SAAU,CAAC,MAAM,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC;AAAA,CAC/C,CAAC,CAAC;AAEH,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE,CAAC;IACxC,MAAM,GAAG,GAAgC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3D,IAAI,SAAqC,CAAC;IAC1C,IAAA,WAAG,EAAC,GAAG,EAAE,CAAC;QACR,SAAS,GAAG,QAAQ,CAAC,MAAM,CACzB,kBAAC,iBAAa,IAAC,YAAY,EAAE,GAAG,EAAE,iBAAiB,QAAC,QAAQ,QAAC,sBAAsB,QAAC,kCAAkC,SAAG,CAC1H,CAAC;IAAA,CACH,CAAC,CAAC;IACH,MAAM,CAAC,SAAU,CAAC,MAAM,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC;AAAA,CAC/C,CAAC,CAAC"}
@@ -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,7 +1,17 @@
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
- var 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
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
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,iDAAuE;AAA9D,8GAAA,aAAa,OAAA;AAAE,sHAAA,qBAAqB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,mDAAuE;AAA9D,8GAAA,aAAa,OAAA;AAAE,sHAAA,qBAAqB,OAAA"}
package/package.json CHANGED
@@ -1,80 +1,88 @@
1
1
  {
2
2
  "name": "@fluentui-react-native/focus-trap-zone",
3
- "version": "0.12.19",
3
+ "version": "0.13.0",
4
4
  "description": "A cross-platform FocusTrapZone component using the Fluent Design System",
5
- "main": "lib-commonjs/index.js",
6
- "module": "lib/index.js",
7
- "react-native": "src/index.ts",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/microsoft/fluentui-react-native.git",
8
+ "directory": "packages/components/FocusTrapZone"
9
+ },
10
+ "license": "MIT",
11
+ "author": "",
8
12
  "exports": {
9
13
  ".": {
14
+ "types": "./lib/index.d.ts",
10
15
  "import": "./lib/index.js",
11
- "require": "./lib-commonjs/index.js",
12
- "types": "./lib/index.d.ts"
16
+ "require": "./lib-commonjs/index.js"
13
17
  }
14
18
  },
15
- "typings": "lib/index.d.ts",
19
+ "main": "lib-commonjs/index.js",
20
+ "module": "lib/index.js",
21
+ "types": "lib/index.d.ts",
16
22
  "scripts": {
17
23
  "build": "fluentui-scripts build",
18
- "depcheck": "fluentui-scripts depcheck",
19
- "just": "fluentui-scripts",
24
+ "build-cjs": "tsgo --outDir lib-commonjs",
25
+ "build-esm": "tsgo --outDir lib --module esnext --moduleResolution bundler",
20
26
  "clean": "fluentui-scripts clean",
27
+ "depcheck": "fluentui-scripts depcheck",
21
28
  "lint": "fluentui-scripts eslint",
22
- "test": "fluentui-scripts jest",
23
- "update-snapshots": "fluentui-scripts jest -u",
29
+ "lint-package": "fluentui-scripts lint-package",
24
30
  "prettier": "fluentui-scripts prettier",
25
- "prettier-fix": "fluentui-scripts prettier --fix true"
26
- },
27
- "repository": {
28
- "type": "git",
29
- "url": "https://github.com/microsoft/fluentui-react-native.git",
30
- "directory": "packages/components/FocusTrapZone"
31
+ "test": "fluentui-scripts jest",
32
+ "update-snapshots": "fluentui-scripts jest -u"
31
33
  },
32
34
  "dependencies": {
33
- "@fluentui-react-native/adapters": "0.13.5",
34
- "@fluentui-react-native/interactive-hooks": "0.27.18",
35
- "@uifabricshared/foundation-composable": "0.13.11",
36
- "@uifabricshared/foundation-settings": "0.15.11"
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"
37
39
  },
38
40
  "devDependencies": {
39
41
  "@babel/core": "^7.20.0",
40
42
  "@fluentui-react-native/babel-config": "0.1.1",
41
43
  "@fluentui-react-native/eslint-config-rules": "0.1.1",
42
44
  "@fluentui-react-native/jest-config": "0.1.1",
43
- "@fluentui-react-native/scripts": "0.1.1",
45
+ "@fluentui-react-native/kit-config": "0.1.2",
46
+ "@fluentui-react-native/scripts": "0.1.2",
44
47
  "@office-iss/react-native-win32": "^0.74.0",
45
- "@react-native/babel-preset": "^0.74.0",
46
- "@react-native/metro-config": "^0.74.0",
47
- "@types/react": "~18.2.0",
48
- "@types/react-test-renderer": "^18.2.0",
49
- "react": "18.2.0",
50
- "react-native": "^0.74.0",
51
- "react-native-macos": "^0.74.0",
52
- "react-native-windows": "^0.74.0",
53
- "react-test-renderer": "18.2.0"
48
+ "@react-native-community/cli": "^20.0.0",
49
+ "@react-native-community/cli-platform-android": "^20.0.0",
50
+ "@react-native-community/cli-platform-ios": "^20.0.0",
51
+ "@react-native/babel-preset": "^0.81.0",
52
+ "@react-native/metro-config": "^0.81.0",
53
+ "@types/react": "~19.1.0",
54
+ "@types/react-test-renderer": "^19.1.0",
55
+ "react": "19.1.0",
56
+ "react-native": "^0.81.0",
57
+ "react-native-macos": "^0.81.0",
58
+ "react-native-windows": "^0.81.0",
59
+ "react-test-renderer": "19.1.0"
54
60
  },
55
61
  "peerDependencies": {
56
62
  "@office-iss/react-native-win32": "^0.74.0",
57
- "react": "18.2.0",
58
- "react-native": "^0.73.0 || ^0.74.0",
59
- "react-native-macos": "^0.73.0 || ^0.74.0",
60
- "react-native-windows": "^0.73.0 || ^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",
66
+ "react-native-macos": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0",
67
+ "react-native-windows": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0"
68
+ },
69
+ "peerDependenciesMeta": {
70
+ "@office-iss/react-native-win32": {
71
+ "optional": true
72
+ },
73
+ "@types/react": {
74
+ "optional": true
75
+ },
76
+ "react-native-macos": {
77
+ "optional": true
78
+ },
79
+ "react-native-windows": {
80
+ "optional": true
81
+ }
61
82
  },
62
- "author": "",
63
- "license": "MIT",
64
83
  "rnx-kit": {
65
84
  "kitType": "library",
66
85
  "alignDeps": {
67
- "presets": [
68
- "microsoft/react-native"
69
- ],
70
- "requirements": {
71
- "development": [
72
- "react-native@0.74"
73
- ],
74
- "production": [
75
- "react-native@0.73 || 0.74"
76
- ]
77
- },
78
86
  "capabilities": [
79
87
  "babel-preset-react-native",
80
88
  "core",
@@ -83,19 +91,11 @@
83
91
  "core-macos",
84
92
  "core-windows",
85
93
  "react",
86
- "react-test-renderer"
94
+ "react-test-renderer",
95
+ "tools-core",
96
+ "tools-jest"
87
97
  ]
88
- }
89
- },
90
- "peerDependenciesMeta": {
91
- "@office-iss/react-native-win32": {
92
- "optional": true
93
98
  },
94
- "react-native-macos": {
95
- "optional": true
96
- },
97
- "react-native-windows": {
98
- "optional": true
99
- }
99
+ "extends": "@fluentui-react-native/kit-config"
100
100
  }
101
- }
101
+ }
@@ -4,9 +4,7 @@
4
4
  * @format
5
5
  */
6
6
 
7
- import type { HostComponent, ViewProps } from 'react-native';
8
-
9
- import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
7
+ import { requireNativeComponent, type HostComponent, type ViewProps } from 'react-native';
10
8
 
11
9
  export interface NativeProps extends ViewProps {
12
10
  /**
@@ -38,4 +36,4 @@ export interface NativeProps extends ViewProps {
38
36
  forceFocusInsideTrap?: boolean;
39
37
  }
40
38
 
41
- export default codegenNativeComponent<NativeProps>('RCTFocusTrapZone') as HostComponent<NativeProps>;
39
+ export default requireNativeComponent<NativeProps>('RCTFocusTrapZone') as HostComponent<NativeProps>;
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { act } from 'react';
2
3
 
3
4
  import type { IFocusable } from '@fluentui-react-native/interactive-hooks';
4
5
  import * as renderer from 'react-test-renderer';
@@ -6,14 +7,20 @@ import * as renderer from 'react-test-renderer';
6
7
  import { FocusTrapZone } from '..';
7
8
 
8
9
  it('FocusTrapZone default props', () => {
9
- const tree = renderer.create(<FocusTrapZone />).toJSON();
10
- expect(tree).toMatchSnapshot();
10
+ let component: renderer.ReactTestRenderer;
11
+ act(() => {
12
+ component = renderer.create(<FocusTrapZone />);
13
+ });
14
+ expect(component!.toJSON()).toMatchSnapshot();
11
15
  });
12
16
 
13
17
  it('FocusTrapZone all props props', () => {
14
18
  const ref: React.RefObject<IFocusable> = { current: null };
15
- const tree = renderer
16
- .create(<FocusTrapZone componentRef={ref} disableFirstFocus disabled ignoreExternalFocusing focusPreviouslyFocusedInnerElement />)
17
- .toJSON();
18
- expect(tree).toMatchSnapshot();
19
+ let component: renderer.ReactTestRenderer;
20
+ act(() => {
21
+ component = renderer.create(
22
+ <FocusTrapZone componentRef={ref} disableFirstFocus disabled ignoreExternalFocusing focusPreviouslyFocusedInnerElement />,
23
+ );
24
+ });
25
+ expect(component!.toJSON()).toMatchSnapshot();
19
26
  });