From daed9e240402a31492c46b2b4aa53b3c27efdbfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Curda?= Date: Tue, 6 Aug 2024 10:22:14 +0200 Subject: [PATCH] fixup! Feat(web-react): Add spacing property to Tabs component #DS-1315 --- .../src/components/Stack/useStackStyleProps.ts | 3 +-- .../Tabs/stories/UncontrolledTabs.stories.tsx | 10 ++++++++++ .../web-react/src/components/Tabs/useTabsStyleProps.ts | 3 +-- packages/web-react/src/hooks/index.ts | 1 + 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/web-react/src/components/Stack/useStackStyleProps.ts b/packages/web-react/src/components/Stack/useStackStyleProps.ts index 5511c500d0..2ada6e2302 100644 --- a/packages/web-react/src/components/Stack/useStackStyleProps.ts +++ b/packages/web-react/src/components/Stack/useStackStyleProps.ts @@ -1,7 +1,6 @@ import classNames from 'classnames'; import { CSSProperties, ElementType } from 'react'; -import { useClassNamePrefix } from '../../hooks'; -import { useSpacingStyle } from '../../hooks/useSpacingStyle'; +import { useClassNamePrefix, useSpacingStyle } from '../../hooks'; import { SpiritStackProps } from '../../types'; interface StackCSSProperties extends CSSProperties { diff --git a/packages/web-react/src/components/Tabs/stories/UncontrolledTabs.stories.tsx b/packages/web-react/src/components/Tabs/stories/UncontrolledTabs.stories.tsx index 85a51850d5..71d6bc34dd 100644 --- a/packages/web-react/src/components/Tabs/stories/UncontrolledTabs.stories.tsx +++ b/packages/web-react/src/components/Tabs/stories/UncontrolledTabs.stories.tsx @@ -11,6 +11,16 @@ const meta: Meta = { type: 'number', }, }, + spacing: { + control: 'object', + }, + }, + args: { + spacing: { + desktop: 'space-700', + mobile: 'space-500', + tablet: 'space-600', + }, }, }; diff --git a/packages/web-react/src/components/Tabs/useTabsStyleProps.ts b/packages/web-react/src/components/Tabs/useTabsStyleProps.ts index f5c3d8e209..207f8429d4 100644 --- a/packages/web-react/src/components/Tabs/useTabsStyleProps.ts +++ b/packages/web-react/src/components/Tabs/useTabsStyleProps.ts @@ -1,7 +1,6 @@ import classNames from 'classnames'; import { CSSProperties } from 'react'; -import { useClassNamePrefix } from '../../hooks'; -import { useSpacingStyle } from '../../hooks/useSpacingStyle'; +import { useClassNamePrefix, useSpacingStyle } from '../../hooks'; import { SpiritTabsProps } from '../../types'; import { useTabContext } from './TabContext'; diff --git a/packages/web-react/src/hooks/index.ts b/packages/web-react/src/hooks/index.ts index 545d9435c4..23a659d86d 100644 --- a/packages/web-react/src/hooks/index.ts +++ b/packages/web-react/src/hooks/index.ts @@ -8,4 +8,5 @@ export * from './useIcon'; export * from './useIsomorphicLayoutEffect'; export * from './useLastActiveFocus'; export * from './useScrollControl'; +export * from './useSpacingStyle'; export * from './useToggle';