Royal-Navy / design-system

Build web applications that meet the Royal Navy service standards
https://storybook.design-system.navy.digital.mod.uk
Apache License 2.0
103 stars 32 forks source link

Add Masthead component #187

Closed antictor closed 4 years ago

antictor commented 4 years ago

Applications require a top bar that communicates the application/service name and optionally provides features for: search, user profile info, notifications and navigation.

The Masthead may or may not be used in conjunction with the Sidebar.

The Masthead needs to be modular to the application in question is able to use any combination of its features, including all or none of them.

Currently we don't have any applications that require the Masthead to support mobile, but this will come in time.

As this is potentially complex it may be worth creating the Masthead in stages, though the design should include all options to ensure that it will evolve without issue.

Initially the primary project for this simply requires the ability to display a logo and service name.

Another project, re-starting soon will also require the user profile section to be added.

Finally there is a project being worked on elsewhere that requires a Masthead including search and navigation.

Screenshot 2019-08-01 at 14 13 44 Screenshot 2019-08-01 at 14 14 17 Screenshot 2019-08-01 at 14 13 56 Screenshot 2019-08-01 at 13 29 25
antictor commented 4 years ago

Creating a basic version first that just has the logo and service name for current project.

hxltrhuxze commented 4 years ago

I've updated both the mobile and desktop comps to include placement for:


Desktop Masthead

The Desktop version of the Masthead keeps the placement of the Notification Badge and the Profile Avatar, however adds the ability to have a Search Button next to them.

When the Search Button is clicked, the new Search Bar replaces the the nav with a dark background input. The input takes up the full height of the nav.

Screenshot 2019-08-05 at 16 30 58

Mobile Masthead

To maintain usage consistency, not a lot has changed between the desktop and mobile versions of the Masthead.

The Search Bar still functions the same as it does on desktop - clicking the Search Button will open the bar over the Nav. Clicking it again will revert the UI.

The Nav Links sit within a container that overflows on the x-axis. This removes the need for a separate dropdown mobile menu.

Screenshot 2019-08-05 at 16 31 05

Notification Sheet

The notification sheet now behaves slightly different on Desktop and Mobile. On Desktop, the regular Notification Sheet stays in its popover, just below the Notification Button. On Mobile, when the Notification Button is clicked, the Notification Sheet now becomes full screen. The bars at the top and bottom of the Sheet are fixed in place, with the list of notifications becoming a scrolling list.

Screenshot 2019-08-05 at 16 31 10
antictor commented 4 years ago

ok I'll make a start

09txzS1qs commented 4 years ago

Both look good generally. 2 questions:

antictor commented 4 years ago

Any chance of a Sketch file to go with this or something we can inspect?

antictor commented 4 years ago

Can you add focus states for the search/notification/avatar links/buttons for people using keyboard navigation?