From 9b9a8c15ee030c9874952e798a7056a26762dcf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=ED=98=84=EC=88=98?= <54893898+junghyeonsu@users.noreply.github.com> Date: Wed, 22 Jan 2025 15:48:03 +0900 Subject: [PATCH] feat(headless/tab): orientation type --- packages/react-headless/tabs/src/types.ts | 2 ++ packages/react-headless/tabs/src/useTabs.ts | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-headless/tabs/src/types.ts b/packages/react-headless/tabs/src/types.ts index a0b39e743..06ed9d516 100644 --- a/packages/react-headless/tabs/src/types.ts +++ b/packages/react-headless/tabs/src/types.ts @@ -38,6 +38,8 @@ export interface UseTabsProps extends UseTabsStateProps, UseSwipeableStateProps */ duration?: number; }; + + orientation?: "horizontal" | "vertical"; } export interface TriggerProps { diff --git a/packages/react-headless/tabs/src/useTabs.ts b/packages/react-headless/tabs/src/useTabs.ts index a964e10f9..d0a4e56a5 100644 --- a/packages/react-headless/tabs/src/useTabs.ts +++ b/packages/react-headless/tabs/src/useTabs.ts @@ -119,12 +119,10 @@ export function useTabs(props: UseTabsProps) { onValueChange: omitOnValueChange, isSwipeable = false, swipeConfig, + orientation = "horizontal", ...restProps } = props; - // TODO: orientation prop 추가 - const orientation = "horizontal" as "horizontal" | "vertical"; - const updateIndicatorStyle = React.useCallback(() => { if (rootEl) { rootEl.style.setProperty("--seed-design-tabs-indicator-left", `${triggerSize.left}px`);