@fluentui-react-native/focus-zone 0.22.0 → 0.22.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-zone
2
2
 
3
+ ## 0.22.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.22.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.22.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.22.0
4
40
 
5
41
  ### Minor Changes
@@ -5,8 +5,5 @@
5
5
  */
6
6
  import * as React from 'react';
7
7
  import type { FocusZoneProps, FocusZoneSlotProps } from './FocusZone.types';
8
- export declare const FocusZone: import('@uifabricshared/foundation-composable').IWithComposable<
9
- React.FunctionComponent<FocusZoneProps>,
10
- import('@uifabricshared/foundation-composable').IComposable<FocusZoneProps, FocusZoneSlotProps, {}>
11
- >;
12
- //# sourceMappingURL=FocusZone.d.ts.map
8
+ export declare const FocusZone: import("@uifabricshared/foundation-composable").IWithComposable<React.FunctionComponent<FocusZoneProps>, import("@uifabricshared/foundation-composable").IComposable<FocusZoneProps, FocusZoneSlotProps, {}>>;
9
+ //# sourceMappingURL=FocusZone.d.ts.map
package/lib/FocusZone.js CHANGED
@@ -11,32 +11,34 @@ import { mergeSettings } from '@uifabricshared/foundation-settings';
11
11
  import RCTFocusZone from './FocusZoneNativeComponent';
12
12
  const filterOutComponentRef = (propName) => propName !== 'componentRef';
13
13
  export const FocusZone = composable({
14
- usePrepareProps: (userProps, useStyling) => {
15
- const { componentRef, defaultTabbableElement, isCircularNavigation, ...rest } = userProps;
16
- const ftzRef = useViewCommandFocus(componentRef);
17
- const [targetFirstFocus, setTargetFirstFocus] = React.useState(undefined);
18
- React.useLayoutEffect(() => {
19
- if (typeof defaultTabbableElement === 'string') {
20
- setTargetFirstFocus(defaultTabbableElement);
21
- } else if (defaultTabbableElement?.current) {
22
- setTargetFirstFocus(findNodeHandle(defaultTabbableElement.current));
23
- } else {
24
- setTargetFirstFocus(undefined);
25
- }
26
- }, [defaultTabbableElement]);
27
- return {
28
- slotProps: mergeSettings(useStyling(userProps), {
29
- root: {
30
- navigateAtEnd: isCircularNavigation ? 'NavigateWrap' : 'NavigateStopAtEnds', // let rest override
31
- ...rest,
32
- defaultTabbableElement: targetFirstFocus,
33
- ref: ftzRef,
34
- },
35
- }),
36
- };
37
- },
38
- slots: {
39
- root: { slotType: RCTFocusZone, filter: filterOutComponentRef },
40
- },
14
+ usePrepareProps: (userProps, useStyling) => {
15
+ const { componentRef, defaultTabbableElement, isCircularNavigation, ...rest } = userProps;
16
+ const ftzRef = useViewCommandFocus(componentRef);
17
+ const [targetFirstFocus, setTargetFirstFocus] = React.useState(undefined);
18
+ React.useLayoutEffect(() => {
19
+ if (typeof defaultTabbableElement === 'string') {
20
+ setTargetFirstFocus(defaultTabbableElement);
21
+ }
22
+ else if (defaultTabbableElement?.current) {
23
+ setTargetFirstFocus(findNodeHandle(defaultTabbableElement.current));
24
+ }
25
+ else {
26
+ setTargetFirstFocus(undefined);
27
+ }
28
+ }, [defaultTabbableElement]);
29
+ return {
30
+ slotProps: mergeSettings(useStyling(userProps), {
31
+ root: {
32
+ navigateAtEnd: isCircularNavigation ? 'NavigateWrap' : 'NavigateStopAtEnds', // let rest override
33
+ ...rest,
34
+ defaultTabbableElement: targetFirstFocus,
35
+ ref: ftzRef,
36
+ },
37
+ }),
38
+ };
39
+ },
40
+ slots: {
41
+ root: { slotType: RCTFocusZone, filter: filterOutComponentRef },
42
+ },
41
43
  });
42
- //# sourceMappingURL=FocusZone.js.map
44
+ //# sourceMappingURL=FocusZone.js.map
@@ -2,95 +2,91 @@ 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
  import type { IRenderData } from '@uifabricshared/foundation-composable';
5
- export declare const focusZoneName = 'FocusZone';
5
+ export declare const focusZoneName = "FocusZone";
6
6
  type EmptyInterface = {};
7
7
  export type FocusZoneState = EmptyInterface;
8
8
  export type FocusZoneProps = IViewProps & {
9
- /**
10
- * A RefObject to access the IFocusable interface. Use this to access the public methods and properties of the component.
11
- */
12
- componentRef?: React.RefObject<IFocusable>;
13
- /**
14
- * Optionally defines the initial tabbable element inside the FocusZone
15
- */
16
- defaultTabbableElement?: React.RefObject<React.Component> | string;
17
- /**
18
- ** Defines which arrows to react to
19
- */
20
- focusZoneDirection?: FocusZoneDirection;
21
- /**
22
- ** If set, the FocusZone will not be tabbable and keyboard navigation will be disabled
23
- */
24
- disabled?: boolean;
25
- isCircularNavigation?: boolean;
26
- /**
9
+ /**
10
+ * A RefObject to access the IFocusable interface. Use this to access the public methods and properties of the component.
11
+ */
12
+ componentRef?: React.RefObject<IFocusable>;
13
+ /**
14
+ * Optionally defines the initial tabbable element inside the FocusZone
15
+ */
16
+ defaultTabbableElement?: React.RefObject<React.Component> | string;
17
+ /**
18
+ ** Defines which arrows to react to
19
+ */
20
+ focusZoneDirection?: FocusZoneDirection;
21
+ /**
22
+ ** If set, the FocusZone will not be tabbable and keyboard navigation will be disabled
23
+ */
24
+ disabled?: boolean;
25
+ isCircularNavigation?: boolean;
26
+ /**
27
27
  *Allows for 2D navigation. This navigation strategy takes into account the position of elements
28
28
  on screen, and navigates in the direction the user selects to the nearest element.
29
29
  */
30
- use2DNavigation?: boolean;
31
- /**
32
- * By default, pressing Tab within a FocusZone moves focus out of the FocusZone.
33
- * This prop allows you to change that behavior.
34
- *
35
- * "None" : Default
36
- * "NavigateWrap" : Tab allowed within FZ with circular navigation behavior
37
- * "NavigateStopAtEnds" : Tab allowed within FZ and stops at ends
38
- * "Normal" : Tab allowed within FZ, and focus is not trapped. Tabbing at the last element bring you out of the FZ.
39
- *
40
- * Recommended Usage - Moving focus OUT of the FocusZone - Custom Key Handlers
41
- * Example: Subscribe to key events. On the pressing of "Escape", move focus out of the FocusZone.
42
- *
43
- * Recommended Usage - Moving focus INTO the FocusZone
44
- * Let's take a CardList, for example. If a user is navigating through elements of the List, we don't want
45
- * focus to land within the FocusZone on initial focus. If it does, it will trap focus within the FocusZone and
46
- * ruin the user's workflow.
47
- * Instead, once focus lands on the parent of the FocusZone, implement a custom key handler that will enable
48
- * the FocusZone.
49
- */
50
- tabKeyNavigation?: FocusZoneTabNavigation;
51
- /**
52
- * Callback called when “focus” event triggered in FocusZone
53
- */
54
- onFocus?: (e?: any) => void;
55
- /**
56
- * @platform macos
57
- * By default, the Apple KeyView loop is calculated based on the UI tree hierarchy, accessibility properties,
58
- * custom element overrides of navigation order, and positions in layout.
59
- *
60
- * Normally this produces the appropriate accessible experience for users, but occasionally we may need to
61
- * clarify the intended order of navigation. The navigationOrderInRenderOrder prop will have the FocusZone
62
- * establish the navigation order of its children according to their order in the UI tree
63
- * (i.e. as returned by accessibilityChildren).
64
- *
65
- * Note that to participate in the KeyView loop calculation, the FocusZone itself must be part of the
66
- * accessibility tree (i.e. 'accessible') with an appropriate role, e.g. 'group'.
67
- *
68
- * Extra note: This property is unlikely to perform well if changed from its initial value due to finer details
69
- * of the MacOS KeyView loop mechanics.
70
- */
71
- navigationOrderInRenderOrder?: boolean;
30
+ use2DNavigation?: boolean;
31
+ /**
32
+ * By default, pressing Tab within a FocusZone moves focus out of the FocusZone.
33
+ * This prop allows you to change that behavior.
34
+ *
35
+ * "None" : Default
36
+ * "NavigateWrap" : Tab allowed within FZ with circular navigation behavior
37
+ * "NavigateStopAtEnds" : Tab allowed within FZ and stops at ends
38
+ * "Normal" : Tab allowed within FZ, and focus is not trapped. Tabbing at the last element bring you out of the FZ.
39
+ *
40
+ * Recommended Usage - Moving focus OUT of the FocusZone - Custom Key Handlers
41
+ * Example: Subscribe to key events. On the pressing of "Escape", move focus out of the FocusZone.
42
+ *
43
+ * Recommended Usage - Moving focus INTO the FocusZone
44
+ * Let's take a CardList, for example. If a user is navigating through elements of the List, we don't want
45
+ * focus to land within the FocusZone on initial focus. If it does, it will trap focus within the FocusZone and
46
+ * ruin the user's workflow.
47
+ * Instead, once focus lands on the parent of the FocusZone, implement a custom key handler that will enable
48
+ * the FocusZone.
49
+ */
50
+ tabKeyNavigation?: FocusZoneTabNavigation;
51
+ /**
52
+ * Callback called when “focus” event triggered in FocusZone
53
+ */
54
+ onFocus?: (e?: any) => void;
55
+ /**
56
+ * @platform macos
57
+ * By default, the Apple KeyView loop is calculated based on the UI tree hierarchy, accessibility properties,
58
+ * custom element overrides of navigation order, and positions in layout.
59
+ *
60
+ * Normally this produces the appropriate accessible experience for users, but occasionally we may need to
61
+ * clarify the intended order of navigation. The navigationOrderInRenderOrder prop will have the FocusZone
62
+ * establish the navigation order of its children according to their order in the UI tree
63
+ * (i.e. as returned by accessibilityChildren).
64
+ *
65
+ * Note that to participate in the KeyView loop calculation, the FocusZone itself must be part of the
66
+ * accessibility tree (i.e. 'accessible') with an appropriate role, e.g. 'group'.
67
+ *
68
+ * Extra note: This property is unlikely to perform well if changed from its initial value due to finer details
69
+ * of the MacOS KeyView loop mechanics.
70
+ */
71
+ navigationOrderInRenderOrder?: boolean;
72
72
  };
