mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-06 20:37:44 +00:00
* feat: telemetry Co-authored-by: Kinfe123 <kinfishtech@gmail.com> * chore: remove changeset * fix: do not generate project id unless telemetry is enabled * fix: return `isInsiderContainerCached` Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> * chore: remove unused utils file * fix: properly cache generated project id * feat: interpret empty env vars as false Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> * fix: use nullish coalescing to set fallback * fix: should be `isInsideContainerCached` * fix: unique icons + tooltip for telemetry component * fix: import child process from node * fix: remove quotes in description Co-authored-by: Alex Yang <himself65@outlook.com> * fix: address reviews Co-authored-by: Alex Yang <himself65@outlook.com> * chore: refactor * refactor * add tests * cache pkg json * add cli tracking * add migrate * chore fix xi * skip tet * update snapshot * chore: fix typecheck * Expand telemetry docs: list collected fields, clarify anonymous redaction via getTelemetryAuthConfig, and document CLI events and audit/opt‑out paths. * docs * doc cleanup * fixes * remove git first commit message * update docs --------- Co-authored-by: Kinfe123 <kinfishtech@gmail.com> Co-authored-by: Bereket Engida <86073083+Bekacru@users.noreply.github.com> Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> Co-authored-by: Alex Yang <himself65@outlook.com> Co-authored-by: Bereket Engida <Bekacru@gmail.com>
62 lines
1.7 KiB
TypeScript
62 lines
1.7 KiB
TypeScript
"use client";
|
|
|
|
import * as React from "react";
|
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
|
|
import { cn } from "@/lib/utils";
|
|
|
|
function TooltipProvider({
|
|
delayDuration = 0,
|
|
...props
|
|
}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
|
|
return (
|
|
<TooltipPrimitive.Provider
|
|
data-slot="tooltip-provider"
|
|
delayDuration={delayDuration}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function Tooltip({
|
|
...props
|
|
}: React.ComponentProps<typeof TooltipPrimitive.Root>) {
|
|
return (
|
|
<TooltipProvider>
|
|
<TooltipPrimitive.Root data-slot="tooltip" {...props} />
|
|
</TooltipProvider>
|
|
);
|
|
}
|
|
|
|
function TooltipTrigger({
|
|
...props
|
|
}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
|
|
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />;
|
|
}
|
|
|
|
function TooltipContent({
|
|
className,
|
|
sideOffset = 0,
|
|
children,
|
|
...props
|
|
}: React.ComponentProps<typeof TooltipPrimitive.Content>) {
|
|
return (
|
|
<TooltipPrimitive.Portal>
|
|
<TooltipPrimitive.Content
|
|
data-slot="tooltip-content"
|
|
sideOffset={sideOffset}
|
|
className={cn(
|
|
"bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit rounded-md px-3 py-1.5 text-xs text-balance",
|
|
className,
|
|
)}
|
|
{...props}
|
|
>
|
|
{children}
|
|
<TooltipPrimitive.Arrow className="-z-10 relative bg-primary fill-primary size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" />
|
|
</TooltipPrimitive.Content>
|
|
</TooltipPrimitive.Portal>
|
|
);
|
|
}
|
|
|
|
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|