Repository navigation
Release v2.22.0
v2.22.0
Changelog
Target 2.22.0 (minor). ROADMAP "Ideas from an admin-template review (2026-11)", P1 lot 1.
Added
- Choice cards (
choice_cardsoption,Form\Extension\ChoiceCardsExtension) onChoiceTypewith
expanded: trueand its subtypes (EntityType,EnumType…): each choice is drawn as a selectable card with a
title, an optional description, an icon (icon_html, trusted HTML) or an image ({src, alt},altrequired), in
1–4 columns or an auto-fit grid. Resolvers are arrays keyed by choice value orchoice_attr-style callables; texts
follow the choice translation domain and parameters. Native radios / checkboxes stay visible, the label is stretched
over the card (CSS only), descriptions are linked witharia-describedby, and the group gets
role="radiogroup"/grouplabelled by the field label. - Framework-neutral switch (
switchoption,Form\Extension\SwitchExtension) onCheckboxType: a real checkbox
withrole="switch", the track inside its<label>, sizessm/md/lgand optional on/off icons; the same
markup on Bootstrap, Tailwind,form_div_layoutand UiKit. Radios reject it. - Character counter (
char_counteroption,Form\Extension\CharCounterExtension) onTextTypeand its
subtypes (TextareaType,EmailType…): limits from the option, the field'sLengthconstraint, theLength
constraint of the mapped property (validator metadata) or themaxlength/minlengthattributes; count unit from
Length::$countUnit. Without JavaScript the limit is printed and linked witharia-describedby; the new
char-counter.js(IIFE, CSP-safe) shows "42 / 160" and announces the remaining / over-limit count in a polite live
region near the limit only. Never addsmaxlength. - Form theme
@NowoFormKitBundle/form/field_widgets_theme.html.twig, registered intwig.form_themesby default
(nowo_form_kit.field_widgets.form_theme, defaulttrue); its blocks are reached only through the new block
prefixesnowo_choice_cards,nowo_switchandnowo_char_counter. - Public assets
field-widgets.css(UiKit tokens withcurrentColorfallbacks, forced-colors and reduced-motion
rules) andchar-counter.js. - Translations
char_counter.*in the 7 bundle locales (en, es, fr, de, it, pt, nl). - Demo: the Choice fields page shows a plan picker with choice cards, a notifications switch and a bio with a
character counter.
Changed
.scripts/check-no-raw-html-form.sh(REQ-TWIG-005) allowsfield_widgets_theme.html.twig, a form theme that writes
the native radio / checkbox of its cards and switch.
Tests
FieldWidgetsThemeTest: fields without the new options render byte-identical onform_div_layout,
bootstrap_5_layout,bootstrap_5_horizontal_layout,tailwind_2_layoutand UiKit'snowo_ui_layout; choice cards,
switch and counter on each of them; CSP checks (no inline script, style or handler); no state leak across forms.FieldWidgetsExtensionsTest,FieldWidgetsConfigTest; Vitestchar-counter.test.ts(100 % coverage).
Documentation
- USAGE (DDD / hexagonal section): standard vs DDD lead-in linking the entity path (locale tabs on a collection indexed by locale) and the DTO path.
Tests
HostPathsFormTest: FormKit types bound to an input DTO with a value-object model transformer and locale tabs on locale-keyed DTOs (DDD host), and to an entity with a DoctrineCollectionindexed by locale (standard host).
Documentation
- ROADMAP.md: new section "Ideas from an admin-template review (2026-11)" with prioritised gaps (choice cards, a framework-neutral switch, a character counter, date conventions, a file upload field, layout profiles, sticky actions, an error summary, a wizard review step and a checkbox matrix), and ideas routed to other bundles.
What's Changed
- docs(roadmap): add ideas from an admin-template review by @HecFranco in #70
- docs: add DDD host path lead-in and host-paths form tests by @HecFranco in #72
- ci: run the igor worker-state audit by @HecFranco in #71
- feat(widgets): choice cards, switch and character counter (P1 lot 1) by @HecFranco in #73
Full Changelog: v2.21.0...v2.22.0