From 17d88d0b3bd60cd53617ca6307195e53e747d07e Mon Sep 17 00:00:00 2001 From: Nano Date: Thu, 23 Jan 2025 16:00:54 +0800 Subject: [PATCH 01/14] comp: add `Tooltip.astro` component --- src/components/Tooltip.astro | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/components/Tooltip.astro diff --git a/src/components/Tooltip.astro b/src/components/Tooltip.astro new file mode 100644 index 00000000..6077221f --- /dev/null +++ b/src/components/Tooltip.astro @@ -0,0 +1,51 @@ +--- +import type { HTMLAttributes } from 'astro/types' +import Element from 'fulldev-ui/components/Element.astro' + +interface Props extends HTMLAttributes<'div'> { + isTransition?: boolean | undefined + text?: string | undefined + placement?: 'top' | 'right' | 'bottom' | 'left' | undefined +} + +const { isTransition = true, text, placement = 'bottom', ...rest } = Astro.props + +const transitonClasses = isTransition ? 'transition' : '' +const placementClasses = (() => { + switch (placement) { + case 'top': + return 'bottom-full' + case 'right': + return 'left-full top-0' + case 'left': + return 'right-full top-0' + case 'bottom': + return '' + default: + return '' + } +})() +--- + + + + + + + + From 23ee469e0bb65f013da7c5ff48a2d92f00778ec7 Mon Sep 17 00:00:00 2001 From: fulldev-bot Date: Thu, 23 Jan 2025 11:05:27 +0000 Subject: [PATCH 02/14] Bump to version 0.6.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6d72b12c..420c2984 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fulldev-ui", - "version": "0.6.3", + "version": "0.6.4", "description": "A component library built for Astro", "homepage": "https://ui.full.dev", "bugs": "https://github.com/fulldotdev/ui/issues", From da9035009b6f1831eb8c45aedfe7a0eef98bb823 Mon Sep 17 00:00:00 2001 From: Nano Date: Thu, 23 Jan 2025 20:05:48 +0800 Subject: [PATCH 03/14] refactor: Fix typo in `transitionClasses` variable name --- src/components/Tooltip.astro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Tooltip.astro b/src/components/Tooltip.astro index 6077221f..62c5c607 100644 --- a/src/components/Tooltip.astro +++ b/src/components/Tooltip.astro @@ -10,7 +10,7 @@ interface Props extends HTMLAttributes<'div'> { const { isTransition = true, text, placement = 'bottom', ...rest } = Astro.props -const transitonClasses = isTransition ? 'transition' : '' +const transitionClasses = isTransition ? 'transition' : '' const placementClasses = (() => { switch (placement) { case 'top': @@ -33,7 +33,7 @@ const placementClasses = (() => { > -