diff --git a/CHANGELOG.md b/CHANGELOG.md index f3156d2..4865b1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,17 +2,46 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. -### [0.0.477](https://github.com/getpingback/ui/compare/v0.0.476...v0.0.477) (2025-07-30) +### [0.0.481](https://github.com/getpingback/ui/compare/v0.0.480...v0.0.481) (2025-07-30) + + +### Bug Fixes -### [0.0.476](https://github.com/getpingback/ui/compare/v0.0.475...v0.0.476) (2025-07-30) +* add unique layoutId ([224a7a0](https://github.com/getpingback/ui/commits/224a7a04cea0c024085babc0969ff7f5af514ce7)) -### [0.0.475](https://github.com/getpingback/ui/compare/v0.0.474...v0.0.475) (2025-07-30) +### [0.0.480](https://github.com/getpingback/ui/compare/v0.0.479...v0.0.480) (2025-07-30) ### Bug Fixes +* merge ([f0b7bae](https://github.com/getpingback/ui/commits/f0b7baeafca49835c6b31c132dc122e804c067dc)) * **variable-input:** return '\n' ([65a032f](https://github.com/getpingback/ui/commits/65a032fff1cfcb904c9feddaba21f1984fad14cb)) +### [0.0.479](https://github.com/getpingback/ui/compare/v0.0.478...v0.0.479) (2025-07-30) + +### [0.0.478](https://github.com/getpingback/ui/compare/v0.0.477...v0.0.478) (2025-07-30) + +### [0.0.477](https://github.com/getpingback/ui/compare/v0.0.476...v0.0.477) (2025-07-30) + + +### Bug Fixes + +* add unique key on tabs ([b9bab2e](https://github.com/getpingback/ui/commits/b9bab2e7b78084275962d756c3a369407c250698)) + +### [0.0.476](https://github.com/getpingback/ui/compare/v0.0.475...v0.0.476) (2025-07-29) + + +### Bug Fixes + +* onEndReached ([f7c0410](https://github.com/getpingback/ui/commits/f7c0410d8967b6d0521c9ffe6a6c67928376c820)) + +### [0.0.475](https://github.com/getpingback/ui/compare/v0.0.474...v0.0.475) (2025-07-28) + + +### Bug Fixes + +* onEndReached on combobox ([4585957](https://github.com/getpingback/ui/commits/458595769ac9cb8aa164a393cf89f64876deda97)) + ### [0.0.474](https://github.com/getpingback/ui/compare/v0.0.473...v0.0.474) (2025-07-11) diff --git a/package-lock.json b/package-lock.json index 697e914..f02d5eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@getpingback/ui", - "version": "0.0.477", + "version": "0.0.481", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@getpingback/ui", - "version": "0.0.477", + "version": "0.0.481", "license": "MIT", "dependencies": { "@radix-ui/react-accordion": "^1.1.2", diff --git a/package.json b/package.json index 3b16d0f..b505b07 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@getpingback/ui", "author": "Pingback Team", - "version": "0.0.477", + "version": "0.0.481", "license": "MIT", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/src/components/combobox/combobox.tsx b/src/components/combobox/combobox.tsx index 5734598..7133dd7 100644 --- a/src/components/combobox/combobox.tsx +++ b/src/components/combobox/combobox.tsx @@ -101,7 +101,7 @@ export function Combobox({ }, 100); return () => observer.disconnect(); - }, [open, options, onEndReached]); + }, [open, onEndReached, hasSelectedStep]); const comboboxVariants = { default: DefaultVariant, diff --git a/src/components/tabs/tabs.tsx b/src/components/tabs/tabs.tsx index 1c8fe3d..59b82b8 100644 --- a/src/components/tabs/tabs.tsx +++ b/src/components/tabs/tabs.tsx @@ -1,51 +1,53 @@ -import * as React from "react"; -import * as TabsPrimitive from "@radix-ui/react-tabs"; -import { cva, type VariantProps } from "class-variance-authority"; -import { motion } from "framer-motion"; +import * as React from 'react'; +import * as TabsPrimitive from '@radix-ui/react-tabs'; +import { cva, type VariantProps } from 'class-variance-authority'; +import { motion } from 'framer-motion'; -import { cn } from "@/lib/utils"; +import { cn } from '@/lib/utils'; const Tabs = TabsPrimitive.Root; const tabTriggerVariants = cva( - "relative w-full h-full !outline-none rounded-md [&[data-state=active]]:opacity-100 font-semibold text-secondary-foreground text-xs opacity-45 hover:opacity-100 transition-all duration-200 ease-in-out", + 'relative w-full h-full !outline-none rounded-md [&[data-state=active]]:opacity-100 font-semibold text-secondary-foreground text-xs opacity-45 hover:opacity-100 transition-all duration-200 ease-in-out', { variants: { type: { - clear: "[&[data-state=active]]:text-[#9061F9] hover:text-[#9061F9]", - purple: "[&[data-state=active]]:text-[#7E3AF2] hover:text-[#7E3AF2]", - "bottom-line": "[&[data-state=active]]:text-[#7E3AF2] hover:text-[#7E3AF2] bg-transparent", - }, + clear: '[&[data-state=active]]:text-[#9061F9] hover:text-[#9061F9]', + purple: '[&[data-state=active]]:text-[#7E3AF2] hover:text-[#7E3AF2]', + 'bottom-line': '[&[data-state=active]]:text-[#7E3AF2] hover:text-[#7E3AF2] bg-transparent' + } }, defaultVariants: { - type: "purple", - }, + type: 'purple' + } } ); -const tabListVariants = cva("inline-flex items-center justify-center rounded-md text-muted-foreground bg-[#71717A0A]", { +const tabListVariants = cva('inline-flex items-center justify-center rounded-md text-muted-foreground bg-[#71717A0A]', { variants: { height: { - medium: "h-[32px]", - full: "h-[40px] p-1", - }, + medium: 'h-[32px]', + full: 'h-[40px] p-1' + } }, defaultVariants: { - height: "medium", - }, + height: 'medium' + } }); export interface TabsTriggerProps - extends Omit, "type">, - VariantProps {} + extends Omit, 'type'>, + VariantProps { + layoutId?: string; +} -function TabsTrigger({ className, type, ...props }: TabsTriggerProps) { +function TabsTrigger({ className, type, layoutId, ...props }: TabsTriggerProps) { const [isActive, setIsActive] = React.useState(false); const triggerRef: React.MutableRefObject = React.useRef(null); React.useEffect(() => { const handleStateChange = () => { - if (triggerRef.current && triggerRef.current.getAttribute("data-state") === "active") { + if (triggerRef.current && triggerRef.current.getAttribute('data-state') === 'active') { setIsActive(true); } else { setIsActive(false); @@ -56,7 +58,7 @@ function TabsTrigger({ className, type, ...props }: TabsTriggerProps) { const observer = new MutationObserver(handleStateChange); if (triggerRef.current) { - observer.observe(triggerRef.current, { attributes: true, attributeFilter: ["data-state"] }); + observer.observe(triggerRef.current, { attributes: true, attributeFilter: ['data-state'] }); } return () => { @@ -68,27 +70,26 @@ function TabsTrigger({ className, type, ...props }: TabsTriggerProps) { <> -
{props.children}
+
{props.children}
{isActive ? ( ) : null}
@@ -99,36 +100,31 @@ function TabsTrigger({ className, type, ...props }: TabsTriggerProps) { export interface TabWrapperProps { type: string; children: React.ReactNode; + layoutId?: string; } -function TabWrapper({ type, children }: TabWrapperProps) { +function TabWrapper({ type, children, layoutId }: TabWrapperProps) { if (React.Children.count(children) !== 1) return; const child = React.Children.only(children) as React.ReactElement; - return React.cloneElement(child, { type }); + return React.cloneElement(child, { type, layoutId }); } -export interface TabProps - extends Omit, "type">, - VariantProps { - type: "purple" | "clear" | "bottom-line"; - height: "medium" | "full"; +export interface TabProps extends Omit, 'type'>, VariantProps { + type: 'purple' | 'clear' | 'bottom-line'; + height: 'medium' | 'full'; + layoutId?: string; } -function TabsList({ className, type = "purple", height, ...props }: TabProps) { +function TabsList({ className, type = 'purple', height, layoutId, ...props }: TabProps) { return ( {React.Children.map(props.children, (child, index) => ( - + {child} ))} @@ -141,8 +137,8 @@ export interface TabContentProps extends React.ComponentProps );