@ichaingo/tooltip 1.4.10

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 ADDED
@@ -0,0 +1,7 @@
1
+ # @ichaingo/tooltip
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Running unit tests
6
+
7
+ Run `nx test @ichaingo/tooltip` to execute the unit tests via [Vitest](https://vitest.dev/).
@@ -0,0 +1,12 @@
1
+ type TooltipProps = {
2
+ children: React.ReactNode;
3
+ trigger: React.ReactNode;
4
+ side?: 'top' | 'bottom' | 'left' | 'right';
5
+ contentClassName?: string;
6
+ triggerClassName?: string;
7
+ delayDuration?: number;
8
+ needClick?: boolean;
9
+ };
10
+ export default function CustomTooltip({ children, trigger, side, contentClassName, triggerClassName, delayDuration, needClick }: TooltipProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAIA,KAAK,YAAY,GAAG;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAC3C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAA;AACD,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAmB,EAAE,SAAgB,EAAE,EAAE,YAAY,2CAwBjK"}
package/dist/index.js ADDED
@@ -0,0 +1,20 @@
1
+ 'use client';
2
+ import { jsx as o, jsxs as i } from "react/jsx-runtime";
3
+ import { TooltipProvider as m, Tooltip as g, TooltipTrigger as h, TooltipPortal as u, TooltipContent as T, TooltipArrow as x } from "@radix-ui/react-tooltip";
4
+ import { useState as C } from "react";
5
+ import { twMerge as l } from "tailwind-merge";
6
+ function O({ children: n, trigger: r, side: s = "top", contentClassName: a, triggerClassName: c, delayDuration: p = 300, needClick: d = !0 }) {
7
+ const [e, t] = C(!1), f = () => {
8
+ d && t(!e);
9
+ };
10
+ return /* @__PURE__ */ o(m, { delayDuration: p, children: /* @__PURE__ */ i(g, { open: e, onOpenChange: t, children: [
11
+ /* @__PURE__ */ o(h, { asChild: !0, children: /* @__PURE__ */ o("span", { className: l("inline-block", c), onClick: f, children: r }) }),
12
+ /* @__PURE__ */ o(u, { children: /* @__PURE__ */ i(T, { side: s, align: "center", sideOffset: 10, className: l("bg-icg-black text-icg-white rounded-lg w-[200px] p-2 z-[1000] text-xs fade-in-5 transition-all duration-3000 [&_[role='tooltip']]:select-none", a), children: [
13
+ n,
14
+ /* @__PURE__ */ o(x, { className: "fill-icg-black" })
15
+ ] }) })
16
+ ] }) });
17
+ }
18
+ export {
19
+ O as default
20
+ };
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@ichaingo/tooltip",
3
+ "version": "1.4.10",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ "./package.json": "./package.json",
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "default": "./dist/index.js"
14
+ }
15
+ },
16
+ "peerDependencies": {
17
+ "@radix-ui/react-tooltip": "^1.2.3",
18
+ "react": "^19.1.0",
19
+ "react-dom": "^19.1.0",
20
+ "tailwind-merge": "^2.5.5"
21
+ },
22
+ "devDependencies": {
23
+ "rollup-plugin-preserve-use-client": "^1.0.0"
24
+ },
25
+ "files": [
26
+ "dist",
27
+ "!**/*.tsbuildinfo"
28
+ ]
29
+ }