73
73
  export interface NativeProps extends Omit<FocusZoneProps, 'isCircularNavigation'> {
74
- navigateAtEnd?: NavigateAtEnd;
75
- tabKeyNavigation?: FocusZoneTabNavigation;
74
+ navigateAtEnd?: NavigateAtEnd;
75
+ tabKeyNavigation?: FocusZoneTabNavigation;
76
76
  }
77
- export type FocusZoneDirection =
78
- | 'bidirectional' /** React to all arrows. */
79
- | 'vertical' /** Only react to up/down arrows. */
80
- | 'horizontal' /** Only react to left/right arrows. */
81
- | 'none'; /** Doesn't respond to any arrow keys. */
77
+ export type FocusZoneDirection = 'bidirectional' /** React to all arrows. */ | 'vertical' /** Only react to up/down arrows. */ | 'horizontal' /** Only react to left/right arrows. */ | 'none'; /** Doesn't respond to any arrow keys. */
82
78
  export type NavigateAtEnd = 'NavigateStopAtEnds' | 'NavigateWrap' | 'NavigateContinue';
83
79
  export type FocusZoneTabNavigation = 'None' | 'NavigateWrap' | 'NavigateStopAtEnds' | 'Normal';
84
80
  export type FocusZoneTokens = EmptyInterface;
85
81
  export interface FocusZoneSlotProps {
86
- root: NativeProps;
82
+ root: NativeProps;
87
83
  }
88
84
  export type FocusZoneRenderData = IRenderData<FocusZoneSlotProps, FocusZoneState>;
89
85
  export interface FocusZoneType {
90
- props: FocusZoneProps;
91
- tokens: FocusZoneTokens;
92
- slotProps: FocusZoneSlotProps;
93
- state: FocusZoneState;
86
+ props: FocusZoneProps;
87
+ tokens: FocusZoneTokens;
88
+ slotProps: FocusZoneSlotProps;
89
+ state: FocusZoneState;
94
90
  }
