Skip to content

feat(inputtext): sync styles and API with Figma - #189

Open
khaliulin wants to merge 5 commits into
feature/form-caption-figma-syncfrom
feature/form-inputtext-figma-sync
Open

khaliulin wants to merge 5 commits into
feature/form-caption-figma-syncfrom
feature/form-inputtext-figma-sync

Conversation

@khaliulin

@khaliulin khaliulin commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Syncs InputText styles and API with Figma UI Kit DS v2.1 and moves the caption to the shared ExtraCaptionComponent.

Changes

  1. Sync the field geometry with Figma 1:1 for small, base, large and xlarge: height, paddings, radius, font and line height; update the input tokens and the focus ring.
  2. Rework the float label: field height 56, label 14/20 at rest and 12/14 raised, placeholder hidden at rest and shown in focus under the raised label.
  3. Add requiredMark (red asterisk before the label) and captionSeverity.
  4. Make readonly a single input; the clear button stays in the flow and is hidden through visibility for readonly and disabled fields.
  5. Rework the stories: one story is one Figma preset with a single instance, sources that update with Controls, Controls for all 20 inputs. The original per-feature example components are preserved alongside the current stories.
  6. Document the API in docs/components-api/inputtext.md and the Figma mapping in inputtext.figma.md.
  • Restore all 6 original example component files. Apply only the typing/API compatibility changes needed to compile them against the current component. Keep existing descriptions verbatim and keep the current single-instance story list.

  • Keep Show code limited to the displayed instance and update it when Controls change. Restore existing story and Control descriptions verbatim from main.

API changes

  • BREAKING (relative to main): labelPosition is 'default' | 'float' | 'left' (default is the label on top, float is the floating label). The boolean floatLabel added in main is removed. This differs from the form field rows of docs/naming-rules.md.
  • BREAKING: the caption class .extra-inputtext-caption is replaced by .extra-caption from the shared component; custom styles on the old class must be moved.
  • requiredMark: boolean, default false; visual only.
  • captionSeverity: 'base' | 'success' | 'warning' | 'danger' | 'info', default base.
  • Kept from main: required (NG_VALIDATORS), name, autocomplete, maxLength, ariaLabel, ariaLabelledBy, autofocus, tabindex, accessible clear button.

Technical notes for reviewers

  • Tokens: components.inputtext and components.floatlabel are updated (floatlabel key inside renamed to in; extend.iconSize is now size.450); extra values in tokens.json.
  • The caption base color changes from fg.subtle to fg.muted and gets an icon, as in Figma.

Visual changes

  • Heights 36/42/50/56, float field height 56 with radius 14.
  • Caption now has a severity icon and color.

Verification

  • Gates: check-component (3 warnings G6 about foreign floatlabel tokens, no failures), check-stories-bg, check-stories-controls, check-stories-single (8 stories, clean console): pass.

  • Storybook: default, float and left label positions, required, name, autocomplete, maxLength, aria attributes, tabindex, readonly, clear button, reactive forms status: checked through Playwright, no console errors. captionSeverity measured for all variants in light and dark.

  • Not verified: focus and readonly of the float field in dark, autofill.

  • PASS (example restoration): targeted strict Angular template compilation of all 6 restored examples; check-stories-bg; check-stories-source for the full current story list and changed Controls; check-stories-descriptions against origin/main; check-stories-single and check-stories-controls.

  • The restored standalone files remain available as source examples; restoring them does not add combinatorial stories to the current Storybook index.

Known issues and open questions

  • The float label rests at y=18 where Figma has y=16 (centering by a 20px line).
  • Design question: in Figma a focused float field with a placeholder keeps the 14/20 label; in code the label rises to 12/14 (standard float label behaviour). Kept as is.

Stack

