Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Counter): add prop appearance and change mode values #7919

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

EldarMuhamethanov
Copy link
Contributor

@EldarMuhamethanov EldarMuhamethanov commented Nov 8, 2024


  • Unit-тесты
  • e2e-тесты
  • Дизайн-ревью
  • Документация фичи
  • Release notes
  • Codemod

Описание

Расширение функциональности компонента Counter путем добавления новых свойств для более гибкой настройки внешнего вида.

Изменения

Новые свойства

  • Добавлено свойство appearance для управления цветовой схемой компонента
  • Добавлено свойство color для установки пользовательского цвета (работает только при appearance="custom")

Изменения существующих свойств

Обновлены значения свойства mode:

  // Было
  type Mode = 'secondary' | 'primary' | 'prominent' | 'contrast' | 'inherit';
  
  // Стало
  type Mode = 'primary' | 'contrast' | 'tertiary' | 'inherit';

Техническая реализация

  • Реализованы кодмоды для автоматической миграции старых значений mode
  • Добавлены unit-тесты для новой функциональности
  • Обновлены скриншот-тесты компонента Counter

Release notes

Улучшения

  • Counter:
    • добавлено свойство appearance, которое отвечает за цвет
    • добавлено свойство color, с помощью которого можно изменить цвет компонента. Работает только совместно с appearance="custom"

BREAKING CHANGE

  • Counter: изменены значения свойства mode
    Было 'secondary' | 'primary' | 'prominent' | 'contrast' | 'inherit'
    Стало 'primary' | 'contrast' | 'tertiary' | 'inherit'
    Логика перехода на новые значения:
    Таблица миграции значений:
    Старое значение Новые свойства
    inherit mode="inherit" (без изменений)
    primary mode="primary" appearance="accent"
    secondary mode="primary" appearance="neutral"
    prominent mode="primary" appearance="accent-red"
    contrast mode="contrast" appearance="accent"

@EldarMuhamethanov EldarMuhamethanov requested a review from a team November 8, 2024 11:45
@EldarMuhamethanov EldarMuhamethanov self-assigned this Nov 8, 2024
@EldarMuhamethanov EldarMuhamethanov requested a review from a team as a code owner November 8, 2024 11:45
Copy link
Contributor

github-actions bot commented Nov 8, 2024

size-limit report 📦

Path Size
JS 385.96 KB (+0.16% 🔺)
JS (gzip) 123.38 KB (+0.16% 🔺)
JS (brotli) 102.22 KB (+0.19% 🔺)
JS import Div (tree shaking) 1.47 KB (0%)
CSS 344.5 KB (+0.6% 🔺)
CSS (gzip) 49.52 KB (+0.37% 🔺)
CSS (brotli) 40.21 KB (+0.67% 🔺)

Copy link

codesandbox-ci bot commented Nov 8, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link
Contributor

github-actions bot commented Nov 8, 2024

e2e tests

Playwright Report

Copy link

codecov bot commented Nov 8, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.

Project coverage is 95.28%. Comparing base (7f7c03b) to head (6b365ba).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
packages/vkui/src/components/Counter/Counter.tsx 85.71% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7919      +/-   ##
==========================================
- Coverage   95.30%   95.28%   -0.02%     
==========================================
  Files         378      378              
  Lines       11196    11210      +14     
  Branches     3735     3740       +5     
==========================================
+ Hits        10670    10682      +12     
- Misses        526      528       +2     
Flag Coverage Δ
unittests 95.28% <85.71%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Nov 8, 2024

👀 Docs deployed

Commit 6b365ba

@EldarMuhamethanov EldarMuhamethanov removed their assignment Nov 8, 2024
@qurle
Copy link
Contributor

qurle commented Nov 8, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature][Counter]: Обновить пропы Counter
2 participants