-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up progress indicator implementation: JS & styling #36
Clean up progress indicator implementation: JS & styling #36
Comments
Note that this may potentially be a breaking change due to the |
The Additionally, the |
Refinement: Sergei says we need to toss out the old implementation and get something new and shiny. We should look at NLDS for existing components or inspiration. |
Rather than having the progress indicator component inherit the card component styles, it shares the implementation details with it but uses its own component namespace in the design tokens. Implemented in a backwards compatible manner to point to existing design tokens, but you can specify more specific ones if you'd like so.
* Use flexbox and gap for spacing between caption and link list in progress indicator * Hide the mobile header/toggle button on desktop * Manage spacing between list items with gap rather than margins
This now uses a flexbox approach for the content, while using the normal document flow as much as possible to fit the element inside its container element(s). The story is updated so that it's clear how overflowing content is handled. Padding is removed from the parent element and moved into the button element, so that it is more touch-device friendly. Tapping anywhere on the header now toggles it between open/closed state. Finally, most of these appearance aspects are now parametrized through design tokens.
When scrolling the main content, the progress indicator should stay in view.
This is quite involved as there are some styling edge cases to consider: * form title that overflows and is truncated with ellipsis - if you're not careful, this can cause a horizontal scrollbar * form title that is long and the main content being scrollable - this can also cause a small horizontal scrollbar due to the ellipsis situation * the progress indicator content itself should be scrollable, independent from the main content * possibly there is an external header/footer that may take up some vertical space, which limits the amount of vertical space available for our progress indicator The implementation now passes a ref to the button element in React, which allows us to calculate the height of the button (our 'menu' bar) AND its offset to the top of the page, in case there is another external UI element taking space. We then allocate a maximum block size (= vertical space) as the dynamic viewport block (100dvb, dynamic taking into account the address bar that can dissapear on actual mobile devices) minues the vertical/block spacing reserved for the button and possible third party content. When scrolling down, our button may overlay the third party content (due to the position: sticky) and this frees up a little bit of space below the progress indicator - this is deliberate. Users are allowed to interact with buttons below it and simplifies us having to track more things in React.
On mobile, apply some padding to push the language buttons down.
Add new, update existing and remove obsolete design tokens related to the progress indicator styling. This includes some bigger changes to the app component as well.
Add new, update existing and remove obsolete design tokens related to the progress indicator styling. This includes some bigger changes to the app component as well.
The fixed steps being added don't need to be falsy, they need to not be added at all.
The explicit z-index creates a stacking context which puts it on top of the date picker in appointments. Not specifying the z-index seems to work equally well.
Add new, update existing and remove obsolete design tokens related to the progress indicator styling. This includes some bigger changes to the app component as well.
Something went wrong with the previous version of design tokens, so I've redone them. Even the git reflog couldn't help :(
On request we can bring it back, but currently it doesn't seem that anyone makes use of this mechanism.
The overview should be navigable once all the preceding steps are completed, rather than always rendering a placeholder.
The sass does weird things because it's based on the
card
component and on mobile spacing is different. It's also very contextual w/r to the font-size.The combination of
position: sticky
+flexbox
+ having the expanded progress indicator overlay the rest of the page is challenging.Additional input:
The text was updated successfully, but these errors were encountered: