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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { clsx } from 'clsx';
import { type ComponentProps, forwardRef, type MouseEventHandler } from 'react';

import { Icon20CloseFilled } from '../../../../icons';
import { SvgButton } from '../../../SvgButton';
import { SvgButton } from '../../../../internal';
import { useAvatarContainerContext } from '../AvatarContainer/AvatarContainerContext';
import styles from './AvatarCloseButton.module.scss';
import { getButtonSize } from './helpers';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Meta, StoryObj } from '@storybook/react-vite';
import Icon16Placeholder from '../../../../../.storybook/assets/icons/icon-16-placeholder.svg';
import Icon24Placeholder from '../../../../../.storybook/assets/icons/icon-24-placeholder.svg';
import { hideArgsControl } from '../../../../../.storybook/shared/args-manager';
import { Flex } from '../../../Flex';
import { Flex } from '../../../../internal';
import { IconButton } from '../../../IconButton';
import { Avatar } from '../../index';
import { AvatarContainer, type AvatarContainerProps } from './AvatarContainer';
Expand Down
4 changes: 2 additions & 2 deletions src/components/Button/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { OverlayContainer } from '../../../.storybook/components/OverlayContaine
import { hideArgsControl } from '../../../.storybook/shared/args-manager';
import { useColorScheme } from '../../hooks';
import { Counter } from '../Counter';
import { Dot } from '../Dot';
import { Dot } from '../Dot/';
import { Button, type ButtonProps, type ButtonSize } from './Button';

