Skip to content

feat(webkit): add the Hint component, Label's hint prop, and quieter field-* helpers - #873

Merged
robsongajunior merged 6 commits into
mainfrom
feat/inputs-label-hint
Aug 10, 2026
Merged

feat(webkit): add the Hint component, Label's hint prop, and quieter field-* helpers#873
robsongajunior merged 6 commits into
mainfrom
feat/inputs-label-hint

Conversation

@gabriel-lisboa-azion

Copy link
Copy Markdown
Collaborator

Summary

  • New hint component (@aziontech/webkit/hint): a Tooltip-anchored info glyph on a focusable button, where text is both the tooltip copy and the button's accessible name. Label renders it from a new hint prop, so a field name and its one-sentence explanation are one component instead of a hand-built row.
  • field-* no longer writes copy of its own: a field with no helperText renders no helper row, disabled or not — the old "This field is locked." fallback appeared and vanished under every field for the ~1s of a submit.
  • Password requirement chips move from --bg-surface-raised to --bg-placeholder, so an unsatisfied chip tints its container instead of reading as a raised block on one.

How to test

  1. pnpm storybook:devComponents/Inputs/Hint: hover and Tab to the glyph — the tooltip opens on both, Esc closes it, and the four anchors in Placements open on their declared side.
  2. Same Storybook → Components/Inputs/Label → Hinted: the glyph sits after the label text; clicking it does not toggle a control the label points at (the Sensitive switch pattern).
  3. Same Storybook → Components/Inputs/FieldText → Disabled (and FieldSelect / FieldPassword / FieldPhoneNumber / FieldTextSwitch / FieldInputGroup): a disabled field with no helper-text shows no helper line; one with helper-text keeps it and gains the lock glyph.
  4. Same Storybook → Components/Inputs/FieldPassword → Requirements: unsatisfied chips read as a translucent tint of the card behind them; satisfied chips are unchanged (--success + check).
  5. pnpm webkit:test → 30 inputs suites, 792 passing (label +5, hint +9 new browser-mode tests, axe included).

Notes

  • Behavior change, not a breaking API change: no prop, event or slot was removed. A consumer relying on the automatic "This field is locked." string now sees nothing unless it passes helper-text. The shipped webkit-form skill is updated in the same commit so consumer-side AI guidance matches.
  • Visual baselines for the three new stories (Hint Default/Placements, Label Hinted) and the requirement-chip color still need a CI regeneration run.

Hint is a Tooltip-anchored info glyph on a focusable button: the text prop is
both the tooltip copy and the button's accessible name, the glyph is decorative,
and the click default is prevented so a Hint inside a label never toggles the
control that label points at.

Label gains hint: non-empty renders the Hint after the text and the required
indicator, sets data-hinted, and picks up the xxs gap. The hint's testid derives
from the label root, so a consumer override carries through.
A field-* with no helperText used to fall back to "This field is locked." while
disabled, so a form disabled for the length of a submit grew a padlock line the
screen never asked for and lost it a second later. The field now writes no copy
of its own: no helperText means no helper row, disabled or not, and a caller who
wants a reason passes one (it still renders with the lock glyph).

Also moves the password requirement chips off --bg-surface-raised onto
--bg-placeholder, so an unsatisfied chip tints its container instead of reading
as a raised block on one.

@robsongajunior robsongajunior left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nos .md na tabela de props quando diz se required ou não está no, ideal seria ser tb true||false

The Required column read yes/no while Type and Default beside it read as
literal values, so the same boolean fact was spelled two ways in one table.
Every touched spec now says true/false, and each frontmatter checksum is
recomputed so enforce-spec-exists still matches the body.
@gabriel-lisboa-azion

Copy link
Copy Markdown
Collaborator Author

Boa, @robsongajunior — feito em 648bf6b.

A coluna Required dos 8 specs deste PR agora usa true/false (antes yes/no), alinhada com as colunas Type e Default, que já são valores literais:

| `text`      | `string` | `''`    | true  | ... |
| `placement` | ...       | `'top'` | false | ... |

Recalculei o checksum do frontmatter de cada spec no mesmo commit, então o enforce-spec-exists continua batendo com o corpo.

Os outros ~70 specs do repo e o .specs/_template.md (que é o que ensina a convenção) ainda estão em yes/no. Como _template.md é doc compartilhado, ele não pode viajar junto com código no mesmo PR — levo o sweep completo (template + specs restantes) num PR separado, se estiver ok pra você.

robsongajunior
robsongajunior previously approved these changes Aug 10, 2026
@isaque-bock-azion

Copy link
Copy Markdown
Contributor

Não sei se existe algum cenário desse tipo, mas eu recomendaria dar um truncate nesse text
image

@isaque-bock-azion

Copy link
Copy Markdown
Contributor

Num container flexivel (maior que o componente), o componente se expande conforme vai se expandindo. É esperado?
https://github.com/user-attachments/assets/09da4127-7de6-4493-8e32-2e523e7b978a

…ippets

exampleProps matched the literal 'yes', so once a spec table says true the
generator stops seeing that prop as required and picks leading scalars instead.
Both spellings are now accepted, so the reader is correct whichever spec files
have migrated.
@gabriel-lisboa-azion

Copy link
Copy Markdown
Collaborator Author

@isaque-bock-azion Isso so acontece no Storybook, ele vai respeitar o Container que ele está inserido. No storybook ta com largura automática, logo vai acontecer isso mesmo.

@gabriel-lisboa-azion

Copy link
Copy Markdown
Collaborator Author

Não sei se existe algum cenário desse tipo, mas eu recomendaria dar um truncate nesse text image

Não acontece isso de fato, ja testei na Sample e ele quebra e respeita a altura docmponente, posos testar textos maiores mas esse seu teste não faz sentido pq a palabra kkkkkkkk é uma palvra com inumeros carecteres, não vai quebrar pq é uma palavra unica.

@robsongajunior
robsongajunior merged commit 84ccc25 into main Aug 10, 2026
23 checks passed
@robsongajunior
robsongajunior deleted the feat/inputs-label-hint branch August 10, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants