@fluentui-react-native/tooltip 0.4.28 → 0.5.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 (49) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/SPEC.md +1 -1
  3. package/lib/Tooltip.d.ts +2 -2
  4. package/lib/Tooltip.d.ts.map +1 -1
  5. package/lib/Tooltip.js +23 -24
  6. package/lib/Tooltip.js.map +1 -1
  7. package/lib/Tooltip.types.d.ts +40 -37
  8. package/lib/Tooltip.types.d.ts.map +1 -1
  9. package/lib/Tooltip.types.js +1 -1
  10. package/lib/TooltipNativeComponent.d.ts +3 -5
  11. package/lib/TooltipNativeComponent.d.ts.map +1 -1
  12. package/lib/TooltipNativeComponent.js +1 -1
  13. package/lib/TooltipNativeComponent.js.map +1 -1
  14. package/lib/TooltipNativeComponent.win32.d.ts +5 -0
  15. package/lib/TooltipNativeComponent.win32.d.ts.map +1 -0
  16. package/lib/TooltipNativeComponent.win32.js +3 -0
  17. package/lib/TooltipNativeComponent.win32.js.map +1 -0
  18. package/lib/__tests__/Tooltip.test.d.ts +1 -1
  19. package/lib/__tests__/Tooltip.test.js +10 -8
  20. package/lib/__tests__/Tooltip.test.js.map +1 -1
  21. package/lib/index.d.ts +1 -1
  22. package/lib/index.js +1 -1
  23. package/lib-commonjs/Tooltip.d.ts +2 -2
  24. package/lib-commonjs/Tooltip.d.ts.map +1 -1
  25. package/lib-commonjs/Tooltip.js +88 -56
  26. package/lib-commonjs/Tooltip.js.map +1 -1
  27. package/lib-commonjs/Tooltip.types.d.ts +40 -37
  28. package/lib-commonjs/Tooltip.types.d.ts.map +1 -1
  29. package/lib-commonjs/Tooltip.types.js +3 -3
  30. package/lib-commonjs/TooltipNativeComponent.d.ts +3 -5
  31. package/lib-commonjs/TooltipNativeComponent.d.ts.map +1 -1
  32. package/lib-commonjs/TooltipNativeComponent.js +9 -7
  33. package/lib-commonjs/TooltipNativeComponent.js.map +1 -1
  34. package/lib-commonjs/TooltipNativeComponent.win32.d.ts +5 -0
  35. package/lib-commonjs/TooltipNativeComponent.win32.d.ts.map +1 -0
  36. package/lib-commonjs/TooltipNativeComponent.win32.js +5 -0
  37. package/lib-commonjs/TooltipNativeComponent.win32.js.map +1 -0
  38. package/lib-commonjs/__tests__/Tooltip.test.d.ts +1 -1
  39. package/lib-commonjs/__tests__/Tooltip.test.js +70 -36
  40. package/lib-commonjs/__tests__/Tooltip.test.js.map +1 -1
  41. package/lib-commonjs/index.d.ts +1 -1
  42. package/lib-commonjs/index.js +17 -7
  43. package/lib-commonjs/index.js.map +1 -1
  44. package/package.json +57 -61
  45. package/src/Tooltip.tsx +5 -5
  46. package/src/Tooltip.types.ts +5 -1
  47. package/src/TooltipNativeComponent.ts +2 -5
  48. package/src/TooltipNativeComponent.win32.ts +6 -0
  49. package/src/__tests__/Tooltip.test.tsx +7 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # Change Log - @fluentui-react-native/tooltip
2
2
 
3
+ ## 0.5.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
+ - @fluentui-react-native/callout@0.28.0
38
+ - @fluentui-react-native/framework-base@0.3.0
39
+
3
40
  <!-- This log was last generated on Tue, 05 Aug 2025 18:50:38 GMT and should not be manually modified. -->
4
41
 
5
42
  <!-- Start content -->
package/SPEC.md CHANGED
@@ -16,7 +16,7 @@ const tooltip = (
16
16
  );
