Usage
filename, mediaType, url): a 40px media tile, the file name over a supporting line, and an optional remove control. An image with a URL shows as a thumbnail; every other type shows a glyph on a tile tinted by its kind.
attachments slot of a Message, beside its text.FlexBox rendered as a ul, which Box gives an explicit role="list" because WebKit drops the list semantics of a list without markers. It wraps, with an 8px gap. Attachment is its li, so place it inside Attachments.objectFit Cover, decorative because the file name is beside it, and allowRemoteSource for hosted URLs. It shows only for an image/* type with a url.title. The supporting line is Text, caption, subtle, truncated.removeLabel, which is also its tooltip. It is type="button", so it never submits a form.description is copy or data. With none, the short uppercase subtype of mediaType shows (PDF, PNG), which is data derived from the type, not copy. With neither, no line shows. getAttachmentMediaMeta(mediaType) returns the glyph, kind and subtype for a caller that builds its own line.
normalizeMediaType lowercases a MIME type and drops its parameters, so Image/PNG;charset=utf-8 is image/png. JavaScript, TypeScript, JSON, XML, CSS, HTML and +json style suffixes are code; Office Open XML is not.