Accessibility
Attachment, AttachmentMediaKind, Attachments, getAttachmentMediaMeta, normalizeMediaType from @prepared911/ui/attachment.
role="list" (Box adds it to a ul), because WebKit exposes a list without markers as a group and VoiceOver would not announce the file count. A screen reader announces how many files a message carries. aria-label names it and is optional: the chips name themselves.button named by removeLabel, such as "Remove requirements.pdf", so the name says which file it removes. It is type="button". Its tooltip repeats the name visually and is not read twice.
The tile is tinted by the kind of file, and the glyph differs by kind too (document, image, video, microphone, code). The supporting line states the type.
Each tile tint and its glyph use a status or accent fill with its matching foreground. The browser tests run axe over every kind in light and dark. Under forced-colors: active fills are removed, so the tile gets an edge and takes the system colors.
A long file name truncates with an ellipsis and keeps the full name in title. The chip never grows past its container, and chips wrap onto new rows.
The tile comes first and the remove control last in reading order, so they swap sides with the direction.