17
17
  ```
18
18
 
19
- More examples on the [Test pages for Tooltip](../../../apps/fluent-tester/src/TestComponents/Tooltip). Instructions on running the tester app can be found [here](../../../apps/fluent-tester/README.md).
19
+ More examples on the [Test pages for Tooltip](../../../apps/tester-core/src/TestComponents/Tooltip). Instructions on running the tester app can be found [here](../../../apps/fluent-tester/README.md).
20
20
 
21
21
  ## Visual Examples
22
22
 
package/lib/Tooltip.d.ts CHANGED
@@ -4,6 +4,6 @@
4
4
  * @format
5
5
  */
6
6
  import type { TooltipProps } from './Tooltip.types';
7
- export declare const Tooltip: import("@fluentui-react-native/framework").ComposableFunction<TooltipProps>;
7
+ export declare const Tooltip: import('@fluentui-react-native/framework-base').FunctionComponent<TooltipProps>;
8
8
  export default Tooltip;
9
- //# sourceMappingURL=Tooltip.d.ts.map
9
+ //# sourceMappingURL=Tooltip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../src/Tooltip.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAIpD,eAAO,MAAM,OAAO,6EA2BlB,CAAC;AAIH,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../src/Tooltip.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAIpD,eAAO,MAAM,OAAO,iFA4BlB,CAAC;AAIH,eAAe,OAAO,CAAC"}
package/lib/Tooltip.js CHANGED
@@ -1,36 +1,35 @@
1
+ import { jsx as _jsx } from 'react/jsx-runtime';
1
2
  /**
2
3
  * Copyright (c) Microsoft Corporation.
3
4
  * Licensed under the MIT License.
4
5
  * @format
5
6
  */
6
- /** @jsxRuntime classic */
7
7
  import * as React from 'react';
8
8
  import { findNodeHandle } from 'react-native';
9
- import { mergeProps, stagedComponent } from '@fluentui-react-native/framework';
9
+ import { mergeProps, phasedComponent, directComponent } from '@fluentui-react-native/framework-base';
10
10
  import { tooltipName } from './Tooltip.types';
11
11
  import NativeTooltipView from './TooltipNativeComponent';
12
- export const Tooltip = stagedComponent((props) => {
13
- const { target } = props;
14
- const [nativeTarget, setNativeTarget] = React.useState(null);
15
- React.useLayoutEffect(() => {
16
- if (typeof target === 'string') {
17
- // Pass string type `target` directly
18
- setNativeTarget(target);
19
- }
20
- else if (target?.current) {
21
- // Pass the tagID for a valid ref `target`
22
- setNativeTarget(findNodeHandle(target.current));
23
- }
24
- else {
25
- // Clear `target` so we may fall back on `anchorRect` if provided
26
- setNativeTarget(null);
27
- }
28
- }, [target]);
29
- const TooltipComponent = (rest, children) => {
30
- return (React.createElement(NativeTooltipView, { ...(nativeTarget && { target: nativeTarget }), ...mergeProps(props, rest) }, children));
31
- };
32
- return TooltipComponent;
12
+ export const Tooltip = phasedComponent((props) => {
13
+ const { target } = props;
14
+ const [nativeTarget, setNativeTarget] = React.useState(null);
15
+ React.useLayoutEffect(() => {
16
+ if (typeof target === 'string') {
17
+ // Pass string type `target` directly
18
+ setNativeTarget(target);
19
+ } else if (target?.current) {
20
+ // Pass the tagID for a valid ref `target`
21
+ setNativeTarget(findNodeHandle(target.current));
22
+ } else {
23
+ // Clear `target` so we may fall back on `anchorRect` if provided
24
+ setNativeTarget(null);
25
+ }
26
+ }, [target]);
27
+ const TooltipComponent = directComponent((innerProps) => {
28
+ const { children, ...rest } = innerProps;
29
+ return _jsx(NativeTooltipView, { ...(nativeTarget && { target: nativeTarget }), ...mergeProps(props, rest), children: children });
30
+ });
31
+ return TooltipComponent;
33
32
  });
34
33
  Tooltip.displayName = tooltipName;
35
34
  export default Tooltip;
36
- //# sourceMappingURL=Tooltip.js.map
35
+ //# sourceMappingURL=Tooltip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../src/Tooltip.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,0BAA0B;AAC1B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAG/E,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,iBAAiB,MAAM,0BAA0B,CAAC;AAEzD,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC,CAAC,KAAmB,EAAE,EAAE;IAC7D,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAEzB,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAyB,IAAI,CAAC,CAAC;IAErF,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE;QACzB,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;YAC9B,qCAAqC;YACrC,eAAe,CAAC,MAAM,CAAC,CAAC;SACzB;aAAM,IAAI,MAAM,EAAE,OAAO,EAAE;YAC1B,0CAA0C;YAC1C,eAAe,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;SACjD;aAAM;YACL,iEAAiE;YACjE,eAAe,CAAC,IAAI,CAAC,CAAC;SACvB;IACH,C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AC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;QAClD,CAAC;aAAM,CAAC;YACN,iEAAiE;YACjE,eAAe,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC;IAAA,CACF,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,MAAM,gBAAgB,GAAG,eAAe,CAAe,CAAC,UAAwB,EAAE,EAAE,CAAC;QACnF,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,UAAU,CAAC;QACzC,OAAO,CACL,KAAC,iBAAiB,OAAK,CAAC,YAAY,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,KAAM,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,YAC3F,QAAQ,GACS,CACrB,CAAC;IAAA,CACH,CAAC,CAAC;IAEH,OAAO,gBAAgB,CAAC;AAAA,CACzB,CAAC,CAAC;AAEH,OAAO,CAAC,WAAW,GAAG,WAAW,CAAC;AAElC,eAAe,OAAO,CAAC"}
@@ -1,45 +1,48 @@
1
1
  import type * as React from 'react';
2
- import type { ViewStyle } from 'react-native';
2
+ import type { ViewStyle, ViewProps } from 'react-native';
3
3
  import type { DirectionalHint } from '@fluentui-react-native/callout';
4
- export declare const tooltipName = "Tooltip";
4
+ export declare const tooltipName = 'Tooltip';
5
5
  export type TooltipProps = React.PropsWithChildren<{
6
- /**
7
- * The text of the tooltip.
8
- */
9
- content: string;
10
- /**
11
- * Notification when the visibility of the tooltip is changed.
12
- */
13
- onVisibleChange?: (event: any, data: any) => void;
14
- /**
15
- * Positioning of the tooltip relative to the target element.
16
- *
17
- * @default topCenter
18
- */
19
- positioning?: DirectionalHint;
20
- /**
21
- * Allow consumers to pass in Style props
22
- */
23
- style?: ViewStyle;
24
- /**
25
- * Target anchor that tooltip uses for relative positioning. Certain components may proffer a string as an anchor target, such as
26
- * anchoring to a point inside the component.
27
- *
28
- * If not provided, will anchor to the wrapper element.
29
- */
30
- target?: React.RefObject<React.Component> | string;
31
- /**
32
- * Controls the tooltip visibility and can be used in conjunction with onVisibleChange to modify show/hide behavior. If not provided, will be updated based on hover/focus events on target element.
33
- *
34
- * @default false
35
- */
36
- visible?: boolean;
6
+ /**
7
+ * The text of the tooltip.
8
+ */
9
+ content: string;
10
+ /**
11
+ * Notification when the visibility of the tooltip is changed.
12
+ */
13
+ onVisibleChange?: (event: any, data: any) => void;
14
+ /**
15
+ * Positioning of the tooltip relative to the target element.
16
+ *
17
+ * @default topCenter
18
+ */
19
+ positioning?: DirectionalHint;
20
+ /**
21
+ * Allow consumers to pass in Style props
22
+ */
23
+ style?: ViewStyle;
24
+ /**
25
+ * Target anchor that tooltip uses for relative positioning. Certain components may proffer a string as an anchor target, such as
26
+ * anchoring to a point inside the component.
27
+ *
28
+ * If not provided, will anchor to the wrapper element.
29
+ */
30
+ target?: React.RefObject<React.Component> | string;
31
+ /**
32
+ * Controls the tooltip visibility and can be used in conjunction with onVisibleChange to modify show/hide behavior. If not provided, will be updated based on hover/focus events on target element.
33
+ *
34
+ * @default false
35
+ */
36
+ visible?: boolean;
37
37
  }>;
38
38
  export interface TooltipSlotProps {
39
- root: TooltipProps;
39
+ root: TooltipProps;
40
40
  }
41
41
  export interface TooltipType {
42
- props: TooltipProps;
43
- slotProps: TooltipSlotProps;
42
+ props: TooltipProps;
43
+ slotProps: TooltipSlotProps;
44
44
  }
45
- //# sourceMappingURL=Tooltip.types.d.ts.map
45
+ export interface NativeProps extends ViewProps {
46
+ content?: string;
47
+ }
48
+ //# sourceMappingURL=Tooltip.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.types.d.ts","sourceRoot":"","sources":["../src/Tooltip.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEtE,eAAO,MAAM,WAAW,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;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC;IAEnD;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC,CAAC;AAEH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,YAAY,CAAC;IACpB,SAAS,EAAE,gBAAgB,CAAC;CAC7B;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -1,2 +1,2 @@
1
1
  export const tooltipName = 'Tooltip';
2
- //# sourceMappingURL=Tooltip.types.js.map
2
+ //# sourceMappingURL=Tooltip.types.js.map
@@ -3,10 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  * @format
5
5
  */
6
- import type { HostComponent, ViewProps } from 'react-native';
7
- export interface NativeProps extends ViewProps {
8
- content?: string;
9
- }
6
+ import type { HostComponent } from 'react-native';
7
+ import type { NativeProps } from './Tooltip.types';
10
8
  declare const _default: HostComponent<NativeProps>;
11
9
  export default _default;
12
- //# sourceMappingURL=TooltipNativeComponent.d.ts.map
10
+ //# sourceMappingURL=TooltipNativeComponent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TooltipNativeComponent.d.ts","sourceRoot":"","sources":["../src/TooltipNativeComponent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI7D,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;;AAED,wBAA+F"}
1
+ {"version":3,"file":"TooltipNativeComponent.d.ts","sourceRoot":"","sources":["../src/TooltipNativeComponent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;;AAInD,wBAA+F"}
@@ -5,4 +5,4 @@
5
5
  */
6
6
  import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
7
7
  export default codegenNativeComponent('RCTTooltip');
8
- //# sourceMappingURL=TooltipNativeComponent.js.map
8
+ //# sourceMappingURL=TooltipNativeComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TooltipNativeComponent.js","sourceRoot":"","sources":["../src/TooltipNativeComponent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,sBAAsB,MAAM,yDAAyD,CAAC;AAM7F,eAAe,sBAAsB,CAAc,YAAY,CAA+B,CAAC"}
1
+ {"version":3,"file":"TooltipNativeComponent.js","sourceRoot":"","sources":["../src/TooltipNativeComponent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,sBAAsB,MAAM,yDAAyD,CAAC;AAE7F,eAAe,sBAAsB,CAAc,YAAY,CAA+B,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { HostComponent } from 'react-native';
2
+ import type { NativeProps } from './Tooltip.types';
3
+ declare const _default: HostComponent<NativeProps>;
4
+ export default _default;
5
+ //# sourceMappingURL=TooltipNativeComponent.win32.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TooltipNativeComponent.win32.d.ts","sourceRoot":"","sources":["../src/TooltipNativeComponent.win32.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;;AAInD,wBAA+F"}
@@ -0,0 +1,3 @@
1
+ import { requireNativeComponent } from 'react-native';
2
+ export default requireNativeComponent('RCTTooltip');
3
+ //# sourceMappingURL=TooltipNativeComponent.win32.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TooltipNativeComponent.win32.js","sourceRoot":"","sources":["../src/TooltipNativeComponent.win32.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEtD,eAAe,sBAAsB,CAAc,YAAY,CAA+B,CAAC"}
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=Tooltip.test.d.ts.map
2
+ //# sourceMappingURL=Tooltip.test.d.ts.map
@@ -1,14 +1,16 @@
1
- import * as React from 'react';
1
+ import { jsx as _jsx } from 'react/jsx-runtime';
2
2
  import { ButtonV1 } from '@fluentui-react-native/button';
3
3
  import * as renderer from 'react-test-renderer';
4
+ import { act } from 'react';
4
5
  import { Tooltip } from '../Tooltip';
5
6
  describe('Tooltip component tests', () => {
6
- it('Tooltip default', () => {
7
- const tree = renderer
8
- .create(React.createElement(Tooltip, { content: "Your component" },
9
- React.createElement(ButtonV1, null, "Your component")))
10
- .toJSON();
11
- expect(tree).toMatchSnapshot();
7
+ it('Tooltip default', () => {
8
+ let component;
9
+ act(() => {
10
+ component = renderer.create(_jsx(Tooltip, { content: 'Your component', children: _jsx(ButtonV1, { children: 'Your component' }) }));
12
11
  });
12
+ const tree = component.toJSON();
13
+ expect(tree).toMatchSnapshot();
14
+ });
13
15
  });
14
- //# sourceMappingURL=Tooltip.test.js.map
16
+ //# sourceMappingURL=Tooltip.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.test.js","sourceRoot":"","sources":["../../src/__tests__/Tooltip.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;QACzB,MAAM,IAAI,GAAG,QAAQ;aAClB,MAAM,CACL,oBAAC,OAAO,IAAC,OAAO,EAAC,gBAAgB;YAC/B,oBAAC,QAAQ,yBAA0B,CAC3B,CACX;aACA,MAAM,EAAE,CAAC;QACZ,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"Tooltip.test.js","sourceRoot":"","sources":["../../src/__tests__/Tooltip.test.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE,CAAC;IACxC,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE,CAAC;QAC1B,IAAI,SAAqC,CAAC;QAC1C,GAAG,CAAC,GAAG,EAAE,CAAC;YACR,SAAS,GAAG,QAAQ,CAAC,MAAM,CACzB,KAAC,OAAO,IAAC,OAAO,EAAC,gBAAgB,YAC/B,KAAC,QAAQ,iCAA0B,GAC3B,CACX,CAAC;QAAA,CACH,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,SAAU,CAAC,MAAM,EAAE,CAAC;QACjC,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IAAA,CAChC,CAAC,CAAC;AAAA,CACJ,CAAC,CAAC"}
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { Tooltip } from './Tooltip';
2
2
  export { tooltipName } from './Tooltip.types';
3
3
  export type { TooltipProps, TooltipSlotProps, TooltipType } from './Tooltip.types';
4
- //# sourceMappingURL=index.d.ts.map
4
+ //# sourceMappingURL=index.d.ts.map
package/lib/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export { Tooltip } from './Tooltip';
2
2
  export { tooltipName } from './Tooltip.types';
3
- //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -4,6 +4,6 @@
4
4
  * @format
5
5
  */
6
6
  import type { TooltipProps } from './Tooltip.types';
7
- export declare const Tooltip: import("@fluentui-react-native/framework").ComposableFunction<TooltipProps>;
7
+ export declare const Tooltip: import('@fluentui-react-native/framework-base').FunctionComponent<TooltipProps>;
8
8
  export default Tooltip;
9
- //# sourceMappingURL=Tooltip.d.ts.map
9
+ //# sourceMappingURL=Tooltip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../src/Tooltip.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAIpD,eAAO,MAAM,OAAO,6EA2BlB,CAAC;AAIH,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../src/Tooltip.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAIpD,eAAO,MAAM,OAAO,iFA4BlB,CAAC;AAIH,eAAe,OAAO,CAAC"}
@@ -1,65 +1,97 @@
1
- "use strict";
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
+ var __importDefault =
53
+ (this && this.__importDefault) ||
54
+ function (mod) {
55
+ return mod && mod.__esModule ? mod : { default: mod };
56
+ };
57
+ Object.defineProperty(exports, '__esModule', { value: true });
58
+ exports.Tooltip = void 0;
59
+ const jsx_runtime_1 = require('react/jsx-runtime');
2
60
  /**
3
61
  * Copyright (c) Microsoft Corporation.
4
62
  * Licensed under the MIT License.
5
63
  * @format
6
64
  */
7
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
- if (k2 === undefined) k2 = k;
9
- var desc = Object.getOwnPropertyDescriptor(m, k);
10
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
- desc = { enumerable: true, get: function() { return m[k]; } };
65
+ const React = __importStar(require('react'));
66
+ const react_native_1 = require('react-native');
67
+ const framework_base_1 = require('@fluentui-react-native/framework-base');
68
+ const Tooltip_types_1 = require('./Tooltip.types');
69
+ const TooltipNativeComponent_1 = __importDefault(require('./TooltipNativeComponent'));
70
+ exports.Tooltip = (0, framework_base_1.phasedComponent)((props) => {
71
+ const { target } = props;
72
+ const [nativeTarget, setNativeTarget] = React.useState(null);
73
+ React.useLayoutEffect(() => {
74
+ if (typeof target === 'string') {
75
+ // Pass string type `target` directly
76
+ setNativeTarget(target);
77
+ } else if (target?.current) {
78
+ // Pass the tagID for a valid ref `target`
79
+ setNativeTarget((0, react_native_1.findNodeHandle)(target.current));
80
+ } else {
81
+ // Clear `target` so we may fall back on `anchorRect` if provided
82
+ setNativeTarget(null);
12
83
  }
13
- Object.defineProperty(o, k2, desc);
14
- }) : (function(o, m, k, k2) {
15
- if (k2 === undefined) k2 = k;
16
- o[k2] = m[k];
17
- }));
18
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
19
- Object.defineProperty(o, "default", { enumerable: true, value: v });
20
- }) : function(o, v) {
21
- o["default"] = v;
22
- });
23
- var __importStar = (this && this.__importStar) || function (mod) {
24
- if (mod && mod.__esModule) return mod;
25
- var result = {};
26
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
27
- __setModuleDefault(result, mod);
28
- return result;
29
- };
30
- var __importDefault = (this && this.__importDefault) || function (mod) {
31
- return (mod && mod.__esModule) ? mod : { "default": mod };
32
- };
33
- Object.defineProperty(exports, "__esModule", { value: true });
34
- exports.Tooltip = void 0;
35
- /** @jsxRuntime classic */
36
- const React = __importStar(require("react"));
37
- const react_native_1 = require("react-native");
38
- const framework_1 = require("@fluentui-react-native/framework");
39
- const Tooltip_types_1 = require("./Tooltip.types");
40
- const TooltipNativeComponent_1 = __importDefault(require("./TooltipNativeComponent"));
41
- exports.Tooltip = (0, framework_1.stagedComponent)((props) => {
42
- const { target } = props;
43
- const [nativeTarget, setNativeTarget] = React.useState(null);
44
- React.useLayoutEffect(() => {
45
- if (typeof target === 'string') {
46
- // Pass string type `target` directly
47
- setNativeTarget(target);
48
- }
49
- else if (target?.current) {
50
- // Pass the tagID for a valid ref `target`
51
- setNativeTarget((0, react_native_1.findNodeHandle)(target.current));
52
- }
53
- else {
54
- // Clear `target` so we may fall back on `anchorRect` if provided
55
- setNativeTarget(null);
56
- }
57
- }, [target]);
58
- const TooltipComponent = (rest, children) => {
59
- return (React.createElement(TooltipNativeComponent_1.default, { ...(nativeTarget && { target: nativeTarget }), ...(0, framework_1.mergeProps)(props, rest) }, children));
60
- };
61
- return TooltipComponent;
84
+ }, [target]);
85
+ const TooltipComponent = (0, framework_base_1.directComponent)((innerProps) => {
86
+ const { children, ...rest } = innerProps;
87
+ return jsx_runtime_1.jsx(TooltipNativeComponent_1.default, {
88
+ ...(nativeTarget && { target: nativeTarget }),
89
+ ...(0, framework_base_1.mergeProps)(props, rest),
90
+ children: children,
91
+ });
92
+ });
93
+ return TooltipComponent;
62
94
  });
63
95
  exports.Tooltip.displayName = Tooltip_types_1.tooltipName;
64
96
  exports.default = exports.Tooltip;
65
- //# sourceMappingURL=Tooltip.js.map
97
+ //# sourceMappingURL=Tooltip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../src/Tooltip.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,0BAA0B;AAC1B,6CAA+B;AAC/B,+CAA8C;AAE9C,gEAA+E;AAG/E,mDAA8C;AAC9C,sFAAyD;AAE5C,QAAA,OAAO,GAAG,IAAA,2BAAe,EAAC,CAAC,KAAmB,EAAE,EAAE;IAC7D,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAEzB,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAyB,IAAI,CAAC,CAAC;IAErF,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE;QACzB,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;YAC9B,qCAAqC;YACrC,eAAe,CAAC,MAAM,CAAC,CAAC;SACzB;aAAM,IAAI,MAAM,EAAE,OAAO,EAAE;YAC1B,0CAA0C;YAC1C,eAAe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CAAC,IAAA,6BAAc,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;QAClD,CAAC;aAAM,CAAC;YACN,iEAAiE;YACjE,eAAe,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC;IAAA,CACF,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,MAAM,gBAAgB,GAAG,IAAA,gCAAe,EAAe,CAAC,UAAwB,EAAE,EAAE,CAAC;QACnF,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,UAAU,CAAC;QACzC,OAAO,CACL,kBAAC,gCAAiB,OAAK,CAAC,YAAY,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,KAAM,IAAA,2BAAU,EAAC,KAAK,EAAE,IAAI,CAAC,YAC3F,QAAQ,GACS,CACrB,CAAC;IAAA,CACH,CAAC,CAAC;IAEH,OAAO,gBAAgB,CAAC;AAAA,CACzB,CAAC,CAAC;AAEH,QAAA,OAAO,CAAC,WAAW,GAAG,2BAAW,CAAC;kBAEnB,QAAA,OAAO"}
@@ -1,45 +1,48 @@
1
1
  import type * as React from 'react';
2
- import type { ViewStyle } from 'react-native';
2
+ import type { ViewStyle, ViewProps } from 'react-native';
3
3
  import type { DirectionalHint } from '@fluentui-react-native/callout';
4
- export declare const tooltipName = "Tooltip";
4
+ export declare const tooltipName = 'Tooltip';
5
5
  export type TooltipProps = React.PropsWithChildren<{
6
- /**
7
- * The text of the tooltip.
8
- */
9
- content: string;
10
- /**
11
- * Notification when the visibility of the tooltip is changed.
12
- */
13
- onVisibleChange?: (event: any, data: any) => void;
14
- /**
15
- * Positioning of the tooltip relative to the target element.
16
- *
17
- * @default topCenter
18
- */
19
- positioning?: DirectionalHint;
20
- /**
21
- * Allow consumers to pass in Style props
22
- */
23
- style?: ViewStyle;
24
- /**
25
- * Target anchor that tooltip uses for relative positioning. Certain components may proffer a string as an anchor target, such as
26
- * anchoring to a point inside the component.
27
- *
28
- * If not provided, will anchor to the wrapper element.
29
- */
30
- target?: React.RefObject<React.Component> | string;
31
- /**
32
- * Controls the tooltip visibility and can be used in conjunction with onVisibleChange to modify show/hide behavior. If not provided, will be updated based on hover/focus events on target element.
33
- *
34
- * @default false
35
- */
36
- visible?: boolean;
6
+ /**
7
+ * The text of the tooltip.
8
+ */
9
+ content: string;
10
+ /**
11
+ * Notification when the visibility of the tooltip is changed.
12
+ */
13
+ onVisibleChange?: (event: any, data: any) => void;
14
+ /**
15
+ * Positioning of the tooltip relative to the target element.
16
+ *
17
+ * @default topCenter
18
+ */
19
+ positioning?: DirectionalHint;
20
+ /**
21
+ * Allow consumers to pass in Style props
22
+ */
23
+ style?: ViewStyle;
24
+ /**
25
+ * Target anchor that tooltip uses for relative positioning. Certain components may proffer a string as an anchor target, such as
26
+ * anchoring to a point inside the component.
27
+ *
28
+ * If not provided, will anchor to the wrapper element.
29
+ */
30
+ target?: React.RefObject<React.Component> | string;
31
+ /**
32
+ * Controls the tooltip visibility and can be used in conjunction with onVisibleChange to modify show/hide behavior. If not provided, will be updated based on hover/focus events on target element.
33
+ *
34
+ * @default false
35
+ */
36
+ visible?: boolean;
37
37
  }>;
38
38
  export interface TooltipSlotProps {
39
- root: TooltipProps;
39
+ root: TooltipProps;
40
40
  }
41
41
  export interface TooltipType {
42
- props: TooltipProps;
43
- slotProps: TooltipSlotProps;
42
+ props: TooltipProps;
43
+ slotProps: TooltipSlotProps;
44
44
  }
45
- //# sourceMappingURL=Tooltip.types.d.ts.map
45
+ export interface NativeProps extends ViewProps {
46
+ content?: string;
47
+ }
48
+ //# sourceMappingURL=Tooltip.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.types.d.ts","sourceRoot":"","sources":["../src/Tooltip.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM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,CAAC,EAAE,SAAS,CAAC;IAElB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC;IAEnD;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC,CAAC;AAEH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,YAAY,CAAC;IACpB,SAAS,EAAE,gBAAgB,CAAC;CAC7B;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -1,5 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
3
  exports.tooltipName = void 0;
4
4
  exports.tooltipName = 'Tooltip';
5
- //# sourceMappingURL=Tooltip.types.js.map
5
+ //# sourceMappingURL=Tooltip.types.js.map
@@ -3,10 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  * @format
5
5
  */
6
- import type { HostComponent, ViewProps } from 'react-native';
7
- export interface NativeProps extends ViewProps {
8
- content?: string;
9
- }
6
+ import type { HostComponent } from 'react-native';
7
+ import type { NativeProps } from './Tooltip.types';
10
8
  declare const _default: HostComponent<NativeProps>;
11
9
  export default _default;
12
- //# sourceMappingURL=TooltipNativeComponent.d.ts.map
10
+ //# sourceMappingURL=TooltipNativeComponent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TooltipNativeComponent.d.ts","sourceRoot":"","sources":["../src/TooltipNativeComponent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI7D,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;;AAED,wBAA+F"}
1
+ {"version":3,"file":"TooltipNativeComponent.d.ts","sourceRoot":"","sources":["../src/TooltipNativeComponent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;;AAInD,wBAA+F"}
@@ -1,13 +1,15 @@
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"));
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
+ const codegenNativeComponent_1 = __importDefault(require('react-native/Libraries/Utilities/codegenNativeComponent'));
12
14
  exports.default = (0, codegenNativeComponent_1.default)('RCTTooltip');
13
- //# sourceMappingURL=TooltipNativeComponent.js.map
15
+ //# sourceMappingURL=TooltipNativeComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TooltipNativeComponent.js","sourceRoot":"","sources":["../src/TooltipNativeComponent.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;AAIH,qHAA6F;AAM7F,kBAAe,IAAA,gCAAsB,EAAc,YAAY,CAA+B,CAAC"}
1
+ {"version":3,"file":"TooltipNativeComponent.js","sourceRoot":"","sources":["../src/TooltipNativeComponent.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;AAKH,qHAA6F;kBAE9E,IAAA,gCAAsB,EAAc,YAAY,CAA+B"}
@@ -0,0 +1,5 @@
1
+ import type { HostComponent } from 'react-native';
2
+ import type { NativeProps } from './Tooltip.types';
3
+ declare const _default: HostComponent<NativeProps>;
4
+ export default _default;
5
+ //# sourceMappingURL=TooltipNativeComponent.win32.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TooltipNativeComponent.win32.d.ts","sourceRoot":"","sources":["../src/TooltipNativeComponent.win32.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;;AAInD,wBAA+F"}
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ const react_native_1 = require('react-native');
4
+ exports.default = (0, react_native_1.requireNativeComponent)('RCTTooltip');
5
+ //# sourceMappingURL=TooltipNativeComponent.win32.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TooltipNativeComponent.win32.js","sourceRoot":"","sources":["../src/TooltipNativeComponent.win32.ts"],"names":[],"mappings":";;AAGA,+CAAsD;kBAEvC,IAAA,qCAAsB,EAAc,YAAY,CAA+B"}
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=Tooltip.test.d.ts.map
2
+ //# sourceMappingURL=Tooltip.test.d.ts.map
@@ -1,39 +1,73 @@
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 button_1 = require("@fluentui-react-native/button");
28
- const renderer = __importStar(require("react-test-renderer"));
29
- const Tooltip_1 = require("../Tooltip");
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 button_1 = require('@fluentui-react-native/button');
55
+ const renderer = __importStar(require('react-test-renderer'));
56
+ const react_1 = require('react');
57
+ const Tooltip_1 = require('../Tooltip');
30
58
  describe('Tooltip component tests', () => {
31
- it('Tooltip default', () => {
32
- const tree = renderer
33
- .create(React.createElement(Tooltip_1.Tooltip, { content: "Your component" },
34
- React.createElement(button_1.ButtonV1, null, "Your component")))
35
- .toJSON();
36
- expect(tree).toMatchSnapshot();
59
+ it('Tooltip default', () => {
60
+ let component;
61
+ (0, react_1.act)(() => {
62
+ component = renderer.create(
63
+ jsx_runtime_1.jsx(Tooltip_1.Tooltip, {
64
+ content: 'Your component',
65
+ children: jsx_runtime_1.jsx(button_1.ButtonV1, { children: 'Your component' }),
66
+ }),
67
+ );
37
68
  });
69
+ const tree = component.toJSON();
70
+ expect(tree).toMatchSnapshot();
71
+ });
38
72
  });
39
- //# sourceMappingURL=Tooltip.test.js.map
73
+ //# sourceMappingURL=Tooltip.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.test.js","sourceRoot":"","sources":["../../src/__tests__/Tooltip.test.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAE/B,0DAAyD;AACzD,8DAAgD;AAEhD,wCAAqC;AAErC,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;QACzB,MAAM,IAAI,GAAG,QAAQ;aAClB,MAAM,CACL,oBAAC,iBAAO,IAAC,OAAO,EAAC,gBAAgB;YAC/B,oBAAC,iBAAQ,yBAA0B,CAC3B,CACX;aACA,MAAM,EAAE,CAAC;QACZ,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"Tooltip.test.js","sourceRoot":"","sources":["../../src/__tests__/Tooltip.test.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAAyD;AACzD,MAAY,QAAQ,gDAA4B;AAChD,iCAA4B;AAE5B,wCAAqC;AAErC,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE,CAAC;IACxC,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE,CAAC;QAC1B,IAAI,SAAqC,CAAC;QAC1C,IAAA,WAAG,EAAC,GAAG,EAAE,CAAC;YACR,SAAS,GAAG,QAAQ,CAAC,MAAM,CACzB,kBAAC,iBAAO,IAAC,OAAO,EAAC,gBAAgB,YAC/B,kBAAC,iBAAQ,iCAA0B,GAC3B,CACX,CAAC;QAAA,CACH,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,SAAU,CAAC,MAAM,EAAE,CAAC;QACjC,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IAAA,CAChC,CAAC,CAAC;AAAA,CACJ,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
1
  export { Tooltip } from './Tooltip';
2
2
  export { tooltipName } from './Tooltip.types';
3
3
  export type { TooltipProps, TooltipSlotProps, TooltipType } from './Tooltip.types';
4
- //# sourceMappingURL=index.d.ts.map
4
+ //# sourceMappingURL=index.d.ts.map
@@ -1,8 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
3
  exports.tooltipName = exports.Tooltip = void 0;
4
- var Tooltip_1 = require("./Tooltip");
5
- Object.defineProperty(exports, "Tooltip", { enumerable: true, get: function () { return Tooltip_1.Tooltip; } });
6
- var Tooltip_types_1 = require("./Tooltip.types");
7
- Object.defineProperty(exports, "tooltipName", { enumerable: true, get: function () { return Tooltip_types_1.tooltipName; } });
8
- //# sourceMappingURL=index.js.map
4
+ const Tooltip_1 = require('./Tooltip');
5
+ Object.defineProperty(exports, 'Tooltip', {
6
+ enumerable: true,
7
+ get: function () {
8
+ return Tooltip_1.Tooltip;
9
+ },
10
+ });
11
+ const Tooltip_types_1 = require('./Tooltip.types');
12
+ Object.defineProperty(exports, 'tooltipName', {
13
+ enumerable: true,
14
+ get: function () {
15
+ return Tooltip_types_1.tooltipName;
16
+ },
17
+ });
18
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,iDAA8C;AAArC,4GAAA,WAAW,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,uCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,mDAA8C;AAArC,4GAAA,WAAW,OAAA"}
package/package.json CHANGED
@@ -1,102 +1,98 @@
1
1
  {
2
2
  "name": "@fluentui-react-native/tooltip",
3
- "version": "0.4.28",
3
+ "version": "0.5.0",
4
4
  "description": "A cross-platform Tooltip component for React Native.",
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/experimental/Tooltip"
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",
24
+ "build-cjs": "tsgo --outDir lib-commonjs",
25
+ "build-esm": "tsgo --outDir lib --module esnext --moduleResolution bundler",
18
26
  "clean": "fluentui-scripts clean",
19
27
  "depcheck": "fluentui-scripts depcheck",
20
- "just": "fluentui-scripts",
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/experimental/Tooltip"
31
+ "test": "fluentui-scripts jest",
32
+ "update-snapshots": "fluentui-scripts jest -u"
31
33
  },
32
34
  "dependencies": {
33
- "@fluentui-react-native/callout": "0.27.17",
34
- "@fluentui-react-native/framework": "0.14.17"
35
+ "@fluentui-react-native/callout": "0.28.0",
36
+ "@fluentui-react-native/framework-base": "0.3.0"
35
37
  },
36
38
  "devDependencies": {
37
39
  "@babel/core": "^7.20.0",
38
40
  "@fluentui-react-native/babel-config": "0.1.1",
39
- "@fluentui-react-native/button": "0.39.21",
41
+ "@fluentui-react-native/button": "0.40.0",
40
42
  "@fluentui-react-native/eslint-config-rules": "0.1.1",
41
43
  "@fluentui-react-native/jest-config": "0.1.1",
42
- "@fluentui-react-native/scripts": "0.1.1",
44
+ "@fluentui-react-native/kit-config": "0.1.2",
45
+ "@fluentui-react-native/scripts": "0.1.2",
43
46
  "@fluentui-react-native/test-tools": "0.1.1",
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-svg": "^15.4.0",
53
- "react-native-windows": "^0.74.0",
54
- "react-test-renderer": "18.2.0"
48
+ "@react-native/babel-preset": "^0.81.0",
49
+ "@types/react": "~19.1.0",
50
+ "@types/react-test-renderer": "^19.1.0",
51
+ "react": "19.1.0",
52
+ "react-native": "^0.81.0",
53
+ "react-native-macos": "^0.81.0",
54
+ "react-native-svg": "^15.12.1",
55
+ "react-native-windows": "^0.81.0",
56
+ "react-test-renderer": "19.1.0"
55
57
  },
56
58
  "peerDependencies": {
57
59
  "@office-iss/react-native-win32": "^0.74.0",
58
- "react": "18.2.0",
59
- "react-native": "^0.73.0 || ^0.74.0",
60
- "react-native-macos": "^0.73.0 || ^0.74.0",
61
- "react-native-svg": "^15.0.0 || ^15.4.0",
62
- "react-native-windows": "^0.73.0 || ^0.74.0"
60
+ "@types/react": "~18.2.0 || ~19.0.0 || ~19.1.0",
61
+ "react": "18.2.0 || 19.0.0 || 19.1.0",
62
+ "react-native": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0",
63
+ "react-native-macos": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0",
64
+ "react-native-svg": ">=15.0.0 <15.13.0 || >=15.4.0 <15.13.0 || ^15.11.2 || ^15.12.1",
65
+ "react-native-windows": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0"
66
+ },
67
+ "peerDependenciesMeta": {
68
+ "@office-iss/react-native-win32": {
69
+ "optional": true
70
+ },
71
+ "@types/react": {
72
+ "optional": true
73
+ },
74
+ "react-native-macos": {
75
+ "optional": true
76
+ },
77
+ "react-native-windows": {
78
+ "optional": true
79
+ }
63
80
  },
64
- "author": "",
65
- "license": "MIT",
66
81
  "rnx-kit": {
67
82
  "kitType": "library",
68
83
  "alignDeps": {
69
- "presets": [
70
- "microsoft/react-native"
71
- ],
72
- "requirements": {
73
- "development": [
74
- "react-native@0.74"
75
- ],
76
- "production": [
77
- "react-native@0.73 || 0.74"
78
- ]
79
- },
80
84
  "capabilities": [
81
85
  "babel-preset-react-native",
82
86
  "core",
83
87
  "core-macos",
84
88
  "core-windows",
85
89
  "react",
90
+ "react-test-renderer",
86
91
  "svg",
87
- "react-test-renderer"
92
+ "tools-core",
93
+ "tools-jest"
88
94
  ]
89
- }
90
- },
91
- "peerDependenciesMeta": {
92
- "@office-iss/react-native-win32": {
93
- "optional": true
94
95
  },
95
- "react-native-macos": {
96
- "optional": true
97
- },
98
- "react-native-windows": {
99
- "optional": true
100
- }
96
+ "extends": "@fluentui-react-native/kit-config"
101
97
  }
102
- }
98
+ }
package/src/Tooltip.tsx CHANGED
@@ -4,17 +4,16 @@
4
4
  * @format
5
5
  */
6
6
 
7
- /** @jsxRuntime classic */
8
7
  import * as React from 'react';
9
8
  import { findNodeHandle } from 'react-native';
10
9
 
11
- import { mergeProps, stagedComponent } from '@fluentui-react-native/framework';
10
+ import { mergeProps, phasedComponent, directComponent } from '@fluentui-react-native/framework-base';
12
11
 
13
12
  import type { TooltipProps } from './Tooltip.types';
14
13
  import { tooltipName } from './Tooltip.types';
15
14
  import NativeTooltipView from './TooltipNativeComponent';
16
15
 
17
- export const Tooltip = stagedComponent((props: TooltipProps) => {
16
+ export const Tooltip = phasedComponent((props: TooltipProps) => {
18
17
  const { target } = props;
19
18
 
20
19
  const [nativeTarget, setNativeTarget] = React.useState<number | string | null>(null);
@@ -32,13 +31,14 @@ export const Tooltip = stagedComponent((props: TooltipProps) => {
32
31
  }
33
32
  }, [target]);
34
33
 
35
- const TooltipComponent = (rest: TooltipProps, children: React.ReactNode) => {
34
+ const TooltipComponent = directComponent<TooltipProps>((innerProps: TooltipProps) => {
35
+ const { children, ...rest } = innerProps;
36
36
  return (
37
37
  <NativeTooltipView {...(nativeTarget && { target: nativeTarget })} {...mergeProps(props, rest)}>
38
38
  {children}
39
39
  </NativeTooltipView>
40
40
  );
41
- };
41
+ });
42
42
 
43
43
  return TooltipComponent;
44
44
  });
@@ -1,5 +1,5 @@
1
1
  import type * as React from 'react';
2
- import type { ViewStyle } from 'react-native';
2
+ import type { ViewStyle, ViewProps } from 'react-native';
3
3
 
4
4
  import type { DirectionalHint } from '@fluentui-react-native/callout';
5
5
 
@@ -52,3 +52,7 @@ export interface TooltipType {
52
52
  props: TooltipProps;
53
53
  slotProps: TooltipSlotProps;
54
54
  }
55
+
56
+ export interface NativeProps extends ViewProps {
57
+ content?: string;
58
+ }
@@ -4,12 +4,9 @@
4
4
  * @format
5
5
  */
6
6
 
7
- import type { HostComponent, ViewProps } from 'react-native';
7
+ import type { HostComponent } from 'react-native';
8
+ import type { NativeProps } from './Tooltip.types';
8
9
 
9
10
  import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
10
11
 
11
- export interface NativeProps extends ViewProps {
12
- content?: string;
13
- }
14
-
15
12
  export default codegenNativeComponent<NativeProps>('RCTTooltip') as HostComponent<NativeProps>;
@@ -0,0 +1,6 @@
1
+ import type { HostComponent } from 'react-native';
2
+ import type { NativeProps } from './Tooltip.types';
3
+
4
+ import { requireNativeComponent } from 'react-native';
5
+
6
+ export default requireNativeComponent<NativeProps>('RCTTooltip') as HostComponent<NativeProps>;
@@ -1,19 +1,20 @@
1
- import * as React from 'react';
2
-
3
1
  import { ButtonV1 } from '@fluentui-react-native/button';
4
2
  import * as renderer from 'react-test-renderer';
3
+ import { act } from 'react';
5
4
 
6
5
  import { Tooltip } from '../Tooltip';
7
6
 
8
7
  describe('Tooltip component tests', () => {
9
8
  it('Tooltip default', () => {
10
- const tree = renderer
11
- .create(
9
+ let component: renderer.ReactTestRenderer;
10
+ act(() => {
11
+ component = renderer.create(
12
12
  <Tooltip content="Your component">
13
13
  <ButtonV1>Your component</ButtonV1>
14
14
  </Tooltip>,
15
- )
16
- .toJSON();
15
+ );
16
+ });
17
+ const tree = component!.toJSON();
17
18
  expect(tree).toMatchSnapshot();
18
19
  });
19
20
  });