♻️ Re-use MoreInfoTooltip for lp and builder

This commit is contained in:
Baptiste Arnaud 2025-09-17 15:04:01 +02:00
parent 6cdbc7c9d8
commit b1f030be19
No known key found for this signature in database
33 changed files with 30 additions and 54 deletions

View File

@ -11,6 +11,7 @@ import {
} from "@chakra-ui/react";
import { env } from "@typebot.io/env";
import { isDefined } from "@typebot.io/lib/utils";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import type { Variable } from "@typebot.io/variables/schemas";
import {
type LanguageName,
@ -24,7 +25,6 @@ import { useEffect, useRef, useState } from "react";
import { useDebouncedCallback } from "use-debounce";
import { VariablesButton } from "@/features/variables/components/VariablesButton";
import { CopyButton } from "../CopyButton";
import { MoreInfoTooltip } from "../MoreInfoTooltip";
type Props = {
label?: string;

View File

@ -13,12 +13,12 @@ import {
Text,
} from "@chakra-ui/react";
import { env } from "@typebot.io/env";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import type { Variable, VariableString } from "@typebot.io/variables/schemas";
import type { ReactNode } from "react";
import { useEffect, useState } from "react";
import { useDebouncedCallback } from "use-debounce";
import { VariablesButton } from "@/features/variables/components/VariablesButton";
import { MoreInfoTooltip } from "../MoreInfoTooltip";
type Value<HasVariable> = HasVariable extends true | undefined
? number | VariableString

View File

@ -7,8 +7,8 @@ import {
type SwitchProps,
} from "@chakra-ui/react";
import { isDefined } from "@typebot.io/lib/utils";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import { useEffect, useState } from "react";
import { MoreInfoTooltip } from "../MoreInfoTooltip";
export type SwitchWithLabelProps = {
label: string;

View File

@ -8,6 +8,7 @@ import {
Stack,
} from "@chakra-ui/react";
import { env } from "@typebot.io/env";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import type { Variable } from "@typebot.io/variables/schemas";
import type React from "react";
import type { ReactNode } from "react";
@ -22,7 +23,6 @@ import { useDebouncedCallback } from "use-debounce";
import { VariablesButton } from "@/features/variables/components/VariablesButton";
import { injectVariableInText } from "@/features/variables/helpers/injectVariableInTextInput";
import { focusInput } from "@/helpers/focusInput";
import { MoreInfoTooltip } from "../MoreInfoTooltip";
export type TextInputProps = {
forceDebounce?: boolean;

View File

@ -8,6 +8,7 @@ import {
type TextareaProps,
} from "@chakra-ui/react";
import { env } from "@typebot.io/env";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import type { Variable } from "@typebot.io/variables/schemas";
import type React from "react";
import type { ReactNode } from "react";
@ -16,7 +17,6 @@ import { useDebouncedCallback } from "use-debounce";
import { VariablesButton } from "@/features/variables/components/VariablesButton";
import { injectVariableInText } from "@/features/variables/helpers/injectVariableInTextInput";
import { focusInput } from "@/helpers/focusInput";
import { MoreInfoTooltip } from "../MoreInfoTooltip";
type Props = {
id?: string;

View File

@ -15,6 +15,7 @@ import { createId } from "@paralleldrive/cuid2";
import { useTranslate } from "@tolgee/react";
import { byId, isDefined, isNotDefined } from "@typebot.io/lib/utils";
import { Button } from "@typebot.io/ui/components/Button";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import { Popover } from "@typebot.io/ui/components/Popover";
import { EditIcon } from "@typebot.io/ui/icons/EditIcon";
import { TrashIcon } from "@typebot.io/ui/icons/TrashIcon";
@ -26,7 +27,6 @@ import { useRef, useState } from "react";
import { PlusIcon } from "@/components/icons";
import { useTypebot } from "@/features/editor/providers/TypebotProvider";
import { useOpenControls } from "@/hooks/useOpenControls";
import { MoreInfoTooltip } from "../MoreInfoTooltip";
type Props = {
initialVariableId: string | undefined;

View File

@ -14,8 +14,8 @@ import { prices } from "@typebot.io/billing/constants";
import { formatPrice } from "@typebot.io/billing/helpers/formatPrice";
import { Plan } from "@typebot.io/prisma/enum";
import { Button } from "@typebot.io/ui/components/Button";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import { Tooltip } from "@typebot.io/ui/components/Tooltip";
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
import { ChatsProTiersDialog } from "./ChatsProTiersDialog";
import { FeaturesList } from "./FeaturesList";

View File

@ -11,7 +11,7 @@ import { prices } from "@typebot.io/billing/constants";
import { formatPrice } from "@typebot.io/billing/helpers/formatPrice";
import { Plan } from "@typebot.io/prisma/enum";
import { Button } from "@typebot.io/ui/components/Button";
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import { FeaturesList } from "./FeaturesList";
type Props = {

View File

@ -2,11 +2,11 @@ import { FormControl, FormLabel, Stack } from "@chakra-ui/react";
import { useTranslate } from "@tolgee/react";
import { defaultChoiceInputOptions } from "@typebot.io/blocks-inputs/choice/constants";
import type { ChoiceInputBlock } from "@typebot.io/blocks-inputs/choice/schema";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import type { Variable } from "@typebot.io/variables/schemas";
import { TextInput } from "@/components/inputs";
import { SwitchWithLabel } from "@/components/inputs/SwitchWithLabel";
import { VariableSearchInput } from "@/components/inputs/VariableSearchInput";
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
import { SwitchWithRelatedSettings } from "@/components/SwitchWithRelatedSettings";
type Props = {

View File

@ -14,13 +14,13 @@ import {
} from "@typebot.io/blocks-inputs/file/constants";
import type { FileInputBlock } from "@typebot.io/blocks-inputs/file/schema";
import { Field } from "@typebot.io/ui/components/Field";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import type { Variable } from "@typebot.io/variables/schemas";
import { TextInput } from "@/components/inputs";
import { BasicSelect } from "@/components/inputs/BasicSelect";
import { CodeEditor } from "@/components/inputs/CodeEditor";
import { SwitchWithLabel } from "@/components/inputs/SwitchWithLabel";
import { VariableSearchInput } from "@/components/inputs/VariableSearchInput";
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
import { SwitchWithRelatedSettings } from "@/components/SwitchWithRelatedSettings";
import { TagsInput } from "@/components/TagsInput";

View File

@ -5,10 +5,10 @@ import type { StripeCredentials } from "@typebot.io/credentials/schemas";
import { isNotEmpty } from "@typebot.io/lib/utils";
import { Button } from "@typebot.io/ui/components/Button";
import { Dialog } from "@typebot.io/ui/components/Dialog";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import type React from "react";
import { useState } from "react";
import { TextInput } from "@/components/inputs";
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
import { TextLink } from "@/components/TextLink";
import { useUser } from "@/features/user/hooks/useUser";
import { useWorkspace } from "@/features/workspace/WorkspaceProvider";

View File

@ -5,9 +5,9 @@ import type { StripeCredentials } from "@typebot.io/credentials/schemas";
import { isNotEmpty } from "@typebot.io/lib/utils";
import { Button } from "@typebot.io/ui/components/Button";
import { Dialog } from "@typebot.io/ui/components/Dialog";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import { useEffect, useState } from "react";
import { TextInput } from "@/components/inputs";
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
import { TextLink } from "@/components/TextLink";
import { useUser } from "@/features/user/hooks/useUser";
import { useWorkspace } from "@/features/workspace/WorkspaceProvider";

View File

@ -5,12 +5,12 @@ import { defaultTextInputOptions } from "@typebot.io/blocks-inputs/text/constant
import type { TextInputBlock } from "@typebot.io/blocks-inputs/text/schema";
import { inputModeOptions } from "@typebot.io/blocks-inputs/text/schema";
import { Field } from "@typebot.io/ui/components/Field";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import type { Variable } from "@typebot.io/variables/schemas";
import { TextInput } from "@/components/inputs";
import { BasicSelect } from "@/components/inputs/BasicSelect";
import { SwitchWithLabel } from "@/components/inputs/SwitchWithLabel";
import { VariableSearchInput } from "@/components/inputs/VariableSearchInput";
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
import { SwitchWithRelatedSettings } from "@/components/SwitchWithRelatedSettings";
type Props = {

View File

@ -1,6 +1,6 @@
import { HStack, Input } from "@chakra-ui/react";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import { BasicSelect } from "@/components/inputs/BasicSelect";
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
import type { Sheet } from "../types";
type Props = {

View File

@ -16,13 +16,13 @@ import { defaultSendEmailOptions } from "@typebot.io/blocks-integrations/sendEma
import type { SendEmailBlock } from "@typebot.io/blocks-integrations/sendEmail/schema";
import { env } from "@typebot.io/env";
import { isNotEmpty } from "@typebot.io/lib/utils";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import type { Variable } from "@typebot.io/variables/schemas";
import type { Workspace } from "@typebot.io/workspaces/schemas";
import { Textarea, TextInput } from "@/components/inputs";
import { CodeEditor } from "@/components/inputs/CodeEditor";
import { SwitchWithLabel } from "@/components/inputs/SwitchWithLabel";
import { VariableSearchInput } from "@/components/inputs/VariableSearchInput";
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
import { isFreePlan } from "@/features/billing/helpers/isFreePlan";
import { CredentialsDropdown } from "@/features/credentials/components/CredentialsDropdown";
import { useWorkspace } from "@/features/workspace/WorkspaceProvider";

View File

@ -1,7 +1,7 @@
import { useDisclosure } from "@chakra-ui/react";
import { useQuery } from "@tanstack/react-query";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import { XCircleIcon } from "@/components/icons";
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
import { trpc } from "@/lib/queryClient";
import { CustomDomainConfigDialog } from "./CustomDomainConfigDialog";

View File

@ -9,9 +9,9 @@ import {
} from "@chakra-ui/react";
import { useTranslate } from "@tolgee/react";
import type { InvalidReplyEvent } from "@typebot.io/events/schemas";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import type { Variable } from "@typebot.io/variables/schemas";
import { VariableSearchInput } from "@/components/inputs/VariableSearchInput";
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
export const InvalidReplyEventSettings = ({
options,

View File

@ -9,9 +9,9 @@ import {
} from "@chakra-ui/react";
import { useTranslate } from "@tolgee/react";
import type { ReplyEvent } from "@typebot.io/events/schemas";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import type { Variable } from "@typebot.io/variables/schemas";
import { VariableSearchInput } from "@/components/inputs/VariableSearchInput";
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
export const ReplyEventSettings = ({
options,

View File

@ -1,5 +1,6 @@
import type { ForgedBlockDefinition } from "@typebot.io/forge-repository/definitions";
import type { ForgedBlock } from "@typebot.io/forge-repository/schemas";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import { cx } from "@typebot.io/ui/lib/cva";
import { type ReactNode, useEffect, useRef } from "react";
import {
@ -9,7 +10,6 @@ import {
} from "@/components/collections";
import { Combobox } from "@/components/combobox";
import { Field } from "@/components/field";
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
import { Portal } from "@/components/Portal";
import { VariablesButton } from "@/features/variables/components/VariablesButton";
import { useDebounce } from "@/hooks/useDebounce";

View File

@ -7,9 +7,9 @@ import {
} from "@chakra-ui/react";
import type { ForgedBlockDefinition } from "@typebot.io/forge-repository/definitions";
import type { ForgedBlock } from "@typebot.io/forge-repository/schemas";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import type { ReactNode } from "react";
import { BasicSelect } from "@/components/inputs/BasicSelect";
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
import { useSelectItemsQuery } from "../hooks/useSelectItemsQuery";
type Props = {

View File

@ -3,6 +3,7 @@ import { evaluateIsHidden } from "@typebot.io/forge/helpers/evaluateIsHidden";
import type { ForgedBlockDefinition } from "@typebot.io/forge-repository/definitions";
import type { ForgedBlock } from "@typebot.io/forge-repository/schemas";
import { Field } from "@typebot.io/ui/components/Field";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import type { ZodLayoutMetadata } from "@typebot.io/zod";
import Markdown, { type Components } from "react-markdown";
import type { ZodTypeAny, z } from "zod";
@ -11,7 +12,6 @@ import { BasicSelect } from "@/components/inputs/BasicSelect";
import { CodeEditor } from "@/components/inputs/CodeEditor";
import { SwitchWithLabel } from "@/components/inputs/SwitchWithLabel";
import { VariableSearchInput } from "@/components/inputs/VariableSearchInput";
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
import { PrimitiveList } from "@/components/PrimitiveList";
import { TableList } from "@/components/TableList";
import { TagsInput } from "@/components/TagsInput";

View File

@ -19,9 +19,9 @@ import {
rememberUserStorages,
} from "@typebot.io/settings/constants";
import type { Settings, SystemMessages } from "@typebot.io/settings/schemas";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import { BasicSelect } from "@/components/inputs/BasicSelect";
import { SwitchWithLabel } from "@/components/inputs/SwitchWithLabel";
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
import { SwitchWithRelatedSettings } from "@/components/SwitchWithRelatedSettings";
import { SystemMessagesForm } from "./SystemMessagesForm";

View File

@ -3,12 +3,12 @@ import { useTranslate } from "@tolgee/react";
import { env } from "@typebot.io/env";
import { defaultSettings } from "@typebot.io/settings/constants";
import type { Settings } from "@typebot.io/settings/schemas";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import { Popover } from "@typebot.io/ui/components/Popover";
import { ImageUploadContent } from "@/components/ImageUploadContent";
import { Textarea, TextInput } from "@/components/inputs";
import { CodeEditor } from "@/components/inputs/CodeEditor";
import { SwitchWithLabel } from "@/components/inputs/SwitchWithLabel";
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
import { useOpenControls } from "@/hooks/useOpenControls";
type Props = {

View File

@ -3,7 +3,7 @@ import { useTranslate } from "@tolgee/react";
import { env } from "@typebot.io/env";
import { isDefined } from "@typebot.io/lib/utils";
import type { Settings } from "@typebot.io/settings/schemas";
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import { TagsInput } from "@/components/TagsInput";
type Props = {

View File

@ -12,10 +12,10 @@ import {
import type { ProgressBar } from "@typebot.io/theme/schemas";
import type { TypebotV6 } from "@typebot.io/typebot/schemas/typebot";
import { Field } from "@typebot.io/ui/components/Field";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import { ColorPicker } from "@/components/ColorPicker";
import { NumberInput } from "@/components/inputs";
import { BasicSelect } from "@/components/inputs/BasicSelect";
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
import { SwitchWithRelatedSettings } from "@/components/SwitchWithRelatedSettings";
type Props = {

View File

@ -3,12 +3,12 @@ import type { BlockV6 } from "@typebot.io/blocks-core/schemas/schema";
import type { Credentials } from "@typebot.io/credentials/schemas";
import { forgedBlocks } from "@typebot.io/forge-repository/definitions";
import { Field } from "@typebot.io/ui/components/Field";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import { defaultGroupTitleGenPrompt } from "@typebot.io/user/constants";
import type { GroupTitlesAutoGeneration } from "@typebot.io/user/schemas";
import { useState } from "react";
import { Textarea } from "@/components/inputs";
import { BasicSelect } from "@/components/inputs/BasicSelect";
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
import { CredentialsCreateDialog } from "@/features/credentials/components/CredentialsCreateDialog";
import { CredentialsDropdown } from "@/features/credentials/components/CredentialsDropdown";
import { BlockIcon } from "@/features/editor/components/BlockIcon";

View File

@ -1,11 +1,11 @@
import { Heading, HStack, Stack } from "@chakra-ui/react";
import { useTolgee, useTranslate } from "@tolgee/react";
import { GraphNavigation } from "@typebot.io/prisma/enum";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import type { GroupTitlesAutoGeneration } from "@typebot.io/user/schemas";
import { useRouter } from "next/router";
import { useEffect } from "react";
import { BasicSelect } from "@/components/inputs/BasicSelect";
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
import { SwitchWithRelatedSettings } from "@/components/SwitchWithRelatedSettings";
import { VideoOnboardingPopover } from "@/features/onboarding/components/VideoOnboardingPopover";
import { setLocaleInCookies } from "../helpers/setLocaleInCookies";

View File

@ -1,23 +0,0 @@
import { Portal } from "@ark-ui/react/portal";
import { Tooltip } from "@ark-ui/react/tooltip";
import { HelpCircleIcon } from "@typebot.io/ui/icons/CircleHelpIcon";
type Props = {
children: React.ReactNode;
};
export const MoreInfoTooltip = ({ children }: Props) => {
return (
<Tooltip.Root openDelay={0} closeDelay={0}>
<Tooltip.Trigger>
<HelpCircleIcon className="size-4 inline-flex" />
</Tooltip.Trigger>
<Portal>
<Tooltip.Positioner>
<Tooltip.Content className="bg-gray-1 p-4 border border-gray-6 shadow-md max-w-sm rounded-md text-sm data-[state=open]:motion-opacity-in-0 data-[state=open]:motion-translate-y-in-[-5px] motion-duration-300">
{children}
</Tooltip.Content>
</Tooltip.Positioner>
</Portal>
</Tooltip.Root>
);
};

View File

@ -2,10 +2,10 @@ import { chatsLimits, seatsLimits } from "@typebot.io/billing/constants";
import { formatPrice } from "@typebot.io/billing/helpers/formatPrice";
import { parseNumberWithCommas } from "@typebot.io/lib/utils";
import { Button } from "@typebot.io/ui/components/Button";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import { InfinityIcon } from "@typebot.io/ui/icons/InfinityIcon";
import { TickIcon } from "@typebot.io/ui/icons/TickIcon";
import { cn } from "@typebot.io/ui/lib/cn";
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
import {
Table,
TableBody,

View File

@ -6,8 +6,8 @@ import {
import { formatPrice } from "@typebot.io/billing/helpers/formatPrice";
import { Plan } from "@typebot.io/prisma/enum";
import { Button } from "@typebot.io/ui/components/Button";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import { CtaButtonLink } from "@/components/link";
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
import { registerUrl } from "@/constants";
import {
PerkListItem,

View File

@ -5,8 +5,8 @@ import {
} from "@typebot.io/billing/constants";
import { formatPrice } from "@typebot.io/billing/helpers/formatPrice";
import { Plan } from "@typebot.io/prisma/enum";
import { MoreInfoTooltip } from "@typebot.io/ui/components/MoreInfoTooltip";
import { CtaButtonLink } from "@/components/link";
import { MoreInfoTooltip } from "@/components/MoreInfoTooltip";
import { registerUrl } from "@/constants";
import {
PerkListItem,

View File

@ -1,4 +1,3 @@
import { env } from "@typebot.io/env";
import { forgedBlocks } from "@typebot.io/forge-repository/definitions";
import { parseUnknownError } from "@typebot.io/lib/parseUnknownError";
import prisma from "@typebot.io/prisma";