From 749b8528f41198918269745f68802b0b895ee6fa Mon Sep 17 00:00:00 2001 From: Victoria Zhizhonkova Date: Thu, 3 Oct 2024 14:47:55 +0700 Subject: [PATCH] feat(Flex, SimpleGrid): extends from RootComponentProps (#7700) --- packages/vkui/src/components/Flex/Flex.tsx | 5 +++-- packages/vkui/src/components/Flex/FlexItem/FlexItem.tsx | 7 +++++-- packages/vkui/src/components/SimpleGrid/SimpleGrid.tsx | 5 +++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/vkui/src/components/Flex/Flex.tsx b/packages/vkui/src/components/Flex/Flex.tsx index c0fa883ae5..6e6dec07fb 100644 --- a/packages/vkui/src/components/Flex/Flex.tsx +++ b/packages/vkui/src/components/Flex/Flex.tsx @@ -7,8 +7,9 @@ import { type GapsProp, rowGapClassNames, } from '../../lib/layouts'; -import type { CSSCustomProperties, HTMLAttributesWithRootRef } from '../../types'; +import type { CSSCustomProperties } from '../../types'; import { RootComponent } from '../RootComponent/RootComponent'; +import type { RootComponentProps } from '../RootComponent/RootComponent'; import { FlexItem, type FlexItemProps } from './FlexItem/FlexItem'; import styles from './Flex.module.css'; @@ -39,7 +40,7 @@ type FlexContentProps = | 'space-between' | 'space-evenly'; -export interface FlexProps extends HTMLAttributesWithRootRef { +export interface FlexProps extends Omit, 'baseClassName'> { /** * Направление осей, эквивалентно `flex-direction`. */ diff --git a/packages/vkui/src/components/Flex/FlexItem/FlexItem.tsx b/packages/vkui/src/components/Flex/FlexItem/FlexItem.tsx index 5bd86dc437..7d424602ff 100644 --- a/packages/vkui/src/components/Flex/FlexItem/FlexItem.tsx +++ b/packages/vkui/src/components/Flex/FlexItem/FlexItem.tsx @@ -1,6 +1,7 @@ import { classNames } from '@vkontakte/vkjs'; -import type { HasChildren, HTMLAttributesWithRootRef } from '../../../types'; +import type { HasChildren } from '../../../types'; import { RootComponent } from '../../RootComponent/RootComponent'; +import type { RootComponentProps } from '../../RootComponent/RootComponent'; import styles from './FlexItem.module.css'; const flexClassNames = { @@ -18,7 +19,9 @@ const alignSelfClassNames = { stretch: styles.alignSelfStretch, }; -export interface FlexItemProps extends HTMLAttributesWithRootRef, HasChildren { +export interface FlexItemProps + extends Omit, 'baseClassName'>, + HasChildren { /** * Для задания выравнивания, отлично от родительского, эквивалентно `align-self` */ diff --git a/packages/vkui/src/components/SimpleGrid/SimpleGrid.tsx b/packages/vkui/src/components/SimpleGrid/SimpleGrid.tsx index fb211f2c8d..fac6a92de8 100644 --- a/packages/vkui/src/components/SimpleGrid/SimpleGrid.tsx +++ b/packages/vkui/src/components/SimpleGrid/SimpleGrid.tsx @@ -5,8 +5,9 @@ import { type GapsProp, rowGapClassNames, } from '../../lib/layouts'; -import type { CSSCustomProperties, HTMLAttributesWithRootRef } from '../../types'; +import type { CSSCustomProperties } from '../../types'; import { RootComponent } from '../RootComponent/RootComponent'; +import type { RootComponentProps } from '../RootComponent/RootComponent'; import styles from './SimpleGrid.module.css'; const marginClassNames = { @@ -23,7 +24,7 @@ const alignClassNames = { baseline: styles.alignBaseline, }; -export interface SimpleGridProps extends HTMLAttributesWithRootRef { +export interface SimpleGridProps extends Omit, 'baseClassName'> { /** * Количество колонок */