Skip to content

PLASMA-7798: update animations (sdds-sbcom) - #3015

Open
oki1oki wants to merge 2 commits into
devfrom
PLASMA-7798
Open

PLASMA-7798: update animations (sdds-sbcom)#3015
oki1oki wants to merge 2 commits into
devfrom
PLASMA-7798

Conversation

@oki1oki

@oki1oki oki1oki commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

SDDS-SBCOM

Avatar, Button, Loader, Switch, TextField, TextArea, Tabs

  • добавлены примеры настройки анимации

What/why changed

  • добавлены примеры настройки анимации
📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install @salutejs/plasma-asdk@0.387.0-canary.3015.31185964477.0
npm install @salutejs/plasma-b2c@1.629.0-canary.3015.31185964477.0
npm install @salutejs/plasma-colors@0.18.0-canary.3015.31185964477.0
npm install @salutejs/plasma-core@1.236.0-canary.3015.31185964477.0
npm install @salutejs/plasma-giga@0.356.0-canary.3015.31185964477.0
npm install @salutejs/plasma-homeds@0.356.0-canary.3015.31185964477.0
npm install @salutejs/plasma-hope@1.383.0-canary.3015.31185964477.0
npm install @salutejs/plasma-icons@1.245.0-canary.3015.31185964477.0
npm install @salutejs/plasma-new-hope@0.373.0-canary.3015.31185964477.0
npm install @salutejs/plasma-tokens@1.147.0-canary.3015.31185964477.0
npm install @salutejs/plasma-tokens-b2b@1.61.0-canary.3015.31185964477.0
npm install @salutejs/plasma-tokens-b2c@0.72.0-canary.3015.31185964477.0
npm install @salutejs/plasma-tokens-core@0.9.0-canary.3015.31185964477.0
npm install @salutejs/plasma-tokens-web@1.76.0-canary.3015.31185964477.0
npm install @salutejs/plasma-typo@0.49.0-canary.3015.31185964477.0
npm install @salutejs/plasma-web@1.631.0-canary.3015.31185964477.0
npm install @salutejs/sdds-bizcom@0.361.0-canary.3015.31185964477.0
npm install @salutejs/sdds-cs@0.365.0-canary.3015.31185964477.0
npm install @salutejs/sdds-dfa@0.359.0-canary.3015.31185964477.0
npm install @salutejs/sdds-finai@0.352.0-canary.3015.31185964477.0
npm install @salutejs/sdds-insol@0.356.0-canary.3015.31185964477.0
npm install @salutejs/sdds-insol-next@0.355.0-canary.3015.31185964477.0
npm install @salutejs/sdds-netology@0.360.0-canary.3015.31185964477.0
npm install @salutejs/sdds-os@0.31.0-canary.3015.31185964477.0
npm install @salutejs/sdds-platform-ai@0.360.0-canary.3015.31185964477.0
npm install @salutejs/sdds-sbcom@0.361.0-canary.3015.31185964477.0
npm install @salutejs/sdds-scan@0.359.0-canary.3015.31185964477.0
npm install @salutejs/sdds-serv@0.360.0-canary.3015.31185964477.0
npm install @salutejs/core-themes@0.37.0-canary.3015.31185964477.0
npm install @salutejs/plasma-themes@0.59.0-canary.3015.31185964477.0
npm install @salutejs/sdds-themes@0.74.0-canary.3015.31185964477.0
npm install @salutejs/sdds-api-tests@0.18.0-canary.3015.31185964477.0
npm install @salutejs/plasma-cy-utils@0.166.0-canary.3015.31185964477.0
npm install @salutejs/plasma-sb-utils@0.237.0-canary.3015.31185964477.0
npm install @salutejs/plasma-tokens-utils@0.57.0-canary.3015.31185964477.0
# or 
yarn add @salutejs/plasma-asdk@0.387.0-canary.3015.31185964477.0
yarn add @salutejs/plasma-b2c@1.629.0-canary.3015.31185964477.0
yarn add @salutejs/plasma-colors@0.18.0-canary.3015.31185964477.0
yarn add @salutejs/plasma-core@1.236.0-canary.3015.31185964477.0
yarn add @salutejs/plasma-giga@0.356.0-canary.3015.31185964477.0
yarn add @salutejs/plasma-homeds@0.356.0-canary.3015.31185964477.0
yarn add @salutejs/plasma-hope@1.383.0-canary.3015.31185964477.0
yarn add @salutejs/plasma-icons@1.245.0-canary.3015.31185964477.0
yarn add @salutejs/plasma-new-hope@0.373.0-canary.3015.31185964477.0
yarn add @salutejs/plasma-tokens@1.147.0-canary.3015.31185964477.0
yarn add @salutejs/plasma-tokens-b2b@1.61.0-canary.3015.31185964477.0
yarn add @salutejs/plasma-tokens-b2c@0.72.0-canary.3015.31185964477.0
yarn add @salutejs/plasma-tokens-core@0.9.0-canary.3015.31185964477.0
yarn add @salutejs/plasma-tokens-web@1.76.0-canary.3015.31185964477.0
yarn add @salutejs/plasma-typo@0.49.0-canary.3015.31185964477.0
yarn add @salutejs/plasma-web@1.631.0-canary.3015.31185964477.0
yarn add @salutejs/sdds-bizcom@0.361.0-canary.3015.31185964477.0
yarn add @salutejs/sdds-cs@0.365.0-canary.3015.31185964477.0
yarn add @salutejs/sdds-dfa@0.359.0-canary.3015.31185964477.0
yarn add @salutejs/sdds-finai@0.352.0-canary.3015.31185964477.0
yarn add @salutejs/sdds-insol@0.356.0-canary.3015.31185964477.0
yarn add @salutejs/sdds-insol-next@0.355.0-canary.3015.31185964477.0
yarn add @salutejs/sdds-netology@0.360.0-canary.3015.31185964477.0
yarn add @salutejs/sdds-os@0.31.0-canary.3015.31185964477.0
yarn add @salutejs/sdds-platform-ai@0.360.0-canary.3015.31185964477.0
yarn add @salutejs/sdds-sbcom@0.361.0-canary.3015.31185964477.0
yarn add @salutejs/sdds-scan@0.359.0-canary.3015.31185964477.0
yarn add @salutejs/sdds-serv@0.360.0-canary.3015.31185964477.0
yarn add @salutejs/core-themes@0.37.0-canary.3015.31185964477.0
yarn add @salutejs/plasma-themes@0.59.0-canary.3015.31185964477.0
yarn add @salutejs/sdds-themes@0.74.0-canary.3015.31185964477.0
yarn add @salutejs/sdds-api-tests@0.18.0-canary.3015.31185964477.0
yarn add @salutejs/plasma-cy-utils@0.166.0-canary.3015.31185964477.0
yarn add @salutejs/plasma-sb-utils@0.237.0-canary.3015.31185964477.0
yarn add @salutejs/plasma-tokens-utils@0.57.0-canary.3015.31185964477.0

