From f76f212825b437fc519d2f100d4bc946b44b1246 Mon Sep 17 00:00:00 2001 From: Victoria Zhizhonkova Date: Thu, 7 Nov 2024 19:33:56 +0700 Subject: [PATCH] feat: add more exports (#7892) * feat: add more imports * feat: add more exports * bump(@vkontakte/vkui): from 7.0.0-beta.1 to 7.0.0-dev-d4929f.0 * feat: type getInitialsFontSize function * bump(@vkontakte/vkui): from 7.0.0-dev-d4929f.0 to 7.0.0-dev-d4929f.1 * revert version up --------- Co-authored-by: GitHub Action --- packages/vkui/src/components/Avatar/helpers.ts | 6 ++++-- .../src/components/Placeholder/Placeholder.tsx | 8 ++++---- packages/vkui/src/index.ts | 15 ++++++++++++--- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/packages/vkui/src/components/Avatar/helpers.ts b/packages/vkui/src/components/Avatar/helpers.ts index 4d938137f7..40b0280ffa 100644 --- a/packages/vkui/src/components/Avatar/helpers.ts +++ b/packages/vkui/src/components/Avatar/helpers.ts @@ -4,10 +4,12 @@ const MAX_FONT_SIZE = 30; const MAX_IMAGE_BASE_SIZE: ImageBaseSize = 96; const RELATIVE_SIZE = MAX_FONT_SIZE / MAX_IMAGE_BASE_SIZE; +export type GetInitialsFontSizeType = (avatarSize: number) => number; + /** * По возможности выставляем размеры по дизайн-системе. Иначе высчитываем. */ -export function getInitialsFontSize(avatarSize: number): number { +export const getInitialsFontSize: GetInitialsFontSizeType = (avatarSize) => { if (avatarSize <= 16) { return 5; } else if (avatarSize <= 24) { @@ -33,4 +35,4 @@ export function getInitialsFontSize(avatarSize: number): number { const calculatedFontSize = Math.ceil(avatarSize * RELATIVE_SIZE); const evenFix = calculatedFontSize % 2; return calculatedFontSize + evenFix; -} +}; diff --git a/packages/vkui/src/components/Placeholder/Placeholder.tsx b/packages/vkui/src/components/Placeholder/Placeholder.tsx index 3d2bda81f0..67b692b1c2 100644 --- a/packages/vkui/src/components/Placeholder/Placeholder.tsx +++ b/packages/vkui/src/components/Placeholder/Placeholder.tsx @@ -39,18 +39,18 @@ const PlaceholderIcon = (props: PlaceholderIconProps): React.ReactNode => ( ); -export type PlaceholderHeaderProps = HTMLAttributesWithRootRef & HasComponent; +export type PlaceholderTitleProps = HTMLAttributesWithRootRef & HasComponent; -const PlaceholderTitle = ({ className, ...restProps }: PlaceholderHeaderProps): React.ReactNode => ( +const PlaceholderTitle = ({ className, ...restProps }: PlaceholderTitleProps): React.ReactNode => ( ); -export type PlaceholderTextProps = HTMLAttributesWithRootRef<HTMLElement> & HasComponent; +export type PlaceholderDescriptionProps = HTMLAttributesWithRootRef<HTMLElement> & HasComponent; const PlaceholderDescription = ({ className, ...restProps -}: PlaceholderTextProps): React.ReactNode => ( +}: PlaceholderDescriptionProps): React.ReactNode => ( <Headline weight="3" className={classNames(className, styles.description)} {...restProps} /> ); diff --git a/packages/vkui/src/index.ts b/packages/vkui/src/index.ts index 058719e375..729579cc68 100644 --- a/packages/vkui/src/index.ts +++ b/packages/vkui/src/index.ts @@ -106,6 +106,7 @@ export { AspectRatio } from './components/AspectRatio/AspectRatio'; export type { AspectRatioProps } from './components/AspectRatio/AspectRatio'; export { Flex } from './components/Flex/Flex'; export type { FlexProps } from './components/Flex/Flex'; +export type { FlexItemProps } from './components/Flex/FlexItem/FlexItem'; export { SimpleGrid } from './components/SimpleGrid/SimpleGrid'; export type { SimpleGridProps } from './components/SimpleGrid/SimpleGrid'; @@ -198,6 +199,7 @@ export type { InfoRowProps } from './components/InfoRow/InfoRow'; export { Gallery } from './components/Gallery/Gallery'; export type { GalleryProps } from './components/Gallery/Gallery'; export { Avatar } from './components/Avatar/Avatar'; +export type { GetInitialsFontSizeType } from './components/Avatar/helpers'; export type { AvatarProps, AvatarBadgeProps, @@ -244,8 +246,8 @@ export type { PlaceholderProps, PlaceholderContainerProps, PlaceholderIconProps, - PlaceholderHeaderProps, - PlaceholderTextProps, + PlaceholderTitleProps, + PlaceholderDescriptionProps, PlaceholderActionsProps, } from './components/Placeholder/Placeholder'; export { Banner } from './components/Banner/Banner'; @@ -292,7 +294,13 @@ export type { DropZoneProps } from './components/DropZone/DropZone'; export { Input } from './components/Input/Input'; export type { InputProps } from './components/Input/Input'; export { Chip } from './components/ChipsInputBase/Chip/Chip'; -export type { ChipProps, ChipOption, RenderChipProps } from './components/ChipsInputBase/types'; +export type { + ChipProps, + ChipOption, + RenderChipProps, + ChipOptionValue, + ChipOptionLabel, +} from './components/ChipsInputBase/types'; export { ChipsInput } from './components/ChipsInput/ChipsInput'; export type { ChipsInputProps } from './components/ChipsInput/ChipsInput'; export { ChipsSelect } from './components/ChipsSelect/ChipsSelect'; @@ -445,6 +453,7 @@ export { export type { AdaptivityProps } from './components/AdaptivityProvider/AdaptivityContext'; export { calcInitialsAvatarColor } from './helpers/avatar'; export { CustomScrollView } from './components/CustomScrollView/CustomScrollView'; +export type { CustomScrollViewProps } from './components/CustomScrollView/CustomScrollView'; export { Popper } from './components/Popper/Popper'; export type { PopperProps } from './components/Popper/Popper';