@fluentui-react-native/tooltip 0.4.29 → 0.5.1
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.json +0 -21
- package/CHANGELOG.md +50 -0
- package/SPEC.md +1 -1
- package/lib/Tooltip.d.ts +1 -1
- package/lib/Tooltip.d.ts.map +1 -1
- package/lib/Tooltip.js +7 -6
- package/lib/Tooltip.js.map +1 -1
- package/lib/Tooltip.types.d.ts +4 -1
- package/lib/Tooltip.types.d.ts.map +1 -1
- package/lib/TooltipNativeComponent.win32.d.ts +7 -0
- package/lib/TooltipNativeComponent.win32.d.ts.map +1 -0
- package/lib/TooltipNativeComponent.win32.js +3 -0
- package/lib/TooltipNativeComponent.win32.js.map +1 -0
- package/lib/__tests__/Tooltip.test.js +7 -5
- package/lib/__tests__/Tooltip.test.js.map +1 -1
- package/lib-commonjs/Tooltip.d.ts +1 -1
- package/lib-commonjs/Tooltip.d.ts.map +1 -1
- package/lib-commonjs/Tooltip.js +29 -18
- package/lib-commonjs/Tooltip.js.map +1 -1
- package/lib-commonjs/Tooltip.types.d.ts +4 -1
- package/lib-commonjs/Tooltip.types.d.ts.map +1 -1
- package/lib-commonjs/TooltipNativeComponent.js.map +1 -1
- package/lib-commonjs/TooltipNativeComponent.win32.d.ts +7 -0
- package/lib-commonjs/TooltipNativeComponent.win32.d.ts.map +1 -0
- package/lib-commonjs/TooltipNativeComponent.win32.js +5 -0
- package/lib-commonjs/TooltipNativeComponent.win32.js.map +1 -0
- package/lib-commonjs/__tests__/Tooltip.test.js +24 -12
- package/lib-commonjs/__tests__/Tooltip.test.js.map +1 -1
- package/lib-commonjs/index.js +2 -2
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +58 -61
- package/src/Tooltip.tsx +5 -5
- package/src/Tooltip.types.ts +5 -1
- package/src/TooltipNativeComponent.win32.ts +9 -0
- package/src/__tests__/Tooltip.test.tsx +7 -6
package/CHANGELOG.json
CHANGED
|
@@ -1,27 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/tooltip",
|
|
3
3
|
"entries": [
|
|
4
|
-
{
|
|
5
|
-
"date": "Sat, 22 Nov 2025 00:55:48 GMT",
|
|
6
|
-
"version": "0.4.29",
|
|
7
|
-
"tag": "@fluentui-react-native/tooltip_v0.4.29",
|
|
8
|
-
"comments": {
|
|
9
|
-
"none": [
|
|
10
|
-
{
|
|
11
|
-
"author": "sanajmi@microsoft.com",
|
|
12
|
-
"package": "@fluentui-react-native/tooltip",
|
|
13
|
-
"commit": "e986858243200966d730f4e546ef366132ebb545",
|
|
14
|
-
"comment": "beachball sync"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"author": "4123478+tido64@users.noreply.github.com",
|
|
18
|
-
"package": "@fluentui-react-native/tooltip",
|
|
19
|
-
"commit": "b91dda380b291d3368f567d4bf8815b2094a38a5",
|
|
20
|
-
"comment": "Lock down `react-native-svg` version to avoid breaking changes"
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
4
|
{
|
|
26
5
|
"date": "Tue, 05 Aug 2025 18:50:38 GMT",
|
|
27
6
|
"version": "0.4.21",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
# Change Log - @fluentui-react-native/tooltip
|
|
2
2
|
|
|
3
|
+
## 0.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f72b43a: Fix codegen definitions for native components in repo
|
|
8
|
+
- 0d6e9c1: chore: migrate to `oxfmt`
|
|
9
|
+
- ac6e7af: Ensure packages have a default export that references the typescript entrypoint and clean up build dependency ordering
|
|
10
|
+
- Updated dependencies [f72b43a]
|
|
11
|
+
- Updated dependencies [0d6e9c1]
|
|
12
|
+
- Updated dependencies [ac6e7af]
|
|
13
|
+
- @fluentui-react-native/callout@0.28.1
|
|
14
|
+
- @fluentui-react-native/framework-base@0.3.1
|
|
15
|
+
|
|
16
|
+
## 0.5.0
|
|
17
|
+
|
|
18
|
+
### Minor Changes
|
|
19
|
+
|
|
20
|
+
- d7adbdd: # Migration from Beachball to Changesets
|
|
21
|
+
|
|
22
|
+
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.
|
|
23
|
+
|
|
24
|
+
All 75 affected packages receive a minor version bump to acknowledge the accumulated changes from the beachball era.
|
|
25
|
+
|
|
26
|
+
## What Changed
|
|
27
|
+
|
|
28
|
+
Going forward, all version management uses Changesets via `yarn changeset`. The following beachball infrastructure has been removed:
|
|
29
|
+
|
|
30
|
+
- ❌ 440+ beachball change files from `change/` directory
|
|
31
|
+
- ❌ `beachball` package dependency
|
|
32
|
+
- ❌ Beachball scripts from `package.json`
|
|
33
|
+
- ❌ `beachball.config.js` configuration file
|
|
34
|
+
- ❌ Beachball publish steps from Azure Pipelines
|
|
35
|
+
|
|
36
|
+
## New Workflow
|
|
37
|
+
|
|
38
|
+
✅ **Create changes**: Run `yarn changeset` to document changes
|
|
39
|
+
✅ **Version bump PRs**: Automatically created by GitHub Actions
|
|
40
|
+
✅ **Publishing**: Handled by Azure Pipelines using `changeset publish`
|
|
41
|
+
✅ **Validation**: CI validates changesets and blocks major version bumps
|
|
42
|
+
|
|
43
|
+
For details, see `CHANGESETS_SETUP.md` and `CONTRIBUTING.md`.
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- 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.
|
|
48
|
+
- Updated dependencies [d7adbdd]
|
|
49
|
+
- Updated dependencies [d1d8c26]
|
|
50
|
+
- @fluentui-react-native/callout@0.28.0
|
|
51
|
+
- @fluentui-react-native/framework-base@0.3.0
|
|
52
|
+
|
|
3
53
|
<!-- This log was last generated on Tue, 05 Aug 2025 18:50:38 GMT and should not be manually modified. -->
|
|
4
54
|
|
|
5
55
|
<!-- 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/
|
|
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").
|
|
7
|
+
export declare const Tooltip: import("@fluentui-react-native/framework-base").FunctionComponent<TooltipProps>;
|
|
8
8
|
export default Tooltip;
|
|
9
9
|
//# sourceMappingURL=Tooltip.d.ts.map
|
package/lib/Tooltip.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../src/Tooltip.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
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,15 +1,15 @@
|
|
|
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,
|
|
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 =
|
|
12
|
+
export const Tooltip = phasedComponent((props) => {
|
|
13
13
|
const { target } = props;
|
|
14
14
|
const [nativeTarget, setNativeTarget] = React.useState(null);
|
|
15
15
|
React.useLayoutEffect(() => {
|
|
@@ -26,9 +26,10 @@ export const Tooltip = stagedComponent((props) => {
|
|
|
26
26
|
setNativeTarget(null);
|
|
27
27
|
}
|
|
28
28
|
}, [target]);
|
|
29
|
-
const TooltipComponent = (
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
const TooltipComponent = directComponent((innerProps) => {
|
|
30
|
+
const { children, ...rest } = innerProps;
|
|
31
|
+
return (_jsx(NativeTooltipView, { ...(nativeTarget && { target: nativeTarget }), ...mergeProps(props, rest), children: children }));
|
|
32
|
+
});
|
|
32
33
|
return TooltipComponent;
|
|
33
34
|
});
|
|
34
35
|
Tooltip.displayName = tooltipName;
|
package/lib/Tooltip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../src/Tooltip.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../src/Tooltip.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAGrG,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,CAAC;IAC9D,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,CAAC;QAC1B,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC/B,qCAAqC;YACrC,eAAe,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC;aAAM,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;YAC3B,0CAA0C;YAC1C,eAAe,CAAC,cAAc,CAAC,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"}
|
package/lib/Tooltip.types.d.ts
CHANGED
|
@@ -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
|
import type { DirectionalHint } from '@fluentui-react-native/callout';
|
|
4
4
|
export declare const tooltipName = "Tooltip";
|
|
5
5
|
export type TooltipProps = React.PropsWithChildren<{
|
|
@@ -42,4 +42,7 @@ export interface TooltipType {
|
|
|
42
42
|
props: TooltipProps;
|
|
43
43
|
slotProps: TooltipSlotProps;
|
|
44
44
|
}
|
|
45
|
+
export interface NativeProps extends ViewProps {
|
|
46
|
+
content?: string;
|
|
47
|
+
}
|
|
45
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;
|
|
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,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEtE,eAAO,MAAM,WAAW,YAAY,CAAC;AAErC,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACjD;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,KAAA,EAAE,IAAI,KAAA,KAAK,IAAI,CAAC;IAExC;;;;OAIG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;IAE9B;;OAEG;IACH,KAAK,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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HostComponent, ViewProps } from 'react-native';
|
|
2
|
+
export interface NativeProps extends ViewProps {
|
|
3
|
+
content?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: HostComponent<NativeProps>;
|
|
6
|
+
export default _default;
|
|
7
|
+
//# 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,SAAS,EAAE,MAAM,cAAc,CAAC;AAI7D,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;;AAED,wBAA+F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TooltipNativeComponent.win32.js","sourceRoot":"","sources":["../src/TooltipNativeComponent.win32.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAMtD,eAAe,sBAAsB,CAAc,YAAY,CAA+B,CAAC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import
|
|
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
7
|
it('Tooltip default', () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
let component;
|
|
9
|
+
act(() => {
|
|
10
|
+
component = renderer.create(_jsx(Tooltip, { content: "Your component", children: _jsx(ButtonV1, { children: "Your component" }) }));
|
|
11
|
+
});
|
|
12
|
+
const tree = component.toJSON();
|
|
11
13
|
expect(tree).toMatchSnapshot();
|
|
12
14
|
});
|
|
13
15
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.test.js","sourceRoot":"","sources":["../../src/__tests__/Tooltip.test.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
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"}
|
|
@@ -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").
|
|
7
|
+
export declare const Tooltip: import("@fluentui-react-native/framework-base").FunctionComponent<TooltipProps>;
|
|
8
8
|
export default Tooltip;
|
|
9
9
|
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../src/Tooltip.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
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-commonjs/Tooltip.js
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) Microsoft Corporation.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
* @format
|
|
6
|
-
*/
|
|
7
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
3
|
if (k2 === undefined) k2 = k;
|
|
9
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -20,25 +15,40 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
20
15
|
}) : function(o, v) {
|
|
21
16
|
o["default"] = v;
|
|
22
17
|
});
|
|
23
|
-
var __importStar = (this && this.__importStar) || function (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
30
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
31
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
32
37
|
};
|
|
33
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
39
|
exports.Tooltip = void 0;
|
|
35
|
-
|
|
40
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
|
+
/**
|
|
42
|
+
* Copyright (c) Microsoft Corporation.
|
|
43
|
+
* Licensed under the MIT License.
|
|
44
|
+
* @format
|
|
45
|
+
*/
|
|
36
46
|
const React = __importStar(require("react"));
|
|
37
47
|
const react_native_1 = require("react-native");
|
|
38
|
-
const
|
|
48
|
+
const framework_base_1 = require("@fluentui-react-native/framework-base");
|
|
39
49
|
const Tooltip_types_1 = require("./Tooltip.types");
|
|
40
50
|
const TooltipNativeComponent_1 = __importDefault(require("./TooltipNativeComponent"));
|
|
41
|
-
exports.Tooltip = (0,
|
|
51
|
+
exports.Tooltip = (0, framework_base_1.phasedComponent)((props) => {
|
|
42
52
|
const { target } = props;
|
|
43
53
|
const [nativeTarget, setNativeTarget] = React.useState(null);
|
|
44
54
|
React.useLayoutEffect(() => {
|
|
@@ -55,9 +65,10 @@ exports.Tooltip = (0, framework_1.stagedComponent)((props) => {
|
|
|
55
65
|
setNativeTarget(null);
|
|
56
66
|
}
|
|
57
67
|
}, [target]);
|
|
58
|
-
const TooltipComponent = (
|
|
59
|
-
|
|
60
|
-
|
|
68
|
+
const TooltipComponent = (0, framework_base_1.directComponent)((innerProps) => {
|
|
69
|
+
const { children, ...rest } = innerProps;
|
|
70
|
+
return (jsx_runtime_1.jsx(TooltipNativeComponent_1.default, { ...(nativeTarget && { target: nativeTarget }), ...(0, framework_base_1.mergeProps)(props, rest), children: children }));
|
|
71
|
+
});
|
|
61
72
|
return TooltipComponent;
|
|
62
73
|
});
|
|
63
74
|
exports.Tooltip.displayName = Tooltip_types_1.tooltipName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../src/Tooltip.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../src/Tooltip.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;GAIG;AAEH,MAAY,KAAK,kCAAc;AAC/B,+CAA8C;AAE9C,0EAAqG;AAGrG,mDAA8C;AAC9C,sFAAyD;AAE5C,QAAA,OAAO,GAAG,IAAA,gCAAe,EAAC,CAAC,KAAmB,EAAE,EAAE,CAAC;IAC9D,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,CAAC;QAC1B,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC/B,qCAAqC;YACrC,eAAe,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC;aAAM,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;YAC3B,0CAA0C;YAC1C,eAAe,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,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
|
import type { DirectionalHint } from '@fluentui-react-native/callout';
|
|
4
4
|
export declare const tooltipName = "Tooltip";
|
|
5
5
|
export type TooltipProps = React.PropsWithChildren<{
|
|
@@ -42,4 +42,7 @@ export interface TooltipType {
|
|
|
42
42
|
props: TooltipProps;
|
|
43
43
|
slotProps: TooltipSlotProps;
|
|
44
44
|
}
|
|
45
|
+
export interface NativeProps extends ViewProps {
|
|
46
|
+
content?: string;
|
|
47
|
+
}
|
|
45
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;
|
|
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,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEtE,eAAO,MAAM,WAAW,YAAY,CAAC;AAErC,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACjD;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,KAAA,EAAE,IAAI,KAAA,KAAK,IAAI,CAAC;IAExC;;;;OAIG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;IAE9B;;OAEG;IACH,KAAK,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipNativeComponent.js","sourceRoot":"","sources":["../src/TooltipNativeComponent.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;AAIH,qHAA6F;
|
|
1
|
+
{"version":3,"file":"TooltipNativeComponent.js","sourceRoot":"","sources":["../src/TooltipNativeComponent.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;AAIH,qHAA6F;kBAM9E,IAAA,gCAAsB,EAAc,YAAY,CAA+B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HostComponent, ViewProps } from 'react-native';
|
|
2
|
+
export interface NativeProps extends ViewProps {
|
|
3
|
+
content?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: HostComponent<NativeProps>;
|
|
6
|
+
export default _default;
|
|
7
|
+
//# 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,SAAS,EAAE,MAAM,cAAc,CAAC;AAI7D,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;;AAED,wBAA+F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TooltipNativeComponent.win32.js","sourceRoot":"","sources":["../src/TooltipNativeComponent.win32.ts"],"names":[],"mappings":";;AAEA,+CAAsD;kBAMvC,IAAA,qCAAsB,EAAc,YAAY,CAA+B"}
|
|
@@ -15,24 +15,36 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
const
|
|
36
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
27
37
|
const button_1 = require("@fluentui-react-native/button");
|
|
28
38
|
const renderer = __importStar(require("react-test-renderer"));
|
|
39
|
+
const react_1 = require("react");
|
|
29
40
|
const Tooltip_1 = require("../Tooltip");
|
|
30
41
|
describe('Tooltip component tests', () => {
|
|
31
42
|
it('Tooltip default', () => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
43
|
+
let component;
|
|
44
|
+
(0, react_1.act)(() => {
|
|
45
|
+
component = renderer.create(jsx_runtime_1.jsx(Tooltip_1.Tooltip, { content: "Your component", children: jsx_runtime_1.jsx(button_1.ButtonV1, { children: "Your component" }) }));
|
|
46
|
+
});
|
|
47
|
+
const tree = component.toJSON();
|
|
36
48
|
expect(tree).toMatchSnapshot();
|
|
37
49
|
});
|
|
38
50
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.test.js","sourceRoot":"","sources":["../../src/__tests__/Tooltip.test.tsx"],"names":[],"mappings":"
|
|
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"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.tooltipName = exports.Tooltip = void 0;
|
|
4
|
-
|
|
4
|
+
const Tooltip_1 = require("./Tooltip");
|
|
5
5
|
Object.defineProperty(exports, "Tooltip", { enumerable: true, get: function () { return Tooltip_1.Tooltip; } });
|
|
6
|
-
|
|
6
|
+
const Tooltip_types_1 = require("./Tooltip.types");
|
|
7
7
|
Object.defineProperty(exports, "tooltipName", { enumerable: true, get: function () { return Tooltip_types_1.tooltipName; } });
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
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,99 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/tooltip",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "A cross-platform Tooltip component for React Native.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/microsoft/fluentui-react-native.git",
|
|
10
|
+
"directory": "packages/experimental/Tooltip"
|
|
11
|
+
},
|
|
5
12
|
"main": "lib-commonjs/index.js",
|
|
6
13
|
"module": "lib/index.js",
|
|
7
|
-
"
|
|
14
|
+
"types": "lib/index.d.ts",
|
|
8
15
|
"exports": {
|
|
9
16
|
".": {
|
|
17
|
+
"types": "./lib/index.d.ts",
|
|
10
18
|
"import": "./lib/index.js",
|
|
11
19
|
"require": "./lib-commonjs/index.js",
|
|
12
|
-
"
|
|
20
|
+
"default": "./src/index.ts"
|
|
13
21
|
}
|
|
14
22
|
},
|
|
15
|
-
"typings": "lib/index.d.ts",
|
|
16
23
|
"scripts": {
|
|
17
24
|
"build": "fluentui-scripts build",
|
|
25
|
+
"build-cjs": "tsgo --outDir lib-commonjs",
|
|
26
|
+
"build-core": "tsgo --outDir lib --module esnext --moduleResolution bundler",
|
|
18
27
|
"clean": "fluentui-scripts clean",
|
|
19
28
|
"depcheck": "fluentui-scripts depcheck",
|
|
20
|
-
"just": "fluentui-scripts",
|
|
21
29
|
"lint": "fluentui-scripts eslint",
|
|
30
|
+
"lint-package": "fluentui-scripts lint-package",
|
|
31
|
+
"format": "fluentui-scripts format",
|
|
22
32
|
"test": "fluentui-scripts jest",
|
|
23
|
-
"update-snapshots": "fluentui-scripts jest -u"
|
|
24
|
-
"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"
|
|
33
|
+
"update-snapshots": "fluentui-scripts jest -u"
|
|
31
34
|
},
|
|
32
35
|
"dependencies": {
|
|
33
|
-
"@fluentui-react-native/callout": "0.
|
|
34
|
-
"@fluentui-react-native/framework": "0.
|
|
36
|
+
"@fluentui-react-native/callout": "0.28.1",
|
|
37
|
+
"@fluentui-react-native/framework-base": "0.3.1"
|
|
35
38
|
},
|
|
36
39
|
"devDependencies": {
|
|
37
40
|
"@babel/core": "^7.20.0",
|
|
38
41
|
"@fluentui-react-native/babel-config": "0.1.1",
|
|
39
|
-
"@fluentui-react-native/button": "0.
|
|
40
|
-
"@fluentui-react-native/eslint-config-rules": "0.1.
|
|
41
|
-
"@fluentui-react-native/jest-config": "0.1.
|
|
42
|
-
"@fluentui-react-native/
|
|
43
|
-
"@fluentui-react-native/
|
|
42
|
+
"@fluentui-react-native/button": "0.40.1",
|
|
43
|
+
"@fluentui-react-native/eslint-config-rules": "0.1.2",
|
|
44
|
+
"@fluentui-react-native/jest-config": "0.1.0",
|
|
45
|
+
"@fluentui-react-native/kit-config": "0.1.2",
|
|
46
|
+
"@fluentui-react-native/scripts": "0.1.0",
|
|
47
|
+
"@fluentui-react-native/test-tools": "0.1.0",
|
|
44
48
|
"@office-iss/react-native-win32": "^0.74.0",
|
|
45
|
-
"@react-native/babel-preset": "^0.
|
|
46
|
-
"@react
|
|
47
|
-
"@types/react": "
|
|
48
|
-
"
|
|
49
|
-
"react": "
|
|
50
|
-
"react-native": "^0.
|
|
51
|
-
"react-native-
|
|
52
|
-
"react-native-
|
|
53
|
-
"react-
|
|
54
|
-
"react-test-renderer": "18.2.0"
|
|
49
|
+
"@react-native/babel-preset": "^0.81.0",
|
|
50
|
+
"@types/react": "~19.1.0",
|
|
51
|
+
"@types/react-test-renderer": "^19.1.0",
|
|
52
|
+
"react": "19.1.0",
|
|
53
|
+
"react-native": "^0.81.0",
|
|
54
|
+
"react-native-macos": "^0.81.0",
|
|
55
|
+
"react-native-svg": "^15.12.1",
|
|
56
|
+
"react-native-windows": "^0.81.0",
|
|
57
|
+
"react-test-renderer": "19.1.0"
|
|
55
58
|
},
|
|
56
59
|
"peerDependencies": {
|
|
57
60
|
"@office-iss/react-native-win32": "^0.74.0",
|
|
58
|
-
"react": "18.2.0",
|
|
59
|
-
"react
|
|
60
|
-
"react-native
|
|
61
|
-
"react-native-
|
|
62
|
-
"react-native-
|
|
61
|
+
"@types/react": "~18.2.0 || ~19.0.0 || ~19.1.0",
|
|
62
|
+
"react": "18.2.0 || 19.0.0 || 19.1.0",
|
|
63
|
+
"react-native": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0",
|
|
64
|
+
"react-native-macos": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0",
|
|
65
|
+
"react-native-svg": ">=15.0.0 <15.13.0 || >=15.4.0 <15.13.0 || ^15.11.2 || ^15.12.1",
|
|
66
|
+
"react-native-windows": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0"
|
|
67
|
+
},
|
|
68
|
+
"peerDependenciesMeta": {
|
|
69
|
+
"@office-iss/react-native-win32": {
|
|
70
|
+
"optional": true
|
|
71
|
+
},
|
|
72
|
+
"@types/react": {
|
|
73
|
+
"optional": true
|
|
74
|
+
},
|
|
75
|
+
"react-native-macos": {
|
|
76
|
+
"optional": true
|
|
77
|
+
},
|
|
78
|
+
"react-native-windows": {
|
|
79
|
+
"optional": true
|
|
80
|
+
}
|
|
63
81
|
},
|
|
64
|
-
"author": "",
|
|
65
|
-
"license": "MIT",
|
|
66
82
|
"rnx-kit": {
|
|
67
83
|
"kitType": "library",
|
|
68
84
|
"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
85
|
"capabilities": [
|
|
81
86
|
"babel-preset-react-native",
|
|
82
87
|
"core",
|
|
83
88
|
"core-macos",
|
|
84
89
|
"core-windows",
|
|
85
90
|
"react",
|
|
91
|
+
"react-test-renderer",
|
|
86
92
|
"svg",
|
|
87
|
-
"
|
|
93
|
+
"tools-core",
|
|
94
|
+
"tools-jest"
|
|
88
95
|
]
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
"peerDependenciesMeta": {
|
|
92
|
-
"@office-iss/react-native-win32": {
|
|
93
|
-
"optional": true
|
|
94
96
|
},
|
|
95
|
-
"react-native-
|
|
96
|
-
"optional": true
|
|
97
|
-
},
|
|
98
|
-
"react-native-windows": {
|
|
99
|
-
"optional": true
|
|
100
|
-
}
|
|
97
|
+
"extends": "@fluentui-react-native/kit-config"
|
|
101
98
|
}
|
|
102
|
-
}
|
|
99
|
+
}
|
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,
|
|
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 =
|
|
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 = (
|
|
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
|
});
|
package/src/Tooltip.types.ts
CHANGED
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HostComponent, ViewProps } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import { requireNativeComponent } from 'react-native';
|
|
4
|
+
|
|
5
|
+
export interface NativeProps extends ViewProps {
|
|
6
|
+
content?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
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
|
-
|
|
11
|
-
|
|
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
|
-
|
|
15
|
+
);
|
|
16
|
+
});
|
|
17
|
+
const tree = component!.toJSON();
|
|
17
18
|
expect(tree).toMatchSnapshot();
|
|
18
19
|
});
|
|
19
20
|
});
|