Summary by CodeRabbit

  • New Features
    • Added animated selection indicators for horizontal and vertical tabs.
    • Added CSS customization hooks for Avatar, Spinner, Switch, Tabs, TextField, and related animations.
    • Added configurable animation examples for Avatar, Button, Loader, Switch, Tabs, TextArea, and TextField.
  • Bug Fixes
    • Improved Switch thumb positioning and pressed-state animation.
    • Corrected TextArea behavior when controlled values are empty.
  • Style
    • Refined tab colors, focus states, borders, radii, and selected-state styling across layouts.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds animation CSS hooks for components, improves switch thumb motion and TextArea controlled-value handling, introduces animated selection indicators for horizontal and vertical Tabs, updates SBCOM tab styling, and documents animation customization examples.

Changes

Component animation and input behavior

Layer / File(s) Summary
Animation CSS hooks and text input behavior
packages/plasma-new-hope/src/components/Avatar/*, packages/plasma-new-hope/src/components/Spinner/*, packages/plasma-new-hope/src/components/TextArea/*, packages/plasma-new-hope/src/components/TextField/*, website/sdds-sbcom-docs/docs/components/{Avatar,Button,Loader,TextArea,TextField}.mdx
Avatar, Spinner, and TextField expose CSS classes for animation. TextArea preserves explicitly empty controlled values. Documentation adds live animation examples.
Switch motion and animation hooks
packages/plasma-new-hope/src/components/Switch/*, packages/sdds-sbcom/src/components/Switch/Switch.config.ts, website/sdds-sbcom-docs/docs/components/Switch.mdx
Switch thumb movement uses calculated transforms. The track exposes a CSS class. SBCOM configures the enabled thumb border color.

Tab selection and theme configuration

Layer / File(s) Summary
Tab selection measurement and rendering
packages/plasma-new-hope/src/components/Tabs/*, website/sdds-sbcom-docs/docs/components/Tabs.mdx
Tabs measure selected-item geometry with ResizeObserver and render configurable horizontal or vertical selection indicators.
Tab theme and geometry configuration
packages/sdds-sbcom/src/components/Tabs/...
Horizontal and vertical tab variants update accent colors, focus outlines, dividers, border radii, and intersection styles.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Tabs
  participant useTabsSelection
  participant ResizeObserver
  participant TabsSelection
  Tabs->>useTabsSelection: Pass content track ref
  useTabsSelection->>ResizeObserver: Observe track and selected item
  ResizeObserver-->>useTabsSelection: Report size changes
  useTabsSelection-->>TabsSelection: Return selection geometry and styles
  TabsSelection-->>Tabs: Render orientation-specific indicator
Loading

Possibly related PRs

Suggested reviewers: yakutoc, titankuzmich, shuga2704

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the animation updates and the related SDDS-SBCOM scope, which matches the primary purpose of the changes.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch PLASMA-7798

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@oki1oki oki1oki self-assigned this Aug 4, 2026
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Theme Builder app deployed!

https://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-3015/

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Documentation preview deployed!

website: https://plasma.sberdevices.ru/pr/pr-3015/
asdk storybook: https://plasma.sberdevices.ru/pr/pr-3015/asdk-storybook/
b2c storybook: https://plasma.sberdevices.ru/pr/pr-3015/b2c-storybook/
giga storybook: https://plasma.sberdevices.ru/pr/pr-3015/giga-storybook/
homeds storybook: https://plasma.sberdevices.ru/pr/pr-3015/homeds-storybook/
new-hope storybook: https://plasma.sberdevices.ru/pr/pr-3015/new-hope-storybook/
web storybook: https://plasma.sberdevices.ru/pr/pr-3015/web-storybook/
sdds-bizcom storybook: https://plasma.sberdevices.ru/pr/pr-3015/sdds-bizcom-storybook/
sdds-cs storybook: https://plasma.sberdevices.ru/pr/pr-3015/sdds-cs-storybook/
sdds-dfa storybook: https://plasma.sberdevices.ru/pr/pr-3015/sdds-dfa-storybook/
sdds-finai storybook: https://plasma.sberdevices.ru/pr/pr-3015/sdds-finai-storybook/
sdds-insol storybook: https://plasma.sberdevices.ru/pr/pr-3015/sdds-insol-storybook/
sdds-insol-next storybook: https://plasma.sberdevices.ru/pr/pr-3015/sdds-insol-next-storybook/
sdds-netology storybook: https://plasma.sberdevices.ru/pr/pr-3015/sdds-netology-storybook/
sdds-os storybook: https://plasma.sberdevices.ru/pr/pr-3015/sdds-os-storybook/
sdds-platform-ai storybook: https://plasma.sberdevices.ru/pr/pr-3015/sdds-platform-ai-storybook/
sdds-sbcom storybook: https://plasma.sberdevices.ru/pr/pr-3015/sdds-sbcom-storybook/
sdds-scan storybook: https://plasma.sberdevices.ru/pr/pr-3015/sdds-scan-storybook/
sdds-serv storybook: https://plasma.sberdevices.ru/pr/pr-3015/sdds-serv-storybook/

@oki1oki
oki1oki marked this pull request as ready for review August 7, 2026 14:10
@oki1oki
oki1oki requested review from IgorYar and removed request for Yeti-or, neretin-trike and shuga2704 August 7, 2026 14:10

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/plasma-new-hope/src/components/Tabs/ui/hooks/useTabsSelection.ts`:
- Around line 71-75: Update the setSelection bailout in useTabsSelection to
compare the complete selection state, not only previous.geometry and
nextSelection.geometry, including backgroundColor, divider properties,
borderRadius, opacity, and any other selection fields. Retain previous only when
all selection properties are unchanged; otherwise return nextSelection.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2e53322c-28dc-464c-b58f-c517bbaf2dc8

📥 Commits

Reviewing files that changed from the base of the PR and between 9549268 and 485e110.

📒 Files selected for processing (33)
  • packages/plasma-new-hope/src/components/Avatar/Avatar.tokens.ts
  • packages/plasma-new-hope/src/components/Avatar/Avatar.tsx
  • packages/plasma-new-hope/src/components/Spinner/Spinner.tokens.ts
  • packages/plasma-new-hope/src/components/Spinner/Spinner.tsx
  • packages/plasma-new-hope/src/components/Switch/Switch.styles.ts
  • packages/plasma-new-hope/src/components/Switch/Switch.tokens.ts
  • packages/plasma-new-hope/src/components/Switch/Switch.tsx
  • packages/plasma-new-hope/src/components/Switch/_toggleSize/base.ts
  • packages/plasma-new-hope/src/components/Tabs/tokens.ts
  • packages/plasma-new-hope/src/components/Tabs/ui/TabsSelection.styles.ts
  • packages/plasma-new-hope/src/components/Tabs/ui/TabsSelection.tsx
  • packages/plasma-new-hope/src/components/Tabs/ui/hooks/useTabsSelection.ts
  • packages/plasma-new-hope/src/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.styles.ts
  • packages/plasma-new-hope/src/components/Tabs/ui/horizontal/HorizontalTabs/HorizontalTabs.tsx
  • packages/plasma-new-hope/src/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.styles.ts
  • packages/plasma-new-hope/src/components/Tabs/ui/vertical/VerticalTabs/VerticalTabs.tsx
  • packages/plasma-new-hope/src/components/TextArea/TextArea.tsx
  • packages/plasma-new-hope/src/components/TextField/TextField.tokens.ts
  • packages/plasma-new-hope/src/components/TextField/TextField.tsx
  • packages/plasma-new-hope/src/components/TextField/variations/_label-placement/base.ts
  • packages/sdds-sbcom/src/components/Switch/Switch.config.ts
  • packages/sdds-sbcom/src/components/Tabs/horizontal/HorizontalIconTabItem.config.ts
  • packages/sdds-sbcom/src/components/Tabs/horizontal/HorizontalTabItem.config.ts
  • packages/sdds-sbcom/src/components/Tabs/horizontal/HorizontalTabs.config.ts
  • packages/sdds-sbcom/src/components/Tabs/vertical/VerticalIconTabItem.config.ts
  • packages/sdds-sbcom/src/components/Tabs/vertical/VerticalTabItem.config.ts
  • website/sdds-sbcom-docs/docs/components/Avatar.mdx
  • website/sdds-sbcom-docs/docs/components/Button.mdx
  • website/sdds-sbcom-docs/docs/components/Loader.mdx
  • website/sdds-sbcom-docs/docs/components/Switch.mdx
  • website/sdds-sbcom-docs/docs/components/Tabs.mdx
  • website/sdds-sbcom-docs/docs/components/TextArea.mdx
  • website/sdds-sbcom-docs/docs/components/TextField.mdx

Comment on lines +71 to +75
setSelection((previous) =>
!itemChanged && previous && isSameGeometry(previous.geometry, nextSelection.geometry)
? previous
: nextSelection,
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Compare all selection properties before retaining state.

The bailout checks only geometry. A change to backgroundColor, divider properties, borderRadius, or opacity with unchanged geometry keeps stale props on TabsSelection.

Proposed fix
-                !itemChanged && previous && isSameGeometry(previous.geometry, nextSelection.geometry)
+                !itemChanged &&
+                    previous &&
+                    isSameGeometry(previous.geometry, nextSelection.geometry) &&
+                    previous.backgroundColor === nextSelection.backgroundColor &&
+                    previous.backgroundColorHover === nextSelection.backgroundColorHover &&
+                    previous.borderRadius === nextSelection.borderRadius &&
+                    previous.dividerColor === nextSelection.dividerColor &&
+                    previous.dividerColorHover === nextSelection.dividerColorHover &&
+                    previous.dividerHeight === nextSelection.dividerHeight &&
+                    previous.dividerWidth === nextSelection.dividerWidth &&
+                    previous.opacity === nextSelection.opacity
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
setSelection((previous) =>
!itemChanged && previous && isSameGeometry(previous.geometry, nextSelection.geometry)
? previous
: nextSelection,
);
setSelection((previous) =>
!itemChanged &&
previous &&
isSameGeometry(previous.geometry, nextSelection.geometry) &&
previous.backgroundColor === nextSelection.backgroundColor &&
previous.backgroundColorHover === nextSelection.backgroundColorHover &&
previous.borderRadius === nextSelection.borderRadius &&
previous.dividerColor === nextSelection.dividerColor &&
previous.dividerColorHover === nextSelection.dividerColorHover &&
previous.dividerHeight === nextSelection.dividerHeight &&
previous.dividerWidth === nextSelection.dividerWidth &&
previous.opacity === nextSelection.opacity
? previous
: nextSelection,
);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/plasma-new-hope/src/components/Tabs/ui/hooks/useTabsSelection.ts`
around lines 71 - 75, Update the setSelection bailout in useTabsSelection to
compare the complete selection state, not only previous.geometry and
nextSelection.geometry, including backgroundColor, divider properties,
borderRadius, opacity, and any other selection fields. Retain previous only when
all selection properties are unchanged; otherwise return nextSelection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant