Skip to content

feat(caption): add shared ExtraCaptionComponent from Figma _<Caption> - #193

Open
khaliulin wants to merge 4 commits into
feature/tokens-base-figma-syncfrom
feature/form-caption-figma-sync
Open

khaliulin wants to merge 4 commits into
feature/tokens-base-figma-syncfrom
feature/form-caption-figma-sync

Conversation

@khaliulin

Copy link
Copy Markdown
Contributor

Summary

Adds the shared ExtraCaptionComponent for the hint under a form field, built from Figma _<Caption>. Form fields (inputtext, textarea and later others) reuse it instead of their own caption markup.

Changes

  1. Add the standalone extra-caption component: icon plus text, 14px, letter spacing -0.32, gap 2.
  2. Support the severity input (base, success, warning, danger, info) with a matching icon.
  3. Export it as the secondary entry point @cdek-it/angular-ui-kit/components/caption.

API changes

  • ExtraCaptionComponent (<extra-caption>) and the ExtraCaptionSeverity type are new.
  • severity: 'base' | 'success' | 'warning' | 'danger' | 'info', default base.

Technical notes for reviewers

  • Styles live in caption.component.css and use the global --p-* theme variables only, so the caption also works in fields whose PrimeNG css is not loaded.
  • Colors: fg.muted for base, fg.status.*.default for the other severities.
  • Icons: base ti-alert-circle, info ti-info-circle, success ti-circle-check, warning ti-alert-triangle, danger ti-circle-x.
  • Nothing uses the component in this PR; inputtext and textarea consume it.

Visual changes

None on its own. Measured against Figma in light and dark themes for all five severities when used in inputtext.

Verification

  • tsc for the app and Storybook projects: pass.
  • check-push against the tokens branch: no failures.
  • Not verified: a standalone story (the component is shown through inputtext and textarea).

Known issues and open questions

None.

Stack

Base: feature/tokens-base-figma-sync (#192). Followed by the inputtext PR.

1. Добавлен standalone-компонент ExtraCaptionComponent (extra-caption): подпись под полем формы — иконка и текст, 14px, letter-spacing −0.32, отступ 2.
2. Вход severity (base, success, warning, danger, info) с соответствующей иконкой: ti-alert-circle, ti-circle-check, ti-alert-triangle, ti-circle-x, ti-info-circle.
3. Компонент опубликован отдельной точкой входа @cdek-it/angular-ui-kit/components/caption.

Заметки для ревьюеров:
- Новый публичный API: ExtraCaptionComponent и тип ExtraCaptionSeverity; severity по умолчанию base.
- Стили лежат в caption.component.css и используют только глобальные CSS-переменные темы --p-*, поэтому подпись работает и в полях, чей css PrimeNG не подключён.
- Цвета: fg.muted для base и fg.status.*.default для остальных severity; измерено по Figma в light и dark.
- В этой ветке компонент нигде не используется; inputtext и textarea подключают его в своих ветках.
1. Обёртка extra-image над p-image: 7 входов и слоты extraImageTemplate для иконок панели.
2. Панель: 36px кнопки, 16px иконки, белый фон с тенью, hover/focus из токенов, маска через backdrop.
3. Stories по одному состоянию: Default, Preview, Width, Crop, Frame; Docs и токены обновлены.

Заметки для ревьюеров:
- 19 токенов в components.image; focusRing — fg.brand.active (green 700) ради контраста.
- API: 7 входов и 5 слотов, ломающих изменений нет; эталона Figma нет.
- descriptions-gate — SKIPPED: компонента нет в origin/main.
Danil Khaliulin and others added 2 commits November 20, 2026 11:49
1. Снимать блокировку прокрутки body при уничтожении обёртки с открытым предпросмотром.
2. Переопределить нативные токены image.preview.mask: фон маски и контрастный цвет иконки.
3. Перевести живой шаблон story на биндинги и экранировать значения Controls в snippet.
4. Добавить регрессионный тест на снятие блокировки прокрутки при уничтожении.

Заметки для ревьюеров:
- Токены изменены только в components.image; check-component и check-stories-source проходят.
- Karma-тест ExtraImageComponent и сборка библиотеки проходят; e2e image — 12 passed, 2 known.
feat(image): add ExtraImage component and preview toolbar

This branch has not been deployed

No deployments
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.

2 participants