digdir / designsystemet

Designsystemet
https://designsystemet.no
MIT License
85 stars 38 forks source link

Missing Button loading state in Figma #2330

Closed eirikbacker closed 3 weeks ago

eirikbacker commented 3 months ago

Button has a built in loading state, but there is no sketches for it in Figma? :)

Viveca24 commented 1 month ago

I have created and tested an animated spinner for the button's loading state in Figma.

What has been done:

Viveca24 commented 1 month ago

I'm not sure if having multiple lines in a button is considered a good UX practice. But I would like to know what you think about the placement of the spinner: should it be centered in the middle of the button, as shown in the image, or placed next to the first line of text when the button contains two lines? @mrosvik & @Febakke

Image

mrosvik commented 1 month ago

In Storybook it looks like the icon and the loader is centered. I think we should keep it this way, since the padding above text is very small, and the loader will probably not be aligned with the first line of text?

Image

Image

Viveca24 commented 1 month ago

I have implemented a spinner that supports all colors, utilizing the same 'sub-tokens' for consistency across different colors.

Background: color.<variable>.surface-default Stroke: color.<variable>.border-default

Image

Febakke commented 4 weeks ago

Skal spinner være synlig på hover? Vi har satt opp prototypingsoppførsel på button komponenten og ser ut til å ikke fungere så bra med spinner. Det gir kanskje ikke mening at en knapp med loader får hover?

Alternativer:

Image

mrosvik commented 3 weeks ago

Vi går for alternativ 2: La være as is, vil se litt buggy ut i prototyper. Vi kan evt. utbedre dette senere ved behov.