From 1f5e4ae1415d20b2bf0ca87769a4ede7480921fe Mon Sep 17 00:00:00 2001 From: Adam Kudrna Date: Thu, 2 Nov 2023 17:24:47 +0100 Subject: [PATCH] Feat(web-react): Allow combining links and buttons in `HeaderDesktopActions` --- .../web-react/src/components/Header/README.md | 20 +++++++++++--- .../HeaderInvertedWithActionsAndDialog.tsx | 27 ++++++++++--------- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/packages/web-react/src/components/Header/README.md b/packages/web-react/src/components/Header/README.md index c89537e8af..0284ec350e 100644 --- a/packages/web-react/src/components/Header/README.md +++ b/packages/web-react/src/components/Header/README.md @@ -133,9 +133,11 @@ The component implements the [`HTMLElement`][mdn-api-html-element] interface. ### Desktop-Only Actions -As the name suggests, desktop-only actions are intended to display only on -desktop screens. There are two slots to use: primary actions (aligned to the -left in LTR documents) and secondary actions (aligned to the right). +As the name suggests, desktop-only actions are intended to display on desktop screens only. They generally work as flex +containers that define vertical alignment and spacing. + +There are two slots you can use: primary actions (aligned to left in LTR documents), and secondary actions (aligned to +right). 👉 It is critical to **make sure all your actions fit the Header on the desktop breakpoint**. Spirit intentionally does not provide any overflow @@ -204,6 +206,18 @@ Both links and buttons are supported: ``` +#### Other Content + +You can avoid using the [HeaderNav](#navigation) for standalone links. That way, you can combine links and buttons in +the same container: + +```jsx + + Marian + + +``` + ##### HeaderNav API | Name | Type | Default | Required | Description | diff --git a/packages/web-react/src/components/Header/demo/HeaderInvertedWithActionsAndDialog.tsx b/packages/web-react/src/components/Header/demo/HeaderInvertedWithActionsAndDialog.tsx index 9bd822c6c9..fabe455e9e 100644 --- a/packages/web-react/src/components/Header/demo/HeaderInvertedWithActionsAndDialog.tsx +++ b/packages/web-react/src/components/Header/demo/HeaderInvertedWithActionsAndDialog.tsx @@ -1,5 +1,8 @@ import React, { useState } from 'react'; +import { Button } from '../../Button'; +import { Icon } from '../../Icon'; import { Link } from '../../Link'; +import { VisuallyHidden } from '../../VisuallyHidden'; import { Header, HeaderButton, @@ -56,18 +59,18 @@ const HeaderInvertedWithActionsAndDialog = () => { - - - - - Marian - - - + + + Marian + +