@kopexa/tooltip 0.0.0-canary-20250719121117
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/README.md +24 -0
- package/dist/chunk-ZVWV2RGK.mjs +55 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +90 -0
- package/dist/index.mjs +7 -0
- package/dist/tooltip.d.mts +17 -0
- package/dist/tooltip.d.ts +17 -0
- package/dist/tooltip.js +88 -0
- package/dist/tooltip.mjs +7 -0
- package/package.json +57 -0
package/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# @kopexa/tooltip
|
|
2
|
+
|
|
3
|
+
A Quick description of the component
|
|
4
|
+
|
|
5
|
+
> This is an internal utility, not intended for public usage.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
yarn add @kopexa/tooltip
|
|
11
|
+
# or
|
|
12
|
+
npm i @kopexa/tooltip
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Contribution
|
|
16
|
+
|
|
17
|
+
Yes please! See the
|
|
18
|
+
[contributing guidelines](https://github.com/kopexa-grc/sight/blob/master/CONTRIBUTING.md)
|
|
19
|
+
for details.
|
|
20
|
+
|
|
21
|
+
## License
|
|
22
|
+
|
|
23
|
+
This project is licensed under the terms of the
|
|
24
|
+
[MIT license](https://github.com/kopexa-grc/sight/blob/master/LICENSE).
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/tooltip.tsx
|
|
4
|
+
import { tooltip } from "@kopexa/theme";
|
|
5
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
function Tooltip(props) {
|
|
8
|
+
const {
|
|
9
|
+
children,
|
|
10
|
+
delayDuration = 0,
|
|
11
|
+
className,
|
|
12
|
+
side,
|
|
13
|
+
sideOffset = 0,
|
|
14
|
+
align,
|
|
15
|
+
alignOffset,
|
|
16
|
+
arrowPadding,
|
|
17
|
+
disabled,
|
|
18
|
+
...rest
|
|
19
|
+
} = props;
|
|
20
|
+
const styles = tooltip();
|
|
21
|
+
if (disabled) {
|
|
22
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
23
|
+
}
|
|
24
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { children: /* @__PURE__ */ jsxs(
|
|
25
|
+
TooltipPrimitive.Root,
|
|
26
|
+
{
|
|
27
|
+
"data-slot": "tooltip-root",
|
|
28
|
+
delayDuration,
|
|
29
|
+
...rest,
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", children }),
|
|
32
|
+
/* @__PURE__ */ jsxs(
|
|
33
|
+
TooltipPrimitive.Content,
|
|
34
|
+
{
|
|
35
|
+
side,
|
|
36
|
+
className: styles.content({ className }),
|
|
37
|
+
"data-slot": "tooltip-content",
|
|
38
|
+
sideOffset,
|
|
39
|
+
align,
|
|
40
|
+
alignOffset,
|
|
41
|
+
arrowPadding,
|
|
42
|
+
children: [
|
|
43
|
+
props.content,
|
|
44
|
+
/* @__PURE__ */ jsx(TooltipPrimitive.Arrow, {})
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
) });
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export {
|
|
54
|
+
Tooltip
|
|
55
|
+
};
|
package/dist/index.d.mts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// src/index.ts
|
|
32
|
+
var index_exports = {};
|
|
33
|
+
__export(index_exports, {
|
|
34
|
+
Tooltip: () => Tooltip
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(index_exports);
|
|
37
|
+
|
|
38
|
+
// src/tooltip.tsx
|
|
39
|
+
var import_theme = require("@kopexa/theme");
|
|
40
|
+
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
41
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
|
+
function Tooltip(props) {
|
|
43
|
+
const {
|
|
44
|
+
children,
|
|
45
|
+
delayDuration = 0,
|
|
46
|
+
className,
|
|
47
|
+
side,
|
|
48
|
+
sideOffset = 0,
|
|
49
|
+
align,
|
|
50
|
+
alignOffset,
|
|
51
|
+
arrowPadding,
|
|
52
|
+
disabled,
|
|
53
|
+
...rest
|
|
54
|
+
} = props;
|
|
55
|
+
const styles = (0, import_theme.tooltip)();
|
|
56
|
+
if (disabled) {
|
|
57
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
|
|
58
|
+
}
|
|
59
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPrimitive.Provider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
60
|
+
TooltipPrimitive.Root,
|
|
61
|
+
{
|
|
62
|
+
"data-slot": "tooltip-root",
|
|
63
|
+
delayDuration,
|
|
64
|
+
...rest,
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", children }),
|
|
67
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
68
|
+
TooltipPrimitive.Content,
|
|
69
|
+
{
|
|
70
|
+
side,
|
|
71
|
+
className: styles.content({ className }),
|
|
72
|
+
"data-slot": "tooltip-content",
|
|
73
|
+
sideOffset,
|
|
74
|
+
align,
|
|
75
|
+
alignOffset,
|
|
76
|
+
arrowPadding,
|
|
77
|
+
children: [
|
|
78
|
+
props.content,
|
|
79
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPrimitive.Arrow, {})
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
) });
|
|
86
|
+
}
|
|
87
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
88
|
+
0 && (module.exports = {
|
|
89
|
+
Tooltip
|
|
90
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
3
|
+
import { ComponentProps } from 'react';
|
|
4
|
+
|
|
5
|
+
type TooltipProps = ComponentProps<typeof TooltipPrimitive.Root> & {
|
|
6
|
+
content?: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
9
|
+
sideOffset?: number;
|
|
10
|
+
align?: "start" | "center" | "end";
|
|
11
|
+
alignOffset?: number;
|
|
12
|
+
arrowPadding?: number;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
};
|
|
15
|
+
declare function Tooltip(props: TooltipProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { Tooltip, type TooltipProps };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
3
|
+
import { ComponentProps } from 'react';
|
|
4
|
+
|
|
5
|
+
type TooltipProps = ComponentProps<typeof TooltipPrimitive.Root> & {
|
|
6
|
+
content?: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
9
|
+
sideOffset?: number;
|
|
10
|
+
align?: "start" | "center" | "end";
|
|
11
|
+
alignOffset?: number;
|
|
12
|
+
arrowPadding?: number;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
};
|
|
15
|
+
declare function Tooltip(props: TooltipProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { Tooltip, type TooltipProps };
|
package/dist/tooltip.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// src/tooltip.tsx
|
|
32
|
+
var tooltip_exports = {};
|
|
33
|
+
__export(tooltip_exports, {
|
|
34
|
+
Tooltip: () => Tooltip
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(tooltip_exports);
|
|
37
|
+
var import_theme = require("@kopexa/theme");
|
|
38
|
+
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
39
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
40
|
+
function Tooltip(props) {
|
|
41
|
+
const {
|
|
42
|
+
children,
|
|
43
|
+
delayDuration = 0,
|
|
44
|
+
className,
|
|
45
|
+
side,
|
|
46
|
+
sideOffset = 0,
|
|
47
|
+
align,
|
|
48
|
+
alignOffset,
|
|
49
|
+
arrowPadding,
|
|
50
|
+
disabled,
|
|
51
|
+
...rest
|
|
52
|
+
} = props;
|
|
53
|
+
const styles = (0, import_theme.tooltip)();
|
|
54
|
+
if (disabled) {
|
|
55
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
|
|
56
|
+
}
|
|
57
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPrimitive.Provider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
58
|
+
TooltipPrimitive.Root,
|
|
59
|
+
{
|
|
60
|
+
"data-slot": "tooltip-root",
|
|
61
|
+
delayDuration,
|
|
62
|
+
...rest,
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", children }),
|
|
65
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
66
|
+
TooltipPrimitive.Content,
|
|
67
|
+
{
|
|
68
|
+
side,
|
|
69
|
+
className: styles.content({ className }),
|
|
70
|
+
"data-slot": "tooltip-content",
|
|
71
|
+
sideOffset,
|
|
72
|
+
align,
|
|
73
|
+
alignOffset,
|
|
74
|
+
arrowPadding,
|
|
75
|
+
children: [
|
|
76
|
+
props.content,
|
|
77
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPrimitive.Arrow, {})
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
) });
|
|
84
|
+
}
|
|
85
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
86
|
+
0 && (module.exports = {
|
|
87
|
+
Tooltip
|
|
88
|
+
});
|
package/dist/tooltip.mjs
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kopexa/tooltip",
|
|
3
|
+
"version": "0.0.0-canary-20250719121117",
|
|
4
|
+
"description": "Floating element that provides a control with contextual information via pointer or focus.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"tooltip"
|
|
7
|
+
],
|
|
8
|
+
"author": "Kopexa <hello@kopexa.com>",
|
|
9
|
+
"homepage": "https://kopexa.com",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"main": "dist/index.js",
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/kopexa-grc/sight.git",
|
|
22
|
+
"directory": "packages/components/tooltip"
|
|
23
|
+
},
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/kopexa-grc/sight/issues"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"motion": ">=12.23.6",
|
|
29
|
+
"react": ">=19.0.0-rc.0",
|
|
30
|
+
"react-dom": ">=19.0.0-rc.0",
|
|
31
|
+
"@kopexa/theme": "0.0.0-canary-20250719121117"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@radix-ui/react-tooltip": "^1.2.7",
|
|
35
|
+
"@kopexa/react-utils": "2.0.0",
|
|
36
|
+
"@kopexa/shared-utils": "1.1.0",
|
|
37
|
+
"@kopexa/use-controllable-state": "1.1.0"
|
|
38
|
+
},
|
|
39
|
+
"clean-package": "../../../clean-package.config.json",
|
|
40
|
+
"module": "dist/index.mjs",
|
|
41
|
+
"types": "dist/index.d.ts",
|
|
42
|
+
"exports": {
|
|
43
|
+
".": {
|
|
44
|
+
"types": "./dist/index.d.ts",
|
|
45
|
+
"import": "./dist/index.mjs",
|
|
46
|
+
"require": "./dist/index.js"
|
|
47
|
+
},
|
|
48
|
+
"./package.json": "./package.json"
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "tsup src --dts",
|
|
52
|
+
"build:fast": "tsup src",
|
|
53
|
+
"dev": "pnpm build:fast --watch",
|
|
54
|
+
"clean": "rimraf dist .turbo",
|
|
55
|
+
"typecheck": "tsc --noEmit"
|
|
56
|
+
}
|
|
57
|
+
}
|