Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ 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).
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
Expand Down
29 changes: 15 additions & 14 deletions projects/ui-kit/forms/ui-field-sign/src/lib/ui-field-sign.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,22 @@
</span>
}

<!-- Laid over the drawing area, not beside it: the area keeps the full width of the
box, so the hint and the signature centre on the box itself. -->
@if (clearable() && !readonly()) {
<button
type="button"
class="ui-field-sign-clear"
[class._small]="size() === 'small'"
[attr.aria-label]="clearAriaLabel()"
[disabled]="isDisabled() || !canClear()"
(click)="onClearClick()"
>
<ui-icon name="eraser" [size]="iconSize()" />
</button>
}

<!-- The state, for assistive tech: `aria-describedby` reads hidden nodes. -->
<span hidden [id]="statusId()">{{ statusText() }}</span>
</div>

@if (clearable() && !readonly()) {
<button
uiFieldSuffix
type="button"
class="ui-field-sign-clear"
[class._small]="size() === 'small'"
[attr.aria-label]="clearAriaLabel()"
[disabled]="isDisabled() || !canClear()"
(click)="onClearClick()"
>
<ui-icon name="eraser" [size]="iconSize()" />
</button>
}
</ui-field>
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
4 changes: 3 additions & 1 deletion projects/ui-kit/forms/ui-field-sign/ui-field-sign.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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()`
Expand Down
2 changes: 1 addition & 1 deletion projects/ui-kit/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down