diff --git a/src/app/page.tsx b/src/app/page.tsx index d710a003..3a16b20f 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,4 +1,7 @@ +'use client' + import { Button, Chip, ChipButton, QRCode, Typography } from '@/components' +import Tooltip from '@/components/tooltip' const Home = () => { return ( @@ -23,21 +26,12 @@ const Home = () => { Typography Typography Typography - - μ§„μ˜ Pick - - - 🍝 νƒœκ·Έμ„€λͺ… - - - 🍝 νƒœκ·Έμ„€λͺ… - - - λ„λΌλ°©μŠ€ - - ν•œμš°κ°ˆλΉ„ + + null}> + ν…ŒμŠ€νŠΈ ν…ŒμŠ€νŠΈ + ) } -export default Home +export default Home \ No newline at end of file diff --git a/src/components/common/icons/RoundedTriangle.svg b/src/components/common/icons/RoundedTriangle.svg new file mode 100644 index 00000000..c7a42f18 --- /dev/null +++ b/src/components/common/icons/RoundedTriangle.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/common/icons/index.ts b/src/components/common/icons/index.ts index 6a43e282..f29ef9fc 100644 --- a/src/components/common/icons/index.ts +++ b/src/components/common/icons/index.ts @@ -9,6 +9,7 @@ import HeartStraightOutlined from './HeartStraightOutlined.svg' import Info from './Info.svg' import InfoCircle from './InfoCircle.svg' import Plus from './Plus.svg' +import RoundedTriangle from './RoundedTriangle.svg' import Search from './Search.svg' import ShareNetwork from './ShareNetwork.svg' import SignOut from './SignOut.svg' @@ -26,6 +27,7 @@ export const icons = { info: Info, infoCircle: InfoCircle, plus: Plus, + roundedTriangle: RoundedTriangle, search: Search, shareNetwork: ShareNetwork, signOut: SignOut, diff --git a/src/components/tooltip/index.tsx b/src/components/tooltip.tsx similarity index 69% rename from src/components/tooltip/index.tsx rename to src/components/tooltip.tsx index 8ed2b40a..699706b3 100644 --- a/src/components/tooltip/index.tsx +++ b/src/components/tooltip.tsx @@ -2,18 +2,24 @@ import { HTMLAttributes, forwardRef } from 'react' import cn from '@/utils/cn' import { VariantProps, cva } from 'class-variance-authority' -import AccessibleIconButton from '../accessible-icon-button' +import AccessibleIconButton from './accessible-icon-button' +import Typography from './common/typography' +import RoundedTriangle from './common/icons/RoundedTriangle.svg' +import { Icon } from '.' + +/* Polygon 3 */ const TooltipVariants = cva<{ color: Record<'orange' | 'neutral', string> size: Record<'sm' | 'md' | 'lg', string> }>( - `absolute whitespace-nowrap flex gap-2.5 items-center z-10 text-white rounded-full left-0 top-[calc(100%+20px)] after:content-[''] after:absolute after:border-8 after:rounded-sm after:bottom-[calc(100%-11px)] after:left-6 after:rotate-45`, + `absolute whitespace-nowrap flex gap-2.5 items-center z-10 text-white rounded-full left-0 top-[calc(100%+20px)] + `, { variants: { color: { - neutral: `bg-neutral-500 after:border-neutral-500`, - orange: `bg-orange-400 after:border-orange-400`, + neutral: `bg-neutral-500`, + orange: `bg-orange-400`, }, size: { lg: 'px-7 py-5 ', @@ -40,7 +46,7 @@ interface TooltipProps const Tooltip = forwardRef( ({ size, color, className, label, children, onClose, ...props }, ref) => { return ( -
+
{children}
( ref={ref} className={cn(TooltipVariants({ color, size }), className)} > - + {label} - + + ( onClick: onClose, stroke: 'neutral-000', 'aria-hidden': true, + size: 'sm', }} />
diff --git a/src/components/tooltip/tooltip.stories.ts b/src/stories/tooltip.stories.ts similarity index 93% rename from src/components/tooltip/tooltip.stories.ts rename to src/stories/tooltip.stories.ts index 64d3398f..55655fe2 100644 --- a/src/components/tooltip/tooltip.stories.ts +++ b/src/stories/tooltip.stories.ts @@ -1,6 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react' -import Tooltip from '@/components/tooltip/index' +import Tooltip from '@/components/tooltip' const meta = { title: 'DesignSystem/Tooltip',