Skip to content

feat(react): new component FileUpload#4540

Open
oddvernes wants to merge 72 commits into
mainfrom
feat/fileupload
Open

feat(react): new component FileUpload#4540
oddvernes wants to merge 72 commits into
mainfrom
feat/fileupload

Conversation

@oddvernes

Copy link
Copy Markdown
Collaborator

resolves #1236

@changeset-bot

changeset-bot Bot commented Feb 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: db7641d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@digdir/designsystemet-react Minor
@digdir/designsystemet-css Minor
@digdir/designsystemet Minor
@digdir/designsystemet-types Minor
@digdir/designsystemet-web Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

Preview deployments for this pull request:

storybook - 18. Jun 2026 - 13:05

www - 18. Jun 2026 - 13:08

@oddvernes oddvernes changed the title feat(react): FileUpload new component feat(react): new component FileUpload Feb 24, 2026
@oddvernes

Copy link
Copy Markdown
Collaborator Author

One issue I have encountered: because all the components are in one common @layer, placing FileUpload inside a Field causes .ds-field to overwrite styles on .ds-file-upload (being a label) due to usage of stronger selectors (:is()). For now I have solved this by repeating the class twice .ds-file-upload.ds-file-upload {} to get same specificity (0.2.0) and then it wins by being later in the css order.

@Febakke

Febakke commented Mar 3, 2026

Copy link
Copy Markdown
Member

Tested with VoiceOver.

Label in field gives weird behavior. Image is showing reading order of elements.
Skjermbilde 2026-03-03 kl  09 12 16
Image from screen reader:
test

Text inside works fine:
Skjermbilde 2026-03-03 kl  09 14 10

We need to discuss:

  • Should we support label outside of dropzone? If so, how do we create a robust screen reader experience?
  • We need to think about the "slipp filer her" text. This is something we might want to hide from screen readers. How do we support this and flexible texts 🤔

@oddvernes

Copy link
Copy Markdown
Collaborator Author

Someone else will need to take over this branch and write the documentation. The component is ready but needs code-review for the latest changes.
This pr installs react-dropzone as a devDependency in the react package which is not ideal. But it is useful to have a functional test of this in storybook since downstream users will use it, and it affects the component 🤷

@mrosvik

mrosvik commented Jun 9, 2026

Copy link
Copy Markdown
Member
  1. juni 2026, Status fra @oddvernes @eirikbacker @mimarz :
    Det er kun docs som gjenstår. Viktig å få med i dokumentasjonen hvor en skal sette props fra react-dropzone sånn at alt blir lest av skjermleser.

@Barsnes Barsnes marked this pull request as ready for review June 16, 2026 10:10
FileUploadInputProps
>(function FileUploadInput(rest, ref) {
return (
<input

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should this not be our Input since it has suppressHydrationWarning for use inside ds-field and other stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New component: Fileupload

6 participants