95
91
  export {};
96
- //# sourceMappingURL=FocusZone.types.d.ts.map
92
+ //# sourceMappingURL=FocusZone.types.d.ts.map
@@ -1,2 +1,2 @@
1
1
  export const focusZoneName = 'FocusZone';
2
- //# sourceMappingURL=FocusZone.types.js.map
2
+ //# sourceMappingURL=FocusZone.types.js.map
@@ -1,20 +1,14 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- * @format
5
- */
6
1
  import type { ViewProps } from 'react-native';
7
- import type { WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
8
- import type { UnsafeMixed } from './codegenTypes';
2
+ import type { WithDefault, UnsafeMixed } from 'react-native/Libraries/Types/CodegenTypes';
9
3
  export interface NativeProps extends ViewProps {
10
- navigateAtEnd?: WithDefault<'NavigateStopAtEnds' | 'NavigateWrap' | 'NavigateContinue', 'NavigateStopAtEnds'>;
11
- defaultTabbableElement?: UnsafeMixed;
12
- focusZoneDirection?: WithDefault<'bidirectional' | 'vertical' | 'horizontal' | 'none', 'bidirectional'>;
13
- use2DNavigation?: boolean;
14
- tabKeyNavigation?: WithDefault<'None' | 'NavigateWrap' | 'NavigateStopAtEnds' | 'Normal', 'None'>;
15
- disabled?: boolean;
16
- isTabNavigation?: boolean;
4
+ navigateAtEnd?: WithDefault<'NavigateStopAtEnds' | 'NavigateWrap' | 'NavigateContinue', 'NavigateStopAtEnds'>;
5
+ defaultTabbableElement?: UnsafeMixed;
6
+ focusZoneDirection?: WithDefault<'bidirectional' | 'vertical' | 'horizontal' | 'none', 'bidirectional'>;
7
+ use2DNavigation?: boolean;
8
+ tabKeyNavigation?: WithDefault<'None' | 'NavigateWrap' | 'NavigateStopAtEnds' | 'Normal', 'None'>;
9
+ disabled?: boolean;
10
+ isTabNavigation?: boolean;
17
11
  }
18
- declare const _default: import('react-native').HostComponent<NativeProps>;
12
+ declare const _default: import("react-native/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
19
13
  export default _default;
20
- //# sourceMappingURL=FocusZoneNativeComponent.d.ts.map
14
+ //# sourceMappingURL=FocusZoneNativeComponent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FocusZoneNativeComponent.d.ts","sourceRoot":"","sources":["../src/FocusZoneNativeComponent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAG7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,aAAa,CAAC,EAAE,WAAW,CAAC,oBAAoB,GAAG,cAAc,GAAG,kBAAkB,EAAE,oBAAoB,CAAC,CAAC;IAC9G,sBAAsB,CAAC,EAAE,WAAW,CAAC;IACrC,kBAAkB,CAAC,EAAE,WAAW,CAAC,eAAe,GAAG,UAAU,GAAG,YAAY,GAAG,MAAM,EAAE,eAAe,CAAC,CAAC;IACxG,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,WAAW,CAAC,MAAM,GAAG,cAAc,GAAG,oBAAoB,GAAG,QAAQ,EAAE,MAAM,CAAC,CAAC;IAClG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;;AAED,wBAAmE"}
1
+ {"version":3,"file":"FocusZoneNativeComponent.d.ts","sourceRoot":"","sources":["../src/FocusZoneNativeComponent.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAK1F,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,aAAa,CAAC,EAAE,WAAW,CAAC,oBAAoB,GAAG,cAAc,GAAG,kBAAkB,EAAE,oBAAoB,CAAC,CAAC;IAC9G,sBAAsB,CAAC,EAAE,WAAW,CAAC;IACrC,kBAAkB,CAAC,EAAE,WAAW,CAAC,eAAe,GAAG,UAAU,GAAG,YAAY,GAAG,MAAM,EAAE,eAAe,CAAC,CAAC;IACxG,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,WAAW,CAAC,MAAM,GAAG,cAAc,GAAG,oBAAoB,GAAG,QAAQ,EAAE,MAAM,CAAC,CAAC;IAClG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;;AAED,wBAAmE"}
@@ -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('RCTFocusZone');
8
- //# sourceMappingURL=FocusZoneNativeComponent.js.map
6
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
7
+ export default codegenNativeComponent('RCTFocusZone');
8
+ //# sourceMappingURL=FocusZoneNativeComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FocusZoneNativeComponent.js","sourceRoot":"","sources":["../src/FocusZoneNativeComponent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAgBtD,eAAe,sBAAsB,CAAc,cAAc,CAAC,CAAC"}
1
+ {"version":3,"file":"FocusZoneNativeComponent.js","sourceRoot":"","sources":["../src/FocusZoneNativeComponent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,sBAAsB,MAAM,yDAAyD,CAAC;AAkB7F,eAAe,sBAAsB,CAAc,cAAc,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=FocusZone.test.d.ts.map
2
+ //# sourceMappingURL=FocusZone.test.d.ts.map
@@ -1,153 +1,99 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from 'react/jsx-runtime';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { act } from 'react';
3
3
  import { Button } from 'react-native';
4
4
  import * as renderer from 'react-test-renderer';
5
5
  import { FocusZone } from '..';
6
6
  const onPress = () => {
7
- return;
7
+ return;
8
8
  };
9
9
  describe('FocusZone No Props', () => {
10
- it('No children', () => {
11
- let component;
12
- act(() => {
13
- component = renderer.create(_jsx(FocusZone, {}));
10
+ it('No children', () => {
11
+ let component;
12
+ act(() => {
13
+ component = renderer.create(_jsx(FocusZone, {}));
14
+ });
15
+ expect(component.toJSON()).toMatchSnapshot();
14
16
  });
15
- expect(component.toJSON()).toMatchSnapshot();
16
- });
17
- it('One child', () => {
18
- let component;
19
- act(() => {
20
- component = renderer.create(_jsx(FocusZone, { children: _jsx(Button, { title: 'button', onPress: onPress }) }));
17
+ it('One child', () => {
18
+ let component;
19
+ act(() => {
20
+ component = renderer.create(_jsx(FocusZone, { children: _jsx(Button, { title: "button", onPress: onPress }) }));
21
+ });
22
+ expect(component.toJSON()).toMatchSnapshot();
21
23
  });
22
- expect(component.toJSON()).toMatchSnapshot();
23
- });
24
- it('Two children', () => {
25
- let component;
26
- act(() => {
27
- component = renderer.create(
28
- _jsxs(FocusZone, {
29
- children: [_jsx(Button, { title: 'button', onPress: onPress }), _jsx(Button, { title: 'button', onPress: onPress })],
30
- }),
31
- );
24
+ it('Two children', () => {
25
+ let component;
26
+ act(() => {
27
+ component = renderer.create(_jsxs(FocusZone, { children: [
28
+ _jsx(Button, { title: "button", onPress: onPress }), _jsx(Button, { title: "button", onPress: onPress })
29
+ ] }));
30
+ });
31
+ expect(component.toJSON()).toMatchSnapshot();
32
32
  });
33
- expect(component.toJSON()).toMatchSnapshot();
34
- });
35
- it('Three children', () => {
36
- let component;
37
- act(() => {
38
- component = renderer.create(
39
- _jsxs(FocusZone, {
40
- children: [
41
- _jsx(Button, { title: 'button', onPress: onPress }),
42
- _jsx(Button, { title: 'button', onPress: onPress }),
43
- _jsx(Button, { title: 'button', onPress: onPress }),
44
- ],
45
- }),
46
- );
33
+ it('Three children', () => {
34
+ let component;
35
+ act(() => {
36
+ component = renderer.create(_jsxs(FocusZone, { children: [
37
+ _jsx(Button, { title: "button", onPress: onPress }), _jsx(Button, { title: "button", onPress: onPress }), _jsx(Button, { title: "button", onPress: onPress })
38
+ ] }));
39
+ });
40
+ expect(component.toJSON()).toMatchSnapshot();
47
41
  });
48
- expect(component.toJSON()).toMatchSnapshot();
49
- });
50
42
  });
51
43
  describe('FocusZone With Props', () => {
52
- it('defaultTabbableElement Prop', () => {
53
- let component;
54
- act(() => {
55
- component = renderer.create(
56
- _jsxs(FocusZone, {
57
- defaultTabbableElement: null,
58
- children: [
59
- _jsx(Button, { title: 'button', onPress: onPress }),
60
- _jsx(Button, { title: 'button', onPress: onPress }),
61
- _jsx(Button, { title: 'button', onPress: onPress }),
62
- ],
63
- }),
64
- );
44
+ it('defaultTabbableElement Prop', () => {
45
+ let component;
46
+ act(() => {
47
+ component = renderer.create(_jsxs(FocusZone, { defaultTabbableElement: null, children: [
48
+ _jsx(Button, { title: "button", onPress: onPress }), _jsx(Button, { title: "button", onPress: onPress }), _jsx(Button, { title: "button", onPress: onPress })
49
+ ] }));
50
+ });
51
+ expect(component.toJSON()).toMatchSnapshot();
65
52
  });
66
- expect(component.toJSON()).toMatchSnapshot();
67
- });
68
- it('focusZoneDirection Prop', () => {
69
- let component;
70
- act(() => {
71
- component = renderer.create(
72
- _jsxs(FocusZone, {
73
- focusZoneDirection: 'bidirectional',
74
- children: [
75
- _jsx(Button, { title: 'button', onPress: onPress }),
76
- _jsx(Button, { title: 'button', onPress: onPress }),
77
- _jsx(Button, { title: 'button', onPress: onPress }),
78
- ],
79
- }),
80
- );
53
+ it('focusZoneDirection Prop', () => {
54
+ let component;
55
+ act(() => {
56
+ component = renderer.create(_jsxs(FocusZone, { focusZoneDirection: "bidirectional", children: [
57
+ _jsx(Button, { title: "button", onPress: onPress }), _jsx(Button, { title: "button", onPress: onPress }), _jsx(Button, { title: "button", onPress: onPress })
58
+ ] }));
59
+ });
60
+ expect(component.toJSON()).toMatchSnapshot();
81
61
  });
82
- expect(component.toJSON()).toMatchSnapshot();
83
- });
84
- it('disabled Prop', () => {
85
- let component;
86
- act(() => {
87
- component = renderer.create(
88
- _jsxs(FocusZone, {
89
- disabled: true,
90
- children: [
91
- _jsx(Button, { title: 'button', onPress: onPress }),
92
- _jsx(Button, { title: 'button', onPress: onPress }),
93
- _jsx(Button, { title: 'button', onPress: onPress }),
94
- ],
95
- }),
96
- );
62
+ it('disabled Prop', () => {
63
+ let component;
64
+ act(() => {
65
+ component = renderer.create(_jsxs(FocusZone, { disabled: true, children: [
66
+ _jsx(Button, { title: "button", onPress: onPress }), _jsx(Button, { title: "button", onPress: onPress }), _jsx(Button, { title: "button", onPress: onPress })
67
+ ] }));
68
+ });
69
+ expect(component.toJSON()).toMatchSnapshot();
97
70
  });
98
- expect(component.toJSON()).toMatchSnapshot();
99
- });
100
- it('isCircularNavigation Prop', () => {
101
- let component;
102
- act(() => {
103
- component = renderer.create(
104
- _jsxs(FocusZone, {
105
- isCircularNavigation: true,
106
- children: [
107
- _jsx(Button, { title: 'button', onPress: onPress }),
108
- _jsx(Button, { title: 'button', onPress: onPress }),
109
- _jsx(Button, { title: 'button', onPress: onPress }),
110
- ],
111
- }),
112
- );
71
+ it('isCircularNavigation Prop', () => {
72
+ let component;
73
+ act(() => {
74
+ component = renderer.create(_jsxs(FocusZone, { isCircularNavigation: true, children: [
75
+ _jsx(Button, { title: "button", onPress: onPress }), _jsx(Button, { title: "button", onPress: onPress }), _jsx(Button, { title: "button", onPress: onPress })
76
+ ] }));
77
+ });
78
+ expect(component.toJSON()).toMatchSnapshot();
113
79
  });
114
- expect(component.toJSON()).toMatchSnapshot();
115
- });
116
- it('use2DNavigation Prop', () => {
117
- let component;
118
- act(() => {
119
- component = renderer.create(
120
- _jsxs(FocusZone, {
121
- use2DNavigation: true,
122
- children: [
123
- _jsx(Button, { title: 'button', onPress: onPress }),
124
- _jsx(Button, { title: 'button', onPress: onPress }),
125
- _jsx(Button, { title: 'button', onPress: onPress }),
126
- ],
127
- }),
128
- );
80
+ it('use2DNavigation Prop', () => {
81
+ let component;
82
+ act(() => {
83
+ component = renderer.create(_jsxs(FocusZone, { use2DNavigation: true, children: [
84
+ _jsx(Button, { title: "button", onPress: onPress }), _jsx(Button, { title: "button", onPress: onPress }), _jsx(Button, { title: "button", onPress: onPress })
85
+ ] }));
86
+ });
87
+ expect(component.toJSON()).toMatchSnapshot();
129
88
  });
130
- expect(component.toJSON()).toMatchSnapshot();
131
- });
132
- it('All Props', () => {
133
- let component;
134
- act(() => {
135
- component = renderer.create(
136
- _jsxs(FocusZone, {
137
- disabled: false,
138
- use2DNavigation: true,
139
- defaultTabbableElement: null,
140
- isCircularNavigation: false,
141
- focusZoneDirection: 'vertical',
142
- children: [
143
- _jsx(Button, { title: 'button', onPress: onPress }),
144
- _jsx(Button, { title: 'button', onPress: onPress }),
145
- _jsx(Button, { title: 'button', onPress: onPress }),
146
- ],
147
- }),
148
- );
89
+ it('All Props', () => {
90
+ let component;
91
+ act(() => {
92
+ component = renderer.create(_jsxs(FocusZone, { disabled: false, use2DNavigation: true, defaultTabbableElement: null, isCircularNavigation: false, focusZoneDirection: "vertical", children: [
93
+ _jsx(Button, { title: "button", onPress: onPress }), _jsx(Button, { title: "button", onPress: onPress }), _jsx(Button, { title: "button", onPress: onPress })
94
+ ] }));
95
+ });
96
+ expect(component.toJSON()).toMatchSnapshot();
149
97
  });
150
- expect(component.toJSON()).toMatchSnapshot();
151
- });
152
98
  });
153
- //# sourceMappingURL=FocusZone.test.js.map
99
+ //# sourceMappingURL=FocusZone.test.js.map
package/lib/index.d.ts CHANGED
@@ -1,15 +1,4 @@
1
1
  export { focusZoneName } from './FocusZone.types';
2
- export type {
3
- FocusZoneDirection,
4
- FocusZoneProps,
5
- FocusZoneRenderData,
6
- FocusZoneSlotProps,
7
- FocusZoneState,
8
- FocusZoneTabNavigation,
9
- FocusZoneTokens,
10
- FocusZoneType,
11
- NativeProps,
12
- NavigateAtEnd,
13
- } from './FocusZone.types';
2
+ export type { FocusZoneDirection, FocusZoneProps, FocusZoneRenderData, FocusZoneSlotProps, FocusZoneState, FocusZoneTabNavigation, FocusZoneTokens, FocusZoneType, NativeProps, NavigateAtEnd, } from './FocusZone.types';
14
3
  export { FocusZone } from './FocusZone';
15
- //# sourceMappingURL=index.d.ts.map
4
+ //# sourceMappingURL=index.d.ts.map
package/lib/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export { focusZoneName } from './FocusZone.types';
2
2
  export { FocusZone } from './FocusZone';
3
- //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -5,8 +5,5 @@
5
5
  */
6
6
  import * as React from 'react';
7
7
  import type { FocusZoneProps, FocusZoneSlotProps } from './FocusZone.types';
8
- export declare const FocusZone: import('@uifabricshared/foundation-composable').IWithComposable<
9
- React.FunctionComponent<FocusZoneProps>,
10
- import('@uifabricshared/foundation-composable').IComposable<FocusZoneProps, FocusZoneSlotProps, {}>
11
- >;
12
- //# sourceMappingURL=FocusZone.d.ts.map
8
+ export declare const FocusZone: import("@uifabricshared/foundation-composable").IWithComposable<React.FunctionComponent<FocusZoneProps>, import("@uifabricshared/foundation-composable").IComposable<FocusZoneProps, FocusZoneSlotProps, {}>>;
9
+ //# sourceMappingURL=FocusZone.d.ts.map