Skip to content

Commit

Permalink
feat(Flex, SimpleGrid): extends from RootComponentProps (#7700)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackySoul authored Oct 3, 2024
1 parent ccb6246 commit 749b852
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 3 additions & 2 deletions packages/vkui/src/components/Flex/Flex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -39,7 +40,7 @@ type FlexContentProps =
| 'space-between'
| 'space-evenly';

export interface FlexProps extends HTMLAttributesWithRootRef<HTMLDivElement> {
export interface FlexProps extends Omit<RootComponentProps<HTMLElement>, 'baseClassName'> {
/**
* Направление осей, эквивалентно `flex-direction`.
*/
Expand Down
7 changes: 5 additions & 2 deletions packages/vkui/src/components/Flex/FlexItem/FlexItem.tsx
Original file line number Diff line number Diff line change
@@ -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 = {
Expand All @@ -18,7 +19,9 @@ const alignSelfClassNames = {
stretch: styles.alignSelfStretch,
};

export interface FlexItemProps extends HTMLAttributesWithRootRef<HTMLDivElement>, HasChildren {
export interface FlexItemProps
extends Omit<RootComponentProps<HTMLElement>, 'baseClassName'>,
HasChildren {
/**
* Для задания выравнивания, отлично от родительского, эквивалентно `align-self`
*/
Expand Down
5 changes: 3 additions & 2 deletions packages/vkui/src/components/SimpleGrid/SimpleGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -23,7 +24,7 @@ const alignClassNames = {
baseline: styles.alignBaseline,
};

export interface SimpleGridProps extends HTMLAttributesWithRootRef<HTMLDivElement> {
export interface SimpleGridProps extends Omit<RootComponentProps<HTMLElement>, 'baseClassName'> {
/**
* Количество колонок
*/
Expand Down

0 comments on commit 749b852

Please sign in to comment.