Skip to content

feat(datepicker): sync styles and API with Figma - #198

Open
khaliulin wants to merge 4 commits into
feature/form-select-figma-syncfrom
feature/form-datepicker-figma-sync
Open

khaliulin wants to merge 4 commits into
feature/form-select-figma-syncfrom
feature/form-datepicker-figma-sync

Conversation

@khaliulin

@khaliulin khaliulin commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Synchronize DatePicker fields, calendar cells, panel and time controls with the live UI Kit DS v3.0 design. Reuse the kit Select for month/year navigation and keep range selection, forms and localization working.

Changes

  1. Apply component tokens for four field sizes, light/dark states, calendar geometry and time inputs.
  2. Add label/caption/info, FloatLabel, required validation, fluid layout and forwarded input attributes/events.
  3. Use ExtraSelectComponent in the header, including disabled/readonly behavior and month/year events.
  4. Provide 12 single-instance stories, including Range, and dynamic snippets that reflect Controls. Preserve all nine original example files; update the clear-icon example to the current clearable API.

API changes

  • BREAKING: size="medium" becomes size="base"; supported values are small/base/large/xlarge.
  • BREAKING: showClear becomes clearable (false by default).
  • Add label, labelPosition, caption, captionSeverity, info, floatLabel, required and fluid; reuse the shared Caption component.
  • Add inputId, name, autocomplete, ariaLabel, ariaLabelledBy, autofocus and tabindex.
  • Add onInput/onFocus/onBlur/onShow/onHide/onTodayClick/onClearClick outputs; preserve existing selection and navigation outputs.
  • Add canonical view="day" and view="time"; retain legacy view="date" as a day-view alias.
  • Keep CVA synchronization and touched/dirty validation; disabled is controlled through forms.

Technical notes for reviewers

  • Only DatePicker files and components.datepicker in tokens.json change relative to the Select base branch. Local gates, exports and baselines are excluded.
  • Field dimensions use DatePicker aliases to existing semantic/primitive roles. Shared component tokens are unchanged in this PR.
  • Panel width 411.25px and time-input width 47px come from measured Figma geometry; calendar dates are 32px with 4px cell padding.
  • Outside outlines/separators reproduce Figma strokes without increasing panel height. Time controls precede the footer.
  • Header selects use size small, appendTo body and showCheckmark=false from the Select API in feat(select): sync styles and API with Figma #197. DatePicker-specific layout accounts for the display:contents host.
  • FloatLabel overrides PrimeNG's placeholder-presence selector: an empty unfocused field keeps its label centered, matching InputText.

Visual changes

  • Fields: 36/42/50/56px for small/base/large/xlarge; FloatLabel remains 56px.
  • Calendar cells: 32x32px with 8px radius inside 40x40px slots; weekday weight is 500.
  • Panel: 411.25x528px for the reference six-week month with time and footer; panel radius is 10px.
  • Time inputs: 47x40px. Selected-date foreground works in both themes.
  • Selected month/year options inherit the gray Select tokens from feat(select): sync styles and API with Figma #197.

Verification

  • PASS: check-component, check-stories-bg, check-stories-single (12), check-stories-controls (35 inputs).
  • PASS: check-stories-source for all 12 stories and changed Controls, including inline/disabled/size and FloatLabel/clearable/value scenarios.
  • PASS: check-stories-descriptions (24 existing descriptions match origin/main verbatim).
  • PASS: live Figma bound-token comparison, 32/32 in both themes.
  • PASS: API matrix 110/110, including range preview/completion, FloatLabel transitions across four sizes and both themes, header selections, forms, localization and zero runtime errors.
  • PASS: targeted Angular template compilation of all nine restored example components; TypeScript app check and diff whitespace checks.
  • PASS: DatePicker unit tests 10/10, Storybook runner 12/12 with light/dark/mobile style baselines, TypeScript app check, targeted Prettier and diff whitespace checks.
  • Global check-dt-refs retains unrelated pre-existing failures in confirm-dialog/multiselect/radiobutton/rating; DatePicker references pass.
  • Full lint could not run: missing @angular-eslint/builder and incompatible shared ESLint configuration. This is not recorded as a passed check.

