Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/vkui/src/components/ActionSheet/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type * as React from 'react';
import type { PlacementWithAuto } from '../../lib/floating/types/common';
import type { HasComponent, HasRootRef } from '../../types';
import type { HasComponent, HasRender, HasRootRef } from '../../types';

export type ToggleRef = Element | null | undefined | React.RefObject<Element | null>;

Expand Down Expand Up @@ -34,7 +34,8 @@ export interface SharedDropdownProps
extends UseFocusTrapProps,
Omit<React.AllHTMLAttributes<HTMLElement>, keyof UseFocusTrapProps>,
HasRootRef<HTMLElement>,
HasComponent {
HasComponent,
HasRender<HTMLElement> {
/**
* Состояние закрытия всплывающего окна.
*/
Expand Down
7 changes: 5 additions & 2 deletions packages/vkui/src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { classNames } from '@vkontakte/vkjs';
import type { HasComponent, HTMLAttributesWithRootRef } from '../../types';
import type { HasComponent, HasRender, HTMLAttributesWithRootRef } from '../../types';
import { RootComponent } from '../RootComponent/RootComponent';
import styles from './Card.module.css';

export interface CardProps extends HTMLAttributesWithRootRef<HTMLDivElement>, HasComponent {
export interface CardProps
extends HTMLAttributesWithRootRef<HTMLDivElement>,
HasComponent,
HasRender<HTMLDivElement> {
/**
* Внешний вид карточки.
*/
Expand Down
7 changes: 5 additions & 2 deletions packages/vkui/src/components/CardGrid/CardGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { classNames } from '@vkontakte/vkjs';
import { useAdaptivity } from '../../hooks/useAdaptivity';
import { type SizeTypeValues, ViewWidth, type ViewWidthType } from '../../lib/adaptivity';
import type { HasComponent, HTMLAttributesWithRootRef } from '../../types';
import type { HasComponent, HasRender, HTMLAttributesWithRootRef } from '../../types';
import { RootComponent } from '../RootComponent/RootComponent';
import styles from './CardGrid.module.css';

Expand All @@ -30,7 +30,10 @@ const stylesSize = {
l: 'vkuiInternalCardGrid--size-l',
};

export interface CardGridProps extends HTMLAttributesWithRootRef<HTMLDivElement>, HasComponent {
export interface CardGridProps
extends HTMLAttributesWithRootRef<HTMLDivElement>,
HasComponent,
HasRender<HTMLDivElement> {
/**
* Размер карточек.
*/
Expand Down
3 changes: 2 additions & 1 deletion packages/vkui/src/components/CardScroll/CardScroll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import * as React from 'react';
import { classNames } from '@vkontakte/vkjs';
import { useConfigDirection } from '../../hooks/useConfigDirection';
import type { HasComponent, HTMLAttributesWithRootRef } from '../../types';
import type { HasComponent, HasRender, HTMLAttributesWithRootRef } from '../../types';
import { HorizontalScroll, type HorizontalScrollProps } from '../HorizontalScroll/HorizontalScroll';
import { RootComponent } from '../RootComponent/RootComponent';
import styles from './CardScroll.module.css';
Expand All @@ -17,6 +17,7 @@ const stylesSize = {
export interface CardScrollProps
extends HTMLAttributesWithRootRef<HTMLDivElement>,
HasComponent,
HasRender<HTMLDivElement>,
Pick<HorizontalScrollProps, 'showArrows' | 'prevButtonTestId' | 'nextButtonTestId'> {
/**
* При `size=false` ширина `Card` будет регулироваться контентом внутри. В остальных случаях — будет явно задана в процентах.
Expand Down
10 changes: 8 additions & 2 deletions packages/vkui/src/components/ChipsInputBase/Chip/Chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import { classNames, hasReactNode } from '@vkontakte/vkjs';
import { useAdaptivity } from '../../../hooks/useAdaptivity';
import { useFocusVisible } from '../../../hooks/useFocusVisible';
import { useFocusVisibleClassName } from '../../../hooks/useFocusVisibleClassName';
import type { HasComponent, HasDataAttribute, HTMLAttributesWithRootRef } from '../../../types';
import type {
HasComponent,
HasDataAttribute,
HasRender,
HTMLAttributesWithRootRef,
} from '../../../types';
import { RootComponent } from '../../RootComponent/RootComponent';
import { Footnote } from '../../Typography/Footnote/Footnote';
import { VisuallyHidden } from '../../VisuallyHidden/VisuallyHidden';
Expand All @@ -26,7 +31,8 @@ const modeClassNames = {
export interface ChipProps
extends HasComponent,
HasDataAttribute,
HTMLAttributesWithRootRef<HTMLElement> {
HTMLAttributesWithRootRef<HTMLElement>,
HasRender<HTMLElement> {
/**
* Режим отображения компонента.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/vkui/src/components/ContentCard/ContentCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import styles from './ContentCard.module.css';
export interface ContentCardProps
extends HasRootRef<HTMLDivElement>,
HasComponent,
Omit<TappableOmitProps, 'getRootRef' | 'crossOrigin' | 'title' | 'src'>,
Omit<TappableOmitProps, 'getRootRef' | 'crossOrigin' | 'title' | 'src' | 'render'>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а почему тут удаляем? Component ведь можно передать

Omit<React.ImgHTMLAttributes<HTMLImageElement>, keyof React.HTMLAttributes<HTMLImageElement>>,
HasRef<HTMLImageElement> {
/**
Expand Down
6 changes: 4 additions & 2 deletions packages/vkui/src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import type * as React from 'react';
import { classNames } from '@vkontakte/vkjs';
import type { HasComponent } from '../../types';
import type { HasComponent, HasRender } from '../../types';
import { Footnote } from '../Typography/Footnote/Footnote';
import styles from './Footer.module.css';

export type FooterProps = React.AllHTMLAttributes<HTMLElement> & HasComponent;
export type FooterProps = React.AllHTMLAttributes<HTMLElement> &
HasComponent &
HasRender<HTMLElement>;

/**
* @see https://vkui.io/components/group#footer
Expand Down
3 changes: 2 additions & 1 deletion packages/vkui/src/components/FormItem/FormItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { classNames, hasReactNode, isPrimitiveReactNode } from '@vkontakte/vkjs'
import { useAdaptivity } from '../../hooks/useAdaptivity';
import { useExternRef } from '../../hooks/useExternRef';
import { defineComponentDisplayNames } from '../../lib/react/defineComponentDisplayNames';
import type { HasComponent, HasRootRef } from '../../types';
import type { HasComponent, HasRender, HasRootRef } from '../../types';
import { Removable, type RemovableProps } from '../Removable/Removable';
import { RootComponent } from '../RootComponent/RootComponent';
import { Footnote } from '../Typography/Footnote/Footnote';
Expand All @@ -29,6 +29,7 @@ export interface FormItemProps
extends React.AllHTMLAttributes<HTMLElement>,
HasRootRef<HTMLElement>,
HasComponent,
HasRender<HTMLElement>,
RemovableProps {
/**
* Дополнительный элемент, отображаемый над содержимым.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import type { HasComponent, HTMLAttributesWithRootRef } from '../../../types';
import type { HasComponent, HasRender, HTMLAttributesWithRootRef } from '../../../types';
import { RootComponent } from '../../RootComponent/RootComponent';
import styles from '../FormItem.module.css';

export interface FormItemTopProps extends HTMLAttributesWithRootRef<HTMLDivElement>, HasComponent {}
export interface FormItemTopProps
extends HTMLAttributesWithRootRef<HTMLDivElement>,
HasComponent,
HasRender<HTMLDivElement> {}

/**
* Служит оберткой для составной шапки поля, отвечая за выравнивание контента и расстановку отступов.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import type * as React from 'react';
import { classNames } from '@vkontakte/vkjs';
import type { HasComponent, HasRootRef } from '../../../types';
import type { HasComponent, HasRender, HasRootRef } from '../../../types';
import { Subhead } from '../../Typography/Subhead/Subhead';
import styles from '../FormItem.module.css';

export interface FormItemTopAsideProps
extends React.AllHTMLAttributes<HTMLElement>,
HasRootRef<HTMLElement>,
HasComponent {}
HasComponent,
HasRender<HTMLElement> {}

/**
* Отвечает за отрисовку дополнительного контента справа от заголовка поля.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

import * as React from 'react';
import { classNames } from '@vkontakte/vkjs';
import type { HasComponent, HasRootRef } from '../../../types';
import type { HasComponent, HasRender, HasRootRef } from '../../../types';
import { Subhead } from '../../Typography/Subhead/Subhead';
import { FormItemContext } from '../context';
import styles from '../FormItem.module.css';

export interface FormItemTopLabelProps
extends React.AllHTMLAttributes<HTMLElement>,
HasRootRef<HTMLElement>,
HasComponent {}
HasComponent,
HasRender<HTMLElement> {}

/**
* Отвечает за отрисовку заголовка поля. По умолчанию компонент представлен тегом `label`, если передано свойство `htmlFor`.
Expand Down
5 changes: 3 additions & 2 deletions packages/vkui/src/components/Group/GroupContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useModalContext } from '../../context/ModalContext';
import { useAdaptivity } from '../../hooks/useAdaptivity';
import { type SizeTypeValues, ViewWidth, type ViewWidthType } from '../../lib/adaptivity';
import { warnOnce } from '../../lib/warnOnce';
import type { HasComponent, HTMLAttributesWithRootRef } from '../../types';
import type { HasComponent, HasRender, HTMLAttributesWithRootRef } from '../../types';
import { AppRootContext } from '../AppRoot/AppRootContext';
import { RootComponent } from '../RootComponent/RootComponent';
import styles from './Group.module.css';
Expand Down Expand Up @@ -78,7 +78,8 @@ function useGroupMode(
}

export type GroupContainerProps = HTMLAttributesWithRootRef<HTMLElement> &
HasComponent & {
HasComponent &
HasRender<HTMLElement> & {
/**
`show` (только для `mode="plain"`) - разделитель всегда показывается
`hide` - разделитель всегда спрятан,
Expand Down
6 changes: 4 additions & 2 deletions packages/vkui/src/components/Group/GroupDescription.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { classNames } from '@vkontakte/vkjs';
import type { HasComponent, HTMLAttributesWithRootRef } from '../../types';
import type { HasComponent, HasRender, HTMLAttributesWithRootRef } from '../../types';
import { Footnote } from '../Typography/Footnote/Footnote';
import styles from './Group.module.css';

export type GroupDescriptionProps = HTMLAttributesWithRootRef<HTMLElement> & HasComponent;
export type GroupDescriptionProps = HTMLAttributesWithRootRef<HTMLElement> &
HasComponent &
HasRender<HTMLElement>;

export const GroupDescription = ({ className, ...restProps }: GroupDescriptionProps) => (
<Footnote className={classNames(className, styles.description)} {...restProps} />
Expand Down
5 changes: 3 additions & 2 deletions packages/vkui/src/components/Group/GroupExpandedContent.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { HasComponent, HTMLAttributesWithRootRef } from '../../types';
import type { HasComponent, HasRender, HTMLAttributesWithRootRef } from '../../types';
import { RootComponent } from '../RootComponent/RootComponent';
import styles from './Group.module.css';

Expand All @@ -8,7 +8,8 @@ const stylesDirection = {
};

export type GroupExpandedContentProps = HTMLAttributesWithRootRef<HTMLElement> &
HasComponent & {
HasComponent &
HasRender<HTMLElement> & {
/**
* Направление отображения контента.
*/
Expand Down
7 changes: 5 additions & 2 deletions packages/vkui/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import type * as React from 'react';
import { classNames, hasReactNode, isPrimitiveReactNode } from '@vkontakte/vkjs';
import type { HasComponent, HTMLAttributesWithRootRef } from '../../types';
import type { HasComponent, HasRender, HTMLAttributesWithRootRef } from '../../types';
import { RootComponent } from '../RootComponent/RootComponent';
import { Caption } from '../Typography/Caption/Caption';
import { Footnote } from '../Typography/Footnote/Footnote';
Expand All @@ -12,7 +12,10 @@ import { Subhead } from '../Typography/Subhead/Subhead';
import { Title } from '../Typography/Title/Title';
import styles from './Header.module.css';

export interface HeaderProps extends HTMLAttributesWithRootRef<HTMLElement>, HasComponent {
export interface HeaderProps
extends HTMLAttributesWithRootRef<HTMLElement>,
HasComponent,
HasRender<HTMLElement> {
/**
* Размер компонента.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface MiniInfoCellProps
TappableOmitProps,
'hoverMode' | 'activeMode' | 'hovered' | 'activated' | 'hasHover' | 'hasActive'
>,
RootComponentProps<HTMLDivElement> {
RootComponentProps<HTMLElement> {
/**
* Иконка слева.<br />
* Рекомендуется использовать иконки размера 20.
Expand Down
10 changes: 7 additions & 3 deletions packages/vkui/src/components/Placeholder/Placeholder.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type * as React from 'react';
import { classNames, hasReactNode } from '@vkontakte/vkjs';
import type { HasComponent, HTMLAttributesWithRootRef } from '../../types';
import type { HasComponent, HasRender, HTMLAttributesWithRootRef } from '../../types';
import { RootComponent } from '../RootComponent/RootComponent';
import { Headline } from '../Typography/Headline/Headline';
import { Title } from '../Typography/Title/Title';
Expand Down Expand Up @@ -39,13 +39,17 @@ const PlaceholderIcon = (props: PlaceholderIconProps): React.ReactNode => (
<RootComponent baseClassName={styles.icon} {...props} />
);

export type PlaceholderTitleProps = HTMLAttributesWithRootRef<HTMLElement> & HasComponent;
export type PlaceholderTitleProps = HTMLAttributesWithRootRef<HTMLElement> &
HasComponent &
HasRender<HTMLElement>;

const PlaceholderTitle = ({ className, ...restProps }: PlaceholderTitleProps): React.ReactNode => (
<Title level="2" weight="2" className={classNames(className, styles.title)} {...restProps} />
);

export type PlaceholderDescriptionProps = HTMLAttributesWithRootRef<HTMLElement> & HasComponent;
export type PlaceholderDescriptionProps = HTMLAttributesWithRootRef<HTMLElement> &
HasComponent &
HasRender<HTMLElement>;

const PlaceholderDescription = ({
className,
Expand Down
Loading
Loading