From 3dc6c45d16eca99d9d41c4a41dcfdfd6d306eed4 Mon Sep 17 00:00:00 2001 From: Robin Lopez Date: Thu, 26 Nov 2026 09:52:14 +0100 Subject: [PATCH 1/2] FSHSP-275 fix(field-sign): lay the clear button over the drawing area The clear button was projected as a ui-field suffix, a full-height column beside the drawing area: the area lost its width, and the placeholder and the signature centred left of the box centre. The button now shares the pad's grid cell, pinned to its top-right corner, so the area spans the whole box. --- CHANGELOG.md | 10 +++++++ .../ui-field-sign/src/lib/ui-field-sign.html | 29 ++++++++++--------- .../ui-field-sign/src/lib/ui-field-sign.scss | 8 +++-- .../src/lib/ui-field-sign.spec.ts | 9 ++++++ .../forms/ui-field-sign/ui-field-sign.mdx | 4 ++- 5 files changed, 42 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e33c6a8..6d749f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,16 @@ Le format suit [Keep a Changelog](https://keepachangelog.com/fr/1.1.0/) et le pr ## [Unreleased] +### Fixed + +- **`ui-field-sign` : l'invite et la signature sont centrées dans la boîte** (FSHSP-275). + Le bouton d'effacement occupait une colonne à droite de la zone de dessin, sur toute sa + hauteur : la zone perdait cette largeur, et l'invite comme la signature se centraient à + gauche du centre de la boîte. Le bouton est désormais posé par-dessus le coin haut-droit de + la zone, qui garde toute la largeur de la boîte. Une surcharge CSS qui ciblait le bouton + comme suffixe de `ui-field` (`.ui-field-box > .ui-field-sign-clear`) ne le trouve plus : il + est dans `.ui-field-sign-pad`. + ## [0.17.0] - 2026-11-25 ### Added diff --git a/projects/ui-kit/forms/ui-field-sign/src/lib/ui-field-sign.html b/projects/ui-kit/forms/ui-field-sign/src/lib/ui-field-sign.html index 5489357..d6df3a2 100644 --- a/projects/ui-kit/forms/ui-field-sign/src/lib/ui-field-sign.html +++ b/projects/ui-kit/forms/ui-field-sign/src/lib/ui-field-sign.html @@ -47,21 +47,22 @@ } + + @if (clearable() && !readonly()) { + + } + - - @if (clearable() && !readonly()) { - - } diff --git a/projects/ui-kit/forms/ui-field-sign/src/lib/ui-field-sign.scss b/projects/ui-kit/forms/ui-field-sign/src/lib/ui-field-sign.scss index 4fcc1f8..3f21966 100644 --- a/projects/ui-kit/forms/ui-field-sign/src/lib/ui-field-sign.scss +++ b/projects/ui-kit/forms/ui-field-sign/src/lib/ui-field-sign.scss @@ -82,11 +82,13 @@ $action-height-small: var(--ui-field-sign-action-height-small, #{utils.$form-fie &-pad._small &-placeholder { font-size: $placeholder-font-size-small; } // --- Clear action --------------------------------------------------- - // Same button as every field action, but pinned to the top row: stretched to the - // full height of a signature box, it would be a tall bar. + // Same button as every field action, laid over the top-right corner of the drawing area + // (it shares the pad's grid cell) rather than in a column of its own: the area keeps the + // full width of the box, and the hint and the signature centre on it. Pinned to the top + // row: stretched to the full height of a signature box, it would be a tall bar. &-clear { @include utils.field-action; - align-self: flex-start; + place-self: start end; height: $action-height; &._small { height: $action-height-small; } diff --git a/projects/ui-kit/forms/ui-field-sign/src/lib/ui-field-sign.spec.ts b/projects/ui-kit/forms/ui-field-sign/src/lib/ui-field-sign.spec.ts index 5b6904b..908047f 100644 --- a/projects/ui-kit/forms/ui-field-sign/src/lib/ui-field-sign.spec.ts +++ b/projects/ui-kit/forms/ui-field-sign/src/lib/ui-field-sign.spec.ts @@ -231,6 +231,15 @@ describe('ui-field-sign', () => { }); }); + it('lays the clear button over the drawing area, not in a column beside it', async () => { + const { fixture, clearButton } = await setup(); + const pad = fixture.nativeElement.querySelector('.ui-field-sign-pad') as HTMLElement; + // Inside the pad's grid cell: the area keeps the full width of the box, and the hint + // and the signature centre on it. + expect(pad.contains(clearButton())).toBe(true); + expect(clearButton()!.hasAttribute('uifieldsuffix')).toBe(false); + }); + it('hides the placeholder and enables clearing once signed', async () => { const { draw, placeholder, clearButton } = await setup(); await draw([0, 0], [5, 5]); diff --git a/projects/ui-kit/forms/ui-field-sign/ui-field-sign.mdx b/projects/ui-kit/forms/ui-field-sign/ui-field-sign.mdx index 1ada10a..adae731 100644 --- a/projects/ui-kit/forms/ui-field-sign/ui-field-sign.mdx +++ b/projects/ui-kit/forms/ui-field-sign/ui-field-sign.mdx @@ -120,7 +120,9 @@ rasterise an SVG before embedding it in a document. ## Clear, undo - The clear button (`clearable`, enabled once the area is signed) empties the field and hands - focus back to the drawing area. + focus back to the drawing area. It is laid over the top-right corner of the area rather than + in a column beside it: the area keeps the full width of the box, and the hint and the + signature centre on it. - `clear()` and `undo()` are public, for a "Start again" or "Undo" button owned by the host. `undo()` removes the last stroke drawn in the field, and with none left brings back what the last `clear()` removed. A signature received from the form is not a stroke: only `clear()` From 45917fa2a2beb2a221fefe99b3cc7c8d20683903 Mon Sep 17 00:00:00 2001 From: Robin Lopez Date: Thu, 26 Nov 2026 09:52:30 +0100 Subject: [PATCH 2/2] FSHSP-275 chore(release): bump ui-kit to 0.17.1 --- CHANGELOG.md | 2 ++ projects/ui-kit/package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d749f8..8bb2121 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ Le format suit [Keep a Changelog](https://keepachangelog.com/fr/1.1.0/) et le pr ## [Unreleased] +## [0.17.1] - 2026-11-26 + ### Fixed - **`ui-field-sign` : l'invite et la signature sont centrées dans la boîte** (FSHSP-275). diff --git a/projects/ui-kit/package.json b/projects/ui-kit/package.json index 32984c2..89b1ccc 100644 --- a/projects/ui-kit/package.json +++ b/projects/ui-kit/package.json @@ -1,6 +1,6 @@ { "name": "@4sh/ui-kit", - "version": "0.17.0", + "version": "0.17.1", "description": "Headless Angular components from the 4SH Design System: signals + Angular CDK, styled exclusively through design tokens. Ships a companion MCP server exposing the kit catalog and doc to AI coding agents.", "homepage": "https://4sh.github.io/starter-angular/?path=/docs/introduction--docs", "repository": {