Known issues and open questions

  • Shared Caption retains the existing light-theme contrast warning (3.55:1); its tokens are outside this PR.
  • PrimeNG positions the popup at integer width (411px); inline preserves 411.25px. Month length changes calendar height.
  • Tabler webfont rasterization differs from Figma vectors. Figma shows static raised FloatLabel and dropdown-based month/year panel examples; runtime FloatLabel and month/year grids remain interactive.
  • Button text follows the runtime translation dictionary, so the Russian clear label differs from the static design wording.
  • Full Angular template compilation retains pre-existing errors in progressspinner and unrelated button/dialog/tag/toast examples; the targeted compilation of the restored DatePicker examples passes.
  • Storybook still reports a stale Compodoc entry warning for DatePicker. No runtime errors were found.

Stack

Base: feature/form-select-figma-sync (#197), which depends on caption (#193) and base tokens (#192). Merge the parent stack first; this PR contains only the DatePicker commit relative to #197.

Danil Khaliulin added 3 commits November 17, 2026 02:39
1. Привести геометрию поля, панели, ячеек и времени к токенам Figma в обеих темах.
2. Добавить label, caption, FloatLabel, размеры и события; переименовать medium в base и showClear в clearable.
3. Подключить ExtraSelectComponent для выбора месяца и года, сохранить локализацию и выбор диапазона.
4. Обновить документацию и двенадцать stories с динамическим кодом текущего примера и описаниями из main.

Заметки для ревьюеров:
- API: сохранён view=date как совместимый вариант day; required и состояния формы работают через CVA и валидаторы.
- Токены: изменены только components.datepicker; общие стили и токены остальных компонентов не включены.
- Поведение: FloatLabel возвращается в центр в пустом состоянии; Range показывает предварительное выделение и закрывается после выбора границ.
- Проверки: API 110/110, unit 10/10, stories 12/12; общий lint недоступен из-за конфигурации и зависимостей среды.
1. Восстановить девять исходных файлов examples вместо лишнего удаления при обновлении stories.
2. Привести пример очистки к актуальному входу clearable.

Заметки для ревьюеров:
- API: публичный компонент не меняется; восстанавливаются базовый пример, состояния, диапазон, время, панель кнопок и локализация.
- Stories: основной список и динамические snippets сохранены; наличие example-файлов не противоречит требованию одного отображаемого экземпляра.
- Проверки: отдельная Angular-компиляция девяти примеров, TypeScript и gates snippets, descriptions и bg проходят.
1. parameters.controls.expanded = true — панель Controls в Storybook 10 переключается с компактной на полную таблицу: имя, описание, тип, дефолт, контрол и группы категорий.
2. Добавлены описания 23 входов, у которых их не было (iconDisplay, hourFormat, minDate, maxDate, view, showOtherMonths, selectOtherMonths, label, labelPosition, floatLabel, caption, captionSeverity, info, required, fluid, inputId, name, autocomplete, ariaLabel, ariaLabelledBy, autofocus, tabindex, value). Существующие описания из main не тронуты.
3. Гейты: descriptions 24/24, controls 35/35, source 12/12, single 12/12.

Заметки для ревьюеров:
- Компонент и токены не менялись, только stories.
@khaliulin
khaliulin force-pushed the feature/form-datepicker-figma-sync branch from f1fdaaf to 4c38820 Compare November 18, 2026 12:43
Включает глобальный controls.expanded в .storybook/preview.ts (иначе на ветке панель Controls остаётся компактной до мержа инфраструктурной ветки).
@khaliulin
khaliulin force-pushed the feature/form-select-figma-sync branch from 8ed484d to f39a6ee Compare November 18, 2026 12:45
@khaliulin
khaliulin force-pushed the feature/form-datepicker-figma-sync branch from 4c38820 to 5309eb0 Compare November 18, 2026 12:45

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