Base: feature/form-caption-figma-sync (#193), which is based on feature/tokens-base-figma-sync (#192).

@khaliulin
khaliulin force-pushed the feature/form-inputtext-figma-sync branch from 78502db to 75cb82a Compare November 12, 2026 16:32
@khaliulin
khaliulin force-pushed the feature/button-figma-sync branch 2 times, most recently from 31cc137 to fd780b0 Compare November 12, 2026 17:34
@khaliulin
khaliulin force-pushed the feature/form-inputtext-figma-sync branch from 75cb82a to e042f88 Compare November 12, 2026 17:34
@khaliulin khaliulin changed the title InputText: синхронизация с Figma UI Kit DS v2.1 feat(inputtext): sync styles and API with Figma Nov 12, 2026
@khaliulin
khaliulin changed the base branch from feature/button-figma-sync to feature/form-caption-figma-sync November 12, 2026 17:36
1. Геометрия поля приведена к Figma 1:1 для small, base, large и xlarge: высота, паддинги, радиус, шрифт и line-height; обновлены токены поля и кольцо фокуса.
2. Переработан плавающий лейбл: высота поля 56, лейбл 14/20 в покое и 12/14 поднятым, placeholder скрыт в покое и виден в фокусе под поднятым лейблом.
3. Добавлен вход requiredMark — красная «*» перед лейблом.
4. Добавлен вход captionSeverity (base, success, warning, danger, info); подпись теперь рисует общий компонент extra-caption с иконкой по варианту.
5. readonly оставлен одним входом; крестик остаётся в потоке и скрывается через visibility при readonly и disabled.
6. Сторис переработаны: одна сторис — один пресет Figma, один экземпляр, литералы в Source, Controls для всех 20 входов; старые example-компоненты удалены, остался только пример с reactive forms.
7. API задокументирован в docs/components-api/inputtext.md, соответствие Figma — в inputtext.figma.md.

Заметки для ревьюеров:
- BREAKING относительно main: labelPosition принимает default | float | left (default — лейбл сверху, float — плавающий лейбл); булев floatLabel, добавленный в main, удалён. Расходится со строками для полей ввода в docs/naming-rules.md — решение владельца.
- BREAKING: класс подписи .extra-inputtext-caption заменён на .extra-caption общего компонента; свои стили на старый класс нужно перенести.
- Из main сохранены: required (NG_VALIDATORS), name, autocomplete, maxLength, ariaLabel, ariaLabelledBy, autofocus, tabindex и доступный крестик очистки.
- Токены: components.inputtext и components.floatlabel обновлены (ключ floatlabel inside переименован в in; extend.iconSize теперь size.450); в tokens.json добавлены дополнительные значения.
- Известное отличие от Figma: лейбл float-поля в покое стоит на y=18, в Figma 16 (центрирование по строке 20).
- Открытый вопрос к дизайну: в Figma у float-поля в фокусе с placeholder лейбл остаётся 14/20, в коде поднимается до 12/14. Оставлено как есть по решению владельца.
@khaliulin
khaliulin force-pushed the feature/form-caption-figma-sync branch from b7fbbd2 to bb4a31d Compare November 12, 2026 17:42
@khaliulin
khaliulin force-pushed the feature/form-inputtext-figma-sync branch from e042f88 to 958bc5e Compare November 12, 2026 17:42
Danil Khaliulin added 3 commits November 17, 2026 03:18
1. Восстановить 6 исходных example-файлов компонента вместо лишнего удаления.
2. Согласовать примеры с актуальными типами и API, сохранив исходные описания.
3. Проверить snippets текущих stories, изменённые Controls и строгую Angular-компиляцию восстановленных примеров.

Заметки для ревьюеров:
- Область: только примеры и stories inputtext; производственные компоненты и токены в этом коммите не меняются.
- Stories: сохранён текущий список отдельных примеров; исходные example-файлы доступны рядом с ним.
- Проверки: Angular-компиляция восстановленных примеров и обязательные gates snippets и описаний проходят.
1. Ре-экспорт story из example-файла заменён на объект с дословным описанием из main: Storybook не индексировал ветку (Could not parse import/exports with acorn) и не отдавал index.json.
2. Заметки для ревьюеров: поведение story не изменилось, описания и snippets PASS.
1. parameters.controls.expanded = true — панель Controls в Storybook 10 показывает описание, тип, дефолт и группы категорий (в компактном режиме их нет).
2. Гейты: controls 20/20, descriptions 26/26, source 8/8.
@khaliulin
khaliulin force-pushed the feature/form-inputtext-figma-sync branch from fdf09ae to 8ea3b49 Compare November 18, 2026 12:43
Включает глобальный controls.expanded в .storybook/preview.ts (иначе на ветке панель Controls остаётся компактной до мержа инфраструктурной ветки).
@khaliulin
khaliulin force-pushed the feature/form-inputtext-figma-sync branch from 8ea3b49 to 07a6e8e Compare November 18, 2026 12:44

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.

1 participant