File picker

ds-file-picker keeps a native input type="file" in light DOM. It is the focusable hit target: the browser owns the file chooser, labels, keyboard activation, file drops, required validation, form values, reset and disabled fieldsets. DS1 composes the visible Button face, focus ring and scale.

<ds-file-picker label="Choose logo" secondary>  <input type="file" name="logo" accept="image/svg+xml,.svg" aria-label="Choose logo"></ds-file-picker>

The normal picker is one square high and as wide as its label. icon makes it a one-square icon control; preview makes a four-square image control, or two squares with compact. area fills its container as an eight-square-high upload target, or four squares with compact. It uses the shared secondary face and wraps its label. Use it for a larger native drop target rather than drawing a product-owned well. Put decorative content in the content slot. Keep an accessible name on the native input. The composed button is inert and hidden from assistive technology so there is one control and one tab stop.

In React, register the element in the browser before hydration. The label attribute supplies the visible copy; the native input keeps its own accessible name, attributes and event handlers, and className and style on the host place the picker.

<ds-file-picker label="Attach files" secondary>  <input type="file" aria-label="Attach files" multiple accept="image/*,.pdf" disabled={pending}    onChange={event => acceptFiles(event.currentTarget.files)} /></ds-file-picker>

Products own accepted types, size limits, selected-file display, upload requests, permissions and persistence. No file leaves the browser through this component. Clear event.currentTarget.value after consuming a selection when choosing the same file again should be possible. Do not hide the input or add a second click trigger. Native accept guides selection; product validation still applies. When a containing product surface also accepts dropped files, it owns that drop: prevent the native default and pass a copied array to the same guarded upload function. This avoids uploading once on drop and again on change. Set dragging when that outer surface has a file over it: DS1 applies the same drag feedback to the picker, suppressed when the native control is disabled. Verify file selection and keyboard activation, disabled fieldsets, reset, focus, pending recovery and light/dark scaled layouts without uploading live test data.

The input’s cancel event reports a dismissed chooser. Keep a menu that contains the picker mounted until change or cancel, so returning from the system chooser cannot lose the selected files. Use role="menuitem" inside a Select or Context menu to share its row and arrow navigation while Enter and Space stay native; a file row never closes the menu before the chooser answers.

Choose a print file

The file input stays native. Selection is local to this preview; nothing is uploaded.