digdir / designsystemet

Designsystemet
https://designsystemet.no
MIT License
81 stars 37 forks source link

Chip: Improve styling and behavior #2321

Closed mrosvik closed 1 month ago

mrosvik commented 2 months ago

We need to revise the chip component.

mrosvik commented 1 month ago

New design suggestion:

Image

This should make it clearer which chips that could be selected as single (radio) and which could be selected multiple (checkbox)


Summary of our discussions:

Initially, we considered simplifying the Chip component to only be "Removable" and keeping it as an internal component for use in the Combobox. However, we've noticed some developers have already used it in other contexts, so we need to evaluate that.

We considered to remove the Chip Checkbox, and update Checkbox with a new variant with a chip design. This chip variant of the checkbox will be used when placed horizontally. Similarly, the Chip Radio was considered to be removed, and Radio updated with a new variant with a chip design to be used when placed horizontally. For ToggleGroup, we were also considering a chip design variant.

After further discussion with developers, we considered keeping the Chip as a standalone component with all variants, as it would be easier to locate in the documentation. If we find a better way in the future, we can always deprecate some of it.

mrosvik commented 1 month ago

New design is finished in Figma.

### Tasks
- [x] Add all states
- [x] Add relevant examples
- [x] Old Chip is moved to workspace
- [x] Combobox is updated with new chip

Image