const iconsMapping: Record<ButtonSize, ReactNode> = {
Expand All @@ -29,7 +29,7 @@ const meta = {
iconAfter: { control: 'boolean' },
indicator: {
options: [0, 1, 2],
mapping: [undefined, <Counter key="counter" value={123456} />, <Dot key="dot" aria-label="Есть новые уведомления" />],
mapping: [undefined, <Counter key="counter" value={1} />, <Dot key="dot" aria-label="Есть новые уведомления" />],
control: {
type: 'select',
labels: ['None', 'Counter', 'Dot']
Expand Down
3 changes: 1 addition & 2 deletions src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import { type ComponentProps, type ElementType, forwardRef, type MouseEventHandl

import { getSubtree, hasReactNode } from '../../helpers';
import { useButtonLikeProps, usePlatform } from '../../hooks';
import { EllipsisText, Ripple } from '../../internal';
import { type AsChildProp, type InnerClassNamesProp } from '../../types';
import { EllipsisText } from '../EllipsisText';
import { Ripple } from '../Ripple';
import { Spinner } from '../Spinner';
import styles from './Button.module.scss';
import { getButtonSpinnerAppearance, getButtonSpinnerSize, injectButtonIndicator } from './helpers';
Expand Down
21 changes: 10 additions & 11 deletions src/components/Button/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,26 @@ export const getButtonSpinnerAppearance = (buttonVariant: ButtonVariant): Spinne
}
};

export const getButtonCounterAppearance = (buttonVariant: ButtonVariant): Pick<CounterProps, 'appearance' | 'mode'> => {
export const getButtonCounterAppearance = (buttonVariant: ButtonVariant): Pick<CounterProps, 'variant'> => {
switch (buttonVariant) {
case 'primary':
return { mode: 'inverse', appearance: 'themed' };
return { variant: 'primary-contrast' };
case 'secondary':
return { mode: 'filled', appearance: 'themed' };
return { variant: 'static' };
case 'ghost':
return { mode: 'filled', appearance: 'themed' };
return { variant: 'static' };
case 'primary-contrast':
return { mode: 'filled', appearance: 'neutral-static' };
return { variant: 'static' };
case 'secondary-contrast':
return { mode: 'filled', appearance: 'neutral-static' };
return { variant: 'static' };
case 'overlay':
return { mode: 'filled', appearance: 'neutral-static' };
return { variant: 'static-contrast' };
case 'destructive':
return { mode: 'inverse', appearance: 'negative' };
return { variant: 'attention-contrast' };
}
};

export const injectButtonIndicator = (indicatorNode: ReactNode, buttonVariant: ButtonVariant, disabled?: boolean): ReactNode => {
export const injectButtonIndicator = (indicatorNode: ReactNode, buttonVariant: ButtonVariant): ReactNode => {
if (!isValidElement(indicatorNode)) {
return indicatorNode;
}
Expand All @@ -56,8 +56,7 @@ export const injectButtonIndicator = (indicatorNode: ReactNode, buttonVariant: B
return cloneElement(
indicatorNode as ReactElement<CounterProps>,
{
...getButtonCounterAppearance(buttonVariant),
disabled
...getButtonCounterAppearance(buttonVariant)
}
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/CellAction/CellAction.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { fn } from 'storybook/test';

import Icon28Placeholder from '../../../.storybook/assets/icons/icon-28-placeholder.svg';
import { hideArgsControl } from '../../../.storybook/shared/args-manager';
import { EllipsisText } from '../EllipsisText';
import { EllipsisText } from '../../internal';
import { CellAction, type CellActionProps } from './CellAction';

const meta = {
title: 'Common/CellAction',
title: 'Common/Cell/CellAction',
component: CellAction,
argTypes: {
...hideArgsControl(['asChild', 'innerClassNames']),
Expand Down
2 changes: 1 addition & 1 deletion src/components/CellAction/CellAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { type ComponentProps, forwardRef, type ReactNode } from 'react';

import { getSubtree, hasReactNode } from '../../helpers';
import { Icon16Chevron } from '../../icons';
import { Tappable } from '../../internal';
import { type AsChildProp, type InnerClassNamesProp, type MergeProps } from '../../types';
import { Tappable } from '../Tappable';
import styles from './CellAction.module.scss';

export type CellActionMode = 'primary' | 'destructive' | 'custom';
Expand Down
4 changes: 2 additions & 2 deletions src/components/CellHeader/CellHeader.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import type { Meta, StoryObj } from '@storybook/react-vite';

import Icon16Placeholder from '../../../.storybook/assets/icons/icon-16-placeholder.svg';
import { hideArgsControl } from '../../../.storybook/shared/args-manager';
import { Panel } from '../../internal';
import { Avatar } from '../Avatar';
import { CellList } from '../CellList';
import { CellSimple } from '../CellSimple';
import { Panel } from '../Panel';
import { Typography } from '../Typography';
import { CellHeader, type CellHeaderProps } from './CellHeader';

const meta = {
title: 'Common/CellHeader',
title: 'Common/Cell/CellHeader',
component: CellHeader,
argTypes: {
...hideArgsControl(['innerClassNames']),
Expand Down
2 changes: 1 addition & 1 deletion src/components/CellInput/CellInput.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { hideArgsControl } from '../../../.storybook/shared/args-manager';
import { CellInput, type CellInputProps } from './CellInput';

const meta = {
title: 'Common/CellInput',
title: 'Common/Cell/CellInput',
component: CellInput,
argTypes: {
...hideArgsControl(['innerClassNames']),
Expand Down
3 changes: 1 addition & 2 deletions src/components/CellInput/CellInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import { clsx } from 'clsx';
import { type ComponentProps, forwardRef, type ReactNode } from 'react';

import { hasReactNode } from '../../helpers';
import { ClearableInput, EllipsisText } from '../../internal';
import { type InnerClassNamesProp } from '../../types';
import { ClearableInput } from '../ClearableInput';
import { EllipsisText } from '../EllipsisText';
import styles from './CellInput.module.scss';

export type CellInputHeight = 'compact' | 'normal';
Expand Down
4 changes: 2 additions & 2 deletions src/components/CellList/CellList.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { Meta, StoryObj } from '@storybook/react-vite';

import { Panel } from '../../internal';
import { Avatar } from '../Avatar';
import { CellHeader } from '../CellHeader';
import { CellSimple } from '../CellSimple';
import { Panel } from '../Panel';
import { CellList, type CellListProps } from './CellList';

const meta = {
title: 'Common/CellList',
title: 'Common/Cell/CellList',
component: CellList,
argTypes: {
header: {
Expand Down
4 changes: 2 additions & 2 deletions src/components/CellSimple/CellSimple.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { fn } from 'storybook/test';

import Icon24Placeholder from '../../../.storybook/assets/icons/icon-24-placeholder.svg';
import { hideArgsControl } from '../../../.storybook/shared/args-manager';
import { EllipsisText } from '../../internal';
import { Avatar } from '../Avatar';
import { Button } from '../Button';
import { Counter } from '../Counter';
import { EllipsisText } from '../EllipsisText';
import { CellSimple, type CellSimpleProps } from './CellSimple';

const meta = {
title: 'Common/CellSimple',
title: 'Common/Cell/CellSimple',
component: CellSimple,
argTypes: {
...hideArgsControl(['asChild', 'innerClassNames', 'onClick', 'as']),
Expand Down
2 changes: 1 addition & 1 deletion src/components/CellSimple/CellSimple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { type ComponentProps, type ElementType, forwardRef, type ReactNode } fro

import { getSubtree, hasReactNode } from '../../helpers';
import { Icon16Chevron } from '../../icons';
import { Tappable } from '../../internal';
import { type AsChildProp, type InnerClassNamesProp, type MergeProps } from '../../types';
import { Tappable } from '../Tappable';
import styles from './CellSimple.module.scss';

export type CellSimpleHeight = 'compact' | 'normal';
Expand Down
9 changes: 0 additions & 9 deletions src/components/ClearableInput/ClearableInput.module.scss

This file was deleted.

53 changes: 0 additions & 53 deletions src/components/Container/Container.stories.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/Counter/Counter.module.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@use '../../styles/shared-mixins/typography';

@mixin withoutBackgroundColor {
background-color: transparent;
background-color: var(--background-accent-contrast-secondary);
}
@mixin textColorPrimary {
color: var(--text-primary-inverse)
Expand Down
55 changes: 0 additions & 55 deletions src/components/Dot/Dot.stories.tsx

This file was deleted.

3 changes: 3 additions & 0 deletions src/components/Dot/Dot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ export interface DotProps extends ComponentProps<'span'> {
appearance?: DotAppearance
}

/**
* @deprecated Компонент будет удален в грядущей минорной версии.
*/
export const Dot = forwardRef<HTMLSpanElement, DotProps>((props, ref) => {
const {
className,
Expand Down
32 changes: 0 additions & 32 deletions src/components/EllipsisText/EllipsisText.stories.tsx

This file was deleted.

Loading