From 915095f6408abdabeb7f2e5bfb6343da12af31eb Mon Sep 17 00:00:00 2001 From: DGiannaris Date: Tue, 3 Sep 2024 14:43:11 +0300 Subject: [PATCH] chore: format files --- .../storybook/src/stories/Tooltip.stories.tsx | 6 ++-- packages/ui/src/components/Tooltip/index.tsx | 32 +++---------------- packages/ui/src/components/Tooltip/styles.ts | 14 ++++---- packages/ui/src/tailwind/shadcn-plugin.ts | 2 +- 4 files changed, 15 insertions(+), 39 deletions(-) diff --git a/examples/storybook/src/stories/Tooltip.stories.tsx b/examples/storybook/src/stories/Tooltip.stories.tsx index 524e866..c3f0651 100644 --- a/examples/storybook/src/stories/Tooltip.stories.tsx +++ b/examples/storybook/src/stories/Tooltip.stories.tsx @@ -47,8 +47,7 @@ export const Uncontrolled: Story = { defaultValue: { summary: "false" }, }, type: "boolean", - description: - "The controlled open state of the tooltip. Must be used in conjunction with onOpenChange.", + description: "The controlled open state of the tooltip. Must be used in conjunction with onOpenChange.", defaultValue: false, required: false, }, @@ -56,8 +55,7 @@ export const Uncontrolled: Story = { table: { type: { summary: "(open: boolean) => void" }, }, - description: - "Event handler called when the open state of the tooltip changes.", + description: "Event handler called when the open state of the tooltip changes.", control: false, required: false, }, diff --git a/packages/ui/src/components/Tooltip/index.tsx b/packages/ui/src/components/Tooltip/index.tsx index 9dc4a74..aa815b2 100644 --- a/packages/ui/src/components/Tooltip/index.tsx +++ b/packages/ui/src/components/Tooltip/index.tsx @@ -1,27 +1,13 @@ import * as TooltipPrimitive from "@radix-ui/react-tooltip"; import { Text } from "../Text"; import { cn } from "../../utils/cn"; -import type { - TooltipRootProps, - TooltipContentProps, - TooltipTriggerProps, -} from "./types"; +import type { TooltipRootProps, TooltipContentProps, TooltipTriggerProps } from "./types"; import { sharedTooltipStyles } from "./styles"; -export const TooltipRoot = ({ - children, - defaultOpen, - open, - onOpenChange, -}: TooltipRootProps) => { +export const TooltipRoot = ({ children, defaultOpen, open, onOpenChange }: TooltipRootProps) => { return ( - + {children} @@ -30,18 +16,10 @@ export const TooltipRoot = ({ TooltipRoot.displayName = "Tooltip.Root"; -export const TooltipContent = ({ - children, - label, - className, -}: TooltipContentProps) => { +export const TooltipContent = ({ children, label, className }: TooltipContentProps) => { return ( - + {label ? ( {label} diff --git a/packages/ui/src/components/Tooltip/styles.ts b/packages/ui/src/components/Tooltip/styles.ts index 3b5f8fc..e1518a6 100644 --- a/packages/ui/src/components/Tooltip/styles.ts +++ b/packages/ui/src/components/Tooltip/styles.ts @@ -1,10 +1,10 @@ import { cn } from "../../utils/cn"; export const sharedTooltipStyles = cn( - "py-2 px-3 rounded-md bg-gray-700 text-white max-w-[200px]", - "will-change-[transform,opacity]", - "data-[state=delayed-open]:data-[side=top]:animate-slide-up-and-fade", - "data-[state=delayed-open]:data-[side=right]:animate-slide-right-and-fade", - "data-[state=delayed-open]:data-[side=left]:animate-slide-left-and-fade", - "data-[state=delayed-open]:data-[side=bottom]:animate-slide-down-and-fade", -); + "py-2 px-3 rounded-md bg-gray-700 text-white max-w-[200px]", + "will-change-[transform,opacity]", + "data-[state=delayed-open]:data-[side=top]:animate-slide-up-and-fade", + "data-[state=delayed-open]:data-[side=right]:animate-slide-right-and-fade", + "data-[state=delayed-open]:data-[side=left]:animate-slide-left-and-fade", + "data-[state=delayed-open]:data-[side=bottom]:animate-slide-down-and-fade", +); diff --git a/packages/ui/src/tailwind/shadcn-plugin.ts b/packages/ui/src/tailwind/shadcn-plugin.ts index 97e386d..92529bf 100644 --- a/packages/ui/src/tailwind/shadcn-plugin.ts +++ b/packages/ui/src/tailwind/shadcn-plugin.ts @@ -184,5 +184,5 @@ export const shadcnPlugin = plugin( }, }, }, - } + }, );