Skip to content

feat(textarea): sync styles and API with Figma - #194

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

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

Conversation

@khaliulin

@khaliulin khaliulin commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Syncs Textarea styles and API with Figma UI Kit DS v2.1 and reuses the shared caption component.

Changes

  1. Add the missing .extra-textarea wrapper css: flex layout, label on the left aligned to the top of the field, label 14/14 and caption 14/14 as in Figma, full width for fluid fields inside the wrappers.
  2. Sync the line height per size and the paddings with the Figma form tokens.
  3. Rework the float label: label 14/20 at rest and 12/14 raised, text starts under the raised label, placeholder hidden at rest.
  4. Add requiredMark and captionSeverity.
  5. Focus the field on autofocus after the view is created, because browsers ignore the attribute on elements added after page load.
  6. Rework the stories: one story is one Figma preset with a single instance, sources that update with Controls, Controls for all 23 inputs; the original per-feature example files are preserved.
  • Restore all 7 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'; the boolean floatLabel added in main is removed. This differs from the form field rows of docs/naming-rules.md.
  • requiredMark: boolean, default false; visual only.
  • captionSeverity: 'base' | 'success' | 'warning' | 'danger' | 'info', default base.
  • The info icon is hidden for the floating label, as in Figma.
  • Kept from main: required, name, autocomplete, maxLength, ariaLabel, ariaLabelledBy, tabindex, readonly.

Technical notes for reviewers

  • Tokens: components.textarea gets the wrapper, label, size and float label rules; tokens.json gets the matching values.
  • Reuses ExtraCaptionComponent from the caption PR.

Visual changes

  • Label on the left now works and is aligned to the top of the field.
  • Float label and line height per size as in Figma; caption has a severity icon and color.

Verification

  • Gates: check-component, check-stories-bg, check-stories-controls (23 inputs), check-stories-single (8 stories, clean console): pass.

  • Storybook: label positions, required, name, autocomplete, maxLength, aria-label, tabindex, readonly, auto resize, captionSeverity: checked through Playwright, no console errors.

  • Not verified: dark theme of every state, autofill.

  • PASS (example restoration): targeted strict Angular template compilation of all 7 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

  • A float field with rows=3 is 88px high where Figma has 80px (80 is the min-height).
  • Design question: a focused float field with a placeholder keeps the 14/20 label in Figma; in code it rises to 12/14. Kept as is.

Stack

Base: feature/form-inputtext-figma-sync (#189), which is based on feature/form-caption-figma-sync (#193).

1. Добавлен недостающий css обёртки .extra-textarea: flex-раскладка, лейбл слева выровнен по верху поля, лейбл 14/14 и подпись 14/14 как в Figma, полная ширина для fluid-полей внутри обёрток.
2. line-height по размерам и паддинги приведены к формовым токенам Figma.
3. Переработан плавающий лейбл: лейбл 14/20 в покое и 12/14 поднятым, текст начинается под поднятым лейблом, placeholder скрыт в покое.
4. Добавлен вход requiredMark — красная «*» перед лейблом.
5. Добавлен вход captionSeverity (base, success, warning, danger, info); подпись рисует общий компонент extra-caption.
6. Поле фокусируется по autofocus после создания view: браузеры игнорируют атрибут autofocus у элементов, добавленных после загрузки страницы.
7. Сторис переработаны: одна сторис — один пресет Figma, один экземпляр, литералы в Source, Controls для всех 23 входов; старые example-компоненты удалены.

Заметки для ревьюеров:
- BREAKING относительно main: labelPosition принимает default | float | left; булев floatLabel, добавленный в main, удалён. Расходится со строками для полей ввода в docs/naming-rules.md — решение владельца.
- API: новые входы requiredMark и captionSeverity (по умолчанию base); иконка info скрыта у плавающего лейбла, как в Figma.
- Из main сохранены: required, name, autocomplete, maxLength, ariaLabel, ariaLabelledBy, tabindex, readonly.
- Токены: components.textarea получает правила обёртки, лейбла, размеров и плавающего лейбла; в tokens.json добавлены соответствующие значения.
- Известное отличие от Figma: float-поле при rows=3 высотой 88, в Figma 80 (80 — это min-height).
- Открытый вопрос к дизайну: в Figma у float-поля в фокусе с placeholder лейбл остаётся 14/20, в коде поднимается до 12/14. Оставлено как есть по решению владельца.
@khaliulin
khaliulin force-pushed the feature/form-inputtext-figma-sync branch from e042f88 to 958bc5e Compare November 12, 2026 17:42
@khaliulin
khaliulin force-pushed the feature/form-textarea-figma-sync branch from 9896abb to e240d4c Compare November 12, 2026 17:42
Danil Khaliulin added 3 commits November 14, 2026 03:13
1. Сниппеты Source во всех сторисах Docs приведены к стилю inputtext: только тело компонента, однострочники, без html-комментариев и примеров состояний/размеров (они в Controls).
2. Default: многострочный сниппет с полным набором входов (label, requiredMark, info, caption, placeholder).
3. Readonly и Clearable: булевы атрибуты без скобок (readonly, clearable), как в inputtext.
4. FloatLabel: label="FloatLabel" labelPosition="float" вместо «Комментарий» с requiredMark.

Заметки для ревьюеров:
- Только parameters.docs.source в сторисах, рендер и args не менялись.
- Стиль референса: pr-189 inputtext.stories.ts.
1. Восстановить 7 исходных example-файлов компонента вместо лишнего удаления.
2. Согласовать примеры с актуальными типами и API, сохранив исходные описания.
3. Проверить snippets текущих stories, изменённые Controls и строгую Angular-компиляцию восстановленных примеров.

Заметки для ревьюеров:
- Область: только примеры и stories textarea; производственные компоненты и токены в этом коммите не меняются.
- Stories: сохранён текущий список отдельных примеров; исходные example-файлы доступны рядом с ним.
- Проверки: Angular-компиляция восстановленных примеров и обязательные gates snippets и описаний проходят.
1. parameters.controls.expanded = true — панель Controls показывает описание, тип, дефолт и группы категорий.
2. Гейты: controls 23/23, descriptions 26/26, source 8/8.
@khaliulin
khaliulin force-pushed the feature/form-textarea-figma-sync branch from 688f668 to 13cd36b 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
@khaliulin
khaliulin force-pushed the feature/form-textarea-figma-sync branch from 13cd36b to 942cc59 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